Browse Source

联建单位详情返回分类名称、服务事项名称

feature/teamB_zz_wgh
yinzuomei 3 years ago
parent
commit
adce94369f
  1. 9
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java
  2. 10
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  3. 13
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  4. 30
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

9
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java

@ -69,12 +69,21 @@ public class IcPartyUnitDTO implements Serializable {
@NotBlank(message = "分类不能为空",groups = AddGroup.class)
private String type;
/**
* 分类名称
*/
private String typeName;
/**
* 服务事项 多选逗号隔开
*/
private String serviceMatter;
private List<String> serviceMatterList;
/**
* 服务事项名称
*/
private List<String> serviceMatterNameList;
/**
* 联系人

10
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -12,11 +12,13 @@ import com.epmet.dto.form.IcDemandFormDTO;
import com.epmet.dto.form.PartyUnitListFormDTO;
import com.epmet.dto.form.demand.DemandRecId;
import com.epmet.dto.form.demand.IcEventCommentToDemandFromDTO;
import com.epmet.dto.form.demand.ServiceItemSelectFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.PartyUnitListResultDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
@ -157,4 +159,12 @@ public interface EpmetHeartOpenFeignClient {
*/
@PostMapping("/heart/resi/volunteer/addVolunteer")
Result addVolunteer(@RequestBody ResiVolunteerAuthenticateFormDTO formDTO);
/**
* 联建单位查询可用的服务事项列表
* @param formDTO
* @return
*/
@PostMapping("/heart/serviceitem/dict-list")
Result<List<OptionDTO>> queryDictList(@RequestBody ServiceItemSelectFormDTO formDTO);
}

13
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -13,11 +13,13 @@ import com.epmet.dto.form.IcDemandFormDTO;
import com.epmet.dto.form.PartyUnitListFormDTO;
import com.epmet.dto.form.demand.DemandRecId;
import com.epmet.dto.form.demand.IcEventCommentToDemandFromDTO;
import com.epmet.dto.form.demand.ServiceItemSelectFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.PartyUnitListResultDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
@ -158,4 +160,15 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
public Result addVolunteer(ResiVolunteerAuthenticateFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "addVolunteer", formDTO);
}
/**
* 联建单位查询可用的服务事项列表
*
* @param formDTO
* @return
*/
@Override
public Result<List<OptionDTO>> queryDictList(ServiceItemSelectFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryDictList", formDTO);
}
}

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

@ -51,6 +51,7 @@ import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcPartyUnitDao;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.ServiceItemSelectFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.OptionDTO;
@ -60,15 +61,16 @@ import com.epmet.excel.IcPartyUnitImportExcel;
import com.epmet.excel.IcPartyUnitImportFailedExcel;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.OssFeignClient;
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;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
@ -103,13 +105,13 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
@Resource
private IcUserDemandRecService icUserDemandRecService;
@Resource
private IcResiDemandDictService icResiDemandDictService;
@Resource
private IcServiceItemDictService icServiceItemDictService;
@Resource
private OssFeignClient ossFeignClient;
@Resource
private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient;
@Resource
private EpmetHeartOpenFeignClient heartOpenFeignClient;
@Override
public PageData<IcPartyUnitDTO> search(PartyUnitFormDTO formDTO) {
@ -198,6 +200,28 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA)));
dto.setScore(null == pointMap.get(id) ? NumConstant.ZERO : pointMap.get(id));
// 分类名称
//获取分类名称字典
Result<Map<String, String>> typeDictMapRes=epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode());
Map<String, String> typeDictMap = typeDictMapRes.success() && MapUtils.isNotEmpty(typeDictMapRes.getData()) ? typeDictMapRes.getData() : new HashMap<>();
dto.setType(MapUtils.isNotEmpty(typeDictMap) && typeDictMap.containsKey(dto.getType()) ? typeDictMap.get(dto.getType()) : StrConstant.EPMETY_STR);
// 服务事项
if(CollectionUtils.isNotEmpty(dto.getServiceMatterList())){
ServiceItemSelectFormDTO serviceItemSelectFormDTO=new ServiceItemSelectFormDTO();
serviceItemSelectFormDTO.setCustomerId(entity.getCustomerId());
serviceItemSelectFormDTO.setType("usable");
Result<List<OptionDTO>> serviceMateerRes=heartOpenFeignClient.queryDictList(serviceItemSelectFormDTO);
if(serviceMateerRes.success()&&CollectionUtils.isNotEmpty(serviceMateerRes.getData())){
Map<String,String> serviceMap=serviceMateerRes.getData().stream().collect(Collectors.toMap(OptionDTO::getValue,OptionDTO::getLabel));
List<String> serviceMatterNameList=new ArrayList<>();
for(String serviceMatterCode:dto.getServiceMatterList()){
if(MapUtils.isNotEmpty(serviceMap)&&serviceMap.containsKey(serviceMatterCode)){
serviceMatterNameList.add(serviceMap.get(serviceMatterCode));
}
}
dto.setServiceMatterNameList(serviceMatterNameList);
}
}
}
return dto;
}

Loading…
Cancel
Save