From 826a1949272ec4dee3dc8199b182b409b27615f1 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 10 Sep 2020 09:43:25 +0800 Subject: [PATCH 1/5] =?UTF-8?q?ext=5Fjson=E5=8A=A0=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dao/MiniInfoDao.java | 10 ++++++++++ .../java/com/epmet/service/impl/CodeServiceImpl.java | 8 ++++++++ .../src/main/java/com/epmet/wxapi/param/WxExtJson.java | 4 ++++ .../src/main/resources/mapper/MiniInfoDao.xml | 6 ++++++ 4 files changed, 28 insertions(+) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java index 0d29f738df..6add27be9a 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java @@ -53,5 +53,15 @@ public interface MiniInfoDao extends BaseDao { * @author zxc */ CustomerIdAndClientResultDTO selectCustomerIdAndClientByToUserName(@Param("toUserName")String toUserName); + + /** + * 获取小程序名 + * @author zhaoqifeng + * @date 2020/9/7 17:25 + * @param customerId + * @param clientType + * @return java.lang.String + */ + String getNickName(@Param("customerId") String customerId, @Param("clientType") String clientType); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java index 09f5f5a276..9a5640f22d 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CodeConstant; import com.epmet.dao.AuthorizationInfoDao; import com.epmet.dao.ComponentAccessTokenDao; +import com.epmet.dao.MiniInfoDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -65,6 +66,8 @@ public class CodeServiceImpl implements CodeService { private OssFeignClient ossFeignClient; @Autowired private PaCustomerService paCustomerService; + @Autowired + private MiniInfoDao miniInfoDao; @Override public List templateList() { @@ -115,10 +118,15 @@ public class CodeServiceImpl implements CodeService { if (null == authInfo) { throw new RenException("未授权"); } + //获取小程序居民端与工作端名称 + String resiName = miniInfoDao.getNickName(formDTO.getCustomerId(), "resi"); + String workName = miniInfoDao.getNickName(formDTO.getCustomerId(), "work"); String extJson = getExtJson(formDTO); WxExtJson wxExtJson = JSONObject.parseObject(extJson, WxExtJson.class); wxExtJson.setExtAppid(authInfo.getAuthorizerAppid()); wxExtJson.getExt().setExtAppid(authInfo.getAuthorizerAppid()); + wxExtJson.getExt().setResiName(resiName); + wxExtJson.getExt().setWorkName(workName); extJson = JSON.toJSONString(wxExtJson); CodeExtDTO codeExtDTO = codeExtService.getExtByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); if (null == codeExtDTO) { diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxExtJson.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxExtJson.java index 8d6b843126..4ba45e37cf 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxExtJson.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxExtJson.java @@ -31,6 +31,10 @@ public class WxExtJson implements Serializable { @JSONField(ordinal = 1) private String extAppid; @JSONField(ordinal = 2) + private String resiName; + @JSONField(ordinal = 3) + private String workName; + @JSONField(ordinal = 4) private FootbarBean footbar; @NoArgsConstructor @Data diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml index 7a31b83279..f70597f4d5 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml @@ -64,4 +64,10 @@ AND user_name = #{toUserName} LIMIT 1 + \ No newline at end of file From 3a9113179aedb829897e6611c87ab87bd318d835 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 10 Sep 2020 10:55:48 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81=E9=80=A0=E6=88=90=E7=9A=84?= =?UTF-8?q?ErrorCode=E5=80=BC=E4=B8=A2=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/exception/EpmetErrorCode.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index b7844243d3..a61c25d8cf 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -77,6 +77,9 @@ public enum EpmetErrorCode { CANNOT_DISABLE_YOURSELF(8405,"您不能禁用自己"), NO_SET_GRID_COUNT(8406,"您还未设置创建网格数量上限,请联系管理员设置"), GRID_COUNT_UP(8407,"您的创建网格数量已到达上限,请联系管理员设置"), + EXIT_PEND_PROJECT(8408,"该工作人员有项目尚在处理,处理完毕方可操作"), + EXIT_PUBLISHED_ACTIVITY(8409,"该工作人员有活动尚在进行,等活动完成方可操作"), + CAN_NOT_SELF(8410,"无法对自己进行操作"), ALREADY_EVALUATE(8501,"您已评价"), ALREADY_VOTE(8502,"您已表态"), From 6a26632af9ec5715e87b57b0f1f632ec82f48c56 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Thu, 10 Sep 2020 14:42:50 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=99=BB=E9=99=86?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AE=A2=E6=88=B7=E5=88=97=E8=A1=A8=EF=BC=88?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=AB=AF=EF=BC=89,=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CustomerStaffServiceImpl.java | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 72f9c416b2..ec85e7b960 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -626,23 +626,25 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); - if (!customerInfo.success()) { - logger.error(String.format("获取根管理员信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); - } else { - if (null != customerInfo.getData()){ - CustomerListResultDTO resultDTO = new CustomerListResultDTO(); - resultDTO.setCustomerId(customerInfo.getData().getId()); - resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); - listResultDTO.add(resultDTO); - } - } - } + if (null != roleKey){ + // 3.根据roleId + staff_id(即 userId) 查 staff_role表的主键id, 如果查到了,那这个userId就是 根管理员 + StaffRoleDTO staffRoleDTO = staffRoleDao.selectStaffRoleByStaffIdAndRoleId(staffDTO.getUserId(), roleKey.getId()); + if (null != staffRoleDTO){ + // 4.如果userID是根管理员的话,则根据customerId 去 customer表 查询 id、customer_name + customerDTO.setId(staffDTO.getCustomerId()); + Result customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); + if (!customerInfo.success()) { + logger.error(String.format("获取根管理员信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); + } else { + if (null != customerInfo.getData()){ + CustomerListResultDTO resultDTO = new CustomerListResultDTO(); + resultDTO.setCustomerId(customerInfo.getData().getId()); + resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); + listResultDTO.add(resultDTO); + } + } + } + } } return new Result>().ok(listResultDTO); } From bff80035881fb6ae789bf0a7971ec0f9bdaefe11 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 11 Sep 2020 09:15:39 +0800 Subject: [PATCH 4/5] =?UTF-8?q?gateway=E7=9A=84pom=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=86profile=E7=9A=84=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index e64e3f45c3..cef4109081 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -90,6 +90,8 @@ 8080 + dev + 0 192.168.1.130 @@ -206,6 +208,8 @@ 8080 + local + 0 192.168.1.130 @@ -322,6 +326,8 @@ 8080 + test + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -409,6 +415,8 @@ 8080 + prod + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com From ecd133006e741caca05bf9bab6215f9559401e8d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 11 Sep 2020 10:11:16 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/DeptScoreServiceImpl.java | 2 + .../impl/GridCorreLationServiceImpl.java | 113 +++++++----------- 2 files changed, 42 insertions(+), 73 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index 439cfa155a..5856241cbb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -100,7 +100,9 @@ public class DeptScoreServiceImpl extends BaseServiceImpl dangJianNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), - IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), - IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - if (CollectionUtils.isEmpty(dangJianNengLiList)) { - log.warn("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); - } - calculateGridDangJian(formDTO, dangJianNengLiList); + calculateGridDangJian(formDTO); //2、计算网格相关-治理能力 - List zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), - IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), - IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - if (CollectionUtils.isEmpty(zhiLiNengLiList)) { - log.warn("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - throw new RenException("客户【网格相关:治理能力】指标权重信息不存在"); - } - calculateGridZhiLi(formDTO, zhiLiNengLiList); + calculateGridZhiLi(formDTO); //3、计算网格相关-服务能力 - List fuWuNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), - IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), - IndexCodeEnum.FU_WU_NENG_LI.getCode()); - if (CollectionUtils.isEmpty(fuWuNengLiList)) { - log.warn("calculateGridFuWu customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - throw new RenException("客户【网格相关:服务能力】指标权重信息不存在"); - } - calculateGridFuWu(formDTO, fuWuNengLiList); + calculateGridFuWu(formDTO); //4、计算网格相关总分 - List wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), - IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); - if (CollectionUtils.isEmpty(wgxgList)) { - log.warn("calculateGridTotal customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); - throw new RenException("客户【网格相关】指标权重信息不存在"); - } - calculateGridTotal(formDTO, wgxgList, IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); - - resultFlag = true; - return resultFlag; + calculateGridTotal(formDTO); + return true; } /** * @param formDTO - * @param indexList * @return void * @author yinzuomei * @description 计算网格相关-党建能力 * @Date 2020/8/26 16:47 **/ @Transactional(rollbackFor = Exception.class) - public void calculateGridDangJian(CalculateCommonFormDTO formDTO, List indexList) { + public void calculateGridDangJian(CalculateCommonFormDTO formDTO) { + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.warn("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); + } //查询总记录数 int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; } - //只有一个网格的事实记录时无需处理以下代码注释 - /*else if (NumConstant.ONE == total) { - //只有一个网格时 - log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_party_ablity_grid_monthly record",IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); - this.handleOneGridScene(formDTO,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - }*/ //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); @@ -196,7 +166,6 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), - IndexCalConstant.GRID_DJ_ALL_PARENT_INDEX_CODE, NumConstant.ZERO_STR); } @@ -368,7 +337,6 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private void saveGridCorreLationResult(CalculateCommonFormDTO formDTO, List> resultMapList, String indexCode, - String allParentIndexCode, String isTotal) { String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); @@ -442,8 +410,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); //如果想看每一个指标的分值调用下面的方法 - List listTemp=batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); - log.info("计算的结果(List)"+JSON.toJSONString(listTemp)); + /*List listTemp=batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); + log.info("计算的结果(List)"+JSON.toJSONString(listTemp));*/ HashMap resultMap = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); log.info("计算的结果{}", resultMap); @@ -531,25 +499,25 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { /** * @param formDTO - * @param indexList * @return void * @author yinzuomei * @description 计算网格相关-治理能力 * @Date 2020/8/26 16:47 **/ - private void calculateGridZhiLi(CalculateCommonFormDTO formDTO, List indexList) { + private void calculateGridZhiLi(CalculateCommonFormDTO formDTO) { + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.warn("calculateGridZhiLi customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关:治理能力】指标权重信息不存在"); + } //查询总记录数 int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { log.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; } - //只有一个网格的事实记录时无需处理以下代码注释 - /*else if (NumConstant.ONE == total) { - //只有一个网格时 - log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_govrn_ablity_grid_monthly record",IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); - this.handleOneGridScene(formDTO,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - }*/ //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); @@ -598,32 +566,31 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), - IndexCalConstant.GRID_ZL_ALL_PARENT_INDEX_CODE, NumConstant.ZERO_STR); } /** * @param formDTO - * @param indexList * @return void * @author yinzuomei * @description 计算网格相关-服务能力 * @Date 2020/8/26 16:48 **/ - private void calculateGridFuWu(CalculateCommonFormDTO formDTO, List indexList) { + private void calculateGridFuWu(CalculateCommonFormDTO formDTO) { + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), + IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.warn("calculateGridFuWu customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关:服务能力】指标权重信息不存在"); + } //查询总记录数 int total = factIndexServiceAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { log.warn(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); return; } - //只有一个网格的事实记录时无需处理以下代码注释 - /*else if (NumConstant.ONE == total) { - //只有一个网格时 - log.warn(String.format("indexCode:%s,customerId:%s,monthId:%s,only one fact_index_service_ablity_grid_monthly record",IndexCodeEnum.FU_WU_NENG_LI.getCode(),formDTO.getCustomerId(),formDTO.getMonthId())); - this.handleOneGridScene(formDTO,IndexCodeEnum.FU_WU_NENG_LI.getCode()); - }*/ //总页数,进行批量查询,批量计算 int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); @@ -668,19 +635,23 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.FU_WU_NENG_LI.getCode(), - IndexCalConstant.GRID_FW_ALL_PARENT_INDEX_CODE, NumConstant.ZERO_STR); } /** * @param formDTO - * @param indexList * @return void * @author yinzuomei * @description 计算网格相关总分 * @Date 2020/8/26 16:50 **/ - private void calculateGridTotal(CalculateCommonFormDTO formDTO, List indexList, String indexCode) { + private void calculateGridTotal(CalculateCommonFormDTO formDTO) { + List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); + if (CollectionUtils.isEmpty(indexList)) { + log.warn("calculateGridTotal customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); + throw new RenException("客户【网格相关】指标权重信息不存在"); + } //查询总记录数 List gridScoreDTOList = gridScoreDao.selectList(formDTO); if(CollectionUtils.isEmpty(gridScoreDTOList)){ @@ -692,13 +663,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { for (GridScoreDTO gridScoreDTO : gridScoreDTOList) { GridScoreEntity gridScoreEntity = ConvertUtils.sourceToTarget(gridScoreDTO, GridScoreEntity.class); gridScoreEntity.setIsTotal(NumConstant.ONE_STR); - gridScoreEntity.setIndexCode(indexCode); + gridScoreEntity.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); gridScoreEntity.setScore(BigDecimal.ZERO); gridScoreEntity.setAllParentIndexCode(NumConstant.ZERO_STR); - /*if (!CollectionUtils.isEmpty(gridScoreDTO.getDetailList()) && gridScoreDTO.getDetailList().size() != 3) { - log.error("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失,无法计算总值"); - continue; - }*/ log.warn("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失"); for (GridScoreDetailDTO gridScoreDetailDTO : gridScoreDTO.getDetailList()) { BigDecimal indexScore = gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight()); @@ -711,7 +678,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { do { effectRow =gridScoreDao.deleteBatches(formDTO.getCustomerId(), formDTO.getMonthId(), - indexCode, + IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCalConstant.DELETE_SIZE); } while (effectRow > NumConstant.ZERO); //批量插入