Browse Source

联建活动用到服务事项的地方,统一改为查询ic_service_item_dict

master
yinzuomei 4 years ago
parent
commit
f9c71352f2
  1. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java
  2. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
  3. 29
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  4. 26
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  5. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  6. 40
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

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

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

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

@ -35,17 +35,14 @@ import com.epmet.dao.ActUserRelationDao;
import com.epmet.dao.HeartUserInfoDao;
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.result.demand.OptionDTO;
import com.epmet.dto.result.resi.*;
import com.epmet.entity.ActInfoEntity;
import com.epmet.entity.ActUserRelationEntity;
import com.epmet.service.ActInfoService;
import com.epmet.service.ActUserRelationService;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.*;
import com.epmet.utils.CaculateDistance;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -77,9 +74,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
@Autowired
private HeartUserInfoDao heartUserInfoDao;
@Resource
private IcResiDemandDictService icResiDemandDictService;
@Resource
private IcPartyUnitService icPartyUnitService;
@Resource
private IcServiceItemDictService icServiceItemDictService;
@Override
public PageData<ActInfoDTO> page(Map<String, Object> params) {
@ -260,11 +257,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
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()));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
detailResultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(detailResultDTO.getServiceMatter()) ? categoryMap.get(detailResultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(detailResultDTO.getUnitId())) {
//获取单位名称

29
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -35,14 +35,13 @@ import com.epmet.dao.IcPartyActivityDao;
import com.epmet.dto.IcPartyActivityDTO;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.result.ActivityStatisticsDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcPartyActivityEntity;
import com.epmet.excel.IcPartyActivityImportExcel;
import com.epmet.service.IcPartyActivityService;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcServiceItemDictService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -71,11 +70,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
@Resource
private IcPartyUnitService icPartyUnitService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
/**
* 服务事项code
*/
private static final String SERVICE_MATTER_CODE = "1010";
private IcServiceItemDictService icServiceItemDictService;
@Override
public PageData<IcPartyActivityDTO> search(PartyActivityFormDTO formDTO) {
@ -159,10 +155,9 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
return null;
}
//获取服务事项名称
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(entity.getCustomerId());
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(entity.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class);
dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter()));
//获取单位名称
@ -225,10 +220,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(tokenDto.getCustomerId());
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取联建单位
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(staffInfoCache.getAgencyId());
@ -369,10 +362,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
//获取联建单位
Map<String, String> option = icPartyUnitService.options(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取服务事项字典
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(tokenDto.getCustomerId());
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//数据组装
dtoList.forEach(dto -> {
dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter()));

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

@ -45,7 +45,6 @@ import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.result.PartyUnitDistributionResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.demand.ServiceStatDTO;
@ -54,6 +53,7 @@ import com.epmet.excel.IcPartyUnitImportExcel;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcServiceItemDictService;
import com.epmet.service.IcUserDemandRecService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -87,7 +87,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
private IcUserDemandRecService icUserDemandRecService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
@Resource
private IcServiceItemDictService icServiceItemDictService;
@Override
public PageData<IcPartyUnitDTO> search(PartyUnitFormDTO formDTO) {
@ -104,10 +105,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
PageInfo<IcPartyUnitEntity> pageInfo = new PageInfo<>(list);
List<IcPartyUnitDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class);
Result<Map<String, String>> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode());
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode("1010");
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
dtoList.forEach(item -> {
item.setType(unitTypeMap.getData().get(item.getType()));
if (StringUtils.isNotBlank(item.getServiceMatter())) {
@ -138,10 +139,9 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
List<IcPartyUnitEntity> list = baseDao.selectList(wrapper);
List<IcPartyUnitDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class);
Result<Map<String, String>> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode());
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode("1010");
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
dtoList.forEach(item -> {
item.setType(unitTypeMap.getData().get(item.getType()));
if (StringUtils.isNotBlank(item.getServiceMatter())) {
@ -312,10 +312,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
if (null == staffInfoCache) {
throw new EpmetException(8000, "获取用户缓存失败");
}
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(tokenDto.getCustomerId());
codeFormDTO.setParentCategoryCode("1010");
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//1.数据校验
Iterator<IcPartyUnitImportExcel> iterator = result.iterator();
while (iterator.hasNext()) {

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

@ -6,7 +6,6 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.LatestActContentDTO;
import com.epmet.dto.LatestActInfoDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.form.work.ActPreviewFormDTO;
import com.epmet.dto.form.work.DraftActContentFormDTO;
import com.epmet.dto.form.work.DraftActInfoFormDTO;
@ -43,14 +42,10 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
@Autowired
private LatestActContentService latestActContentService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
private IcServiceItemDictService icServiceItemDictService;
@Resource
private IcPartyUnitService icPartyUnitService;
/**
* 服务事项code
*/
private static final String SERVICE_MATTER_CODE = "1010";
/**
* @return com.epmet.dto.form.work.PublishActInitResultDTO
@ -142,10 +137,8 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
if (StringUtils.isNotBlank(actPreviewResultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
actPreviewResultDTO.setServiceMatterName(categoryMap.get(actPreviewResultDTO.getServiceMatter()));
}
if (StringUtils.isNotBlank(actPreviewResultDTO.getUnitId())) {

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

@ -25,7 +25,6 @@ import com.epmet.dto.*;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.form.work.*;
import com.epmet.dto.result.ActSponsorResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
@ -34,6 +33,7 @@ import com.epmet.entity.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.*;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -99,10 +99,9 @@ public class WorkActServiceImpl implements WorkActService {
@Resource
private IcPartyActivityService icPartyActivityService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
@Resource
private IcPartyUnitService icPartyUnitService;
@Resource
private IcServiceItemDictService icServiceItemDictService;
/**
@ -782,11 +781,10 @@ public class WorkActServiceImpl implements WorkActService {
if (StringUtils.isNotBlank(canceledActDetailResultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
canceledActDetailResultDTO.setServiceMatterName(categoryMap.get(canceledActDetailResultDTO.getServiceMatter()));
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(customerId);
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
canceledActDetailResultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(canceledActDetailResultDTO.getServiceMatter()) ?
categoryMap.get(canceledActDetailResultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(canceledActDetailResultDTO.getUnitId())) {
//获取单位名称
@ -840,11 +838,9 @@ public class WorkActServiceImpl implements WorkActService {
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(formDTO.getCustomerId());
codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
//获取单位名称
@ -921,11 +917,9 @@ public class WorkActServiceImpl implements WorkActService {
}
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(customerId);
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
//获取单位名称
@ -1317,11 +1311,9 @@ public class WorkActServiceImpl implements WorkActService {
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
SubCodeFormDTO codeFormDTO = new SubCodeFormDTO();
codeFormDTO.setCustomerId(customerId);
codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE);
Map<String, String> categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter()));
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(customerId);
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
//获取单位名称

Loading…
Cancel
Save