Browse Source

Merge remote-tracking branch 'origin/master'

master
wxz 3 years ago
parent
commit
dcf7c18325
  1. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
  2. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

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

@ -30,6 +30,7 @@ import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.constant.ActConstant; import com.epmet.constant.ActConstant;
import com.epmet.dao.ActInfoDao; import com.epmet.dao.ActInfoDao;
import com.epmet.dao.ActUserRelationDao; import com.epmet.dao.ActUserRelationDao;
@ -66,16 +67,13 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
private Logger logger = LogManager.getLogger(ActInfoServiceImpl.class); private Logger logger = LogManager.getLogger(ActInfoServiceImpl.class);
@Autowired
private ActUserRelationService relationService;
@Autowired @Autowired
private ActUserRelationDao actUserRelationDao; private ActUserRelationDao actUserRelationDao;
@Autowired @Autowired
private HeartUserInfoDao heartUserInfoDao; private HeartUserInfoDao heartUserInfoDao;
@Resource // @Resource
private IcPartyUnitService icPartyUnitService; // private IcPartyUnitService icPartyUnitService;
@Resource @Resource
private IcServiceItemDictService icServiceItemDictService; private IcServiceItemDictService icServiceItemDictService;
@Resource @Resource
@ -276,7 +274,7 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
//获取联建单位 //获取联建单位
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(dto.getAgencyId()); unitDTO.setAgencyId(dto.getAgencyId());
Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); Map<String, String> option = SpringContextUtils.getBean(IcPartyUnitService.class).option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<String> unitIds = icActivityUnitRelationService.getUnitList(dto.getId()); List<String> unitIds = icActivityUnitRelationService.getUnitList(dto.getId());
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
detailResultDTO.setUnitIdList(unitIds); detailResultDTO.setUnitIdList(unitIds);

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

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

Loading…
Cancel
Save