Browse Source

活动详情添加联建活动相关参数

dev_shibei_match
yinzuomei 4 years ago
parent
commit
6953e23a29
  1. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java
  2. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java
  3. 26
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
  4. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  5. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java

@ -175,4 +175,25 @@ public class ResiActDetailResultDTO implements Serializable {
* 取消活动的时间yyyy-MM-dd HH:mm * 取消活动的时间yyyy-MM-dd HH:mm
*/ */
private String cancelTime; private String cancelTime;
/**
* 活动类型爱心活动heart 联建活动party
*/
private String actType;
/**
* 联建单位
*/
private String unitId;
private String unitName;
/**
* 活动目标
*/
private String target;
/**
* 服务事项
*/
private String serviceMatter;
private String serviceMatterName;
} }

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java

@ -169,4 +169,9 @@ public interface ActConstant {
* 活动类型-联建活动 * 活动类型-联建活动
*/ */
String PARTY = "party"; String PARTY = "party";
/**
* 服务事项code
*/
String SERVICE_MATTER_CODE = "1010";
} }

26
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java

@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
@ -33,12 +34,17 @@ import com.epmet.dao.ActInfoDao;
import com.epmet.dao.ActUserRelationDao; import com.epmet.dao.ActUserRelationDao;
import com.epmet.dao.HeartUserInfoDao; import com.epmet.dao.HeartUserInfoDao;
import com.epmet.dto.ActInfoDTO; import com.epmet.dto.ActInfoDTO;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.form.resi.*; import com.epmet.dto.form.resi.*;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.resi.*; import com.epmet.dto.result.resi.*;
import com.epmet.entity.ActInfoEntity; import com.epmet.entity.ActInfoEntity;
import com.epmet.entity.ActUserRelationEntity; import com.epmet.entity.ActUserRelationEntity;
import com.epmet.service.ActInfoService; import com.epmet.service.ActInfoService;
import com.epmet.service.ActUserRelationService; import com.epmet.service.ActUserRelationService;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.utils.CaculateDistance; import com.epmet.utils.CaculateDistance;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
@ -47,7 +53,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 活动信息 * 活动信息
@ -68,6 +76,10 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
@Autowired @Autowired
private HeartUserInfoDao heartUserInfoDao; private HeartUserInfoDao heartUserInfoDao;
@Resource
private IcResiDemandDictService icResiDemandDictService;
@Resource
private IcPartyUnitService icPartyUnitService;
@Override @Override
public PageData<ActInfoDTO> page(Map<String, Object> params) { public PageData<ActInfoDTO> page(Map<String, Object> params) {
@ -245,6 +257,20 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
// 获取用户报名状态 // 获取用户报名状态
String currentUserStatus = getCurrentUserStatus(formDto.getActId(), formDto.getUserId()); String currentUserStatus = getCurrentUserStatus(formDto.getActId(), formDto.getUserId());
detailResultDTO.setCurrentUserStatus(currentUserStatus); detailResultDTO.setCurrentUserStatus(currentUserStatus);
if (StringUtils.isNotBlank(detailResultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(tokenDto.getCustomerId());
codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
detailResultDTO.setServiceMatterName(categoryMap.get(detailResultDTO.getServiceMatter()));
}
if (StringUtils.isNotBlank(detailResultDTO.getUnitId())) {
//获取单位名称
IcPartyUnitDTO unitDTO = icPartyUnitService.get(detailResultDTO.getUnitId());
detailResultDTO.setUnitName(null != unitDTO ? unitDTO.getUnitName() : StrConstant.EPMETY_STR);
}
return new Result<ResiActDetailResultDTO>().ok(detailResultDTO); return new Result<ResiActDetailResultDTO>().ok(detailResultDTO);
} }

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -103,10 +103,7 @@ public class WorkActServiceImpl implements WorkActService {
@Resource @Resource
private IcPartyUnitService icPartyUnitService; private IcPartyUnitService icPartyUnitService;
/**
* 服务事项code
*/
private static final String SERVICE_MATTER_CODE = "1010";
/** /**
* @author yinzuomei * @author yinzuomei
@ -787,7 +784,7 @@ public class WorkActServiceImpl implements WorkActService {
//获取服务事项 //获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(customerId); codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
canceledActDetailResultDTO.setServiceMatterName(categoryMap.get(canceledActDetailResultDTO.getServiceMatter())); canceledActDetailResultDTO.setServiceMatterName(categoryMap.get(canceledActDetailResultDTO.getServiceMatter()));
} }
@ -845,7 +842,7 @@ public class WorkActServiceImpl implements WorkActService {
//获取服务事项 //获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId()); codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
} }
@ -926,7 +923,7 @@ public class WorkActServiceImpl implements WorkActService {
//获取服务事项 //获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(customerId); codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
} }
@ -1322,7 +1319,7 @@ public class WorkActServiceImpl implements WorkActService {
//获取服务事项 //获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(customerId); codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
} }

5
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

@ -445,7 +445,10 @@
IF(aur.SIGN_IN_FLAG = 'signed_in', true , false ) as isSignUp, -- 是否已签到(true已签到,false未签到) IF(aur.SIGN_IN_FLAG = 'signed_in', true , false ) as isSignUp, -- 是否已签到(true已签到,false未签到)
i.ACT_STATUS actStatus, i.ACT_STATUS actStatus,
i.CANCEL_REASON cancelReason, i.CANCEL_REASON cancelReason,
DATE_FORMAT(i.CANCEL_TIME,'%Y-%m-%d %H:%i') cancelTime DATE_FORMAT(i.CANCEL_TIME,'%Y-%m-%d %H:%i') cancelTime,
i.UNIT_ID AS unitId,
i.SERVICE_MATTER AS serviceMatter,
i.TARGET AS target
FROM FROM
act_info i act_info i
LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID

Loading…
Cancel
Save