Browse Source

Merge remote-tracking branch 'origin/dev_screen_data' into dev_temp

# Conflicts:
#	epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
dev_shibei_match
yinzuomei 5 years ago
parent
commit
62aed2ab2a
  1. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 8
      epmet-gateway/pom.xml
  3. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java
  4. 113
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  5. 10
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java
  6. 8
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java
  7. 4
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxExtJson.java
  8. 6
      epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml
  9. 36
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -109,7 +109,7 @@ public enum EpmetErrorCode {
OPER_EXTERNAL_APP_EXISTS(8711, "应用已存在"), OPER_EXTERNAL_APP_EXISTS(8711, "应用已存在"),
OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"), OPER_CUSTOMER_FOOTBAR_EXISTS(8712, "footbar已存在"),
OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"), OPER_CUSTOMER_FOOTBAR_NOT_FOUND(8713, "footbar不存在"),
OPER_EXT_APP_SECRET_RESET_FAIL(8713, "秘钥更新失败"), OPER_EXT_APP_SECRET_RESET_FAIL(8714, "秘钥更新失败"),
// 党建声音 前端提示 88段 // 党建声音 前端提示 88段
DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"),

8
epmet-gateway/pom.xml

@ -90,6 +90,8 @@
<properties> <properties>
<server.port>8080</server.port> <server.port>8080</server.port>
<spring.profiles.active>dev</spring.profiles.active>
<!-- redis配置 --> <!-- redis配置 -->
<spring.redis.index>0</spring.redis.index> <spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host> <spring.redis.host>192.168.1.130</spring.redis.host>
@ -206,6 +208,8 @@
<properties> <properties>
<server.port>8080</server.port> <server.port>8080</server.port>
<spring.profiles.active>local</spring.profiles.active>
<!-- redis配置 --> <!-- redis配置 -->
<spring.redis.index>0</spring.redis.index> <spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host> <spring.redis.host>192.168.1.130</spring.redis.host>
@ -322,6 +326,8 @@
<properties> <properties>
<server.port>8080</server.port> <server.port>8080</server.port>
<spring.profiles.active>test</spring.profiles.active>
<!-- redis配置 --> <!-- redis配置 -->
<spring.redis.index>0</spring.redis.index> <spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host> <spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
@ -409,6 +415,8 @@
<properties> <properties>
<server.port>8080</server.port> <server.port>8080</server.port>
<spring.profiles.active>prod</spring.profiles.active>
<!-- redis配置 --> <!-- redis配置 -->
<spring.redis.index>0</spring.redis.index> <spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host> <spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host>

2
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<DeptScoreDao, DeptScor
**/ **/
@Override @Override
public Boolean calculateDeptCorreLation(CalculateCommonFormDTO formDTO) { public Boolean calculateDeptCorreLation(CalculateCommonFormDTO formDTO) {
//1、区直部门-治理能力下五级指标分值计算+ 治理能力总分计算
calculateZhiLiNengLiScore(formDTO); calculateZhiLiNengLiScore(formDTO);
//2、区直部门 总分计算
calculateDeptTotalScore(formDTO); calculateDeptTotalScore(formDTO);
return true; return true;
} }

113
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

@ -82,69 +82,39 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
**/ **/
@Override @Override
public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) { public Boolean calculateGridCorreLation(CalculateCommonFormDTO formDTO) {
boolean resultFlag = false;
//1、计算网格相关-党建能力 //1、计算网格相关-党建能力
List<IndexGroupDetailEntity> dangJianNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), calculateGridDangJian(formDTO);
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);
//2、计算网格相关-治理能力 //2、计算网格相关-治理能力
List<IndexGroupDetailEntity> zhiLiNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), calculateGridZhiLi(formDTO);
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);
//3、计算网格相关-服务能力 //3、计算网格相关-服务能力
List<IndexGroupDetailEntity> fuWuNengLiList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), calculateGridFuWu(formDTO);
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);
//4、计算网格相关总分 //4、计算网格相关总分
List<IndexGroupDetailEntity> wgxgList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), calculateGridTotal(formDTO);
IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); return true;
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;
} }
/** /**
* @param formDTO * @param formDTO
* @param indexList
* @return void * @return void
* @author yinzuomei * @author yinzuomei
* @description 计算网格相关-党建能力 * @description 计算网格相关-党建能力
* @Date 2020/8/26 16:47 * @Date 2020/8/26 16:47
**/ **/
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void calculateGridDangJian(CalculateCommonFormDTO formDTO, List<IndexGroupDetailEntity> indexList) { public void calculateGridDangJian(CalculateCommonFormDTO formDTO) {
List<IndexGroupDetailEntity> 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); int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO);
if (NumConstant.ZERO == total) { if (NumConstant.ZERO == total) {
log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId()));
return; 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); int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE);
log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); log.info(String.format("共%s条数据,分%s次计算", total, totalPage));
@ -196,7 +166,6 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
saveGridCorreLationResult(formDTO, saveGridCorreLationResult(formDTO,
resultMapList, resultMapList,
IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),
IndexCalConstant.GRID_DJ_ALL_PARENT_INDEX_CODE,
NumConstant.ZERO_STR); NumConstant.ZERO_STR);
} }
@ -368,7 +337,6 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
private void saveGridCorreLationResult(CalculateCommonFormDTO formDTO, private void saveGridCorreLationResult(CalculateCommonFormDTO formDTO,
List<HashMap<String, CalculateResult>> resultMapList, List<HashMap<String, CalculateResult>> resultMapList,
String indexCode, String indexCode,
String allParentIndexCode,
String isTotal) { String isTotal) {
String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String quarterId = DateUtils.getQuarterId(formDTO.getMonthId());
String yearId = DateUtils.getYearId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId());
@ -442,8 +410,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator();
//如果想看每一个指标的分值调用下面的方法 //如果想看每一个指标的分值调用下面的方法
List<IndexOutputVO> listTemp=batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS); /*List<IndexOutputVO> listTemp=batchScoreCalculator.getScoreDetailOfIndexId(indexInputVOS);
log.info("计算的结果(List)"+JSON.toJSONString(listTemp)); log.info("计算的结果(List)"+JSON.toJSONString(listTemp));*/
HashMap<String, CalculateResult> resultMap = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); HashMap<String, CalculateResult> resultMap = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS);
log.info("计算的结果{}", resultMap); log.info("计算的结果{}", resultMap);
@ -531,25 +499,25 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
/** /**
* @param formDTO * @param formDTO
* @param indexList
* @return void * @return void
* @author yinzuomei * @author yinzuomei
* @description 计算网格相关-治理能力 * @description 计算网格相关-治理能力
* @Date 2020/8/26 16:47 * @Date 2020/8/26 16:47
**/ **/
private void calculateGridZhiLi(CalculateCommonFormDTO formDTO, List<IndexGroupDetailEntity> indexList) { private void calculateGridZhiLi(CalculateCommonFormDTO formDTO) {
List<IndexGroupDetailEntity> 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); int total = factIndexGovrnAblityGridMonthlyDao.selectCount(formDTO);
if (NumConstant.ZERO == total) { if (NumConstant.ZERO == total) {
log.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); log.warn(String.format("customerId%s,monthId%s,没有上传网格相关-治理能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId()));
return; 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); int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE);
log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); log.info(String.format("共%s条数据,分%s次计算", total, totalPage));
@ -598,32 +566,31 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
saveGridCorreLationResult(formDTO, saveGridCorreLationResult(formDTO,
resultMapList, resultMapList,
IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),
IndexCalConstant.GRID_ZL_ALL_PARENT_INDEX_CODE,
NumConstant.ZERO_STR); NumConstant.ZERO_STR);
} }
/** /**
* @param formDTO * @param formDTO
* @param indexList
* @return void * @return void
* @author yinzuomei * @author yinzuomei
* @description 计算网格相关-服务能力 * @description 计算网格相关-服务能力
* @Date 2020/8/26 16:48 * @Date 2020/8/26 16:48
**/ **/
private void calculateGridFuWu(CalculateCommonFormDTO formDTO, List<IndexGroupDetailEntity> indexList) { private void calculateGridFuWu(CalculateCommonFormDTO formDTO) {
List<IndexGroupDetailEntity> 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); int total = factIndexServiceAblityGridMonthlyDao.selectCount(formDTO);
if (NumConstant.ZERO == total) { if (NumConstant.ZERO == total) {
log.warn(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); log.warn(String.format("customerId:%s,monthId:%s,没有上传网格相关-服务能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId()));
return; 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); int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE);
log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); log.info(String.format("共%s条数据,分%s次计算", total, totalPage));
@ -668,19 +635,23 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
saveGridCorreLationResult(formDTO, saveGridCorreLationResult(formDTO,
resultMapList, resultMapList,
IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode(),
IndexCalConstant.GRID_FW_ALL_PARENT_INDEX_CODE,
NumConstant.ZERO_STR); NumConstant.ZERO_STR);
} }
/** /**
* @param formDTO * @param formDTO
* @param indexList
* @return void * @return void
* @author yinzuomei * @author yinzuomei
* @description 计算网格相关总分 * @description 计算网格相关总分
* @Date 2020/8/26 16:50 * @Date 2020/8/26 16:50
**/ **/
private void calculateGridTotal(CalculateCommonFormDTO formDTO, List<IndexGroupDetailEntity> indexList, String indexCode) { private void calculateGridTotal(CalculateCommonFormDTO formDTO) {
List<IndexGroupDetailEntity> 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<GridScoreDTO> gridScoreDTOList = gridScoreDao.selectList(formDTO); List<GridScoreDTO> gridScoreDTOList = gridScoreDao.selectList(formDTO);
if(CollectionUtils.isEmpty(gridScoreDTOList)){ if(CollectionUtils.isEmpty(gridScoreDTOList)){
@ -692,13 +663,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
for (GridScoreDTO gridScoreDTO : gridScoreDTOList) { for (GridScoreDTO gridScoreDTO : gridScoreDTOList) {
GridScoreEntity gridScoreEntity = ConvertUtils.sourceToTarget(gridScoreDTO, GridScoreEntity.class); GridScoreEntity gridScoreEntity = ConvertUtils.sourceToTarget(gridScoreDTO, GridScoreEntity.class);
gridScoreEntity.setIsTotal(NumConstant.ONE_STR); gridScoreEntity.setIsTotal(NumConstant.ONE_STR);
gridScoreEntity.setIndexCode(indexCode); gridScoreEntity.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode());
gridScoreEntity.setScore(BigDecimal.ZERO); gridScoreEntity.setScore(BigDecimal.ZERO);
gridScoreEntity.setAllParentIndexCode(NumConstant.ZERO_STR); 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() + "能力值缺失"); log.warn("customerId:" + gridScoreDTO.getCustomerId() + ";gridId:" + gridScoreDTO.getGridId() + ";monthId:" + gridScoreDTO.getMonthId() + "能力值缺失");
for (GridScoreDetailDTO gridScoreDetailDTO : gridScoreDTO.getDetailList()) { for (GridScoreDetailDTO gridScoreDetailDTO : gridScoreDTO.getDetailList()) {
BigDecimal indexScore = gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight()); BigDecimal indexScore = gridScoreDetailDTO.getScore().multiply(indexMap.get(gridScoreDetailDTO.getIndexCode()).getWeight());
@ -711,7 +678,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
do { do {
effectRow =gridScoreDao.deleteBatches(formDTO.getCustomerId(), effectRow =gridScoreDao.deleteBatches(formDTO.getCustomerId(),
formDTO.getMonthId(), formDTO.getMonthId(),
indexCode, IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(),
IndexCalConstant.DELETE_SIZE); IndexCalConstant.DELETE_SIZE);
} while (effectRow > NumConstant.ZERO); } while (effectRow > NumConstant.ZERO);
//批量插入 //批量插入

10
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java

@ -53,5 +53,15 @@ public interface MiniInfoDao extends BaseDao<MiniInfoEntity> {
* @author zxc * @author zxc
*/ */
CustomerIdAndClientResultDTO selectCustomerIdAndClientByToUserName(@Param("toUserName")String toUserName); 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);
} }

8
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.constant.CodeConstant;
import com.epmet.dao.AuthorizationInfoDao; import com.epmet.dao.AuthorizationInfoDao;
import com.epmet.dao.ComponentAccessTokenDao; import com.epmet.dao.ComponentAccessTokenDao;
import com.epmet.dao.MiniInfoDao;
import com.epmet.dto.*; import com.epmet.dto.*;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
@ -65,6 +66,8 @@ public class CodeServiceImpl implements CodeService {
private OssFeignClient ossFeignClient; private OssFeignClient ossFeignClient;
@Autowired @Autowired
private PaCustomerService paCustomerService; private PaCustomerService paCustomerService;
@Autowired
private MiniInfoDao miniInfoDao;
@Override @Override
public List<TemplateListResultDTO> templateList() { public List<TemplateListResultDTO> templateList() {
@ -115,10 +118,15 @@ public class CodeServiceImpl implements CodeService {
if (null == authInfo) { if (null == authInfo) {
throw new RenException("未授权"); throw new RenException("未授权");
} }
//获取小程序居民端与工作端名称
String resiName = miniInfoDao.getNickName(formDTO.getCustomerId(), "resi");
String workName = miniInfoDao.getNickName(formDTO.getCustomerId(), "work");
String extJson = getExtJson(formDTO); String extJson = getExtJson(formDTO);
WxExtJson wxExtJson = JSONObject.parseObject(extJson, WxExtJson.class); WxExtJson wxExtJson = JSONObject.parseObject(extJson, WxExtJson.class);
wxExtJson.setExtAppid(authInfo.getAuthorizerAppid()); wxExtJson.setExtAppid(authInfo.getAuthorizerAppid());
wxExtJson.getExt().setExtAppid(authInfo.getAuthorizerAppid()); wxExtJson.getExt().setExtAppid(authInfo.getAuthorizerAppid());
wxExtJson.getExt().setResiName(resiName);
wxExtJson.getExt().setWorkName(workName);
extJson = JSON.toJSONString(wxExtJson); extJson = JSON.toJSONString(wxExtJson);
CodeExtDTO codeExtDTO = codeExtService.getExtByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); CodeExtDTO codeExtDTO = codeExtService.getExtByCustomer(formDTO.getCustomerId(), formDTO.getClientType());
if (null == codeExtDTO) { if (null == codeExtDTO) {

4
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) @JSONField(ordinal = 1)
private String extAppid; private String extAppid;
@JSONField(ordinal = 2) @JSONField(ordinal = 2)
private String resiName;
@JSONField(ordinal = 3)
private String workName;
@JSONField(ordinal = 4)
private FootbarBean footbar; private FootbarBean footbar;
@NoArgsConstructor @NoArgsConstructor
@Data @Data

6
epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml

@ -64,4 +64,10 @@
AND user_name = #{toUserName} AND user_name = #{toUserName}
LIMIT 1 LIMIT 1
</select> </select>
<select id="getNickName" resultType="java.lang.String">
select NICK_NAME from mini_info
where DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND CLIENT_TYPE = #{clientType}
</select>
</mapper> </mapper>

36
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -626,23 +626,25 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
for (CustomerStaffDTO staffDTO : customerStaffList){ for (CustomerStaffDTO staffDTO : customerStaffList){
// 2.根据 customer_id 去 gov_staff_role表,查询 customer_id + role_key = root_manager ,确定 根管理员的id,即roleId // 2.根据 customer_id 去 gov_staff_role表,查询 customer_id + role_key = root_manager ,确定 根管理员的id,即roleId
GovStaffRoleDTO roleKey = govStaffRoleDao.getRoleByCustomerIdAndRoleKey(staffDTO.getCustomerId(), RoleKeyConstants.ROLE_KEY_ROOT_MANAGER); GovStaffRoleDTO roleKey = govStaffRoleDao.getRoleByCustomerIdAndRoleKey(staffDTO.getCustomerId(), RoleKeyConstants.ROLE_KEY_ROOT_MANAGER);
// 3.根据roleId + staff_id(即 userId) 查 staff_role表的主键id, 如果查到了,那这个userId就是 根管理员 if (null != roleKey){
StaffRoleDTO staffRoleDTO = staffRoleDao.selectStaffRoleByStaffIdAndRoleId(staffDTO.getUserId(), roleKey.getId()); // 3.根据roleId + staff_id(即 userId) 查 staff_role表的主键id, 如果查到了,那这个userId就是 根管理员
if (null != staffRoleDTO){ StaffRoleDTO staffRoleDTO = staffRoleDao.selectStaffRoleByStaffIdAndRoleId(staffDTO.getUserId(), roleKey.getId());
// 4.如果userID是根管理员的话,则根据customerId 去 customer表 查询 id、customer_name if (null != staffRoleDTO){
customerDTO.setId(staffDTO.getCustomerId()); // 4.如果userID是根管理员的话,则根据customerId 去 customer表 查询 id、customer_name
Result<CustomerDTO> customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); customerDTO.setId(staffDTO.getCustomerId());
if (!customerInfo.success()) { Result<CustomerDTO> customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO);
logger.error(String.format("获取根管理员信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); if (!customerInfo.success()) {
} else { logger.error(String.format("获取根管理员信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId())));
if (null != customerInfo.getData()){ } else {
CustomerListResultDTO resultDTO = new CustomerListResultDTO(); if (null != customerInfo.getData()){
resultDTO.setCustomerId(customerInfo.getData().getId()); CustomerListResultDTO resultDTO = new CustomerListResultDTO();
resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); resultDTO.setCustomerId(customerInfo.getData().getId());
listResultDTO.add(resultDTO); resultDTO.setCustomerName(customerInfo.getData().getCustomerName());
} listResultDTO.add(resultDTO);
} }
} }
}
}
} }
return new Result<List<CustomerListResultDTO>>().ok(listResultDTO); return new Result<List<CustomerListResultDTO>>().ok(listResultDTO);
} }

Loading…
Cancel
Save