| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -44,6 +44,7 @@ import com.epmet.commons.tools.security.user.LoginUserUtil; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.FileUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.Result; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.SpringContextUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constant.UserDemandConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.constants.ImportTaskConstants; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dao.IcPartyUnitDao; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -99,16 +100,16 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Resource | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Resource | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcUserDemandRecService icUserDemandRecService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // @Resource
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // private IcUserDemandRecService icUserDemandRecService;
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Resource | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcServiceItemDictService icServiceItemDictService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Resource | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private OssFeignClient ossFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Resource | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Resource | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private EpmetHeartOpenFeignClient heartOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // @Resource
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // private EpmetHeartOpenFeignClient heartOpenFeignClient;
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Resource | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private IcCommunitySelfOrganizationService icCommunitySelfOrganizationService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Resource | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -140,7 +141,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //获取单位积分
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Integer> pointMap = SpringContextUtils.getBean(IcUserDemandRecService.class).getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        dtoList.forEach(item -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            item.setTypeName(unitTypeMap.getData().get(item.getType())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //这是错误的,应该是赋值type,遗留bug, 先不改了....
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -180,7 +181,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //获取单位积分
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Integer> pointMap = SpringContextUtils.getBean(IcUserDemandRecService.class).getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        dtoList.forEach(item -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            item.setTypeName(unitTypeMap.getData().get(item.getType())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //这是错误的,应该是赋值type,遗留bug, 先不改了....
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -211,7 +212,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IcPartyUnitDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyUnitDTO.class); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (StringUtils.isNotBlank(dto.getServiceMatter())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //获取单位积分
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Map<String, Integer> pointMap = SpringContextUtils.getBean(IcUserDemandRecService.class).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)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 分类名称
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -271,7 +272,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Transactional(rollbackFor = Exception.class) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public void delete(String id) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //存在未完成的需求,不能删除
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (icUserDemandRecService.selectCountByServerId(id) > NumConstant.ZERO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (SpringContextUtils.getBean(IcUserDemandRecService.class).selectCountByServerId(id) > NumConstant.ZERO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "存在未完成的服务", "存在未完成的服务,不能删除"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //校验是否有同步到通讯录,是否存在工作人员下有未处理项目数据【联建单位被同步到通讯录部门的,如果部门下人员存在未办结项目则不允许删除】
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -438,7 +439,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public void calPartyUnitSatisfation(ServerSatisfactionCalFormDTO formDTO) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("收到消息内容啦...." + JSON.toJSONString(formDTO)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<ServiceStatDTO> list = icUserDemandRecService.groupByServer(formDTO.getCustomerId(), formDTO.getServerId(), formDTO.getServiceType()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<ServiceStatDTO> list = SpringContextUtils.getBean(IcUserDemandRecService.class).groupByServer(formDTO.getCustomerId(), formDTO.getServerId(), formDTO.getServiceType()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for (ServiceStatDTO serviceStatDTO : list) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (0 != serviceStatDTO.getDemandCount()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |