jianjun 4 years ago
parent
commit
fb407d6fa1
  1. 35
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java
  2. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  3. 96
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetException.java
  4. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenException.java
  5. 38
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  6. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/AssertUtils.java
  7. 6
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/EventInfoResultDTO.java
  8. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  9. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  10. 39
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java
  11. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java
  12. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java
  13. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java
  14. 21
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java
  15. 16
      epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java
  16. 9
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java
  17. 161
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseConflictsResolveDTO.java
  18. 14
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExDeptDTO.java
  19. 187
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseConflictsResolveEntity.java
  20. 1
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseDisputeProcessEntity.java
  21. 16
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExDeptEntity.java
  22. 26
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExUserEntity.java
  23. 3
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExUserService.java
  24. 72
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java
  25. 8
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java
  26. 4
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExDeptServiceImpl.java
  27. 22
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java

35
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java

@ -67,7 +67,15 @@ public abstract class BaseRequestLogAspect {
log.info(">>>>>>>>请求信息>>>>>>>>:事务流水号:{},url:{} ,method:{},请求参数:{}", transactionSerial, requestURI, method, objectsToString(args));
result = point.proceed();
resultInfoLog(transactionSerial, getExecPeriod(startTime), result);
} catch (RenException e) {
} catch (EpmetException e) {
result = handleRenException(e);
if (e.getCode() > 8000) {
resultWarnLog(transactionSerial, getExecPeriod(startTime), result, e.getInternalMsg(), ExceptionUtils.getErrorStackTrace(e));
} else {
resultErrorLog(transactionSerial, getExecPeriod(startTime), result, e.getInternalMsg(), ExceptionUtils.getErrorStackTrace(e));
}
return result;
} catch (RenException e) {
result = handleRenException(e);
if (e.getCode() > 8000) {
resultWarnLog(transactionSerial, getExecPeriod(startTime), result, e.getInternalMsg(), ExceptionUtils.getErrorStackTrace(e));
@ -213,6 +221,31 @@ public abstract class BaseRequestLogAspect {
return result;
}
/**
* 处理EpmetException
* @param e
* @return
*/
private Result handleRenException(EpmetException e) {
if (e.getCode() > 8000) {
Result result;
if (StringUtils.isNotBlank(e.getMsg())) {
// 抛出异常的时候填写了自定义显示信息,把显示信息返回
result = new Result().error(e.getCode(), e.getMsg());
} else {
// 没有填写显示信息,则根据code找固定的显示信息
result = new Result().error(e.getCode());
}
result.setInternalMsg(e.getInternalMsg());
return result;
}
// 转化成服务器开小差...
Result result=new Result().error();
result.setInternalMsg(e.getInternalMsg());
//result.setMsg(e.getMsg());
return result;
}
/**
* 将请求对象转换为String
* @param args

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

@ -7,6 +7,9 @@ package com.epmet.commons.tools.exception;
*/
public enum EpmetErrorCode {
/**
* 错误code及消息
*/
ERR10002( 10002,"数据库中已存在该记录"),
/**
* 账号或密码错误ACCOUNT_NOT_EXIST
@ -212,8 +215,14 @@ public enum EpmetErrorCode {
SAME_RULE_NAME(8916,"该积分事件已存在,请重新调整保存"),
UP_LIMIT_POINT(8917,"积分上限需为单位积分倍数,请重新调整保存"),
BADGE_CHECK(8918,"");
BADGE_CHECK(8918,""),
//通用错误码 start
//通用的 错误消息自己定义返回
EPMET_COMMON_OPERATION_FAIL(9999,"网络开小差..."),
//通用错误码 end
;
private int code;
private String msg;

96
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetException.java

@ -0,0 +1,96 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有侵权必究
*/
package com.epmet.commons.tools.exception;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.MessageUtils;
import org.apache.commons.lang3.StringUtils;
/**
* Epmet产品 自定义异常
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
public class EpmetException extends RuntimeException {
private static final long serialVersionUID = 1L;
/**
* desc:错误码
*/
protected int code;
/**
* 显示给客户的消息
*/
protected String msg;
/**
* 内部消息用于服务之间传递错误信息排错用
*/
protected String internalMsg;
/**
* desc:指定错误码异常 外部异常内容为错误码对应的异常
* @param code
*/
public EpmetException(int code) {
this(code, StrConstant.EPMETY_STR);
}
/**
* desc:指定内部错误消息的异常 外部异常内容为错误码对应的异常
* @param code
* @param internalMsg
*/
public EpmetException(int code, String internalMsg) {
super(internalMsg);
this.code = code;
if (StringUtils.isBlank(internalMsg)) {
this.internalMsg = EpmetErrorCode.getMsg(code);
if (StringUtils.isBlank(this.internalMsg)) {
this.internalMsg = MessageUtils.getMessage(code, internalMsg);
}
} else {
this.internalMsg = internalMsg;
}
}
/**
* desc指定错误码 内外部错误消息异常
* @param code
* @param internalMsg
* @param externalMsg
*/
public EpmetException(int code, String internalMsg, String externalMsg) {
this(code, internalMsg);
this.msg = externalMsg;
}
/**
* desc:指定内部消息异常 外部错误码及消息为8000服务器开小差
* @param internalMsg
*/
public EpmetException(String internalMsg) {
super(internalMsg);
this.code = EpmetErrorCode.SERVER_ERROR.getCode();
this.internalMsg = internalMsg;
}
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
public String getInternalMsg() {
return internalMsg;
}
}

10
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenException.java

@ -35,11 +35,12 @@ public class RenException extends RuntimeException {
* 内部消息用于服务之间传递错误信息排错用
*/
private String internalMsg;
@Deprecated //已废弃 被EpmetException替代
public RenException(int code) {
this(code, "");
}
@Deprecated //已废弃 被EpmetException替代
public RenException(int code, String internalMsg) {
super(internalMsg);
this.code = code;
@ -53,11 +54,13 @@ public class RenException extends RuntimeException {
}
}
@Deprecated //已废弃 被EpmetException替代
public RenException(int code, String internalMsg, String msg, MessageMode mode) {
this(code, internalMsg);
this.msg = msg;
}
@Deprecated //已废弃 被EpmetException替代
public RenException(String internalMsg) {
super(internalMsg);
// this.code = ErrorCode.INTERNAL_SERVER_ERROR;
@ -65,15 +68,12 @@ public class RenException extends RuntimeException {
this.internalMsg = internalMsg;
}
@Deprecated //已废弃 被EpmetException替代
public RenException(String internalMsg, String msg) {
this(internalMsg);
this.msg = msg;
}
public RenException(int code, String... params) {
this.code = code;
this.internalMsg = EpmetErrorCode.getMsg(code);

38
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java

@ -743,44 +743,6 @@ public class DateUtils {
return minusMonthId;
}
/**
* @Description 根据传入的时间维度判断格式
* @param dimension
* @return
* @author wangc
* @date 2020.09.24 10:11
**/
public static String identifyTimeDimension(String dimension){
//yyyyMMdd DATE_PATTERN_YYYYMMDD
//yyyyMM DATE_PATTERN_YYYYMM
//yyyy DATE_PATTERN_YYYY
//yyyyWcc
//yyyyQc
if(dimension.length() == NumConstant.EIGHT){
SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYYMMDD);
try{ df.parse(dimension); }catch (ParseException e){ return null; }
return "date";
}else if(dimension.length() == NumConstant.FOUR){
SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYY);
try{df.parse(dimension);}catch (ParseException e){return null;}
return "year";
}else if(dimension.length() == NumConstant.SEVEN){
if(dimension.contains("W")){
return "week";
}else return null;
}else if(dimension.length() == NumConstant.SIX){
if(dimension.contains("Q")){
return "quarter";
}else{
SimpleDateFormat df = new SimpleDateFormat(DATE_PATTERN_YYYYMM);
try{df.parse(dimension);}catch (ParseException e){return null;}
return "month";
}
}else return null;
}
/**
* 指定月份的开始时间
* @param date

11
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/AssertUtils.java

@ -11,6 +11,7 @@ package com.epmet.commons.tools.validator;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ArrayUtil;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ErrorCode;
import com.epmet.commons.tools.exception.RenException;
import org.apache.commons.lang3.StringUtils;
@ -32,7 +33,7 @@ public class AssertUtils {
public static void isBlank(String str, Integer code, String... params) {
if(code == null){
throw new RenException(ErrorCode.NOT_NULL, "code");
throw new EpmetException(ErrorCode.NOT_NULL, "code");
}
if (StringUtils.isBlank(str)) {
@ -46,7 +47,7 @@ public class AssertUtils {
public static void isNull(Object object, Integer code, String... params) {
if(code == null){
throw new RenException(ErrorCode.NOT_NULL, "code");
throw new EpmetException(ErrorCode.NOT_NULL, "code");
}
if (object == null) {
@ -60,7 +61,7 @@ public class AssertUtils {
public static void isArrayEmpty(Object[] array, Integer code, String... params) {
if(code == null){
throw new RenException(ErrorCode.NOT_NULL, "code");
throw new EpmetException(ErrorCode.NOT_NULL, "code");
}
if(ArrayUtil.isEmpty(array)){
@ -74,7 +75,7 @@ public class AssertUtils {
public static void isListEmpty(List<?> list, Integer code, String... params) {
if(code == null){
throw new RenException(ErrorCode.NOT_NULL, "code");
throw new EpmetException(ErrorCode.NOT_NULL, "code");
}
if(CollUtil.isEmpty(list)){
@ -88,7 +89,7 @@ public class AssertUtils {
public static void isMapEmpty(Map map, Integer code, String... params) {
if(code == null){
throw new RenException(ErrorCode.NOT_NULL, "code");
throw new EpmetException(ErrorCode.NOT_NULL, "code");
}
if(MapUtil.isEmpty(map)){

6
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/EventInfoResultDTO.java

@ -24,7 +24,7 @@ public class EventInfoResultDTO implements Serializable {
*/
private String customerId;
private Integer detpId;
private String orgId;
private String reporterId;
@ -47,7 +47,7 @@ public class EventInfoResultDTO implements Serializable {
* 事件类别
*/
private String eventCategory;
private String parentEventCategory;
/**
* 上报时间 YYYY-MM-DD HH:MM:SS
*/
@ -78,6 +78,8 @@ public class EventInfoResultDTO implements Serializable {
*/
private String successfulOrNo;
private String status;
/**
* 办结层级
01省自治区直辖市

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java

@ -2,6 +2,7 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.distributedlock.LockConstants;
import com.epmet.commons.tools.enums.EnvEnum;
@ -229,6 +230,15 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
log.error("基层治理-难点赌点抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
}
try {
//基层治理 - 热心市民 screen_party_user_rank_data
ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO();
param.setCustomerId(customerId);
param.setDateId(dateId);
screenGrassrootsGovernDataAbsorptionService.userScoreDataHub(param);
} catch (Exception e) {
log.error("大屏热心市民/党员得分数据写入失败,参数为:{}" + customerId+ StrConstant.HYPHEN +dateId, e);
}
} finally {
latch.countDown();
log.info("extractDaily 2 thread run end ========= dateId:{},customerId:{}", dateId, customerId);
@ -426,7 +436,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
} catch (Exception e) {
log.error("党建引领抽取到大屏失败,参数为:" + JSON.toJSONString(formDTO), e);
}
try {
//已经挪到天抽取的抽取里了
/* try {
//基层治理 - 热心市民 screen_party_user_rank_data
ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO();
param.setCustomerId(customerId);
@ -434,7 +445,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
screenGrassrootsGovernDataAbsorptionService.userScoreDataHub(param);
} catch (Exception e) {
log.error("大屏热心市民/党员得分数据写入失败,参数为:{}" + JSON.toJSONString(formDTO), e);
}
}*/
try {
// 项目(事件)数量分析按网格_按月统计
screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId, monthId);

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java

@ -88,6 +88,10 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
**/
@Override
public void userScoreDataHub(ScreenCentralZoneDataFormDTO param) {
if (StringUtils.isNotBlank(param.getDateId()) && param.getDateId().length()!= NumConstant.EIGHT){
log.error("userScoreDataHub param dateId must be dateId(eg:20211212)");
return;
}
//1.查询出客户下的网格注册用户
List<ScreenPartyUserRankDataEntity> registeredUsers = userService.getRegisteredUserList(param.getCustomerId());
@ -100,19 +104,15 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
Map<String, Integer> pointMap = userPointService.getUserPointMap(param.getCustomerId());
//4.查询出客户下党员的分值
String dateId = param.getDateId();
if (StringUtils.isEmpty(dateId)) {
//如果没有传月份,则使用当前时间的上一个月
final String finalDateId = dateId;
String currentMonthId = DateUtils.getBeforeNMonth(0);
if (StringUtils.isEmpty(dateId) || dateId.contains(currentMonthId)) {
//如果没有传月份 或者传的为日期为当前月则,则使用当前时间的上一个月
dateId = DateUtils.getBeforeNMonth(NumConstant.ONE);
} else {
String dateType = DateUtils.identifyTimeDimension(dateId);
if (StringUtils.isEmpty(dateType) || !StringUtils.equalsAny(dateType, "date", "month")) {
dateId = DateUtils.getBeforeNMonth(NumConstant.ONE);
} else if (StringUtils.equals(dateType, "date")) {
dateId = dateId.substring(NumConstant.ZERO, dateId.length() - NumConstant.TWO);
}
dateId = dateId.substring(NumConstant.ZERO, dateId.length() - NumConstant.TWO);
}
final String finalDateId = dateId;
// 查询党员积分
// 查询党员指标得分 按月查
Map<String, BigDecimal> scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(), dateId);
//剔除垃圾数据

39
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java

@ -2,6 +2,7 @@ package com.epmet.service.impl;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.OrgTypeConstant;
import com.epmet.constant.ProjectConstant;
import com.epmet.dto.basereport.form.EventInfoFormDTO;
@ -19,6 +20,7 @@ import com.epmet.dto.user.result.MidPatrolDetailResult;
import com.epmet.dto.user.result.MidPatrolRecordResult;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
import com.epmet.entity.stats.CustomerProjectCategoryDictEntity;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.service.DataReportingService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService;
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService;
@ -61,6 +63,8 @@ public class DataReportingServiceImpl implements DataReportingService {
private StatsStaffPatrolService statsStaffPatrolService;
@Resource
private CustomerProjectCategoryDictService customerProjectCategoryDictService;
@Resource
private OperCrmOpenFeignClient operCrmOpenFeignClient;
/**
* @Author sun
@ -153,16 +157,24 @@ public class DataReportingServiceImpl implements DataReportingService {
if(CollectionUtils.isEmpty(projectList)) {
return Collections.emptyList();
}
Map<String, CustomerProjectCategoryDictEntity> epmetCodeMap = new HashMap<>();
Result<String> parentCustomer = operCrmOpenFeignClient.getExternalAndParentCustomerId(formDTO.getCustomerId());
if (StringUtils.isNotBlank(parentCustomer.getData())) {
customerProjectCategoryDictService.getByCategoryCodeMap(parentCustomer.getData());
}
Map<String, CustomerProjectCategoryDictEntity> codeMap = customerProjectCategoryDictService.getByCategoryCodeMap(formDTO.getCustomerId());;
//项目ID不为空时,因为只有一条,可以直接处理
if (StringUtils.isNotEmpty(formDTO.getProjectId())) {
list = projectList.stream().map(project -> {
EventInfoResultDTO dto = getEventInfoResultDTO(project);
EventInfoResultDTO dto = getEventInfoResultDTO(project, epmetCodeMap, codeMap);
if (OrgTypeConstant.AGENCY.equals(project.getOrgType())) {
ScreenCustomerAgencyEntity agency = screenCustomerAgencyService.getAgencyById(project.getOrgId());
dto.setOrgId(project.getOrgId());
dto.setOrgCode(agency.getCode());
dto.setOrgName(agency.getAgencyName());
} else {
ScreenCustomerGridDTO grid = screenCustomerGridService.getGridById(project.getOrgId());
dto.setOrgId(project.getOrgId());
dto.setOrgCode(grid.getCode());
dto.setOrgName(grid.getGridName());
}
@ -173,7 +185,7 @@ public class DataReportingServiceImpl implements DataReportingService {
Map<String, ScreenCustomerAgencyEntity> agencyMap = screenCustomerAgencyService.getAgencyList(formDTO.getCustomerId());
Map<String, ScreenCustomerGridDTO> gridMap = screenCustomerGridService.getGridList(formDTO.getCustomerId());
list = projectList.stream().map(project -> {
EventInfoResultDTO dto = getEventInfoResultDTO(project);
EventInfoResultDTO dto = getEventInfoResultDTO(project, epmetCodeMap, codeMap);
if (OrgTypeConstant.AGENCY.equals(project.getOrgType())) {
ScreenCustomerAgencyEntity agency = agencyMap.get(project.getOrgId());
dto.setOrgCode(agency.getCode());
@ -189,25 +201,29 @@ public class DataReportingServiceImpl implements DataReportingService {
return list.stream().filter(item -> StringUtils.isNotBlank(item.getEventCategory())).collect(Collectors.toList());
}
private EventInfoResultDTO getEventInfoResultDTO(ScreenProjectDataDTO project) {
private EventInfoResultDTO getEventInfoResultDTO(ScreenProjectDataDTO project, Map<String, CustomerProjectCategoryDictEntity> epmetCodeMap, Map<String, CustomerProjectCategoryDictEntity> codeMap) {
EventInfoResultDTO dto = new EventInfoResultDTO();
dto.setId(project.getProjectId());
dto.setCustomerId(project.getCustomerId());
dto.setEventName(project.getProjectTitle());
dto.setReporterId(project.getProjectCreator());
String categoryCode = project.getCategoryCode().split(StrConstant.COMMA)[0];
String parentCode = null == codeMap.get(categoryCode)?null:codeMap.get(categoryCode).getParentCategoryCode();
//如果是孔村、榆山、锦水的项目需要关联分类字典表
if("2fe0065f70ca0e23ce4c26fca5f1d933".equals(project.getCustomerId()) ||
"44876154d10d7cb7affd92000f84f833".equals(project.getCustomerId()) ||
"46c55cb862d6d5e6d05d2ab61a1cc07e".equals(project.getCustomerId())) {
CustomerProjectCategoryDictEntity categoryEntity = customerProjectCategoryDictService.getByCategoryCode(project.getCustomerId(), categoryCode);
CustomerProjectCategoryDictEntity categoryEntity = codeMap.get(categoryCode);
if (null != categoryEntity) {
categoryCode = categoryEntity.getEpmetCategoryCode();
parentCode = epmetCodeMap.get(categoryEntity.getEpmetCategoryCode()).getParentCategoryCode();
} else {
categoryCode = null;
parentCode = null;
}
}
dto.setEventCategory(categoryCode);
dto.setParentEventCategory(parentCode);
dto.setReportTime(project.getProjectCreateTime());
dto.setHappenDate(DateUtils.parseDate(DateUtils.format(project.getProjectCreateTime()), DateUtils.DATE_PATTERN));
dto.setHappenPlace(project.getProjectAddress());
@ -244,7 +260,7 @@ public class DataReportingServiceImpl implements DataReportingService {
dto.setCompleteLevel("07");
}
}
dto.setStatus(getProjectStatus(project.getProjectStatusCode()));
dto.setCompleteTime(project.getCloseCaseTime());
dto.setLat(project.getLatitude());
dto.setLng(project.getLongitude());
@ -268,6 +284,19 @@ public class DataReportingServiceImpl implements DataReportingService {
}
}
private String getProjectStatus(String status) {
switch (status) {
case ProjectConstant.PENDING:
return "01";
case ProjectConstant.CLOSED:
return "02";
case ProjectConstant.CLOSED_CASE:
return "03";
default:
return null;
}
}
@Override
public List<MidPatrolRecordResult> getPatrolRecordList(MidPatrolFormDTO formDTO) {
return userService.getPatrolRecordList(formDTO);

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java

@ -24,6 +24,7 @@ import com.epmet.entity.issue.IssueProjectCategoryDictEntity;
import com.epmet.entity.stats.CustomerProjectCategoryDictEntity;
import java.util.List;
import java.util.Map;
/**
* 客户项目分类字典表
@ -65,4 +66,6 @@ public interface CustomerProjectCategoryDictService extends BaseService<Customer
* @Date 2021/10/15 16:33
*/
CustomerProjectCategoryDictEntity getByCategoryCode(String customerId, String categoryCode);
Map<String, CustomerProjectCategoryDictEntity> getByCategoryCodeMap(String customerId);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java

@ -34,7 +34,11 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 客户项目分类字典表
@ -135,4 +139,15 @@ public class CustomerProjectCategoryDictServiceImpl extends BaseServiceImpl<Cust
wrapper.eq(CustomerProjectCategoryDictEntity::getCustomerId, customerId);
return baseDao.selectOne(wrapper);
}
@Override
public Map<String, CustomerProjectCategoryDictEntity> getByCategoryCodeMap(String customerId) {
LambdaQueryWrapper<CustomerProjectCategoryDictEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CustomerProjectCategoryDictEntity::getCustomerId, customerId);
List<CustomerProjectCategoryDictEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
return list.stream().collect(Collectors.toMap(CustomerProjectCategoryDictEntity::getCategoryCode, Function.identity()));
}
}

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java

@ -76,16 +76,14 @@ public abstract class ScoreCalculator<T> {
throw new RuntimeException("入参数组错误:请设置sourceValue");
}
BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue));
if (correlation == Correlation.POSITIVE) {
// 正相关
BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue));
BigDecimal score = minScore.add(x);
return score;
} else if (correlation == Correlation.NEGATIVE) {
// 负相关
BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue));
BigDecimal score = minScore.add(x);
return maxScore.subtract(score, MathContext.DECIMAL32);
return maxScore.subtract(x, MathContext.DECIMAL32);
} else {
throw new RuntimeException("错误的相关性");
}

21
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java

@ -76,19 +76,24 @@ public class BatchScoreCalculator {
if (idx.getScoreCalculator().getMaxValue().compareTo(idx.getScoreCalculator().getMinValue()) == 0) {
//*((max-min)/ (Math.PI/2))+min
//Math.atan(new Double(vo.getSampleValue().toString()))*
normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString())))
.multiply(
(maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP)))
.add(minScoreValue).setScale(6, RoundingMode.HALF_UP);
if (Correlation.POSITIVE.getCode().equals(scoreCalculator.getCorrelation().getCode())) {
normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString())))
.multiply(
(maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP)))
.add(minScoreValue).setScale(6, RoundingMode.HALF_UP);
}else{
normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString())))
.multiply(
(maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP)).multiply(new BigDecimal(-1)))
.add(maxScoreValue).setScale(6, RoundingMode.HALF_UP);
}
} else {
normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold));
}
//如果是负相关 则用100-归一后的值为最大值减
/* //如果是负相关 则用100-归一后的值为最大值减
if (Correlation.NEGATIVE.getCode().equals(scoreCalculator.getCorrelation().getCode())) {
normalizeValue = maxScoreValue.subtract(normalizeValue);
}
}*/
}
//如果归一后的值小于0 则置为0
if (normalizeValue.compareTo(NumConstant.ZERO_DECIMAL)<=-1){

16
epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/MathUtilTest.java

@ -20,10 +20,20 @@ public class MathUtilTest {
BigDecimal maxValue = new BigDecimal(100);
BigDecimal minValue = new BigDecimal(60);
BigDecimal normalizeValue = new BigDecimal(Math.atan(new Double("0")))
.multiply(
(maxValue.subtract(minValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))).add(minValue).setScale(6, RoundingMode.HALF_UP);
//((max-min)/ (Math.PI/2))+min
BigDecimal sampleValue = new BigDecimal(Math.atan(new Double("0")));
BigDecimal normalizeValue = sampleValue
.multiply(maxValue.subtract(minValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))
.add(minValue).setScale(6, RoundingMode.HALF_UP);
BigDecimal normalizeValue2 = sampleValue
.multiply(maxValue.subtract(minValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP).multiply(new BigDecimal(-1)))
.add(maxValue).setScale(6, RoundingMode.HALF_UP);
System.out.println(normalizeValue);
System.out.println(normalizeValue2);
//new BigDecimal(Math.atan(new Double(vo.getSampleValue().toString())) / Math.PI * 100).setScale(6, RoundingMode.HALF_UP);
}

9
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java

@ -623,7 +623,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
String bindResult = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_OPEN_GET + authorizerAccessToken, JSON.toJSONString(bindInfoForm)).getData();
Map<String, Object> bindInfo = JSON.parseObject(bindResult, Map.class);
boolean bindStatus = bindInfo.containsKey(ModuleConstant.OPEN_APP_ID);
if (bindStatus != true) {
if (!bindStatus) {
Integer authCount = customerMpDao.selectAuthCount(customerId);
String openPlatformId = null;
if (authCount > 0) {
@ -658,6 +658,8 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
throw new RenException(INVALID_APP_ID);
case ModuleConstant.EIGHTY_NINE_THOUSAND:
throw new RenException(ACCOUNT_HAS_BOUND_OPEN);
default:
}
} else if (authCount > NumConstant.ZERO) {
log.info("该客户已创建过开放平台账号,直接绑定");
@ -685,6 +687,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
throw new RenException(NOT_ALLOWED_OPERATE);
case ModuleConstant.EIGHTY_NINE_THOUSAND_AND_FOUR:
throw new RenException(TO_LIMIT);
default:
}
}
//插入 binding_account
@ -706,7 +709,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
public Date countExpirationTime(String expiresIn) {
expiresIn = expiresIn + "000";
Date date = new Date();
long l = date.getTime() + Long.valueOf(expiresIn);
long l = date.getTime() + Long.parseLong(expiresIn);
date.setTime(l);
return date;
}
@ -727,7 +730,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe
* @author zxc
*/
public Date sToDate(String t) {
Long aLong = Long.valueOf(t + "000");
long aLong = Long.parseLong(t + "000");
Date date = new Date();
date.setTime(aLong);
return date;

161
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseConflictsResolveDTO.java

@ -27,7 +27,7 @@ import java.util.Date;
* 事件中间表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-22
* @since v1.0.0 2021-11-25
*/
@Data
public class BaseConflictsResolveDTO implements Serializable {
@ -40,38 +40,173 @@ public class BaseConflictsResolveDTO implements Serializable {
private String id;
/**
* 事件信息
* 事件所属网格ID
*/
private String eventInfo;
private Integer gridId;
/**
* 事件所属网格ID
* 网格名称
*/
private String gridName;
/**
* 事件名称
*/
private String eventName;
/**
* 发生日期
*/
private Date happenDate;
/**
* 发生地点
*/
private String happenPlace;
/**
* 事件规模
*/
private String eventScale;
/**
* 涉及人数
*/
private Integer numberInvolved;
/**
* 事件简述
*/
private String eventDescription;
/**
* 涉及单位
*/
private String relatedUnits;
/**
* 主要当事人证件代码
*/
private String identificationCode;
/**
* 主要当事人证件号码
*/
private String idCard;
/**
* 主要当事人姓名
*/
private String gridId;
private String name;
/**
*
* 主要当事人性别
*/
private String delFlag;
private String sex;
/**
* 主要当事人民族
*/
private String nation;
/**
* 主要当事人学历
*/
private String education;
/**
* 主要当事人人员类别二级
*/
private String personnelCategory;
/**
* 主要当事人居住详址
*/
private String detailAddress;
/**
* 是否解决或化解Y已解决N未解决
*/
private String successfulOrNot;
/**
* 经度
*/
private String lng;
/**
* 纬度
*/
private String lat;
/**
* 创建人
*/
private String createdBy;
private String createBy;
/**
* 创建时间
*/
private Date createdTime;
private Date createDate;
/**
* 修改人
*/
private String updateBy;
/**
* 修改时间
*/
private Date updateDate;
/**
* 事件所属网格ID状态01待办理02待核实03办结
*/
private String status;
/**
* 事件编号自定义编号可以加前缀如py
*/
private String eventNo;
/**
* 采集来源01App02Web
*/
private String source;
/**
* 事件类别(一级)
*/
private String firstEventCategory;
/**
* 事件类别(二级)
*/
private String secondEventCategory;
/**
* 主要当事人人员类别(一级)
*/
private String firstPersonnelCategory;
/**
* 办结方式状态是办结的时候才填
*/
private String resolveWay;
/**
* 办结层级状态是办结的时候才填
*/
private String resolveGridLevel;
/**
*
* 办结时间状态是办结的时候才填
*/
private String updatedBy;
private Date resolveTime;
/**
* 更新时间
* 同步状态 0 未同步 1 已同步
*/
private Date updatedTime;
private String flag;
}

14
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/ExDeptDTO.java

@ -68,14 +68,24 @@ public class ExDeptDTO implements Serializable {
*/
private String gridCode;
/**
* 组织类型
*/
private String isCgorg;
/**
* 区县平台部门id
*/
private String deptIdQx;
private String qxDeptId;
/**
* 区县平台部门/网格名称
*/
private String qxDeptCode;
/**
* 区县平台部门/网格名称
*/
private String deptNameQx;
private String qxDeptName;
}

187
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseConflictsResolveEntity.java

@ -18,31 +18,196 @@
package com.epmet.opendata.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 事件中间表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-22
* @since v1.0.0 2021-11-25
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("base_conflicts_resolve")
public class BaseConflictsResolveEntity {
public class BaseConflictsResolveEntity{
private static final long serialVersionUID = 1L;
/**
* 事件信息
*/
private String eventInfo;
/**
* 事件ID
*/
private String id;
/**
* 事件所属网格ID
*/
private Integer gridId;
/**
* 网格名称
*/
private String gridName;
/**
* 事件名称
*/
private String eventName;
/**
* 发生日期
*/
private Date happenDate;
/**
* 发生地点
*/
private String happenPlace;
/**
* 事件规模
*/
private String eventScale;
/**
* 涉及人数
*/
private Integer numberInvolved;
/**
* 事件简述
*/
private String eventDescription;
/**
* 涉及单位
*/
private String relatedUnits;
/**
* 主要当事人证件代码
*/
private String identificationCode;
/**
* 主要当事人证件号码
*/
private String idCard;
/**
* 主要当事人姓名
*/
private String name;
/**
* 主要当事人性别
*/
private String sex;
/**
* 主要当事人民族
*/
private String nation;
/**
* 主要当事人学历
*/
private String education;
/**
* 主要当事人人员类别二级
*/
private String personnelCategory;
/**
* 主要当事人居住详址
*/
private String detailAddress;
/**
* 是否解决或化解Y已解决N未解决
*/
private String successfulOrNot;
/**
* 经度
*/
private String lng;
/**
* 纬度
*/
private String lat;
/**
* 创建人
*/
private String createBy;
/**
* 创建时间
*/
private Date createDate;
/**
* 修改人
*/
private String updateBy;
/**
* 修改时间
*/
private Date updateDate;
/**
* 事件所属网格ID状态01待办理02待核实03办结
*/
private String status;
/**
* 事件编号自定义编号可以加前缀如py
*/
private String eventNo;
/**
* 采集来源01App02Web
*/
private String source;
/**
* 事件类别(一级)
*/
private String firstEventCategory;
/**
* 事件类别(二级)
*/
private String secondEventCategory;
/**
* 主要当事人人员类别(一级)
*/
private String firstPersonnelCategory;
/**
* 办结方式状态是办结的时候才填
*/
private String resolveWay;
/**
* 办结层级状态是办结的时候才填
*/
private String resolveGridLevel;
/**
* 事件所属网格ID
*/
private String gridId;
/**
* 办结时间状态是办结的时候才填
*/
private Date resolveTime;
/**
* 同步状态 0 未同步 1 已同步
*/
private String flag;
}

1
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseDisputeProcessEntity.java

@ -97,7 +97,6 @@ public class BaseDisputeProcessEntity extends BaseEpmetEntity {
* 是否办结 YN
*/
private String successfulOrNo;
/**
* 办结层级
01省自治区直辖市

16
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExDeptEntity.java

@ -65,18 +65,28 @@ public class ExDeptEntity {
private String deptCode;
/**
*
* 省标准区划编码/网格编码
*/
private String gridCode;
/**
* 组织类型
*/
private String isCgorg;
/**
* 区县平台部门id
*/
private String deptIdQx;
private String qxDeptId;
/**
* 区县平台部门/网格名称
*/
private String qxDeptCode;
/**
* 区县平台部门/网格名称
*/
private String deptNameQx;
private String qxDeptName;
}

26
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/ExUserEntity.java

@ -37,7 +37,7 @@ public class ExUserEntity {
/**
* 市平台 用户ID
*/
private String userId;
private Integer userId;
/**
* 市平台 用户名
@ -45,28 +45,32 @@ public class ExUserEntity {
private String userName;
/**
* 市平台 用户身份证
* 市平台 登录账
*/
private String idCard;
private String loginName;
/**
* 市平台 用户手机号
* 市平台所属区县街道村居或网格id
*/
private String mobile;
private String gridId;
/**
* 区县平台 用户ID
* 市平台所属部门id
*/
private String userIdQx;
private String deptId;
/**
* 区县平台 用户名
* 区县平台用户id
*/
private String userNameQx;
private String qxUserId;
/**
* 区县平台 用户账号
* 区县平台姓名/用户名称
*/
private String userAccount;
private String qxUserName;
/**
* 区县平台手机号码
*/
private String qxMobile;
}

3
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/ExUserService.java

@ -20,6 +20,8 @@ package com.epmet.opendata.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.opendata.entity.ExUserEntity;
import java.util.Map;
/**
* 系统用户中间表
*
@ -27,5 +29,6 @@ import com.epmet.opendata.entity.ExUserEntity;
* @since v1.0.0 2021-10-22
*/
public interface ExUserService extends BaseService<ExUserEntity> {
Map<String, Integer> getUserMap();
}

72
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java

@ -20,22 +20,26 @@ package com.epmet.opendata.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SystemMessageType;
import com.epmet.dto.basereport.form.EventInfoFormDTO;
import com.epmet.dto.basereport.result.EventInfoResultDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient;
import com.epmet.opendata.dao.BaseDisputeProcessDao;
import com.epmet.opendata.entity.BaseConflictsResolveEntity;
import com.epmet.opendata.entity.BaseDisputeProcessEntity;
import com.epmet.opendata.service.BaseConflictsResolveService;
import com.epmet.opendata.service.BaseDisputeProcessService;
import com.epmet.opendata.service.ExDeptService;
import com.epmet.opendata.service.ExUserService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 事件信息表
@ -49,6 +53,10 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputePr
private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient;
@Resource
private ExDeptService exDeptService;
@Resource
private BaseConflictsResolveService baseConflictsResolveService;
@Resource
private ExUserService exUserService;
/**
* 获取上报事件
@ -66,37 +74,55 @@ public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputePr
throw new RenException(result.getInternalMsg());
}
Map<String, Integer> deptMap = exDeptService.getDeptMap();
Map<String, Integer> userMap = exUserService.getUserMap();
List<EventInfoResultDTO> list = result.getData();
if (CollectionUtils.isNotEmpty(list)) {
List<BaseDisputeProcessEntity> entityList = ConvertUtils.sourceToTarget(list, BaseDisputeProcessEntity.class);
entityList.forEach(item -> {
item.setDetpId(deptMap.get(item.getOrgCode()));
});
if(SystemMessageType.PROJECT_ADD.equals(formDTO.getType())){
insertBatch(entityList);
}else {
updateBatchById(entityList);
}
}
saveEvent(formDTO, deptMap, userMap, list);
//分批次循环
while (CollectionUtils.isNotEmpty(list)) {
formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE);
result = dataStatisticalOpenFeignClient.getEventInfo(formDTO);
list = result.getData();
if (CollectionUtils.isNotEmpty(list)) {
List<BaseDisputeProcessEntity> entityList = ConvertUtils.sourceToTarget(list, BaseDisputeProcessEntity.class);
entityList.forEach(item -> {
item.setDetpId(deptMap.get(item.getOrgCode()));
});
if("add".equals(formDTO.getType())){
insertBatch(entityList);
}else {
updateBatchById(entityList);
}
}
saveEvent(formDTO, deptMap, userMap, list);
}
}
private void saveEvent(EventInfoFormDTO formDTO, Map<String, Integer> deptMap, Map<String, Integer> userMap, List<EventInfoResultDTO> list) {
if (CollectionUtils.isNotEmpty(list)) {
List<BaseConflictsResolveEntity> resolveList = list.stream().map(item -> {
BaseConflictsResolveEntity entity = new BaseConflictsResolveEntity();
entity.setId(item.getId());
entity.setGridId(deptMap.get(item.getOrgId()));
entity.setGridName(item.getOrgName());
entity.setEventName(item.getEventName());
entity.setHappenDate(item.getHappenDate());
entity.setHappenPlace(item.getHappenPlace());
entity.setEventDescription(item.getEventDescription());
entity.setLng(item.getLng().toPlainString());
entity.setLat(item.getLat().toPlainString());
entity.setCreateBy(null == userMap.get(item.getReporterId())?null:String.valueOf(userMap.get(item.getReporterId())));
entity.setCreateDate(item.getReportTime());
entity.setUpdateDate(new Date());
entity.setStatus(item.getStatus());
entity.setFirstEventCategory(item.getParentEventCategory());
entity.setSource("01");
entity.setSecondEventCategory(item.getEventCategory());
entity.setResolveWay(item.getWaysOfResolving());
entity.setResolveGridLevel(item.getCompleteLevel());
entity.setResolveTime(item.getCompleteTime());
if(SystemMessageType.PROJECT_ADD.equals(formDTO.getType())) {
entity.setFlag(NumConstant.ZERO_STR);
}
return entity;
}).collect(Collectors.toList());
if(SystemMessageType.PROJECT_ADD.equals(formDTO.getType())){
baseConflictsResolveService.insertBatch(resolveList);
}else {
baseConflictsResolveService.updateBatchById(resolveList);
}
}
}
}

8
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridInfoServiceImpl.java

@ -90,8 +90,8 @@ public class BaseGridInfoServiceImpl extends BaseServiceImpl<BaseGridInfoDao, Ba
List<ExDeptEntity> ExList = new ArrayList<>();
result.getData().forEach(ag->{
ExDeptEntity entity = new ExDeptEntity();
entity.setDeptIdQx(ag.getId());
entity.setDeptNameQx(ag.getOrganizationName());
entity.setQxDeptId(ag.getId());
entity.setQxDeptName(ag.getOrganizationName());
entity.setGridCode(ag.getCode());
ExList.add(entity);
});
@ -138,8 +138,8 @@ public class BaseGridInfoServiceImpl extends BaseServiceImpl<BaseGridInfoDao, Ba
List<ExDeptEntity> ExList = new ArrayList<>();
result.getData().forEach(ag -> {
ExDeptEntity entity = new ExDeptEntity();
entity.setDeptIdQx(ag.getId());
entity.setDeptNameQx(ag.getGridName());
entity.setQxDeptId(ag.getId());
entity.setQxDeptName(ag.getGridName());
entity.setGridCode(ag.getCode());
ExList.add(entity);
});

4
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExDeptServiceImpl.java

@ -104,12 +104,12 @@ public class ExDeptServiceImpl extends BaseServiceImpl<ExDeptDao, ExDeptEntity>
@Override
public Map<String, Integer> getDeptMap() {
LambdaQueryWrapper<ExDeptEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.ne(ExDeptEntity::getGridCode, null);
wrapper.isNotNull(ExDeptEntity::getGridCode);
List<ExDeptEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(entityList)) {
return Collections.emptyMap();
}
return entityList.stream().collect(Collectors.toMap(ExDeptEntity::getGridCode, ExDeptEntity::getDeptId, (key1, key2) -> key2));
return entityList.stream().collect(Collectors.toMap(ExDeptEntity::getQxDeptId, ExDeptEntity::getDeptId, (key1, key2) -> key2));
}
}

22
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/ExUserServiceImpl.java

@ -17,23 +17,18 @@
package com.epmet.opendata.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.opendata.dao.ExUserDao;
import com.epmet.opendata.dto.ExUserDTO;
import com.epmet.opendata.entity.ExUserEntity;
import com.epmet.opendata.service.ExUserService;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 系统用户中间表
@ -45,4 +40,13 @@ import java.util.Map;
public class ExUserServiceImpl extends BaseServiceImpl<ExUserDao, ExUserEntity> implements ExUserService {
@Override
public Map<String, Integer> getUserMap() {
LambdaQueryWrapper<ExUserEntity> wrapper = new LambdaQueryWrapper<>();
List<ExUserEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
return list.stream().collect(Collectors.toMap(ExUserEntity::getQxUserId, ExUserEntity::getUserId, (key1, key2) -> key2));
}
}
Loading…
Cancel
Save