Browse Source

Merge branch 'develop' of http://git.elinkit.com.cn:7070/r/epmet-cloud into release_temp

master
jianjun 4 years ago
parent
commit
9c52806143
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java
  3. 123
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java
  4. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/beans/GridMemberDataAnalysisExcelExportBean.java
  5. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  6. 1
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  7. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  8. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  9. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/AggreGridServiceImpl.java
  10. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  11. 4
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml
  12. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  13. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java
  14. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java
  15. 156
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainAndPeriodDTO.java
  16. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java
  17. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  18. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java
  19. 251
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  20. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java
  21. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java
  22. 69
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  23. 10
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml
  24. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml
  25. 4
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java
  26. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java
  27. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java
  28. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  29. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  30. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml
  31. 2
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java
  32. 4
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BlockChainCreateProjectFormDTO.java
  33. 4
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BlockChainProcessProjectFormDTO.java
  34. 11
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdOpenFeignClient.java
  35. 21
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java
  36. 15
      epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java
  37. 17
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java
  38. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java
  39. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java
  40. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java
  41. 1
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java
  42. 1
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java
  43. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java
  44. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  45. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java
  46. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  47. 195
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  48. 41
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java
  49. 15
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  50. 13
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml
  51. 12
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  52. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml
  53. 3
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java
  54. 8
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java
  55. 4
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PcWorkListResultDTO.java
  56. 28
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  57. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/PcWorkListExport.java
  58. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java
  59. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

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

@ -157,6 +157,7 @@ public enum EpmetErrorCode {
COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR(8530, "%s社区自组织名称已存在"), COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR(8530, "%s社区自组织名称已存在"),
MATTER_NAME_EXISTS_APPOINTMENT_ERROR(8532, "存在重复预约事项"), MATTER_NAME_EXISTS_APPOINTMENT_ERROR(8532, "存在重复预约事项"),
ERROR_DATE(8533, "不合理日期"),
// 该错误不会提示给前端,只是后端传输错误信息用。 // 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java

@ -59,7 +59,8 @@ public class CustomerOrgRedis {
throw new RenException("查询网格信息失败..."); throw new RenException("查询网格信息失败...");
} }
if (null == gridInfoResult.getData()){ if (null == gridInfoResult.getData()){
throw new RenException("没有此网格信息..."); //throw new RenException("没有此网格信息...");
return null;
} }
Map<String, Object> map = BeanUtil.beanToMap(gridInfoResult.getData(), false, true); Map<String, Object> map = BeanUtil.beanToMap(gridInfoResult.getData(), false, true);
customerOrgRedis.redisUtils.hMSet(key, map); customerOrgRedis.redisUtils.hMSet(key, map);

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

@ -945,4 +945,127 @@ public class DateUtils {
return result; return result;
} }
/**
* @Description 获取工作日时间没有排除节假日
* @param startDate
* @param num
* @author zxc
* @date 2022/1/7 10:51 上午
*/
public static Date getWorkDay(Date startDate, int num) {
Date tomorrow = null;
int delay = 1;
while (delay <= num) {
tomorrow = getTomorrow(startDate);
if (!isWeekend(tomorrow)) {
delay++;
}
startDate = tomorrow;
}
return startDate;
}
/**
* @Description 根据开始时间计算出 当前日期后n个工作日没有排除节假日包括今天
* @param startDate
* @param num
* @author zxc
* @date 2022/1/7 10:20 上午
*/
public static List<String> getWorkDayList(Date startDate, int num) {
List<String> result = new ArrayList<>();
Calendar rightNow = Calendar.getInstance();
rightNow.setTime(startDate);
rightNow.add(Calendar.DATE,-1);
startDate = rightNow.getTime();
Date tomorrow;
Integer tag = 1;
while (tag <= num){
tomorrow = getTomorrow(startDate);
// 返回工作日
if (!isWeekend(tomorrow)) {
result.add(new SimpleDateFormat(DATE_PATTERN).format(tomorrow));
tag++;
}
startDate = tomorrow;
}
return result;
}
/**
* @Description 根据开始时间计算出 当前日期后n个周末没有排除节假日包括今天
* @param startDate
* @param num
* @author zxc
* @date 2022/1/7 10:20 上午
*/
public static List<String> getWeekendDayList(Date startDate, int num) {
List<String> result = new ArrayList<>();
Calendar rightNow = Calendar.getInstance();
rightNow.setTime(startDate);
rightNow.add(Calendar.DATE,-1);
startDate = rightNow.getTime();
Date tomorrow;
Integer tag = 1;
while (tag <= num){
tomorrow = getTomorrow(startDate);
// 返回周末
if (isWeekend(tomorrow)) {
result.add(new SimpleDateFormat(DATE_PATTERN).format(tomorrow));
tag++;
}
startDate = tomorrow;
}
return result;
}
/**
* @Description 根据开始时间计算出 当前日期后n天没有排除节假日包括今天
* @param startDate
* @param num
* @author zxc
* @date 2022/1/7 10:20 上午
*/
public static List<String> getEveryDayList(Date startDate, int num) {
List<String> result = new ArrayList<>();
Calendar rightNow = Calendar.getInstance();
rightNow.setTime(startDate);
rightNow.add(Calendar.DATE,-1);
startDate = rightNow.getTime();
Date tomorrow;
Integer tag = 1;
while (tag <= num){
tomorrow = getTomorrow(startDate);
result.add(new SimpleDateFormat(DATE_PATTERN).format(tomorrow));
tag++;
startDate = tomorrow;
}
return result;
}
/**
* @Description 判断日期字符串是否为周末
* @param date eg:yyyy-MM-dd
* @author zxc
* @date 2022/1/7 10:50 上午
*/
private static boolean isWeekend(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
return cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY;
}
/**
* @Description 获取tomorrow的日期
* @param startDate
* @author zxc
* @date 2022/1/7 10:50 上午
*/
private static Date getTomorrow(Date startDate) {
Calendar cal = Calendar.getInstance();
cal.setTime(startDate);
cal.add(Calendar.DAY_OF_MONTH, +1);
return cal.getTime();
}
} }

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/beans/GridMemberDataAnalysisExcelExportBean.java

@ -47,8 +47,8 @@ public class GridMemberDataAnalysisExcelExportBean {
@ExcelProperty(value = {"巡查次数"}) @ExcelProperty(value = {"巡查次数"})
private int patrolTimes; private int patrolTimes;
@ExcelProperty(value = {"巡查时长(小时)"}) @ExcelProperty(value = {"巡查时长"})
private double totalTime; private String totalTime;
@ExcelProperty(value = {"例行工作次数"}) @ExcelProperty(value = {"例行工作次数"})
private int patrolRoutineWorkTimes; private int patrolRoutineWorkTimes;

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -5,6 +5,7 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.EpmetException;
@ -15,7 +16,6 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil; 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.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.beans.GridMemberDataAnalysisExcelExportBean; import com.epmet.dataaggre.beans.GridMemberDataAnalysisExcelExportBean;
@ -30,7 +30,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -41,7 +40,6 @@ import java.net.URLEncoder;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
@ -302,11 +300,11 @@ public class GovOrgController {
PageData<GridMemberDataAnalysisResultDTO> page; PageData<GridMemberDataAnalysisResultDTO> page;
int pageNo = 0; int pageNo = NumConstant.ONE;
int pageSize = 1000; int pageSize = NumConstant.ONE_THOUSAND;
do { do {
page = aggreGridService.getGridMemberDataAnalysis4PcWork(orgId, orgType, pageNo, pageSize, startTime, endTime, false); page = aggreGridService.getGridMemberDataAnalysis4PcWork(orgId, orgType, pageNo++, pageSize, startTime, endTime, false);
List<GridMemberDataAnalysisResultDTO> pageList = page.getList(); List<GridMemberDataAnalysisResultDTO> pageList = page.getList();
List<GridMemberDataAnalysisExcelExportBean> exportBeans = ConvertUtils.sourceToTarget(pageList, GridMemberDataAnalysisExcelExportBean.class); List<GridMemberDataAnalysisExcelExportBean> exportBeans = ConvertUtils.sourceToTarget(pageList, GridMemberDataAnalysisExcelExportBean.class);

1
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -2172,6 +2172,7 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve
// throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "【pcwork查询网格员数据统计列表】传入时间条件有误"); // throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "【pcwork查询网格员数据统计列表】传入时间条件有误");
//} //}
PageHelper.startPage(pageNo, pageSize, needCount);
return factGridMemberStatisticsDailyDao.listGridMemberDataStatsIncr(pids, gridId, startDateID, endDateID); return factGridMemberStatisticsDailyDao.listGridMemberDataStatsIncr(pids, gridId, startDateID, endDateID);
} }
} }

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -342,7 +342,7 @@ public class EpmetUserServiceImpl implements EpmetUserService {
re.setTotalTime(totalTime == "" ? "0分钟" : totalTime); re.setTotalTime(totalTime == "" ? "0分钟" : totalTime);
//re.setTotalTime(re.getTimeNum() < 1 ? BigDecimal.ZERO + "h" : new BigDecimal(numberFormat.format((float) re.getTimeNum() / (float) 3600)) + "h"); //re.setTotalTime(re.getTimeNum() < 1 ? BigDecimal.ZERO + "h" : new BigDecimal(numberFormat.format((float) re.getTimeNum() / (float) 3600)) + "h");
//re.setTotalTime(re.getTimeNum() / 60 + "分钟"); //re.setTotalTime(re.getTimeNum() / 60 + "分钟");
list.stream().filter(l -> re.getGridId().equals(l.getId())).forEach(s -> re.setGridName(s.getGridName())); //list.stream().filter(l -> re.getGridId().equals(l.getId())).forEach(s -> re.setGridName(s.getGridName()));
}); });
return resultList; return resultList;

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -20,7 +20,6 @@ import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO;
import com.epmet.dataaggre.dto.govorg.result.*; import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import com.epmet.dataaggre.entity.govorg.CustomerGridEntity;
import com.epmet.dataaggre.service.commonservice.AreaCodeService; import com.epmet.dataaggre.service.commonservice.AreaCodeService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.govorg.GovOrgService;
@ -151,13 +150,14 @@ public class GovOrgServiceImpl implements GovOrgService {
List<NextAreaCodeResultDTO> allList = areaCodeService.queryNextLevelAreaCodeList(formDTO); List<NextAreaCodeResultDTO> allList = areaCodeService.queryNextLevelAreaCodeList(formDTO);
if (CollectionUtils.isNotEmpty(allList)) { if (CollectionUtils.isNotEmpty(allList)) {
//内部客户: 已经被使用过的areaCode //内部客户: 已经被使用过的areaCode
List<String> usedAreaCodeList1 = customerAgencyDao.selectUsedAreaCodeList(formDTO.getAreaCode()); // 组织编辑可以修改区域编码,所以不排除了,注释掉
// List<String> usedAreaCodeList1 = customerAgencyDao.selectUsedAreaCodeList(formDTO.getAreaCode());
//外部子客户: //外部子客户:
List<String> usedAreaCodeList2 = customerRelation.selectUsedAreaCodeList(formDTO.getAreaCode()); List<String> usedAreaCodeList2 = customerRelation.selectUsedAreaCodeList(formDTO.getAreaCode());
List<String> list=new ArrayList<>(); List<String> list=new ArrayList<>();
if(CollectionUtils.isNotEmpty(usedAreaCodeList1)){ /*if(CollectionUtils.isNotEmpty(usedAreaCodeList1)){
list.addAll(usedAreaCodeList1); list.addAll(usedAreaCodeList1);
} }*/
if(CollectionUtils.isNotEmpty(usedAreaCodeList2)){ if(CollectionUtils.isNotEmpty(usedAreaCodeList2)){
list.addAll(usedAreaCodeList2); list.addAll(usedAreaCodeList2);
} }

7
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/AggreGridServiceImpl.java

@ -19,11 +19,14 @@ import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService;
import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import sun.rmi.runtime.Log;
import java.util.*; import java.util.*;
@Slf4j
@Service @Service
public class AggreGridServiceImpl implements AggreGridService { public class AggreGridServiceImpl implements AggreGridService {
@ -101,6 +104,10 @@ public class AggreGridServiceImpl implements AggreGridService {
for (GridMemberDataAnalysisResultDTO data : datas) { for (GridMemberDataAnalysisResultDTO data : datas) {
// 填充gridName // 填充gridName
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(data.getGridId()); GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(data.getGridId());
if (gridInfo == null) {
log.warn("未找到网格信息:{}", data.getGridId());
continue;
}
Optional.ofNullable(gridInfo).ifPresent((d) -> data.setOrgName(d.getGridName())); Optional.ofNullable(gridInfo).ifPresent((d) -> data.setOrgName(d.getGridName()));
// 生成结构化map // 生成结构化map

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java

@ -42,6 +42,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import sun.jvm.hotspot.memory.ContiguousSpace;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
@ -397,6 +398,10 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
l.setGridName(agencyInfo.getOrganizationName()); l.setGridName(agencyInfo.getOrganizationName());
}else { }else {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getOrgId()); GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getOrgId());
if (gridInfo == null) {
log.warn("未找到网格信息:{}", l.getOrgId());
return;
}
l.setGridName(gridInfo.getGridNamePath()); l.setGridName(gridInfo.getGridNamePath());
} }
}); });

4
epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml

@ -9,10 +9,10 @@ services:
volumes: volumes:
- "/opt/epmet-cloud-logs/prod:/logs" - "/opt/epmet-cloud-logs/prod:/logs"
environment: environment:
RUN_INSTRUCT: "java -Xms256m -Xmx1524m -jar ./data-stats.jar" RUN_INSTRUCT: "java -Xms256m -Xmx3000m -jar ./data-stats.jar"
restart: "unless-stopped" restart: "unless-stopped"
deploy: deploy:
resources: resources:
limits: limits:
cpus: '0.1' cpus: '0.1'
memory: 1600M memory: 3200M

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -997,11 +997,6 @@ public class DemoController {
@Autowired @Autowired
private ScreenGrassrootsGovernDataAbsorptionService ndddYhjfService; private ScreenGrassrootsGovernDataAbsorptionService ndddYhjfService;
@PostMapping("diffOld")
public Result diff(@RequestBody ScreenCentralZoneDataFormDTO param){
ndddYhjfService.difficultyDataHub(param);
return new Result();
}
@PostMapping("testDiffNew") @PostMapping("testDiffNew")
public Result testDiff(@RequestBody ScreenCentralZoneDataFormDTO param){ public Result testDiff(@RequestBody ScreenCentralZoneDataFormDTO param){
return new Result().ok(ndddYhjfService.difficultyDataExtract(param)); return new Result().ok(ndddYhjfService.difficultyDataExtract(param));

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java

@ -26,10 +26,7 @@ import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO;
import com.epmet.dto.pingyin.result.*; import com.epmet.dto.pingyin.result.*;
import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.*;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -405,11 +402,11 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* *
* @param customerId * @param customerId
* @param dateId * @param dateId
* @return java.util.List<com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity> * @return java.util.List<com.epmet.entity.evaluationindex.extract.FactOriginProjectMainAndPeriodDTO>
* @author LiuJanJun * @author LiuJanJun
* @date 2021/4/12 1:35 下午 * @date 2021/4/12 1:35 下午
*/ */
List<FactOriginProjectMainDailyEntity> getProjectForDiff(@Param("customerId") String customerId, @Param("dateId") String dateId); List<FactOriginProjectMainAndPeriodDTO> getProjectForDiff(@Param("customerId") String customerId, @Param("offset") int offset, @Param("pageSize") int pageSize);
/** /**
* desc: 获取难点堵点项目数据耗时 * desc: 获取难点堵点项目数据耗时
@ -420,7 +417,7 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @author LiuJanJun * @author LiuJanJun
* @date 2021/4/12 1:35 下午 * @date 2021/4/12 1:35 下午
*/ */
List<FactOriginProjectOrgPeriodDailyEntity> getProjectPeriodForDiff(@Param("customerId") String customerId, @Param("dateId") String dateId); List<FactOriginProjectOrgPeriodDailyEntity> getProjectPeriodForDiff(@Param("customerId") String customerId, @Param("projectId") String projectId);
List<ScreenProjectDataDTO> selectResponseCount(@Param("customerId") String customerId); List<ScreenProjectDataDTO> selectResponseCount(@Param("customerId") String customerId);
@ -551,4 +548,5 @@ public interface FactOriginProjectMainDailyDao extends BaseDao<FactOriginProject
* @date 2021/7/5 14:49 * @date 2021/7/5 14:49
*/ */
List<OrgStatisticsResultDTO> getMemberProjectCount(@Param("customerId") String customerId, @Param("dateId") String dateId); List<OrgStatisticsResultDTO> getMemberProjectCount(@Param("customerId") String customerId, @Param("dateId") String dateId);
} }

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java

@ -19,7 +19,6 @@ package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.screencoll.form.DifficultyDataDetailFormDTO; import com.epmet.dto.screencoll.form.DifficultyDataDetailFormDTO;
import com.epmet.dto.screencoll.form.DifficultyDataFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -56,7 +55,7 @@ public interface ScreenDifficultyDataDao extends BaseDao<ScreenDifficultyDataEnt
**/ **/
void batchInsertDifficultyData(@Param("list") List<DifficultyDataDetailFormDTO> list, @Param("customerId")String customerId); void batchInsertDifficultyData(@Param("list") List<DifficultyDataDetailFormDTO> list, @Param("customerId")String customerId);
/** /**
* @Description 根据customerId查询是否有难点赌点的数据 * @Description 根据customerId查询是否有难点赌点的数据
* @param customerId * @param customerId
@ -92,12 +91,4 @@ public interface ScreenDifficultyDataDao extends BaseDao<ScreenDifficultyDataEnt
int insertBatchImg(@Param("list") List<ScreenDifficultyImgDataEntity> list); int insertBatchImg(@Param("list") List<ScreenDifficultyImgDataEntity> list);
/**
* @Description 根据客户Id查出全部的难点赌点的项目Id和网格Id因为需要比对全部的信息然后删除因为删除网格而导致的垃圾数据
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity>
* @author wangc
* @date 2020.11.17 09:33
*/
List<ScreenDifficultyDataEntity> selectAllDifficultyByCustomerId(@Param("customerId")String customerId);
} }

156
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainAndPeriodDTO.java

@ -0,0 +1,156 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity.evaluationindex.extract;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import java.util.List;
/**
* 项目主表_日统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-16
*/
@Data
public class FactOriginProjectMainAndPeriodDTO extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 项目的发布日期yyyyMMdd
*/
private String dateId;
/**
* 周ID
*/
private String weekId;
/**
* 月份ID
*/
private String monthId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年度ID
*/
private String yearId;
/**
* 客户ID
*/
private String customerId;
/**
* 转议题用户ID
*/
private String issueCreatorId;
/**
* 转为项目的议题ID
*/
private String issueId;
/**
* 转为议题的话题ID
*/
private String topicId;
/**
* 网格ID
*/
private String gridId;
/**
* 上级ID
*/
private String pid;
/**
* 所有上级Id集合 (项目来源)
* */
private String pids;
/**
* 组织ID网格所属组织ID
*/
private String agencyId;
/**
* 来源议题issue
*/
private String origin;
/**
* 来源ID
*/
private String originId;
/**
* 状态
*/
private String projectStatus;
/**
* resolved unresolved
* */
private String isResolved;
/**
* 创建话题用户的ID
*/
private String topicCreatorId;
/**
* 是否是党员 1:
*/
private String isParty;
/**
* 是否超期 1:
*/
private String isOverdue;
/**
* 是否满意 1:
*/
private Integer isSatisfied;
/**
* 办结组织Ids:隔开有可能是社区id可能是网格id无需区分级别在统计时模糊查询
*/
private String finishOrgIds;
/**
* 项目创建人议题转项目或立项人
*/
private String projectCreator;
/**
* 项目处理时间节点
*/
private List<FactOriginProjectOrgPeriodDailyEntity> periodList;
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java

@ -27,10 +27,7 @@ import com.epmet.dto.pingyin.result.*;
import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.*;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import java.util.List; import java.util.List;
@ -377,11 +374,13 @@ public interface FactOriginProjectMainDailyService extends BaseService<FactOrigi
* desc: 条件获取项目数据 * desc: 条件获取项目数据
* *
* @param param * @param param
* @param offset
* @param pageSize
* @return java.util.List<com.epmet.dto.extract.FactOriginProjectMainDailyEntity> * @return java.util.List<com.epmet.dto.extract.FactOriginProjectMainDailyEntity>
* @author LiuJanJun * @author LiuJanJun
* @date 2021/4/12 11:07 上午 * @date 2021/4/12 11:07 上午
*/ */
List<FactOriginProjectMainDailyEntity> getProjectForDiff(ScreenCentralZoneDataFormDTO param); List<FactOriginProjectMainAndPeriodDTO> getProjectAndPeriodForDiff(ScreenCentralZoneDataFormDTO param, int offset, int pageSize);
/** /**
* desc: 根据项目数据 获取相关连的项目耗时 * desc: 根据项目数据 获取相关连的项目耗时

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java

@ -36,10 +36,7 @@ import com.epmet.dto.result.CostDayResultDTO;
import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.*;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO;
import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService;
@ -527,8 +524,8 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
} }
@Override @Override
public List<FactOriginProjectMainDailyEntity> getProjectForDiff(ScreenCentralZoneDataFormDTO param) { public List<FactOriginProjectMainAndPeriodDTO> getProjectAndPeriodForDiff(ScreenCentralZoneDataFormDTO param, int offset, int pageSize) {
return baseDao.getProjectForDiff(param.getCustomerId(),param.getDateId()); return baseDao.getProjectForDiff(param.getCustomerId(),offset,pageSize);
} }
@Override @Override

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenGrassrootsGovernDataAbsorptionService.java

@ -18,15 +18,6 @@ public interface ScreenGrassrootsGovernDataAbsorptionService {
**/ **/
void userScoreDataHub(ScreenCentralZoneDataFormDTO param); void userScoreDataHub(ScreenCentralZoneDataFormDTO param);
/**
* @Description 难点赌点数据中转站
* @param param
* @return
* @author wangc
* @date 2020.09.25 10:00
**/
void difficultyDataHub(ScreenCentralZoneDataFormDTO param);
/** /**
* desc: 新的难点堵点抽取 * desc: 新的难点堵点抽取
* *

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

@ -8,12 +8,10 @@ import com.epmet.constant.ProjectConstant;
import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.ProjectDTO; import com.epmet.dto.ProjectDTO;
import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.project.result.ProjectLatestOperationResultDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.dto.topic.TopicAttachmentDTO; import com.epmet.dto.topic.TopicAttachmentDTO;
import com.epmet.dto.topic.result.ResiTopicAndImgResultDTO; import com.epmet.dto.topic.result.ResiTopicAndImgResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainAndPeriodDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
@ -126,7 +124,12 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
if (null != gridInfo) { if (null != gridInfo) {
user.setGridName(gridInfo.getGridName()); user.setGridName(gridInfo.getGridName());
user.setOrgId(gridInfo.getAgencyId()); user.setOrgId(gridInfo.getAgencyId());
user.setOrgName(gridInfo.getOrgName()); if(StringUtils.isNotBlank(gridInfo.getOrgName())){
user.setOrgName(gridInfo.getOrgName());
}else{
GridInfoDTO gridInfoDTO = customerGridService.queryGridInfoDTO(user.getGridId());
user.setOrgName(gridInfoDTO.getOrgName());
}
//原始数据Pid使用英文:隔开,大屏数据要求按照英文,隔开 //原始数据Pid使用英文:隔开,大屏数据要求按照英文,隔开
user.setAllParentIds(gridInfo.getPids().replaceAll(StrConstant.COLON, StrConstant.COMMA)); user.setAllParentIds(gridInfo.getPids().replaceAll(StrConstant.COLON, StrConstant.COMMA));
}else{ }else{
@ -150,101 +153,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
screenPartyUserRankDataService.dataClean(registeredUsers, param.getCustomerId()); screenPartyUserRankDataService.dataClean(registeredUsers, param.getCustomerId());
} }
/**
* @param param
* @return
* @Description 难点赌点数据中转站
* @author wangc
* @date 2020.09.25 10:00
**/
@Override
public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) {
//查询数据
List<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(), projectService.getOvertimeProjectByParameter(param.getCustomerId()));
if (CollectionUtils.isEmpty(difficulties)) {
return;
}
//2.查询出客户下网格的相关信息
List<GridInfoDTO> gridList = customerGridService.queryGridInfoList(param.getCustomerId());
Map<String, GridInfoDTO> gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO::getGridId, a -> a, (o, n) -> o));
//剔除垃圾数据(本次需要更新的数据集)
//for(Iterator<ScreenDifficultyDataEntity> iter = difficulties.iterator(); iter.hasNext();){
// ScreenDifficultyDataEntity pointer = iter.next();
// if(null == gridMap.get(pointer.getOrgId())){
// iter.remove();
// }
//}
difficulties.removeIf(diff -> null == gridMap.get(diff.getOrgId()));
List<String> projectIds = difficulties.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList());
//最近一次操作
Map<String, ProjectLatestOperationResultDTO> latestOperationMap = projectProcessService.getLatestOperation(projectIds, param.getCustomerId());
//图片
List<ProjectSourceMapFormDTO> projectSourceMap = difficulties.stream().map(diff -> {
ProjectSourceMapFormDTO map = new ProjectSourceMapFormDTO();
map.setProjectId(diff.getEventId());
map.setSourceId(diff.getEventImgUrl());
return map;
}).collect(Collectors.toList());
//factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds);
Map<String, List<ScreenDifficultyImgDataEntity>> imgMap = topicService.getTopicImgs(projectSourceMap);
Map<String, String> contentMap = topicService.getTopicContent(projectSourceMap);
difficulties.forEach(diff -> {
List<ScreenDifficultyImgDataEntity> figureList = CollectionUtils.isEmpty(imgMap) ? null : imgMap.get(diff.getEventId());
diff.setEventImgUrl(CollectionUtils.isEmpty(figureList) ? "" : figureList.get(NumConstant.ZERO).getEventImgUrl());
if (!CollectionUtils.isEmpty(contentMap)) {
diff.setEventContent(contentMap.get(diff.getEventId()));
}
if (!CollectionUtils.isEmpty(latestOperationMap)) {
ProjectLatestOperationResultDTO oper = latestOperationMap.get(diff.getEventId());
if (null != oper) {
diff.setLatestOperateDesc(oper.getOperationName());
diff.setEventTitle(oper.getTitle());
diff.setEventCostTime(oper.getCostTime());
}
}
diff.setDataEndTime(DateUtils.getBeforeNDay(NumConstant.ONE));
});
List<ScreenDifficultyImgDataEntity> imgList = new LinkedList<>();
imgMap.values().forEach(imgList::addAll);
//立案后会有 一个process 如果没有则说明是垃圾数据 如果有其他方式立项的项目则需要考虑下兼容
difficulties.removeIf(diff -> StringUtils.isBlank(diff.getLatestOperateDesc()));
screenDifficultyDataService.dataClean(param.getCustomerId(), difficulties, imgList);
log.info("【大屏数据抽取-难点赌点执行完毕】 客户Id{} 难点赌点数据{}", param.getCustomerId(), JSON.toJSONString(difficulties));
difficulties.removeIf( diff -> StringUtils.isBlank(diff.getLatestOperateDesc()));
imgList.forEach(item -> {
item.setCustomerId(param.getCustomerId());
});
screenDifficultyDataService.dataClean(param.getCustomerId(),difficulties,imgList);
log.info("【大屏数据抽取-难点赌点执行完毕】 客户Id{} 难点赌点数据{}",param.getCustomerId(),JSON.toJSONString(difficulties));
}
@Override @Override
public boolean difficultyDataExtract(ScreenCentralZoneDataFormDTO param) { public boolean difficultyDataExtract(ScreenCentralZoneDataFormDTO param) {
//1.根据客户Id 获取所有项目数据
List<FactOriginProjectMainDailyEntity> difficultyBaseList = factOriginProjectMainDailyService.getProjectForDiff(param);
if (CollectionUtils.isEmpty(difficultyBaseList)) {
log.warn("difficultyDataExtract customerId:{} have any project", param.getCustomerId());
return false;
}
//获取业务库项目标题
List<ProjectDTO> bizProjectInfoList = projectService.getProjectInfo(param.getCustomerId(), null, null);
if (CollectionUtils.isEmpty(bizProjectInfoList)) {
log.warn("difficultyDataExtract customerId:{} have any project", param.getCustomerId());
return false;
}
Map<String, ProjectDTO> bizProjectInfoMap = bizProjectInfoList.stream().collect(Collectors.toMap(ProjectDTO::getId, o -> o, (o1, o2) -> o1));
//获取agency维度 //获取agency维度
List<DimAgencyEntity> agencyList = dimAgencyService.getAgencyListByCustomerId(param.getCustomerId()); List<DimAgencyEntity> agencyList = dimAgencyService.getAgencyListByCustomerId(param.getCustomerId());
Map<String, DimAgencyEntity> agencyMap = agencyList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o, (o1, o2) -> o1)); Map<String, DimAgencyEntity> agencyMap = agencyList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o, (o1, o2) -> o1));
@ -261,74 +171,97 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
Map<String, Set<String>> projectCategoryMap = projectCategoryData.stream() Map<String, Set<String>> projectCategoryMap = projectCategoryData.stream()
.collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId, Collectors.mapping(ProjectCategoryDTO::getCategoryCode, Collectors.toSet()))); .collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId, Collectors.mapping(ProjectCategoryDTO::getCategoryCode, Collectors.toSet())));
//2.获取项目的所有节点耗时数据 //获取业务库项目标题
List<FactOriginProjectOrgPeriodDailyEntity> projectPeriodList = factOriginProjectMainDailyService.getProjectPeriod(param); List<ProjectDTO> bizProjectInfoList = projectService.getProjectInfo(param.getCustomerId(), null, null);
//处理部门数去重(只要流转到就算) if (CollectionUtils.isEmpty(bizProjectInfoList)) {
Map<String, Set<String>> orgCountMap = new HashMap<>(); log.warn("difficultyDataExtract customerId:{} have any project", param.getCustomerId());
//被处理次数 return false;
Map<String, Integer> handleCountMap = new HashMap<>(); }
Set<String> valideProjectIdSet = fillAnyCountAndValidProject(param, projectPeriodList, orgCountMap, handleCountMap); Map<String, ProjectDTO> bizProjectInfoMap = bizProjectInfoList.stream().collect(Collectors.toMap(ProjectDTO::getId, o -> o, (o1, o2) -> o1));
List<ScreenDifficultyDataEntity> diffList = new ArrayList<>(); int pageNo = NumConstant.ONE;
List<ScreenDifficultyImgDataEntity> imgDataEntities = new ArrayList<>(); int pageSize = NumConstant.FIVE_HUNDRED;
for (FactOriginProjectMainDailyEntity project : difficultyBaseList) { List<FactOriginProjectMainAndPeriodDTO> difficultyBaseList;
if (agencyMap.get(project.getAgencyId()) == null || bizProjectInfoMap.get(project.getId()) == null) { do {
log.warn("未获取到相关的项目信息或者项目的所属组织信息,agencyId:{},projectId:{}",project.getAgencyId(),project.getId()); //1.根据客户Id 获取所有项目数据
continue; int offset = (pageNo++ - NumConstant.ONE) * pageSize;
} difficultyBaseList = factOriginProjectMainDailyService.getProjectAndPeriodForDiff(param, offset,pageSize);
//判断是否符合难点堵点条件 if (CollectionUtils.isEmpty(difficultyBaseList)) {
if (!valideProjectIdSet.contains(project.getId())) { log.warn("difficultyDataExtract customerId:{} have any project", param.getCustomerId());
continue; return false;
}
ScreenDifficultyDataEntity diffEntity = buildBaseDiffEntity(project, agencyMap, gridMap, bizProjectInfoMap);
Set<String> regCount = orgCountMap.get(project.getId());
if (regCount != null) {
diffEntity.setEventReOrg(regCount.size());
} else {
diffEntity.setEventReOrg(0);
}
Integer handleOrgCount = handleCountMap.get(project.getId());
if (handleOrgCount != null) {
diffEntity.setEventHandledCount(handleOrgCount);
} else {
diffEntity.setEventHandledCount(0);
} }
diffEntity.setDataEndTime(StringUtils.isBlank(param.getDateId())?DateUtils.getBeforeNDay(NumConstant.ONE):param.getDateId()); //2.获取项目的所有节点耗时数据
setCategoryInfo(diffEntity, project.getId(), categoryList, projectCategoryMap); List<FactOriginProjectOrgPeriodDailyEntity> projectPeriodList = difficultyBaseList.stream()
.filter(o->o.getPeriodList() != null)
.flatMap(o->o.getPeriodList().stream())
if (StringUtils.isNotBlank(project.getTopicId())) { .collect(Collectors.toList());
//获取图片及话题内容 //处理部门数去重(只要流转到就算)
ResiTopicAndImgResultDTO topicInfo = topicService.getTopicAndImgs(project.getTopicId(), "image"); Map<String, Set<String>> orgCountMap = new HashMap<>();
if (topicInfo != null) { //被处理次数
List<TopicAttachmentDTO> topicImgList = topicInfo.getTopicImgList(); Map<String, Integer> handleCountMap = new HashMap<>();
if (!CollectionUtils.isEmpty(topicImgList)){ Set<String> valideProjectIdSet = fillAnyCountAndValidProject(param, projectPeriodList, orgCountMap, handleCountMap);
diffEntity.setEventImgUrl(topicImgList.get(NumConstant.ZERO).getAttachmentUrl());
topicImgList.forEach(img -> { List<ScreenDifficultyDataEntity> diffList = new ArrayList<>();
ScreenDifficultyImgDataEntity imgData = new ScreenDifficultyImgDataEntity(); List<ScreenDifficultyImgDataEntity> imgDataEntities = new ArrayList<>();
imgData.setEventId(project.getId()); for (FactOriginProjectMainAndPeriodDTO project : difficultyBaseList) {
imgData.setEventImgUrl(img.getAttachmentUrl()); if (agencyMap.get(project.getAgencyId()) == null || bizProjectInfoMap.get(project.getId()) == null) {
imgData.setSort(img.getSort()); log.warn("未获取到相关的项目信息或者项目的所属组织信息,agencyId:{},projectId:{}",project.getAgencyId(),project.getId());
imgDataEntities.add(imgData); continue;
imgData.setCustomerId(param.getCustomerId()); }
}); //判断是否符合难点堵点条件
if (!valideProjectIdSet.contains(project.getId())) {
continue;
}
ScreenDifficultyDataEntity diffEntity = buildBaseDiffEntity(project, agencyMap, gridMap, bizProjectInfoMap);
Set<String> regCount = orgCountMap.get(project.getId());
if (regCount != null) {
diffEntity.setEventReOrg(regCount.size());
} else {
diffEntity.setEventReOrg(0);
}
Integer handleOrgCount = handleCountMap.get(project.getId());
if (handleOrgCount != null) {
diffEntity.setEventHandledCount(handleOrgCount);
} else {
diffEntity.setEventHandledCount(0);
}
diffEntity.setDataEndTime(StringUtils.isBlank(param.getDateId())?DateUtils.getBeforeNDay(NumConstant.ONE):param.getDateId());
setCategoryInfo(diffEntity, project.getId(), categoryList, projectCategoryMap);
if (StringUtils.isNotBlank(project.getTopicId())) {
//获取图片及话题内容
ResiTopicAndImgResultDTO topicInfo = topicService.getTopicAndImgs(project.getTopicId(), "image");
if (topicInfo != null) {
List<TopicAttachmentDTO> topicImgList = topicInfo.getTopicImgList();
if (!CollectionUtils.isEmpty(topicImgList)){
diffEntity.setEventImgUrl(topicImgList.get(NumConstant.ZERO).getAttachmentUrl());
topicImgList.forEach(img -> {
ScreenDifficultyImgDataEntity imgData = new ScreenDifficultyImgDataEntity();
imgData.setEventId(project.getId());
imgData.setEventImgUrl(img.getAttachmentUrl());
imgData.setSort(img.getSort());
imgDataEntities.add(imgData);
imgData.setCustomerId(param.getCustomerId());
});
}
diffEntity.setEventContent(topicInfo.getTopicContent());
log.info("projectId:{} imgs:{}", project.getId(), imgDataEntities.stream().filter(o -> o.getEventId().equals(project.getId())).count());
} }
diffEntity.setEventContent(topicInfo.getTopicContent());
log.info("projectId:{} imgs:{}", project.getId(), imgDataEntities.stream().filter(o -> o.getEventId().equals(project.getId())).count());
} }
diffList.add(diffEntity);
} }
diffList.add(diffEntity); log.info("========:" + JSON.toJSONString(diffList));
} log.info("========:" + JSON.toJSONString(imgDataEntities));
List<ScreenDifficultyDataEntity> collect = diffList.stream().filter(o -> o.getEventCostTime() < 5 * 24 * 60).collect(Collectors.toList());
log.info("========:" + JSON.toJSONString(collect)); screenDifficultyDataService.dataClean(param.getCustomerId(),diffList,imgDataEntities);
log.info("========:" + JSON.toJSONString(diffList)); } while (!CollectionUtils.isEmpty(difficultyBaseList)&&difficultyBaseList.size()==pageSize);
log.info("========:" + JSON.toJSONString(imgDataEntities));
screenDifficultyDataService.dataClean(param.getCustomerId(),diffList,imgDataEntities); //log.info("【大屏数据抽取-难点赌点执行完毕】 客户Id{} 难点赌点数据{}", param.getCustomerId(), JSON.toJSONString(diffList));
log.info("【大屏数据抽取-难点赌点执行完毕】 客户Id{} 难点赌点数据{}", param.getCustomerId(), JSON.toJSONString(diffList));
//3.获取项目的最后操作记录 //3.获取项目的最后操作记录
return true; return true;
} }
@ -417,7 +350,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
* @param bizProjectInfoMap * @param bizProjectInfoMap
* @return * @return
*/ */
private ScreenDifficultyDataEntity buildBaseDiffEntity(FactOriginProjectMainDailyEntity project, Map<String, DimAgencyEntity> agencyMap, private ScreenDifficultyDataEntity buildBaseDiffEntity(FactOriginProjectMainAndPeriodDTO project, Map<String, DimAgencyEntity> agencyMap,
Map<String, GridInfoDTO> gridMap, Map<String, ProjectDTO> bizProjectInfoMap) { Map<String, GridInfoDTO> gridMap, Map<String, ProjectDTO> bizProjectInfoMap) {
ProjectDTO projectDTO = bizProjectInfoMap.get(project.getId()); ProjectDTO projectDTO = bizProjectInfoMap.get(project.getId());
ScreenDifficultyDataEntity diff = new ScreenDifficultyDataEntity(); ScreenDifficultyDataEntity diff = new ScreenDifficultyDataEntity();

13
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java

@ -34,7 +34,7 @@ public interface ScreenDifficultyDataService extends BaseService<ScreenDifficult
/** /**
* @Description 查询数据库中是否有该客户下的难点赌点信息 * @Description 查询数据库中是否有该客户下的难点赌点信息
* @param customerId * @param customerId
* @return com.epmet.dto.screen.result.DifficultyIfExistedResultDTO * @return com.epmet.dto.screen.result.DifficultyIfExistedResultDTO
* @author wangc * @author wangc
* @date 2020.09.28 10:53 * @date 2020.09.28 10:53
*/ */
@ -50,13 +50,4 @@ public interface ScreenDifficultyDataService extends BaseService<ScreenDifficult
* @date 2020.09.28 11:04 * @date 2020.09.28 11:04
*/ */
void dataClean(String customerId,List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs); void dataClean(String customerId,List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs);
}
/**
* @Description 根据客户Id查出全部的难点赌点的项目Id和网格Id因为需要比对全部的信息然后删除因为删除网格而导致的垃圾数据
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity>
* @author wangc
* @date 2020.11.17 09:31
*/
List<ScreenDifficultyDataEntity> getAllDifficultyByCustomerId(String customerId);
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java

@ -21,7 +21,6 @@ package com.epmet.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenDifficultyDataDao; import com.epmet.dao.evaluationindex.screen.ScreenDifficultyDataDao;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
@ -56,30 +55,15 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl<ScreenDiffi
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void dataClean(String customerId, List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs) { public void dataClean(String customerId, List<ScreenDifficultyDataEntity> difficulties, List<ScreenDifficultyImgDataEntity> imgs) {
List<ScreenDifficultyDataEntity> orient = baseDao.selectAllDifficultyByCustomerId(customerId); List<String> projectId = difficulties.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList());
if(!CollectionUtils.isEmpty(orient)){ baseDao.deleteBatchDifficultyImg(projectId);
baseDao.deleteBatchDifficultyImg(orient.stream().map(ScreenDifficultyDataEntity::getEventId).distinct().collect(Collectors.toList())); baseDao.deleteBatchDifficulty(customerId,projectId);
}
baseDao.deleteBatchDifficulty(customerId,null);
if (!CollectionUtils.isEmpty(difficulties)) { if (!CollectionUtils.isEmpty(difficulties)) {
baseDao.insertBatch(difficulties); baseDao.insertBatch(difficulties);
} }
if (!CollectionUtils.isEmpty(imgs)) { if (!CollectionUtils.isEmpty(imgs)) {
baseDao.insertBatchImg(imgs); baseDao.insertBatchImg(imgs);
} }
//baseDao.updateTime(customerId, DateUtils.getBeforeNDay(NumConstant.ONE));
} }
/**
* @Description 根据客户Id查出全部的难点赌点的项目Id和网格Id因为需要比对全部的信息然后删除因为删除网格而导致的垃圾数据
* @param customerId
* @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity>
* @author wangc
* @date 2020.11.17 09:31
*/
@Override
public List<ScreenDifficultyDataEntity> getAllDifficultyByCustomerId(String customerId) {
return baseDao.selectAllDifficultyByCustomerId(customerId);
}
} }

69
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -3,32 +3,7 @@
<mapper namespace="com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao"> <mapper namespace="com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao">
<resultMap type="com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity" id="factOriginProjectMainDailyMap">
<result property="id" column="ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="weekId" column="WEEK_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="issueCreatorId" column="ISSUE_CREATOR_ID"/>
<result property="issueId" column="ISSUE_ID"/>
<result property="topicId" column="TOPIC_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="pid" column="PID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="projectStatus" column="PROJECT_STATUS"/>
<result property="topicCreatorId" column="TOPIC_CREATOR_ID"/>
<result property="isParty" column="IS_PARTY"/>
<result property="isOverdue" column="IS_OVERDUE"/>
<result property="finishOrgIds" column="FINISH_ORG_IDS"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="getProjectByCustomer" resultType="com.epmet.dto.extract.FactOriginProjectMainDailyDTO"> <select id="getProjectByCustomer" resultType="com.epmet.dto.extract.FactOriginProjectMainDailyDTO">
SELECT SELECT
ID, ID,
@ -663,23 +638,47 @@
</otherwise> </otherwise>
</choose> </choose>
</select> </select>
<resultMap type="com.epmet.entity.evaluationindex.extract.FactOriginProjectMainAndPeriodDTO" id="factOriginProjectMainPeriodMap">
<result property="id" column="ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="weekId" column="WEEK_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="issueCreatorId" column="ISSUE_CREATOR_ID"/>
<result property="issueId" column="ISSUE_ID"/>
<result property="topicId" column="TOPIC_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="pid" column="PID"/>
<result property="pids" column="PIDS"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="projectStatus" column="PROJECT_STATUS"/>
<result property="topicCreatorId" column="TOPIC_CREATOR_ID"/>
<result property="isParty" column="IS_PARTY"/>
<result property="isOverdue" column="IS_OVERDUE"/>
<result property="finishOrgIds" column="FINISH_ORG_IDS"/>
<collection property="periodList" ofType="com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity"
select="getProjectPeriodForDiff" column="id"/>
</resultMap>
<!--获取难点堵点项目数据--> <!--获取难点堵点项目数据-->
<select id="getProjectForDiff" resultType="com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity"> <select id="getProjectForDiff" resultMap = "factOriginProjectMainPeriodMap">
SELECT SELECT
id, date_id, customer_id, issue_id, topic_id, grid_id, pid, pids, agency_id, project_status, is_resolved, m.id, m.date_id dateId, m.customer_id, m.issue_id, m.topic_id, m.grid_id,
topic_creator_id, is_party, is_overdue, finish_org_ids m.pid, m.pids, m.agency_id, m.project_status, m.is_resolved,
FROM fact_origin_project_main_daily m.topic_creator_id, m.is_party, m.is_overdue, m.finish_org_ids
FROM fact_origin_project_main_daily m
WHERE WHERE
CUSTOMER_ID = #{customerId} m.CUSTOMER_ID = #{customerId}
<if test="dateId != null and dateId != ''"> AND m.DEL_FLAG = '0'
AND DATE_ID = #{dateId,jdbcType=VARCHAR} LIMIT #{offset} ,#{pageSize}
</if>
</select> </select>
<select id="getProjectPeriodForDiff" resultType="com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity"> <select id="getProjectPeriodForDiff" resultType="com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity">
SELECT SELECT
t.ID, t.CUSTOMER_ID, t.PROJECT_ID, t.ORG_ID, t.ORG_TYPE, t.PID,t. PIDS, t.INFORMED_DATE, t.HANDLED_DATE, t.TOTAL_PERIOD, t.PERIOD_TILL_REPLY_FIRSTLY, t.OPERATION, t.IS_RESOLVED t.ID, t.CUSTOMER_ID, t.PROJECT_ID, t.ORG_ID, t.ORG_TYPE, t.PID,t. PIDS, t.INFORMED_DATE, t.HANDLED_DATE, t.TOTAL_PERIOD, t.PERIOD_TILL_REPLY_FIRSTLY, t.OPERATION, t.IS_RESOLVED
FROM fact_origin_project_org_period_daily t FROM fact_origin_project_org_period_daily t
WHERE CUSTOMER_ID = #{customerId} WHERE PROJECT_ID = #{projectId}
</select> </select>
<!-- 组织查询项目总数 --> <!-- 组织查询项目总数 -->

10
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml

@ -221,14 +221,4 @@
</foreach> </foreach>
</insert> </insert>
<select id="selectAllDifficultyByCustomerId" resultType="com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity">
SELECT
org_id,
event_id
FROM
screen_difficulty_data
WHERE
del_flag = '0'
AND customer_id = #{customerId}
</select>
</mapper> </mapper>

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml

@ -110,8 +110,7 @@
LEFT JOIN customer_agency ca LEFT JOIN customer_agency ca
ON (cg.PID = CA.ID) ON (cg.PID = CA.ID)
WHERE WHERE
CG.CUSTOMER_ID =#{customerId} cg.id = #{gridId}
and cg.id = #{gridId}
</select> </select>
<select id="getCustomerStaffGridList" resultType="com.epmet.dto.org.CustomerStaffGridDTO"> <select id="getCustomerStaffGridList" resultType="com.epmet.dto.org.CustomerStaffGridDTO">

4
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java

@ -25,6 +25,8 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
@ -616,7 +618,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
//地区编码 同一级不允许重名 //地区编码 同一级不允许重名
List<AreaCodeChildDTO> list = childDao.selectByPCodeAndName(formDTO.getParentAreaCode().trim(), formDTO.getName().trim()); List<AreaCodeChildDTO> list = childDao.selectByPCodeAndName(formDTO.getParentAreaCode().trim(), formDTO.getName().trim());
if (CollUtil.isNotEmpty(list)) { if (CollUtil.isNotEmpty(list)) {
throw new RenException("name已存在"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "name已存在", "组织名称已存在");
} }
AreaCodeChildDTO areaCodeChildDTO = new AreaCodeChildDTO(); AreaCodeChildDTO areaCodeChildDTO = new AreaCodeChildDTO();
areaCodeChildDTO.setName(formDTO.getName().trim()); areaCodeChildDTO.setName(formDTO.getName().trim());

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java

@ -17,11 +17,13 @@
package com.epmet.dto.form; package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
@ -73,11 +75,13 @@ public class AddSocietyOrgFormDTO implements Serializable {
/** /**
* 起始服务时间 * 起始服务时间
*/ */
@NotNull(message = "起始服务时间不能为空", groups = { AddSocietyOrgFormDTO.Add.class })
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date serviceStartTime; private Date serviceStartTime;
/** /**
* 终止服务时间 * 终止服务时间
*/ */
@NotNull(message = "终止服务时间不能为空", groups = { AddSocietyOrgFormDTO.Add.class })
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date serviceEndTime; private Date serviceEndTime;
/** /**
@ -100,6 +104,6 @@ public class AddSocietyOrgFormDTO implements Serializable {
//token中userId //token中userId
private String staffId; private String staffId;
public interface Add {} public interface Add extends CustomerClientShowGroup {}
} }

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java

@ -54,5 +54,7 @@ public class GetListSocietyOrgFormDTO implements Serializable {
private String staffId; private String staffId;
//token中userId所属组织的pid //token中userId所属组织的pid
private String pids; private String pids;
//token中userId所属组织Id
private String agencyId;
} }

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java

@ -117,7 +117,9 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
public GetListSocietyOrgResultDTO getList(GetListSocietyOrgFormDTO formDTO) { public GetListSocietyOrgResultDTO getList(GetListSocietyOrgFormDTO formDTO) {
GetListSocietyOrgResultDTO resultDTO = new GetListSocietyOrgResultDTO(); GetListSocietyOrgResultDTO resultDTO = new GetListSocietyOrgResultDTO();
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setPids(staffInfoCache.getAgencyPIds()); //2022.1.7 应产品要求 当前组织只能看到自己组织添加的社会组织数据,不允许看其他下级的
//formDTO.setPids(staffInfoCache.getAgencyPIds());
formDTO.setAgencyId(staffInfoCache.getAgencyId());
//1.根据查询条件分页查询社会组织数据 //1.根据查询条件分页查询社会组织数据
PageInfo<SocietyOrgListResultDTO> result = PageInfo<SocietyOrgListResultDTO> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO)); PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO));

4
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -1069,7 +1069,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务未完成,不可评价", "服务未完成,不可评价"); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "服务未完成,不可评价", "服务未完成,不可评价");
} }
//用户输入的完成情况,走内容审核 //用户输入的完成情况,走内容审核
textScan(formDTO.getFinishDesc()); if(StringUtils.isNotBlank(formDTO.getFinishDesc())){
textScan(formDTO.getFinishDesc());
}
//当前操作用户是工作端用户还是居民端用户 //当前操作用户是工作端用户还是居民端用户
String userType = ""; String userType = "";
if (AppClientConstant.APP_GOV.equals(formDTO.getApp())) { if (AppClientConstant.APP_GOV.equals(formDTO.getApp())) {

5
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml

@ -24,8 +24,11 @@
<if test="customerId != null and customerId.trim() != ''"> <if test="customerId != null and customerId.trim() != ''">
AND customer_id = #{customerId} AND customer_id = #{customerId}
</if> </if>
<if test="pids != null and pids.trim() != ''"> <!-- <if test="pids != null and pids.trim() != ''">
AND pids LIKE CONCAT('%', #{pids}, '%') AND pids LIKE CONCAT('%', #{pids}, '%')
</if>-->
<if test="agencyId != null and agencyId.trim() != ''">
AND agency_id = #{agencyId}
</if> </if>
<if test="societyName != null and societyName.trim() != ''"> <if test="societyName != null and societyName.trim() != ''">
AND society_name LIKE CONCAT('%', #{societyName}, '%') AND society_name LIKE CONCAT('%', #{societyName}, '%')

2
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java

@ -196,7 +196,7 @@ public interface UserMessageTypeConstant {
* 事件回复立项办结操作 * 事件回复立项办结操作
* rsi_event.id * rsi_event.id
*/ */
String EVENT ="event "; String EVENT ="event";
/** /**
* 需求接单指派确认服务时间操作 * 需求接单指派确认服务时间操作

4
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BlockChainCreateProjectFormDTO.java

@ -4,14 +4,16 @@ import lombok.Data;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List; import java.util.List;
/** /**
* 区块链创建项目form dto * 区块链创建项目form dto
*/ */
@Data @Data
public class BlockChainCreateProjectFormDTO { public class BlockChainCreateProjectFormDTO implements Serializable {
private static final long serialVersionUID = 2061989652173136068L;
@NotNull(message = "项目信息不能为空") @NotNull(message = "项目信息不能为空")
private BlockChainProjectFormDTO project; private BlockChainProjectFormDTO project;

4
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BlockChainProcessProjectFormDTO.java

@ -3,14 +3,16 @@ package com.epmet.dto.form;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List; import java.util.List;
/** /**
* 区块链项目处理进展信息 * 区块链项目处理进展信息
*/ */
@Data @Data
public class BlockChainProcessProjectFormDTO { public class BlockChainProcessProjectFormDTO implements Serializable {
private static final long serialVersionUID = -7316616101790749793L;
@NotNull(message = "处理进展信息不能为空") @NotNull(message = "处理进展信息不能为空")
private BlockChainProjectProcessFormDTO process; private BlockChainProjectProcessFormDTO process;

11
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdOpenFeignClient.java

@ -11,8 +11,13 @@ import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import feign.codec.Encoder; import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder; import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -72,9 +77,13 @@ public interface EpmetThirdOpenFeignClient {
Result blockChainProcessProject(@RequestBody BlockChainProcessProjectFormDTO input); Result blockChainProcessProject(@RequestBody BlockChainProcessProjectFormDTO input);
class MultipartSupportConfig { class MultipartSupportConfig {
@Autowired
private ObjectFactory<HttpMessageConverters> messageConverters;
@Bean @Bean
public Encoder feignFormEncoder() { public Encoder feignFormEncoder() {
return new SpringFormEncoder(); return new SpringFormEncoder(new SpringEncoder(messageConverters));
} }
} }

21
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java

@ -2,10 +2,7 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.AuthorizerAccessTokenFormDTO; import com.epmet.dto.form.*;
import com.epmet.dto.form.ComponentAccessTokenFormDTO;
import com.epmet.dto.form.SaveOrUpdateCustSelPlatformFormDTO;
import com.epmet.dto.form.ThirdPlatformFormDTO;
import com.epmet.dto.result.ThirdplatformResultDTO; import com.epmet.dto.result.ThirdplatformResultDTO;
import com.epmet.feign.fallback.ThirdOpenFeignClientFallback; import com.epmet.feign.fallback.ThirdOpenFeignClientFallback;
import com.epmet.feign.fallback.ThirdOpenFeignClientFallbackFactory; import com.epmet.feign.fallback.ThirdOpenFeignClientFallbackFactory;
@ -57,4 +54,20 @@ public interface ThirdOpenFeignClient {
*/ */
@PostMapping("/third/private-epmet/push-authorizer-tokens") @PostMapping("/third/private-epmet/push-authorizer-tokens")
Result pushAuthorizerTokens(@RequestBody AuthorizerAccessTokenFormDTO input); Result pushAuthorizerTokens(@RequestBody AuthorizerAccessTokenFormDTO input);
/**
* 区块链立项
* @param input
* @return
*/
@PostMapping("/third/blockchain/project/create")
Result blockChainCreateProject(@RequestBody BlockChainCreateProjectFormDTO input);
/**
* 区块链处理进展
* @param input
* @return
*/
@PostMapping("/third/blockchain/project/process")
Result blockChainProcessProject(@RequestBody BlockChainProcessProjectFormDTO input);
} }

15
epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java

@ -3,10 +3,7 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.AuthorizerAccessTokenFormDTO; import com.epmet.dto.form.*;
import com.epmet.dto.form.ComponentAccessTokenFormDTO;
import com.epmet.dto.form.SaveOrUpdateCustSelPlatformFormDTO;
import com.epmet.dto.form.ThirdPlatformFormDTO;
import com.epmet.dto.result.ThirdplatformResultDTO; import com.epmet.dto.result.ThirdplatformResultDTO;
import com.epmet.feign.ThirdOpenFeignClient; import com.epmet.feign.ThirdOpenFeignClient;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -34,4 +31,14 @@ public class ThirdOpenFeignClientFallback implements ThirdOpenFeignClient {
public Result pushAuthorizerTokens(AuthorizerAccessTokenFormDTO input) { public Result pushAuthorizerTokens(AuthorizerAccessTokenFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "pushAuthorizerTokens", input); return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "pushAuthorizerTokens", input);
} }
@Override
public Result blockChainCreateProject(BlockChainCreateProjectFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "blockChainCreateProject", input);
}
@Override
public Result blockChainProcessProject(BlockChainProcessProjectFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "blockChainProcessProject", input);
}
} }

17
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java

@ -72,4 +72,21 @@ public class EditAgencyFormDTO implements Serializable {
*/ */
private String mobile; private String mobile;
/**
* open: 选择地区编码必填closed: 无需选择地区编码;0409新增返参
*/
@NotBlank(message = "areaCodeSwitch不能为空", groups = AddUserInternalGroup.class)
private String areaCodeSwitch;
/**
* 组织区划代码
*/
private String areaCode;
/**
* 父级组织编码
*/
private String parentAreaCode;
@NotBlank(message = "组织级别不能为空;社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province", groups = AddAgencyV2FormDTO.AddUserInternalGroup.class)
private String level;
} }

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java

@ -58,5 +58,6 @@ public class AgencyListResultDTO implements Serializable {
* 联系电话 * 联系电话
*/ */
private String mobile = ""; private String mobile = "";
private String areaCode;
private String parentAreaCode;
} }

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java

@ -47,6 +47,11 @@ public class AllMattersResultDTO implements Serializable {
@JsonIgnore @JsonIgnore
private String endTime; private String endTime;
/**
* 预约类型每天everyDay工作日workDay周末weekend
*/
private String appointmentType;
public AllMattersResultDTO() { public AllMattersResultDTO() {
this.matterName = ""; this.matterName = "";
this.allowTime = ""; this.allowTime = "";
@ -55,5 +60,6 @@ public class AllMattersResultDTO implements Serializable {
this.address = ""; this.address = "";
this.workPhone = ""; this.workPhone = "";
this.centerName = ""; this.centerName = "";
this.appointmentType="";
} }
} }

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AppointmentTimeResultDTO.java

@ -27,8 +27,11 @@ public class AppointmentTimeResultDTO implements Serializable {
*/ */
private List<TimeDTO> timeDetail; private List<TimeDTO> timeDetail;
private List<String> dateList;
public AppointmentTimeResultDTO() { public AppointmentTimeResultDTO() {
this.appointmentType = ""; this.appointmentType = "";
this.timeDetail = new ArrayList<>(); this.timeDetail = new ArrayList<>();
this.dateList = new ArrayList<>();
} }
} }

1
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java

@ -58,4 +58,5 @@ public class DepartmentListResultDTO implements Serializable {
* 联系电话 * 联系电话
*/ */
private String mobile = ""; private String mobile = "";
private String areaCode;
} }

1
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java

@ -49,4 +49,5 @@ public class GridBaseInfoResultDTO implements Serializable {
* 联系电话 * 联系电话
*/ */
private String mobile = ""; private String mobile = "";
private String areaCode;
} }

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java

@ -13,4 +13,8 @@ public interface PartyServiceCenterConstant {
String APPOINTMENT_STATUS_APPOINTING = "appointing"; String APPOINTMENT_STATUS_APPOINTING = "appointing";
String APPOINTMENT_STATUS_CANCEL = "cancel"; String APPOINTMENT_STATUS_CANCEL = "cancel";
String APPOINTMENT_TYPE_EVERY_DAY = "everyDay";
String APPOINTMENT_TYPE_WORK_DAY = "workDay";
String APPOINTMENT_TYPE_WEEKEND = "weekend";
} }

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -304,5 +304,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
* @author sun * @author sun
**/ **/
OrgMobileResultDTO getAgencyMobile(@Param("gridId") String gridId); OrgMobileResultDTO getAgencyMobile(@Param("gridId") String gridId);
int updateSubAgencyAreaCodeById(@Param("customerId")String customerId, @Param("agencyId")String agencyId, @Param("operateUserId") String operateUserId);
} }

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java

@ -101,4 +101,8 @@ public interface CustomerDepartmentDao extends BaseDao<CustomerDepartmentEntity>
* @Date 2020/12/15 10:05 * @Date 2020/12/15 10:05
**/ **/
int delDeptById(@Param("deptId")String deptId,@Param("operateUserId") String operateUserId); int delDeptById(@Param("deptId")String deptId,@Param("operateUserId") String operateUserId);
int updateSubDeptAreaCode(@Param("customerId") String customerId,
@Param("areaCode")String areaCode,
@Param("operateUserId") String operateUserId);
} }

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -351,4 +351,9 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @Description 网格组织信息 * @Description 网格组织信息
**/ **/
CustomerGridDTO gridAgencyByGrid(@Param("gridId") String gridId); CustomerGridDTO gridAgencyByGrid(@Param("gridId") String gridId);
int updateSubGridAreaCode(@Param("customerId") String customerId,
@Param("agencyId")String agencyId,
@Param("operateUserId") String operateUserId);
} }

195
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java

@ -19,10 +19,12 @@ package com.epmet.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
@ -33,6 +35,7 @@ import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.OrgInfoConstant; import com.epmet.constant.OrgInfoConstant;
import com.epmet.constant.RoleKeyConstants; import com.epmet.constant.RoleKeyConstants;
import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dao.CustomerDepartmentDao;
import com.epmet.dao.CustomerGridDao; import com.epmet.dao.CustomerGridDao;
import com.epmet.dao.IcBuildingDao; import com.epmet.dao.IcBuildingDao;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerAgencyDTO;
@ -40,6 +43,7 @@ import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerDepartmentEntity;
import com.epmet.entity.CustomerGridEntity; import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetMessageOpenFeignClient;
@ -60,6 +64,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@ -93,7 +98,8 @@ public class AgencyServiceImpl implements AgencyService {
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired @Autowired
private IcBuildingDao icBuildingDao; private IcBuildingDao icBuildingDao;
@Autowired
private CustomerDepartmentDao customerDepartmentDao;
/** /**
* @param formDTO * @param formDTO
@ -152,6 +158,30 @@ public class AgencyServiceImpl implements AgencyService {
originalEntity.setCode(formDTO.getCode()); originalEntity.setCode(formDTO.getCode());
originalEntity.setContacts(formDTO.getContacts()); originalEntity.setContacts(formDTO.getContacts());
originalEntity.setMobile(formDTO.getMobile()); originalEntity.setMobile(formDTO.getMobile());
//当前客户开启了area_code_switch参数:open: 选择地区编码必填;closed: 无需选择地区编码
if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) {
CustomerAgencyEntity parent = customerAgencyDao.selectById(originalEntity.getPid());
if (null != parent) {
//开关开启后,areaCode必填
String originalAreaCode = originalEntity.getAreaCode();
checkEditAgencyFormDTO(formDTO, originalEntity);
// 1、之前当前组织没有编码,本次修改设置了编码
// 2、之前已经有编码,本次修改为了其他编码
if (StringUtils.isNotBlank(formDTO.getAreaCode()) && !formDTO.getAreaCode().equals(originalAreaCode)) {
String newAreaCode = getAgencyNewAreaCode(formDTO, parent);
originalEntity.setAreaCode(newAreaCode);
originalEntity.setParentAreaCode(parent.getAreaCode());
formDTO.setAreaCode(newAreaCode);
}
//什么时候要全部置为空呢?原来没有现在有 || 原来与现在不一致
if ((StringUtils.isBlank(originalAreaCode) && StringUtils.isNotBlank(formDTO.getAreaCode()))
|| (!formDTO.getAreaCode().equals(originalAreaCode))) {
updateSubOrg(originalEntity.getCustomerId(), formDTO, originalAreaCode);
}
}
}
//1:更新当前组织信息 //1:更新当前组织信息
if (customerAgencyDao.updateById(originalEntity) < NumConstant.ONE) { if (customerAgencyDao.updateById(originalEntity) < NumConstant.ONE) {
log.error(CustomerAgencyConstant.UPDATE_EXCEPTION); log.error(CustomerAgencyConstant.UPDATE_EXCEPTION);
@ -196,6 +226,107 @@ public class AgencyServiceImpl implements AgencyService {
return result; return result;
} }
/**
* 所有下家组织网格部门的area_codeparent_area_code置为空
* 直属组织parent_area_code直属网格+直属部门的area_code更新为最新值
* @param customerId
* @param formDTO
* @param originalAreaCode
*/
private void updateSubOrg(String customerId, EditAgencyFormDTO formDTO,String originalAreaCode) {
//如果原来这个组织有area_code再去更新,没有其实应该按照pids去更新。
customerAgencyDao.updateSubAgencyAreaCodeById(customerId, formDTO.getAgencyId(), formDTO.getUserId());
//网格的
customerGridDao.updateSubGridAreaCode(customerId, formDTO.getAgencyId(), formDTO.getUserId());
//部门的
customerDepartmentDao.updateSubDeptAreaCode(customerId, originalAreaCode, formDTO.getUserId());
//1、更新直属网格的areaCode
LambdaUpdateWrapper<CustomerGridEntity> updateGridWrapper = new LambdaUpdateWrapper<>();
updateGridWrapper.eq(CustomerGridEntity::getPid,formDTO.getAgencyId())
.set(CustomerGridEntity::getAreaCode, formDTO.getAreaCode())
.set(CustomerGridEntity::getUpdatedBy,formDTO.getUserId())
.set(CustomerGridEntity::getUpdatedTime,new Date());
int subGridRows=customerGridDao.update(null,updateGridWrapper);
log.info(String.format("更新了%s个直属网格的area_code",subGridRows));
// 2、更新直属部门的area_code
LambdaUpdateWrapper<CustomerDepartmentEntity> updateDeptWrapper = new LambdaUpdateWrapper<>();
updateDeptWrapper.eq(CustomerDepartmentEntity::getAgencyId,formDTO.getAgencyId())
.set(CustomerDepartmentEntity::getAreaCode, formDTO.getAreaCode())
.set(CustomerDepartmentEntity::getUpdatedBy,formDTO.getUserId())
.set(CustomerDepartmentEntity::getUpdatedTime,new Date());
int gridRows=customerDepartmentDao.update(null,updateDeptWrapper);
log.info(String.format("更新了%s个直属部门的area_code",gridRows));
// 3、更新下级组织的parent_area_code
LambdaUpdateWrapper<CustomerAgencyEntity> updateAgencyWrapper = new LambdaUpdateWrapper<>();
updateAgencyWrapper.eq(CustomerAgencyEntity::getPid,formDTO.getAgencyId())
.set(CustomerAgencyEntity::getParentAreaCode, formDTO.getAreaCode())
.set(CustomerAgencyEntity::getUpdatedBy,formDTO.getUserId())
.set(CustomerAgencyEntity::getUpdatedTime,new Date());
Integer rows = customerAgencyDao.update(null, updateAgencyWrapper);
log.info(String.format("更新了%s个下级组织的parent_area_code",rows));
}
/**
*
* @param formDTO 编辑组织入参
* @param parent 当前编辑组织的上级组织
* @return 返回组织区划编码
*/
private String getAgencyNewAreaCode(EditAgencyFormDTO formDTO, CustomerAgencyEntity parent) {
String newAreaCode="";
if (!"other".equals(formDTO.getAreaCode())) {
//校验除了当前组织外,areaCode是否被使用过
List<String> agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(formDTO.getAreaCode(), formDTO.getAgencyId());
if (CollectionUtils.isNotEmpty(agencyIds)) {
//已经被占用,提示
throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg());
}
newAreaCode=formDTO.getAreaCode();
} else {
//如果选择的是other,需要自定义一个编码
AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO();
addAreaCodeFormDTO.setCurrentAreaLevel(formDTO.getLevel());
addAreaCodeFormDTO.setParentAreaCode(parent.getAreaCode());
addAreaCodeFormDTO.setName(formDTO.getAgencyName());
Result<String> addAreaCodeResult = epmetCommonServiceOpenFeignClient.addAreaCode(addAreaCodeFormDTO);
if (!addAreaCodeResult.success() || StringUtils.isBlank(addAreaCodeResult.getData())) {
if (addAreaCodeResult.getCode() > 8000) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "自定义area_code异常" + addAreaCodeResult.getInternalMsg(), addAreaCodeResult.getMsg());
} else {
throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg());
}
}
newAreaCode=addAreaCodeResult.getData();
}
return newAreaCode;
}
/**
* 如果当前客户开启了areaCode校验参数逼单
* @param formDTO
*/
private void checkEditAgencyFormDTO(EditAgencyFormDTO formDTO,CustomerAgencyEntity originalEntity) {
//根组织不允许修改
if (StringUtils.isNotBlank(originalEntity.getPid()) && !NumConstant.ZERO_STR.equals(originalEntity.getPid())) {
if (StringUtils.isBlank(formDTO.getAreaCode())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open areaCode不能为空", "组织区划不能为空");
}
if (StringUtils.isBlank(formDTO.getParentAreaCode())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "area_code_switch is open parentAreaCode不能为空", "请先设置上级组织的组织区划");
}
//如果当前组织已经使用了自定义编码,不允许在选择其他。
if (StringUtils.isNotBlank(originalEntity.getAreaCode())
&& originalEntity.getAreaCode().contains("UD")
&& StringUtils.isNotBlank(formDTO.getAreaCode())
&& "other".equals(formDTO.getAreaCode())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "自定义编码不允许修改", "自定义组织区划代码不允许修改");
}
}
}
/** /**
* @param formDTO * @param formDTO
* @return * @return
@ -258,27 +389,6 @@ public class AgencyServiceImpl implements AgencyService {
agencysResultDTO.setCode(entity.getCode()); agencysResultDTO.setCode(entity.getCode());
agencysResultDTO.setContacts(entity.getContacts()); agencysResultDTO.setContacts(entity.getContacts());
agencysResultDTO.setMobile(entity.getMobile()); agencysResultDTO.setMobile(entity.getMobile());
//2021.5.26 sun 添加当前组织对应客户的根组织级别返参 start
if (null != entity) {
if (null == entity.getPids() || "".equals(entity.getPids())) {
agencysResultDTO.setRootlevel(entity.getLevel());
} else {
String id = Arrays.asList(entity.getPids().split(":")).get(0);
CustomerAgencyEntity rootEntity = customerAgencyDao.selectById(id);
if (null != rootEntity) {
agencysResultDTO.setRootlevel(rootEntity.getLevel());
}
}
}
//2021.5.26 sun 添加当前组织对应客户的根组织级别返参 end
//2:查询本机关的所有上级机关,按自上而下层级顺序
if (null == entity.getPids()) {
agencysResultDTO.setParentList(parentList);
return new Result<AgencysResultDTO>().ok(agencysResultDTO);
}
List<String> listStr = Arrays.asList(entity.getPids().split(":"));
parentList = customerAgencyDao.selectPAgencyById(listStr);
agencysResultDTO.setParentList(parentList);
agencysResultDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(entity.getCustomerId())); agencysResultDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(entity.getCustomerId()));
agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); agencysResultDTO.setAreaName(StrConstant.EPMETY_STR);
agencysResultDTO.setAreaCode(StringUtils.isNotBlank(entity.getAreaCode())?entity.getAreaCode():StrConstant.EPMETY_STR); agencysResultDTO.setAreaCode(StringUtils.isNotBlank(entity.getAreaCode())?entity.getAreaCode():StrConstant.EPMETY_STR);
@ -286,31 +396,48 @@ public class AgencyServiceImpl implements AgencyService {
if (null != entity && StringUtils.isNotBlank(entity.getAreaCode())) { if (null != entity && StringUtils.isNotBlank(entity.getAreaCode())) {
switch (entity.getLevel()) { switch (entity.getLevel()) {
case CustomerAgencyConstant.PROVINCE_LEVEL: case CustomerAgencyConstant.PROVINCE_LEVEL:
agencysResultDTO.setAreaName(null == entity.getProvince() ? StrConstant.EPMETY_STR : entity.getProvince()); agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getProvince()) ? entity.getProvince():entity.getOrganizationName());
break; break;
case CustomerAgencyConstant.CITY_LEVEL: case CustomerAgencyConstant.CITY_LEVEL:
agencysResultDTO.setAreaName(null == entity.getCity() ? StrConstant.EPMETY_STR : entity.getCity()); agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getCity()) ? entity.getCity():entity.getOrganizationName());
break; break;
case CustomerAgencyConstant.DISTRICT: case CustomerAgencyConstant.DISTRICT:
agencysResultDTO.setAreaName(null == entity.getDistrict() ? StrConstant.EPMETY_STR : entity.getDistrict()); agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getDistrict()) ? entity.getDistrict():entity.getOrganizationName());
break; break;
case CustomerAgencyConstant.STREET_LEVEL: case CustomerAgencyConstant.STREET_LEVEL:
agencysResultDTO.setAreaName(null == entity.getStreet() ? StrConstant.EPMETY_STR : entity.getStreet()); agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getStreet()) ? entity.getStreet():entity.getOrganizationName());
break; break;
case CustomerAgencyConstant.COMMUNITY_LEVEL: case CustomerAgencyConstant.COMMUNITY_LEVEL:
agencysResultDTO.setAreaName(null == entity.getCommunity() ? StrConstant.EPMETY_STR : entity.getCommunity()); agencysResultDTO.setAreaName(StringUtils.isNotBlank(entity.getCommunity()) ? entity.getCommunity():entity.getOrganizationName());
break; break;
default: default:
agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); agencysResultDTO.setAreaName(StrConstant.EPMETY_STR);
} }
} }
//2021.5.26 sun 添加当前组织对应客户的根组织级别返参 start
if (null != entity) {
if (null == entity.getPids() || "".equals(entity.getPids())) {
agencysResultDTO.setRootlevel(entity.getLevel());
} else {
String id = Arrays.asList(entity.getPids().split(":")).get(0);
CustomerAgencyEntity rootEntity = customerAgencyDao.selectById(id);
if (null != rootEntity) {
agencysResultDTO.setRootlevel(rootEntity.getLevel());
}
}
}
//2021.5.26 sun 添加当前组织对应客户的根组织级别返参 end
//2:查询本机关的所有上级机关,按自上而下层级顺序
if (StringUtils.isBlank(entity.getPids())) {
agencysResultDTO.setParentList(parentList);
return new Result<AgencysResultDTO>().ok(agencysResultDTO);
}
List<String> listStr = Arrays.asList(entity.getPids().split(":"));
parentList = customerAgencyDao.selectPAgencyById(listStr);
agencysResultDTO.setParentList(parentList);
return new Result<AgencysResultDTO>().ok(agencysResultDTO); return new Result<AgencysResultDTO>().ok(agencysResultDTO);
} }
public static void main(String[] args) {
String m="1234";
System.out.println(m.equals("1234") ? "yes" : "no");
}
/** /**
* @param formDTO * @param formDTO
* @return * @return
@ -490,7 +617,11 @@ public class AgencyServiceImpl implements AgencyService {
addAreaCodeFormDTO.setName(formDTO.getAgencyName()); addAreaCodeFormDTO.setName(formDTO.getAgencyName());
Result<String> addAreaCodeResult = epmetCommonServiceOpenFeignClient.addAreaCode(addAreaCodeFormDTO); Result<String> addAreaCodeResult = epmetCommonServiceOpenFeignClient.addAreaCode(addAreaCodeFormDTO);
if (!addAreaCodeResult.success() || StringUtils.isBlank(addAreaCodeResult.getData())) { if (!addAreaCodeResult.success() || StringUtils.isBlank(addAreaCodeResult.getData())) {
throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg()); if (addAreaCodeResult.getCode() > 8000) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "自定义area_code异常" + addAreaCodeResult.getInternalMsg(), addAreaCodeResult.getMsg());
} else {
throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg());
}
} }
insertEntity.setAreaCode(addAreaCodeResult.getData()); insertEntity.setAreaCode(addAreaCodeResult.getData());
} }

41
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

@ -275,6 +275,20 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void appointment(AppointmentFormDTO formDTO, TokenDto tokenDto) { public void appointment(AppointmentFormDTO formDTO, TokenDto tokenDto) {
IcPartyServiceCenterMatterEntity entity = matterService.selectById(formDTO.getMatterId());
if (null == entity){
throw new EpmetException("不存在此预约事项");
}
List<String> dateList = getDateList(entity.getAppointmentType());
Boolean s = false;
for (String d : dateList) {
if (d.equals(formDTO.getAppointmentDate())){
s = true;
}
}
if (!s){
throw new EpmetException(EpmetErrorCode.ERROR_DATE.getCode());
}
String customerId = tokenDto.getCustomerId(); String customerId = tokenDto.getCustomerId();
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
@ -322,6 +336,20 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void appointmentMini(AppointmentMiniFormDTO formDTO, TokenDto tokenDto) { public void appointmentMini(AppointmentMiniFormDTO formDTO, TokenDto tokenDto) {
IcPartyServiceCenterMatterEntity entity = matterService.selectById(formDTO.getMatterId());
if (null == entity){
throw new EpmetException("不存在此预约事项");
}
List<String> dateList = getDateList(entity.getAppointmentType());
Boolean s = false;
for (String d : dateList) {
if (d.equals(formDTO.getAppointmentDate())){
s = true;
}
}
if (!s){
throw new EpmetException(EpmetErrorCode.ERROR_DATE.getCode());
}
String customerId = tokenDto.getCustomerId(); String customerId = tokenDto.getCustomerId();
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
@ -423,6 +451,7 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
throw new RenException("事项不存在..."); throw new RenException("事项不存在...");
} }
result.setAppointmentType(matter.getAppointmentType()); result.setAppointmentType(matter.getAppointmentType());
result.setDateList(getDateList(result.getAppointmentType()));
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>();
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId())
.eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getDate()) .eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getDate())
@ -487,6 +516,18 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
return result; return result;
} }
public List<String> getDateList(String type) {
List<String> result = new ArrayList<>();
if (type.equals(PartyServiceCenterConstant.APPOINTMENT_TYPE_EVERY_DAY)){
result = DateUtils.getEveryDayList(new Date(),NumConstant.SEVEN);
}else if (type.equals(PartyServiceCenterConstant.APPOINTMENT_TYPE_WORK_DAY)){
result = DateUtils.getWorkDayList(new Date(),NumConstant.SEVEN);
}else {
result = DateUtils.getWeekendDayList(new Date(),NumConstant.SEVEN);
}
return result;
}
/** /**
* @Description 党群服务中心预约记录 * @Description 党群服务中心预约记录
* @param formDTO * @param formDTO

15
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -131,7 +131,9 @@
total_user AS 'totalUser', total_user AS 'totalUser',
IFNULL(code,'')AS 'code', IFNULL(code,'')AS 'code',
IFNULL(contacts,'')AS 'contacts', IFNULL(contacts,'')AS 'contacts',
IFNULL(mobile,'')AS 'mobile' IFNULL(mobile,'')AS 'mobile',
IFNULL(AREA_CODE,'') AS areaCode,
IFNULL(PARENT_AREA_CODE,'') parentAreaCode
FROM customer_agency FROM customer_agency
WHERE del_flag = '0' WHERE del_flag = '0'
AND pid = #{pId} AND pid = #{pId}
@ -731,4 +733,15 @@
AND PID = #{orgId} AND PID = #{orgId}
</select> </select>
<update id="updateSubAgencyAreaCodeById" parameterType="map">
UPDATE customer_agency
SET AREA_CODE = '',
PARENT_AREA_CODE = '',
UPDATED_BY=#{operateUserId},
UPDATED_TIME = NOW()
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND pids LIKE concat('%',#{agencyId}, '%' )
</update>
</mapper> </mapper>

13
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml

@ -26,7 +26,8 @@
total_user AS 'totalUser', total_user AS 'totalUser',
IFNULL(code,'')AS 'code', IFNULL(code,'')AS 'code',
IFNULL(contacts,'')AS 'contacts', IFNULL(contacts,'')AS 'contacts',
IFNULL(mobile,'')AS 'mobile' IFNULL(mobile,'')AS 'mobile',
IFNULL(AREA_CODE,'')AS areaCode
FROM customer_department FROM customer_department
WHERE del_flag = '0' WHERE del_flag = '0'
AND agency_id = #{agencyId} AND agency_id = #{agencyId}
@ -87,4 +88,14 @@
UPDATED_TIME=NOW() UPDATED_TIME=NOW()
where id=#{deptId} where id=#{deptId}
</update> </update>
<update id="updateSubDeptAreaCode" parameterType="map">
update customer_department
SET AREA_CODE = '',
UPDATED_BY=#{operateUserId},
UPDATED_TIME = NOW()
where customer_id=#{customerId}
AND AREA_CODE LIKE concat(#{areaCode}, '%' )
</update>
</mapper> </mapper>

12
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -291,7 +291,8 @@
IFNULL(code,'')AS 'code', IFNULL(code,'')AS 'code',
IFNULL(grid_type,'')AS 'gridType', IFNULL(grid_type,'')AS 'gridType',
IFNULL(contacts,'')AS 'contacts', IFNULL(contacts,'')AS 'contacts',
IFNULL(mobile,'')AS 'mobile' IFNULL(mobile,'')AS 'mobile',
IFNULL(AREA_CODE,'') as areaCode
FROM FROM
CUSTOMER_GRID CUSTOMER_GRID
<where> <where>
@ -755,4 +756,13 @@
AND cg.id = #{gridId} AND cg.id = #{gridId}
</select> </select>
<update id="updateSubGridAreaCode" parameterType="map">
update customer_grid
SET AREA_CODE = '',
UPDATED_BY=#{operateUserId},
UPDATED_TIME = NOW()
where customer_id=#{customerId}
AND pids LIKE concat('%',#{agencyId}, '%' )
</update>
</mapper> </mapper>

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml

@ -64,7 +64,8 @@
IFNULL(cm.MATTER_IMG,'') AS matterImg, IFNULL(cm.MATTER_IMG,'') AS matterImg,
c.ADDRESS, c.ADDRESS,
c.WORK_PHONE, c.WORK_PHONE,
c.CENTER_NAME c.CENTER_NAME,
cm.APPOINTMENT_TYPE as appointmentType
FROM ic_party_service_center c FROM ic_party_service_center c
INNER JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = c.ID AND cm.DEL_FLAG = 0) INNER JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = c.ID AND cm.DEL_FLAG = 0)
AND c.DEL_FLAG = 0 AND c.DEL_FLAG = 0

3
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/BlockChainUploadServiceImpl.java

@ -8,6 +8,7 @@ import com.epmet.entity.ProjectEntity;
import com.epmet.entity.ProjectProcessEntity; import com.epmet.entity.ProjectProcessEntity;
import com.epmet.entity.ProjectStaffEntity; import com.epmet.entity.ProjectStaffEntity;
import com.epmet.feign.EpmetThirdOpenFeignClient; import com.epmet.feign.EpmetThirdOpenFeignClient;
import com.epmet.feign.ThirdOpenFeignClient;
import com.epmet.service.BlockChainUploadService; import com.epmet.service.BlockChainUploadService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@ -27,7 +28,7 @@ import java.util.stream.Collectors;
public class BlockChainUploadServiceImpl implements BlockChainUploadService { public class BlockChainUploadServiceImpl implements BlockChainUploadService {
@Autowired @Autowired
private EpmetThirdOpenFeignClient thirdOpenFeignClient; private ThirdOpenFeignClient thirdOpenFeignClient;
@Autowired @Autowired
private ProjectStaffDao projectStaffDao; private ProjectStaffDao projectStaffDao;

8
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java

@ -100,6 +100,10 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
dtoList.forEach(item -> { dtoList.forEach(item -> {
if (StringUtils.isNotBlank(item.getGridId())) { if (StringUtils.isNotBlank(item.getGridId())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId());
if(gridInfo == null) {
log.warn("未找到网格信息:{}", item.getGridId());
return;
}
item.setGridName(gridInfo.getGridName()); item.setGridName(gridInfo.getGridName());
} }
}); });
@ -191,6 +195,10 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
dtoList.forEach(item -> { dtoList.forEach(item -> {
if (StringUtils.isNotBlank(item.getGridId())) { if (StringUtils.isNotBlank(item.getGridId())) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId()); GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(item.getGridId());
if (gridInfo == null) {
log.warn("未找到网格信息:{}", item.getGridId());
return;
}
item.setGridName(gridInfo.getGridName()); item.setGridName(gridInfo.getGridName());
} }
}); });

4
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PcWorkListResultDTO.java

@ -42,7 +42,7 @@ public class PcWorkListResultDTO implements Serializable {
/** /**
* 事项类型名称 * 事项类型名称
*/ */
private List<String> workTypeName; private String workTypeName;
/** /**
* 有无异常 * 有无异常
@ -94,7 +94,7 @@ public class PcWorkListResultDTO implements Serializable {
public PcWorkListResult() { public PcWorkListResult() {
this.title = ""; this.title = "";
this.workTypeCode = new ArrayList<>(); this.workTypeCode = new ArrayList<>();
this.workTypeName = new ArrayList<>(); this.workTypeName = "";
this.isNormal = ""; this.isNormal = "";
this.happenAddress = ""; this.happenAddress = "";
this.happenTime = ""; this.happenTime = "";

28
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -218,12 +218,14 @@ public class CustomerStaffController {
Result<CustomerStaffDTO> result = customerStaffService.addStaff(fromDTO); Result<CustomerStaffDTO> result = customerStaffService.addStaff(fromDTO);
//2021-10-18 推送mq,数据同步到中介库 start //2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); if (result.success()) {
mq.setCustomerId(fromDTO.getCustomerId()); OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setOrgId(result.getData().getUserId()); mq.setCustomerId(fromDTO.getCustomerId());
mq.setOrgType("staff"); mq.setOrgId(result.getData().getUserId());
mq.setType("staff_create"); mq.setOrgType("staff");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); mq.setType("staff_create");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
}
//2021-10-18 end //2021-10-18 end
return result; return result;
@ -240,12 +242,14 @@ public class CustomerStaffController {
Result result = customerStaffService.editStaff(fromDTO); Result result = customerStaffService.editStaff(fromDTO);
//2021-10-18 推送mq,数据同步到中介库 start //2021-10-18 推送mq,数据同步到中介库 start
OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); if (result.success()) {
mq.setCustomerId(fromDTO.getCustomerId()); OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg();
mq.setOrgId(fromDTO.getStaffId()); mq.setCustomerId(fromDTO.getCustomerId());
mq.setOrgType("staff"); mq.setOrgId(fromDTO.getStaffId());
mq.setType("staff_change"); mq.setOrgType("staff");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); mq.setType("staff_change");
SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq);
}
//2021-10-18 end //2021-10-18 end
return result; return result;

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/PcWorkListExport.java

@ -32,7 +32,7 @@ public class PcWorkListExport {
@ExcelProperty("事项类型名称") @ExcelProperty("事项类型名称")
@ColumnWidth(40) @ColumnWidth(40)
private String workTypeNames; private String workTypeName;
@ExcelProperty("有无异常") @ExcelProperty("有无异常")
private String isNormal; private String isNormal;

5
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/PatrolRoutineWorkServiceImpl.java

@ -195,7 +195,7 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW
throw new EpmetException("查询网格名字失败..."); throw new EpmetException("查询网格名字失败...");
} }
list.forEach(l -> { list.forEach(l -> {
l.setWorkTypeName(disposeWorkTypeCode(workTypeResult.getData(),l.getWorkTypeCode())); l.setWorkTypeName(disposeWorkTypeCode(workTypeResult.getData(),l.getWorkTypeCode()).stream().collect(Collectors.joining(",")));
gridNamesResult.getData().stream().filter(g -> l.getGridId().equals(g.getGridId())).forEach(g -> l.setGridName(g.getGridName())); gridNamesResult.getData().stream().filter(g -> l.getGridId().equals(g.getGridId())).forEach(g -> l.setGridName(g.getGridName()));
}); });
result.setList(list); result.setList(list);
@ -220,9 +220,6 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW
formDTO.setPageNo(pageNo); formDTO.setPageNo(pageNo);
formDTO.setPageSize(pageSize); formDTO.setPageSize(pageSize);
List<PcWorkListResultDTO.PcWorkListResult> dtos = pcWorkList(formDTO).getList(); List<PcWorkListResultDTO.PcWorkListResult> dtos = pcWorkList(formDTO).getList();
dtos.forEach(d -> {
d.setWorkTypeNames(d.getWorkTypeName().toString());
});
List<PcWorkListExport> data = ConvertUtils.sourceToTarget(dtos, PcWorkListExport.class); List<PcWorkListExport> data = ConvertUtils.sourceToTarget(dtos, PcWorkListExport.class);
num = data.size(); num = data.size();
excelWriter.write(data, writeSheet); excelWriter.write(data, writeSheet);

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

@ -491,6 +491,11 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
//2.查询网格信息并赋值 //2.查询网格信息并赋值
Map<String, CustomerGridDTO> map = new HashMap<>(); Map<String, CustomerGridDTO> map = new HashMap<>();
for (PcworkRecordListResultDTO.StaffPatrol r : result.getList()) { for (PcworkRecordListResultDTO.StaffPatrol r : result.getList()) {
//秒变小时分钟
Integer minutes = r.getTotalTimeNum() / 60;
String patrolDuration = (minutes / 60 > 0 ? minutes / 60 + "小时" : "") + (minutes % 60 > 0 ? minutes % 60 + "分钟" : "0分钟");
r.setTotalTime(patrolDuration);
if (map.containsKey(r.getGridId())) { if (map.containsKey(r.getGridId())) {
r.setGridName(map.get(r.getGridId()).getGridName()); r.setGridName(map.get(r.getGridId()).getGridName());
continue; continue;
@ -512,12 +517,6 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
r.setGridName(resultGrid.getData().getGridName()); r.setGridName(resultGrid.getData().getGridName());
map.put(r.getGridId(), resultGrid.getData()); map.put(r.getGridId(), resultGrid.getData());
} }
//秒变小时分钟
Integer minutes = r.getTotalTimeNum() / 60;
String patrolDuration = (minutes / 60 > 0 ? minutes / 60 + "小时" : "") + (minutes % 60 > 0 ? minutes % 60 + "分钟" : "0分钟");
r.setTotalTime(patrolDuration);
} }
//3.封装数据并返回 //3.封装数据并返回
resultDTO.setTotal((int)result.getTotal()); resultDTO.setTotal((int)result.getTotal());

Loading…
Cancel
Save