|
|
@ -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; |
|
|
|
} |
|
|
|