diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java index 14a5a24ff8..fdd9e5d860 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/OrgOrStaffMQMsg.java @@ -3,6 +3,7 @@ package com.epmet.commons.rocketmq.messages; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * 组织、网格、人员中间库数据上报MQ @@ -18,7 +19,11 @@ public class OrgOrStaffMQMsg implements Serializable { //数据类型【组织:agency 网格:grid 人员:staff】 private String orgType; //操作类型【组织新增:agency_create 组织变更:agency_change 网格新增:grid_create 网格变更:grid_change 人员新增:staff_create 人员变更:staff_change】 + //删除网格:grid_delete;删除组织:agency_delete private String type; + //工作人员Id集合 + private List staffIdList; + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 0d18e6f706..1f0d76e14f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -50,6 +50,8 @@ public interface NumConstant { BigDecimal ZERO_DECIMAL = new BigDecimal(0); int ONE_THOUSAND = 1000; int TEN_THOUSAND = 10000; + + int THREE_THOUSAND = 3000; int MAX = 99999999; int EIGHTY_EIGHT = 88; int EIGHTY = 80; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/StrUtil.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/StrUtil.java new file mode 100644 index 0000000000..8a6b63230c --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/StrUtil.java @@ -0,0 +1,37 @@ +package com.epmet.commons.tools.utils; + +import org.apache.commons.lang3.StringUtils; + +/** + * desc:utf8mb4转为utf8 + * + * @author: LiuJanJun + * @date: 2022/7/22 9:45 下午 + * @version: 1.0 + */ +public class StrUtil { + + private static final int LAST_BMP = 0xFFFF; + + public static String filterEmoji(String source) { + if (StringUtils.isBlank(source)) { + return source; + } + StringBuilder sb = new StringBuilder(source.length()); + for (int i = 0; i < source.length(); i++) { + int codePoint = source.codePointAt(i); + if (codePoint < LAST_BMP) { + sb.appendCodePoint(codePoint); + } else { + i++; + } + } + return sb.toString(); + } + + + public static void main(String[] args) { + String x = StrUtil.filterEmoji("😀😁😆😅🥹🥹😇😗😀😂666"); + System.out.println(x); + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java index 8e6c99d562..c54642b6f1 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java @@ -20,4 +20,11 @@ public class EventInfoFormDTO extends PageFormDTO implements Serializable { * 操作类型【新增:add 修改删除:edit】 */ private String type; + /** + * 是否初始化, 通常用于初期初始化数据,由自己控制 + * 0不初始化,有则更新,没有则新增 + * 1完全初始化,删除全部数据 + * 2在完全初始化之后,由于eventreport_pingyin表没有客户ID,初始化其他客户的数据时候可以设2,直接新增 + */ + private String initFlag = "0"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/form/GridBaseInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/form/GridBaseInfoFormDTO.java index 9d39ef6b81..768fad2827 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/form/GridBaseInfoFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/form/GridBaseInfoFormDTO.java @@ -28,7 +28,7 @@ public class GridBaseInfoFormDTO implements Serializable { * 操作类型【新增:add 修改删除:edit 初始化所有数据:all】 */ private String type; - + private String delFlag; public interface Grid extends CustomerClientShowGroup {} } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAgencyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAgencyDTO.java index 658a3e9c2d..e281c7400e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAgencyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAgencyDTO.java @@ -147,4 +147,14 @@ public class CustomerAgencyDTO implements Serializable { * 社区 */ private String community; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CustomerStaffDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CustomerStaffDTO.java index a5458793dd..7328788cb6 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CustomerStaffDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CustomerStaffDTO.java @@ -134,4 +134,9 @@ public class CustomerStaffDTO implements Serializable { */ private String roleName; + /** + * 身份证号 + */ + private String idCard; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java index c70b0332e4..ce1a1c71ee 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/GridUserInfoDTO.java @@ -20,6 +20,7 @@ package com.epmet.dto.user.result; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** @@ -78,6 +79,25 @@ public class GridUserInfoDTO implements Serializable { */ private String sex; + /** + * 网格员信息编辑插入、更新时间,,县市区填写 + */ + private Date updateTime; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 是否离职,格式为Y:是、N:否 + */ + private String isLeave; + + /** + * 离职时间,格式为“YYYY-MM-DD” + */ + private Date leaveDate; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 67f56957dc..ffd9da0f11 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -36,7 +36,7 @@ import java.util.List; * @author: jianjun liu */ //url="http://localhost:8108" -//@FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallback = DataStatisticalOpenFeignClientFallBack.class, url = "http://localhost:6666") +// @FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallbackFactory = DataStatisticalOpenFeignClientFallBackFactory.class, url = "http://localhost:8108") @FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallbackFactory = DataStatisticalOpenFeignClientFallBackFactory.class) public interface DataStatisticalOpenFeignClient { @@ -341,7 +341,8 @@ public interface DataStatisticalOpenFeignClient { */ @PostMapping("/data/stats/datareporting/eventinfo") Result> getEventInfo(@RequestBody EventInfoFormDTO formDTO); - + @PostMapping("/data/stats/datareporting/eventinfoV2") + Result> getEventInfoV2(@RequestBody EventInfoFormDTO formDTO); /** * wangxianzhang * diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index b5bb0013c4..a46ceb0635 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -333,6 +333,11 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getEventInfo", formDTO); } + @Override + public Result> getEventInfoV2(EventInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getEventInfoV2", formDTO); + } + @Override public Result statsVolunteerDemandServicesDaily(String customerId) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "statsVolunteerDemandServicesDaily", customerId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java index 85706430c4..a61a208f34 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java @@ -102,5 +102,8 @@ public class DataReportingController { public Result> getEventInfo(@RequestBody(required = false) EventInfoFormDTO formDTO) { return new Result>().ok(dataReportingService.getEventInfo(formDTO)); } - + @PostMapping("eventinfoV2") + public Result> getEventInfoV2(@RequestBody(required = false) EventInfoFormDTO formDTO) { + return new Result>().ok(dataReportingService.getEventInfoV2(formDTO)); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java index db2b42ba5b..1809319a3c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -72,6 +72,7 @@ public interface ScreenProjectDataDao extends BaseDao { int updateProjectSatisfactionScore(@Param("projectId")String projectId, @Param("score")BigDecimal score); List selectProjectList(@Param("customerId") String customerId, @Param("projectIds") List projectIds); + List selectProjectListV2(@Param("customerId") String customerId, @Param("projectIds") List projectIds); /** * @Description 查询网格下的项目分类 @@ -132,4 +133,6 @@ public interface ScreenProjectDataDao extends BaseDao { * @Date 2022/3/16 9:48 */ void updateHistoryData(CustomerStaffGridDTO dto); + + int getProjectCount(@Param("customerId") String customerId,@Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java index 921a2b3dde..db3012c803 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java @@ -69,4 +69,13 @@ public interface DataReportingService { */ List getEventInfo(EventInfoFormDTO formDTO); + /** + * 事件上报 + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/15 14:10 + */ + List getEventInfoV2(EventInfoFormDTO formDTO); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java index c0d124698f..e0b4386790 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java @@ -139,7 +139,7 @@ public interface ScreenProjectDataService extends BaseService getProjectList(String customerId, List projectId, Integer pageNo, Integer pageSize); - + List getProjectListV2(String customerId, List projectId, Integer pageNo, Integer pageSize); /** * 项目变更MQ * @Param msg diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java index db975af203..004085496a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -260,10 +260,12 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl NumConstant.ZERO) { - affectedRows = baseDao.deleteByProjectTimeAndCustomerId(customerId, dateId); - } + List projectIds = meta.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList()); + List> projectPartition = ListUtils.partition(projectIds, NumConstant.FIFTY); + projectPartition.forEach(part -> { + baseDao.deleteByProjectIds(customerId, part); + }); + List> partition = ListUtils.partition(meta, NumConstant.ONE_HUNDRED); partition.forEach(part -> { List list = ConvertUtils.sourceToTarget(part, ScreenProjectDataEntity.class); @@ -309,6 +311,11 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl getProjectListV2(String customerId, List projectId, Integer pageNo, Integer pageSize) { + PageHelper.startPage(pageNo, pageSize, false); + return baseDao.selectProjectListV2(customerId, projectId); + } /** * @Description 项目变更MQ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java index 8b33031420..6d76dfd175 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java @@ -100,6 +100,9 @@ public class DataReportingServiceImpl implements DataReportingService { public List getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { //1.查询工作人员所属网格信息 List resultList = customerGridService.getStaffGrid(formDTO); + if (CollectionUtils.isEmpty(resultList)) { + return new ArrayList<>(); + } //2.查询工作人员基础信息 List staffDTOList = userService.getStaffBaseInfo(formDTO); @@ -118,6 +121,13 @@ public class DataReportingServiceImpl implements DataReportingService { st.setUserType(dto.getWorkType().equals("fulltime") ? "01" : "02"); st.setPhonenumber(dto.getMobile()); st.setSex(0 == dto.getGender() ? "9" : dto.getGender().toString()); + st.setUpdateTime(dto.getUpdatedTime()); + st.setIdCard(dto.getIdCard()); + st.setStaffId(dto.getUserId()); + st.setIsLeave("enable".equals(dto.getEnableFlag()) ? "N" : "Y"); + if ("Y".equals(st.getIsLeave())) { + st.setLeaveDate(DateUtils.integrate(dto.getUpdatedTime(), DateUtils.DATE_PATTERN)); + } } }); @@ -201,12 +211,72 @@ public class DataReportingServiceImpl implements DataReportingService { return list.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(EventInfoResultDTO::getId))), ArrayList::new)); } + /** + * 事件上报 + * + * @param formDTO + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/15 14:10 + */ + @Override + public List getEventInfoV2(EventInfoFormDTO formDTO) { + List list; + //根据入参,获取项目 + long start = System.currentTimeMillis(); + List projectList = screenProjectDataService.getProjectListV2(formDTO.getCustomerId(), formDTO.getProjectId(), formDTO.getPageNo(), formDTO.getPageSize()); + log.info("事件上报-查询项目列表耗时:{}ms",System.currentTimeMillis()-start); + //项目列表为空,返回空数组 + if(CollectionUtils.isEmpty(projectList)) { + return Collections.emptyList(); + } + start = System.currentTimeMillis(); + Map epmetCodeMap = new HashMap<>(); + Result parentCustomer = operCrmOpenFeignClient.getExternalAndParentCustomerId(formDTO.getCustomerId()); + if (StringUtils.isNotBlank(parentCustomer.getData())) { + epmetCodeMap = customerProjectCategoryDictService.getByCategoryCodeMap(parentCustomer.getData()); + } + Map codeMap = customerProjectCategoryDictService.getByCategoryCodeMap(formDTO.getCustomerId()); + //项目ID不为空时,因为只有一条,可以直接处理 + Map finalEpmetCodeMap = epmetCodeMap; + if (CollectionUtils.isNotEmpty(formDTO.getProjectId())) { + list = projectList.stream().map(project -> { + EventInfoResultDTO dto = getEventInfoResultDTO(project, finalEpmetCodeMap, codeMap); + ScreenCustomerGridDTO grid = screenCustomerGridService.getGridById(project.getOrgId()); + dto.setOrgId(project.getOrgId()); + if (null != grid) { + dto.setOrgCode(grid.getCode()); + dto.setOrgName(grid.getGridName()); + } + return dto; + }).collect(Collectors.toList()); + } else { + //项目ID不为空时,提前取出客户下的组织和网格 + Map agencyMap = screenCustomerAgencyService.getAgencyList(formDTO.getCustomerId()); + Map gridMap = screenCustomerGridService.getGridList(formDTO.getCustomerId()); + list = projectList.stream().map(project -> { + EventInfoResultDTO dto = getEventInfoResultDTO(project, finalEpmetCodeMap, codeMap); + ScreenCustomerGridDTO grid = gridMap.get(project.getOrgId()); + dto.setOrgId(project.getOrgId()); + if (null != grid) { + dto.setOrgCode(grid.getCode()); + dto.setOrgName(grid.getGridName()); + } + return dto; + }).collect(Collectors.toList()); + } + log.info("事件上报-组装数据耗时:{}ms",System.currentTimeMillis()-start); + return list.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(EventInfoResultDTO::getId))), ArrayList::new)); + } + private EventInfoResultDTO getEventInfoResultDTO(ScreenProjectDataDTO project, Map epmetCodeMap, Map codeMap) { EventInfoResultDTO dto = new EventInfoResultDTO(); dto.setId(project.getProjectId()); dto.setCustomerId(project.getCustomerId()); dto.setEventName(project.getProjectTitle()); dto.setReporterId(project.getProjectCreator()); + //获取工作人员姓名和身份证 String categoryCode = project.getCategoryCode().split(StrConstant.COMMA)[0]; String parentCode = null == codeMap.get(categoryCode)?null:codeMap.get(categoryCode).getParentCategoryCode(); //如果是孔村、榆山、锦水的项目需要关联分类字典表 @@ -290,6 +360,7 @@ public class DataReportingServiceImpl implements DataReportingService { dto.setCompleteTime(project.getCloseCaseTime()); dto.setLat(project.getLatitude()); dto.setLng(project.getLongitude()); + dto.setWaysOfResolving(ProjectConstant.PROJECT_SELF_CLOSED); return dto; } @@ -333,4 +404,7 @@ public class DataReportingServiceImpl implements DataReportingService { return userService.getPatrolDetailList(formDTO); } + + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml index 6cf57e3109..64b783c786 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml @@ -269,6 +269,80 @@ ORDER BY a.CREATED_TIME ASC + + select count(ID) + from screen_project_data + where customer_id = #{customerId} + and DATA_END_TIME = #{dateId} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index 7ab6ca322c..061b1e43bf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -158,8 +158,13 @@ * FROM customer_grid - WHERE del_flag = '0' - AND customer_id = #{customerId} + WHERE customer_id = #{customerId} + + AND del_flag = #{delFlag} + + and CODE is not null + and CODE !='' + and grid_name not like '%专属网格' #{gridId} @@ -176,7 +181,7 @@ cg.`code` code FROM customer_staff_grid csg - INNER JOIN customer_grid cg ON csg.grid_id = cg.id + INNER JOIN customer_grid cg ON csg.grid_id = cg.id AND cg.`CODE` != '' AND cg.`CODE` is not null WHERE csg.del_flag = '0' AND csg.customer_id = #{customerId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index fa5da30046..fec3627bc0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -214,8 +214,12 @@ * FROM customer_agency - WHERE del_flag = '0' - AND customer_id = #{customerId} + WHERE customer_id = #{customerId} + and CODE is not null + and CODE !='' + + AND del_flag = #{delFlag} + #{agencyId} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridStaffListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridStaffListFormDTO.java new file mode 100644 index 0000000000..49b8dbc6c6 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerGridStaffListFormDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + + +@Data +public class CustomerGridStaffListFormDTO implements Serializable { + + /** + * 客户Id + */ + private String customerId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridStaffListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridStaffListResultDTO.java new file mode 100644 index 0000000000..9d138437e9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridStaffListResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @DESC + */ +@Data +public class CustomerGridStaffListResultDTO implements Serializable { + + /** + * 网格Id + */ + private String gridId; + + /** + * 网格编码 + */ + private String gridCode; + + /** + * 网格名 + */ + private String gridName; + + /** + * 区县系统中的网格员唯一编码 + */ + private String gridUserId; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 3abfbc588e..7aa747a910 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -21,7 +21,7 @@ import java.util.Set; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:37 */ -// @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class, url = "localhost:8092") + //@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class, url = "localhost:8092") @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class) public interface GovOrgOpenFeignClient { @@ -696,6 +696,10 @@ public interface GovOrgOpenFeignClient { @PostMapping("/gov/org/coverage/dictinit/{customerId}") Result dictInit(@PathVariable(value = "customerId") String customerId); + @PostMapping("/gov/org/customerstaffgrid/gridstafflist") + Result> gridStaff(CustomerGridStaffListFormDTO dto); + + /** * 获取房主名下的房屋 * @Param formDTO diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 8d020c4538..82af2caade 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -464,4 +464,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "notSyncDept", formDTO); } + @Override + public Result> gridStaff(CustomerGridStaffListFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridStaffList", dto); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index ae07816fa2..893bc95cda 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -201,7 +201,16 @@ public class AgencyController { public Result removeAgency(@LoginUser TokenDto tokenDTO, @RequestBody RemoveAgencyFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); formDTO.setCustomerId(tokenDTO.getCustomerId()); - return agencyService.removeAgency(formDTO); + Result result= agencyService.removeAgency(formDTO); + //2021-11-30 推送mq,数据同步到中介库 start + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(tokenDTO.getCustomerId()); + mq.setOrgId(formDTO.getAgencyId()); + mq.setOrgType("agency"); + mq.setType("agency_delete"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //2021-11-30 end + return result; } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java index 8858cac625..1d7206e877 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java @@ -29,10 +29,10 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.form.CommonGridIdFormDTO; +import com.epmet.dto.form.CustomerGridStaffListFormDTO; +import com.epmet.dto.form.GridStaffUploadtFormDTO; import com.epmet.dto.form.LatestGridFormDTO; -import com.epmet.dto.result.CustomerGridByUserIdResultDTO; -import com.epmet.dto.result.EventTitleOrgResultDTO; -import com.epmet.dto.result.GridStaffResultDTO; +import com.epmet.dto.result.*; import com.epmet.excel.CustomerStaffGridExcel; import com.epmet.service.CustomerStaffGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -156,4 +156,13 @@ public class CustomerStaffGridController { public Result> getAllStaffByGridId(@RequestParam("gridId")String gridId){ return new Result>().ok(customerStaffGridService.getAllStaffByGridId(gridId)); } + + /** + * @Author sun + * @Description 网格下工作人员列表 + **/ + @PostMapping("gridstafflist") + public Result> gridStaffList(@RequestBody CustomerGridStaffListFormDTO formDTO) { + return new Result>().ok(customerStaffGridService.gridStaffList(formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java index abcf908367..c7d3f5ecb6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java @@ -99,7 +99,18 @@ public class GridController { @RequirePermission(requirePermission = RequirePermissionEnum.ORG_GRID_DELETE) public Result deleteGrid(@LoginUser TokenDto tokenDto, @RequestBody DeleteGridFormDTO deleteGridFormDTO){ deleteGridFormDTO.setCustomerId(tokenDto.getCustomerId()); - return customerGridService.deleteGrid(tokenDto,deleteGridFormDTO); + Result result =customerGridService.deleteGrid(tokenDto,deleteGridFormDTO); + //2021-10-18 推送mq,数据同步到中介库 start + if (result.success()) { + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(tokenDto.getCustomerId()); + mq.setOrgId(deleteGridFormDTO.getGridId()); + mq.setOrgType("grid"); + mq.setType("grid_delete"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + } + //2021-10-18 end + return result; } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java index ed00369f86..fa95c587e4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffGridDao.java @@ -22,6 +22,7 @@ import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.StaffOrgRelationDTO; import com.epmet.dto.form.LatestGridFormDTO; +import com.epmet.dto.result.CustomerGridStaffListResultDTO; import com.epmet.dto.result.EventTitleOrgResultDTO; import com.epmet.dto.result.GridStaffResultDTO; import com.epmet.entity.CustomerStaffGridEntity; @@ -130,4 +131,5 @@ public interface CustomerStaffGridDao extends BaseDao { */ List getAllStaffByGridId(String gridId); + List getGridStaffByCustomerId(@Param("customerId") String customerId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java index c6b606e7df..49ac4b16b4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java @@ -22,8 +22,10 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.form.CommonGridIdFormDTO; +import com.epmet.dto.form.CustomerGridStaffListFormDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.CustomerGridStaffListResultDTO; import com.epmet.dto.result.EventTitleOrgResultDTO; import com.epmet.dto.result.GridStaffResultDTO; import com.epmet.entity.CustomerStaffGridEntity; @@ -142,4 +144,5 @@ public interface CustomerStaffGridService extends BaseService getAllStaffByGridId(String gridId); + List gridStaffList(CustomerGridStaffListFormDTO formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 5d992fe92e..162aed146b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; @@ -55,6 +56,7 @@ import com.epmet.entity.CustomerStaffGridEntity; import com.epmet.entity.StaffOrgRelationEntity; import com.epmet.feign.*; import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; +import com.epmet.send.SendMqMsgUtil; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerGridService; import com.epmet.util.ModuleConstant; @@ -112,6 +114,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl { CustomerStaffRedis.delStaffInfoFormCache(staffListFormDTO.getCustomerId(), staffId); }); + //22.7.25 网格添加工作人员推送mq 同步工作人员信息到中间库 start + OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); + mq.setCustomerId(staffListFormDTO.getCustomerId()); + mq.setStaffIdList(staffListFormDTO.getSelectedList()); + mq.setOrgType("staff"); + mq.setType("staff_create"); + SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); + //22.7.25 网格添加工作人员推送mq 同步工作人员信息到中间库 end return new Result(); } } + return new Result().error(); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java index 4cc572edc8..28896d3a8a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffGridServiceImpl.java @@ -29,8 +29,10 @@ import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerStaffGridDTO; import com.epmet.dto.form.CommonGridIdFormDTO; +import com.epmet.dto.form.CustomerGridStaffListFormDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.result.CustomerGridByUserIdResultDTO; +import com.epmet.dto.result.CustomerGridStaffListResultDTO; import com.epmet.dto.result.EventTitleOrgResultDTO; import com.epmet.dto.result.GridStaffResultDTO; import com.epmet.entity.CustomerStaffGridEntity; @@ -202,4 +204,11 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl getAllStaffByGridId(String gridId) { return baseDao.getAllStaffByGridId(gridId); } + + @Override + public List gridStaffList(CustomerGridStaffListFormDTO formDTO) { + //查询客户下未被禁用的工作人员基本信息 + return baseDao.getGridStaffByCustomerId(formDTO.getCustomerId()); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index bd6f04bbc8..c3d15d75e0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -240,7 +240,9 @@ set grid_name = #{gridName}, manage_district = #{manageDistrict}, - code = #{code}, + + code = #{code}, + grid_type = #{gridType}, contacts = #{contacts}, mobile = #{mobile}, diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml index db1fa9571b..5cfece3eb1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffGridDao.xml @@ -196,4 +196,20 @@ WHERE DEL_FLAG = '0' AND GRID_ID = #{gridId} + + + diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/DataWorkerConstant.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/DataWorkerConstant.java new file mode 100644 index 0000000000..df1781038f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/constant/DataWorkerConstant.java @@ -0,0 +1,8 @@ +package com.epmet.opendata.dto.constant; + +public interface DataWorkerConstant { + String ALL = "all"; + String CREATE = "create"; + String CHANGE = "change"; + String DELETE = "delete"; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/ExractGridInfoPingYinFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/ExractGridInfoPingYinFormDTO.java new file mode 100644 index 0000000000..970f98e1ab --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/ExractGridInfoPingYinFormDTO.java @@ -0,0 +1,40 @@ +package com.epmet.opendata.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/7/22 14:02 + */ +@Data +public class ExractGridInfoPingYinFormDTO implements Serializable { + + public interface GridInfo extends CustomerClientShowGroup { + } + + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = {GridInfo.class}) + private String customerId = ""; + + /** + * 网格Id或者组织id + */ + private List orgIdList; + + /** + * 废弃:这个不对。操作类型【新增:add 修改删除:edit 初始化所有数据:all】 + * 操作类型【组织新增:agency_create 组织变更:agency_change 网格新增:grid_create 网格变更:grid_change 人员新增:staff_create 人员变更:staff_change】 + * 删除网格grid_delete,删除组织agency_delete + */ + @NotBlank(message = "操作类型【新增:add 修改删除:edit 初始化所有数据:all】不能为空", groups = {GridInfo.class}) + private String type; +} + diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GridStaffInfoFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GridStaffInfoFormDTO.java new file mode 100644 index 0000000000..399e11a7ee --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/GridStaffInfoFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.opendata.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class GridStaffInfoFormDTO implements Serializable { + + private static final long serialVersionUID = -5277855973512833181L; + + /** + * 客户Id + */ + private String customerId; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/HistoryDataSyncFormDTO.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/HistoryDataSyncFormDTO.java new file mode 100644 index 0000000000..18b6bd212f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/HistoryDataSyncFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.opendata.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/7/22 13:23 + * @DESC + */ +@Data +public class HistoryDataSyncFormDTO implements Serializable { + + private static final long serialVersionUID = -58891187838165930L; + + private String customerId; +} diff --git a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/UpsertPatrolRecordForm.java b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/UpsertPatrolRecordForm.java index 3e1b0b4dd1..2566ed3af0 100644 --- a/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/UpsertPatrolRecordForm.java +++ b/epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/UpsertPatrolRecordForm.java @@ -22,8 +22,9 @@ public class UpsertPatrolRecordForm extends PageFormDTO { /** * 记录id + * 2022-07-22 注释校验的原因是兼容初始化,当不传id时,查询全部 */ - @NotEmpty(message = "id不能为空",groups = AddGroup.class) +// @NotEmpty(message = "id不能为空",groups = AddGroup.class) private String id; /** diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridDailyworkController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridDailyworkController.java index 1efda7b0b3..7bb809d167 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridDailyworkController.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridDailyworkController.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.opendata.dto.form.UpsertPatrolRecordForm; import com.epmet.opendata.service.BaseGridDailyworkService; +import com.epmet.opendata.service.GridstaffWorkInfoPingyinService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -42,6 +43,8 @@ public class BaseGridDailyworkController { @Autowired private BaseGridDailyworkService baseGridDailyworkService; + @Autowired + private GridstaffWorkInfoPingyinService gridstaffWorkInfoPingyinService; /** * @Author sun @@ -54,5 +57,18 @@ public class BaseGridDailyworkController { return new Result(); } + /** + * Desc: 2022-07-22 新表 例行工作同步 + * @param formDTO + * @author zxc + * @date 2022/7/22 11:16 + */ + @PostMapping("syncV2") + public Result getStaffBaseInfoV2(@RequestBody(required = false) UpsertPatrolRecordForm formDTO) { + ValidatorUtils.validateEntity(formDTO, DefaultGroup.class); + gridstaffWorkInfoPingyinService.insertBaseGridWorkRecordV2(formDTO); + return new Result(); + } + } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/EventreportPingyinController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/EventreportPingyinController.java new file mode 100755 index 0000000000..cc44f4c5b8 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/EventreportPingyinController.java @@ -0,0 +1,39 @@ +package com.epmet.opendata.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.opendata.service.EventreportPingyinService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + + +/** + * 平阴区事件上报中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@RestController +@RequestMapping("eventreportPingyin") +public class EventreportPingyinController { + @Resource + private EventreportPingyinService eventreportPingyinService; + + /** + * 获取上报事件 + * @Param formDTO + * @Return {@link Result} + * @Author zhaoqifeng + * @Date 2021/10/15 16:59 + */ + @PostMapping("eventinfo") + public Result getEventinfo(@RequestBody(required = false) EventInfoFormDTO formDTO) { + eventreportPingyinService.getEventInfo(formDTO); + return new Result(); + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridInfoPingyinController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridInfoPingyinController.java new file mode 100755 index 0000000000..2a1ac80444 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridInfoPingyinController.java @@ -0,0 +1,48 @@ +package com.epmet.opendata.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.opendata.dto.form.ExractGridInfoPingYinFormDTO; +import com.epmet.opendata.service.GridInfoPingyinService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 平阴区网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@RestController +@RequestMapping("gridInfoPingyin") +public class GridInfoPingyinController { + + @Autowired + private GridInfoPingyinService gridInfoPingyinService; + + /** + * @Author yzm + * @Description 组织基础信息中间库同步 + **/ + @PostMapping("extract-agency") + public Result getAgencyBaseInfo(@RequestBody ExractGridInfoPingYinFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ExractGridInfoPingYinFormDTO.GridInfo.class); + gridInfoPingyinService.exractAgency(formDTO); + return new Result(); + } + + /** + * @Author yzm + * @Description 网格基础信息中间库同步 + **/ + @PostMapping("extract-grid") + public Result getGridBaseInfo(@RequestBody ExractGridInfoPingYinFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ExractGridInfoPingYinFormDTO.GridInfo.class); + gridInfoPingyinService.exractGrid(formDTO); + return new Result(); + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridstaffInfoPingyinController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridstaffInfoPingyinController.java new file mode 100755 index 0000000000..fa6bf83195 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridstaffInfoPingyinController.java @@ -0,0 +1,47 @@ +package com.epmet.opendata.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.form.CustomerGridStaffListFormDTO; +import com.epmet.dto.result.CustomerGridStaffListResultDTO; +import com.epmet.opendata.dto.form.GridStaffInfoFormDTO; +import com.epmet.opendata.service.GridstaffInfoPingyinService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 平阴区网格员基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@RestController +@RequestMapping("gridstaffInfoPingyin") +public class GridstaffInfoPingyinController { + + @Autowired + private GridstaffInfoPingyinService gridstaffInfoPingyinService; + + + /** + * @Author sun + * @Description 网格员基本信息同步 + **/ + @PostMapping(value = "gridstaffinfo") + public Result gridStaffInfo(@RequestBody GridStaffInfoFormDTO formDTO) { + gridstaffInfoPingyinService.gridStaffInfo(formDTO); + return new Result(); + } + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridstaffWorkInfoPingyinController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridstaffWorkInfoPingyinController.java new file mode 100755 index 0000000000..3dd7d54d03 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/GridstaffWorkInfoPingyinController.java @@ -0,0 +1,32 @@ +package com.epmet.opendata.controller; + +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 平阴区网格员例行工作信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@RestController +@RequestMapping("gridstaffWorkInfoPingyin") +public class GridstaffWorkInfoPingyinController { + + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridDailyworkDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridDailyworkDao.java index f20f9612e7..936617ff7a 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridDailyworkDao.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseGridDailyworkDao.java @@ -21,6 +21,9 @@ package com.epmet.opendata.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.opendata.entity.BaseGridDailyworkEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 巡查例行工作 @@ -31,4 +34,12 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface BaseGridDailyworkDao extends BaseDao { + /** + * Desc: 每次查询1000 + * @param customerId + * @author zxc + * @date 2022/7/22 13:26 + */ + List getBaseGridDailyWork(@Param("customerId")String customerId,@Param("size")Integer size); + } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/EventreportPingyinDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/EventreportPingyinDao.java new file mode 100755 index 0000000000..b06a4939fd --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/EventreportPingyinDao.java @@ -0,0 +1,16 @@ +package com.epmet.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.EventreportPingyinEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 平阴区事件上报中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Mapper +public interface EventreportPingyinDao extends BaseDao { + void deleteAllData(); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridInfoPingyinDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridInfoPingyinDao.java new file mode 100755 index 0000000000..0aae21b99f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridInfoPingyinDao.java @@ -0,0 +1,33 @@ +package com.epmet.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.GridInfoPingyinEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.List; + +/** + * 平阴区网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Mapper +public interface GridInfoPingyinDao extends BaseDao { + + int deleteAllAgencyData(); + + int deleteAllGridData(); + + List selectByGridCode(String gridCode); + + int updateSomeCol(@Param("gridCode") String gridCode, + @Param("gridName")String gridName, + @Param("gridLevel")String gridLevel, + @Param("lng")BigDecimal lng, + @Param("lat")BigDecimal lat); + + int deleteByCode(String gridCode); +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridstaffInfoPingyinDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridstaffInfoPingyinDao.java new file mode 100755 index 0000000000..0df03ede97 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridstaffInfoPingyinDao.java @@ -0,0 +1,22 @@ +package com.epmet.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.GridstaffInfoPingyinEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 平阴区网格员基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Mapper +public interface GridstaffInfoPingyinDao extends BaseDao { + + void del(); + + void edit(GridstaffInfoPingyinEntity entity); + + GridstaffInfoPingyinEntity selectByCodeAndStaffId(@Param("code") String code, @Param("staffId") String staffId); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridstaffWorkInfoPingyinDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridstaffWorkInfoPingyinDao.java new file mode 100755 index 0000000000..997cbf7c8e --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridstaffWorkInfoPingyinDao.java @@ -0,0 +1,18 @@ +package com.epmet.opendata.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.opendata.entity.GridstaffWorkInfoPingyinEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 平阴区网格员例行工作信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Mapper +public interface GridstaffWorkInfoPingyinDao extends BaseDao { + + Integer delAllGridStaffWorkInfoPY(); + +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridDailyworkEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridDailyworkEntity.java index 5be0280fc9..76150c399d 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridDailyworkEntity.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseGridDailyworkEntity.java @@ -17,6 +17,7 @@ package com.epmet.opendata.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableLogic; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -152,4 +153,22 @@ public class BaseGridDailyworkEntity implements Serializable { */ private Date updateTime; + @TableField(exist = false) + private String qxBm; + + /** + * 上报区县名称 + */ + @TableField(exist = false) + private String qxMc; + + @TableField(exist = false) + private String workType; + + @TableField(exist = false) + private String happenTimeString; + + @TableField(exist = false) + private Date recoredInsertTime; + } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/EventreportPingyinEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/EventreportPingyinEntity.java new file mode 100755 index 0000000000..1298790b7c --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/EventreportPingyinEntity.java @@ -0,0 +1,178 @@ +package com.epmet.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 平阴区事件上报中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("eventreport_pingyin") +public class EventreportPingyinEntity { + + private static final long serialVersionUID = 1L; + + /** + * 上报区县代码,参照6位行政区划代码 + */ + private String qxBm; + + /** + * 上报区县名称 + */ + private String qxMc; + + /** + * 网格编码,参照《山东省社会治理网格化智能工作平台数据标准》 + */ + private String gridCode; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 事件编号,可以使用区县系统中的事件唯一识别码 + */ + private String eventCode; + + /** + * 事件名称 + */ + private String eventName; + + /** + * 事件类别,参照《山东省社会治理网格化智能工作平台数据标准》10.19 + */ + private String eventCategory; + + /** + * 上报网格员姓名 + */ + private String gridUserName; + + /** + * 上报网格员的身份证号码 + */ + private String gridUserCardid; + + /** + * 事件上报时间 + */ + private Date reportTime; + + /** + * 事件发生时间 + */ + private Date happenTime; + + /** + * 事件发生地点描述 + */ + private String happenPlace; + + /** + * 事件简述,详细一些,文字数量不少于10字 + */ + private String eventDescription; + + /** + * 事件办结方式,符合《标准》10.20 + */ + private String waysOfResolving; + + /** + * 是否办结,填写Y、N(Y 是 N 否) + */ + private String successfulOrNo; + + /** + * 办结层级,符合《标准》10.21 + */ + private String completeLevel; + + /** + * 办结时间,办结后填写 + */ + private Date completeTime; + + /** + * 事件发生位置经度,wgs84坐标系,请勿用火星坐标系,不得跑出辖区 + */ + private BigDecimal lng; + + /** + * 事件发生位置纬度,wgs84坐标系,请勿用火星坐标系,不得跑出辖区 + */ + private BigDecimal lat; + + /** + * 事件主要当事人姓名 + */ + private String name; + + /** + * 事件涉及人数 + */ + private Integer numberInvolved; + + /** + * 事件涉及单位名称 + */ + private String relatedUnites; + + /** + * 重点场所类别,符合《标准》10.25 + */ + private String keyAreaType; + + /** + * 宗教活动规模,符合《标准》10.26 + */ + private String religionScale; + + /** + * 宗教类别,符合《标准》10.27 + */ + private String religionType; + + /** + * 重点场所是否变动,填写Y、N(Y 是 N 否) + */ + private String isKeyareaState; + + /** + * 重点人员是否在当地,填写Y、N(Y 是 N 否) + */ + private String isKeypeopleLocate; + + /** + * 重点人员现状描述 + */ + private String keypeopleStatus; + + /** + * 例行工作编辑插入、更新时间,县市区填写 + */ + private Date updateTime; + + /** + * 事件是否删除,Y:是、N:否 + */ + private String isDel; + + /** + * 入库时间,自动生成,请勿设置 + */ + private Date recoredInsertTime; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridInfoPingyinEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridInfoPingyinEntity.java new file mode 100755 index 0000000000..d469072534 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridInfoPingyinEntity.java @@ -0,0 +1,98 @@ +package com.epmet.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 平阴区网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("grid_info_pingyin") +public class GridInfoPingyinEntity { + + private static final long serialVersionUID = 1L; + + /** + * 上报区县代码,参照6位行政区划代码 + */ + private String qxBm; + + /** + * 上报区县名称 + */ + private String qxMc; + + /** + * 网格编码,参照《标准》 + */ + private String gridCode; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格层级,应符合10.1组织层级,所有层级上报 + */ + private String gridLevel; + + /** + * 专属网格类型,应符合10.28专属网格类型 + */ + private String gridType; + + /** + * 网格内人口规模,如果为农村和城市网格,字段必填,应符合10.29.网格内人口规模 + */ + private String populationSize; + + /** + * 是否成立网格党支部或网格党小组,Y:是、N:否 + */ + private String isPartyBranch; + + /** + * 网格党组织类型,是否成立党支部或党小组为是,此项必填。应符合10.37网格党组织类型。 + */ + private String partyBranchType; + + /** + * 网格中心点的经度 + */ + private BigDecimal lng; + + /** + * 网格中心点纬度 + */ + private BigDecimal lat; + + /** + * 网格颜色,如 #000000 + */ + private String gridColor; + + /** + * 网格信息编辑插入、更新时间,,县市区填写 + */ + private Date updateTime; + + /** + * 此网格是否删除,Y:是、N:否 + */ + private String isDel; + + /** + * 入库时间,自动生成,请勿设置 + */ + private Date recoredInsertTime; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridstaffInfoPingyinEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridstaffInfoPingyinEntity.java new file mode 100755 index 0000000000..ef5fc9d982 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridstaffInfoPingyinEntity.java @@ -0,0 +1,152 @@ +package com.epmet.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 平阴区网格员基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gridstaff_info_pingyin") +public class GridstaffInfoPingyinEntity { + + private static final long serialVersionUID = 1L; + + /** + * 上报区县代码,参照6位行政区划代码 + */ + private String qxBm; + + /** + * 上报区县名称 + */ + private String qxMc; + + /** + * 区县系统中的网格员唯一编码 + */ + private String gridUserId; + + /** + * 网格编码 + */ + private String gridCode; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格员姓名 + */ + private String nickName; + + /** + * 网格员身份证号码 + */ + private String cardNum; + + /** + * 网格员类型,符合《标准》10.3 + */ + private String userType; + + /** + * 网格员手机号 + */ + private String phonenumber; + + /** + * 网格员性别,应符合10.31中性别,不要有 其他 + */ + private String sex; + + /** + * 网格员民族,应符合10.32中民族 + */ + private String nation; + + /** + * 网格员政治面貌,符合GB/T 4762 + */ + private String paerty; + + /** + * 网格员出生日期 + */ + private Date birthday; + + /** + * 网格员学历,符合GB/T4658,博士、研究生会进行预警 + */ + private String education; + + /** + * 入职时间,格式为“YYYY-MM-DD” + */ + private Date entryDate; + + /** + * 是否离职,格式为Y:是、N:否 + */ + private String isLeave; + + /** + * 离职时间,格式为“YYYY-MM-DD” + */ + private Date leaveDate; + + /** + * 网格员年收入,含福利、补贴和保险等,应符合10.30中的网格员年收入,专职低于1w5、兼职大于3w会预警 + */ + private String income; + + /** + * 是否社区(村)两委委员,Y:是、N:否 + */ + private String isCommittee; + + /** + * 是否社区工作者,Y:是、N:否 + */ + private String isCommunityWorkers; + + /** + * 是否社会工作者,Y:是、N:否 + */ + private String isSocialWorker; + + /** + * 是否村(居)民小组长,Y:是、N:否 + */ + private String isVillageLeader; + + /** + * 是否警务助理,Y:是、N:否 + */ + private String isPoliceAssistant; + + /** + * 是否人民调解员,Y:是、N:否 + */ + private String isMediator; + + /** + * 网格员信息编辑插入、更新时间,,县市区填写 + */ + private Date updateTime; + + /** + * 入库时间,自动生成,请勿设置 + */ + private Date recoredInsertTime; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridstaffWorkInfoPingyinEntity.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridstaffWorkInfoPingyinEntity.java new file mode 100755 index 0000000000..acc8721b10 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/GridstaffWorkInfoPingyinEntity.java @@ -0,0 +1,94 @@ +package com.epmet.opendata.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 平阴区网格员例行工作信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gridstaff_work_info_pingyin") +public class GridstaffWorkInfoPingyinEntity { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 上报区县代码,参照6位行政区划代码 + */ + private String qxBm; + + /** + * 上报区县名称 + */ + private String qxMc; + + /** + * 网格编码 + */ + private String gridCode; + + /** + * 网格名称 + */ + private String gridName; + + @TableField(exist = false) + private String gridId; + + /** + * 例行工作类型,应符合10.27中的例行工作类型 + */ + private String workType; + + /** + * 发生日期,格式为“YYYY-MM-DD” + */ + private Date happenTime; + + /** + * 基础信息主键,出租房巡查、重点场所巡查、刑满释放人员、社区矫正、吸毒人员、信访人员重点青少年和精神障碍者必填 + */ + private Integer baseInfoId; + + /** + * 有无变动(异常),Y:是、N:否 + */ + private String workResult; + + /** + * 说明 + */ + private String workContent; + + /** + * 例行工作编辑插入、更新时间,,县市区填写 + */ + private Date updateTime; + + /** + * 例行工作是否删除,Y:是、N:否 + */ + private String isDel; + + /** + * 入库时间,自动生成,请勿设置 + */ + private Date recoredInsertTime; + + @TableField(exist = false) + private String happenTimeString; + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java index 928489f8b0..deb7384c61 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataOrgChangeEventListener.java @@ -10,8 +10,8 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.SpringContextUtils; -import com.epmet.opendata.dto.form.ExDeptFormDTO; -import com.epmet.opendata.service.ExDeptService; +import com.epmet.opendata.dto.form.ExractGridInfoPingYinFormDTO; +import com.epmet.opendata.service.GridInfoPingyinService; import org.apache.commons.lang.StringUtils; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; @@ -78,17 +78,33 @@ public class OpenDataOrgChangeEventListener implements MessageListenerConcurrent lock = distributedLock.getLock(String.format("lock:open_data_org:%s", obj.getOrgId()), 30L, 30L, TimeUnit.SECONDS); - ExDeptFormDTO dto = new ExDeptFormDTO(); - dto.setCustomerId(obj.getCustomerId()); - dto.setType(obj.getType()); + // ExDeptFormDTO dto = new ExDeptFormDTO(); + // dto.setCustomerId(obj.getCustomerId()); + // dto.setType(obj.getType()); + // List orgIdList = new ArrayList<>(); + // orgIdList.add(obj.getOrgId()); + // dto.setOrgIdList(orgIdList); + // if ("agency".equals(obj.getOrgType())) { + // SpringContextUtils.getBean(ExDeptService.class).getAgencyBaseInfo(dto); + // } else { + // SpringContextUtils.getBean(ExDeptService.class).getGridBaseInfo(dto); + // } + + // 抽取到grid_info_pingyin + ExractGridInfoPingYinFormDTO extractFormDto = new ExractGridInfoPingYinFormDTO(); + extractFormDto.setCustomerId(obj.getCustomerId()); + extractFormDto.setType(obj.getType()); List orgIdList = new ArrayList<>(); - orgIdList.add(obj.getOrgId()); - dto.setOrgIdList(orgIdList); + if(StringUtils.isNotBlank(obj.getOrgId())){ + orgIdList.add(obj.getOrgId()); + } + extractFormDto.setOrgIdList(orgIdList); if ("agency".equals(obj.getOrgType())) { - SpringContextUtils.getBean(ExDeptService.class).getAgencyBaseInfo(dto); + SpringContextUtils.getBean(GridInfoPingyinService.class).exractAgency(extractFormDto); } else { - SpringContextUtils.getBean(ExDeptService.class).getGridBaseInfo(dto); + SpringContextUtils.getBean(GridInfoPingyinService.class).exractGrid(extractFormDto); } + } catch (RenException e) { // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 logger.error("【开放数据事件监听器】-组织信息变更-同步信息到中间库失败:".concat(ExceptionUtils.getErrorStackTrace(e))); diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java index d168875abb..5c3bbb4404 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java @@ -15,7 +15,7 @@ import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.constant.SystemMessageType; import com.epmet.opendata.dto.form.UpsertPatrolRecordForm; -import com.epmet.opendata.service.BaseGridDailyworkService; +import com.epmet.opendata.service.GridstaffWorkInfoPingyinService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; @@ -98,7 +98,8 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr aBoolean = true; break; case SystemMessageType.PATROL_ROUTINE_WORK_ADD: - aBoolean = SpringContextUtils.getBean(BaseGridDailyworkService.class).insertBaseGridWorkRecord(patrolRecordForm); +// aBoolean = SpringContextUtils.getBean(BaseGridDailyworkService.class).insertBaseGridWorkRecord(patrolRecordForm); + aBoolean = SpringContextUtils.getBean(GridstaffWorkInfoPingyinService.class).insertBaseGridWorkRecordV2(patrolRecordForm); break; default: log.error("错误的消息类型:{}", tags); diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java index 097235e7e6..1912fc95a3 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataProjectChangeEventListener.java @@ -11,7 +11,7 @@ import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.dto.basereport.form.EventInfoFormDTO; -import com.epmet.opendata.service.BaseDisputeProcessService; +import com.epmet.opendata.service.EventreportPingyinService; import org.apache.commons.lang3.StringUtils; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; @@ -75,7 +75,8 @@ public class OpenDataProjectChangeEventListener implements MessageListenerConcur try { lock = distributedLock.getLock(String.format("lock:open_data_project:%s", obj.getProjectId()), 30L, 30L, TimeUnit.SECONDS); - SpringContextUtils.getBean(BaseDisputeProcessService.class).getEventinfo(formDTO); + //SpringContextUtils.getBean(BaseDisputeProcessService.class).getEventinfo(formDTO); + SpringContextUtils.getBean(EventreportPingyinService.class).getEventInfo(formDTO); } catch (RenException e) { // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 logger.error("【开放数据事件监听器】-项目信息变更-上报项目信息失败:".concat(ExceptionUtils.getErrorStackTrace(e))); diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java index ad7bd79b62..b2d9bd4976 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataStaffChangeEventListener.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.opendata.service.ExUserService; +import com.epmet.opendata.service.GridstaffInfoPingyinService; import org.apache.commons.lang3.StringUtils; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; @@ -83,10 +84,12 @@ public class OpenDataStaffChangeEventListener implements MessageListenerConcurre StaffBaseInfoFormDTO dto = new StaffBaseInfoFormDTO(); dto.setCustomerId(obj.getCustomerId()); dto.setType(obj.getType()); - List staffIdList = new ArrayList<>(); + /*List staffIdList = new ArrayList<>(); staffIdList.add(obj.getOrgId()); dto.setStaffIdList(staffIdList); - SpringContextUtils.getBean(ExUserService.class).getStaffBaseInfo(dto); + SpringContextUtils.getBean(ExUserService.class).getStaffBaseInfo(dto);*/ + dto.setStaffIdList(obj.getStaffIdList()); + SpringContextUtils.getBean(GridstaffInfoPingyinService.class).getStaffBaseInfo(dto); } catch (RenException e) { // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 logger.error("【开放数据事件监听器】-工作人员信息变更-初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e))); diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/EventreportPingyinService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/EventreportPingyinService.java new file mode 100755 index 0000000000..d2fe6c88f2 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/EventreportPingyinService.java @@ -0,0 +1,23 @@ +package com.epmet.opendata.service; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.opendata.entity.EventreportPingyinEntity; + +/** + * 平阴区事件上报中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +public interface EventreportPingyinService extends BaseService { + /** + * 获取上报事件 + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/10/15 16:59 + */ + void getEventInfo(EventInfoFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GridInfoPingyinService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GridInfoPingyinService.java new file mode 100755 index 0000000000..3feaabc3eb --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GridInfoPingyinService.java @@ -0,0 +1,27 @@ +package com.epmet.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.dto.form.ExractGridInfoPingYinFormDTO; +import com.epmet.opendata.entity.GridInfoPingyinEntity; + +/** + * 平阴区网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +public interface GridInfoPingyinService extends BaseService { + /** + * 抽取customer_agency到grid_info_pingyin表 + * + * @param formDTO + */ + void exractAgency(ExractGridInfoPingYinFormDTO formDTO); + + /** + * 抽取customer_grid到grid_info_pingyin表 + * + * @param formDTO + */ + void exractGrid(ExractGridInfoPingYinFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GridstaffInfoPingyinService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GridstaffInfoPingyinService.java new file mode 100755 index 0000000000..9164dad0ac --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GridstaffInfoPingyinService.java @@ -0,0 +1,25 @@ +package com.epmet.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.dto.form.GridStaffInfoFormDTO; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.entity.GridstaffInfoPingyinEntity; + +import java.util.Map; + +/** + * 平阴区网格员基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +public interface GridstaffInfoPingyinService extends BaseService { + + void gridStaffInfo(GridStaffInfoFormDTO formDTO); + + /** + * @Author sun + * @Description 网格员信息中间库同步 + **/ + void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GridstaffWorkInfoPingyinService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GridstaffWorkInfoPingyinService.java new file mode 100755 index 0000000000..5961e3355e --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GridstaffWorkInfoPingyinService.java @@ -0,0 +1,22 @@ +package com.epmet.opendata.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.opendata.dto.form.UpsertPatrolRecordForm; +import com.epmet.opendata.entity.GridstaffWorkInfoPingyinEntity; + +/** + * 平阴区网格员例行工作信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +public interface GridstaffWorkInfoPingyinService extends BaseService { + /** + * Desc: 2022-07-22 新表 例行工作同步 + * @param formDTO + * @author zxc + * @date 2022/7/22 11:16 + */ + Boolean insertBaseGridWorkRecordV2(UpsertPatrolRecordForm formDTO); + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/EventreportPingyinServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/EventreportPingyinServiceImpl.java new file mode 100755 index 0000000000..380df961e4 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/EventreportPingyinServiceImpl.java @@ -0,0 +1,178 @@ +package com.epmet.opendata.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.StrUtil; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.dto.basereport.result.EventInfoResultDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.opendata.dao.EventreportPingyinDao; +import com.epmet.opendata.dao.GridstaffInfoPingyinDao; +import com.epmet.opendata.entity.EventreportPingyinEntity; +import com.epmet.opendata.entity.GridstaffInfoPingyinEntity; +import com.epmet.opendata.service.EventreportPingyinService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 平阴区事件上报中间表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Slf4j +@Service +public class EventreportPingyinServiceImpl extends BaseServiceImpl implements EventreportPingyinService { + @Resource + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + @Resource + private GridstaffInfoPingyinDao gridstaffInfoPingyinDao; + + /** + * 获取上报事件 + * + * @param formDTO + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/10/15 16:59 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void getEventInfo(EventInfoFormDTO formDTO) { + formDTO.setPageSize(1000); + long start = System.currentTimeMillis(); + if (NumConstant.ONE_STR.equals(formDTO.getInitFlag())) { + //清空表里数据 + baseDao.deleteAllData(); + } + Result> result = dataStatisticalOpenFeignClient.getEventInfoV2(formDTO); + if (!result.success()) { + log.error("getEventinfo cost:{}ms",System.currentTimeMillis()-start); + throw new RenException(result.getInternalMsg()); + } + List list = result.getData(); + saveEvent(list, formDTO.getInitFlag()); + //分批次循环 + while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()) { + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + result = dataStatisticalOpenFeignClient.getEventInfo(formDTO); + list = result.getData(); + saveEvent(list, formDTO.getInitFlag()); + } + } + + private void saveEvent(List list, String initFlag) { + if (CollectionUtils.isEmpty(list)) { + log.warn("no event data to save table base_conflicts_resolve"); + return; + } + List entityList = list.stream().map(item -> { + EventreportPingyinEntity entity = new EventreportPingyinEntity(); + entity.setQxBm("370124"); + entity.setQxMc("平阴县"); + entity.setGridCode(item.getOrgCode()); + entity.setGridName(item.getOrgName()); + entity.setEventCode(("py_").concat(item.getId())); + + String eventName = StrUtil.filterEmoji(item.getEventName()); + entity.setEventName(eventName); + entity.setEventCategory(item.getEventCategory()); + entity.setGridUserCardid(""); + entity.setGridUserName(""); + LambdaQueryWrapper staffWrapper = new LambdaQueryWrapper<>(); + staffWrapper.eq(GridstaffInfoPingyinEntity::getGridUserId, item.getReporterId()); + List staffList = gridstaffInfoPingyinDao.selectList(staffWrapper); + if (CollectionUtils.isNotEmpty(staffList)) { + entity.setGridUserCardid(staffList.get(NumConstant.ZERO).getCardNum()); + entity.setGridUserName(staffList.get(NumConstant.ZERO).getNickName()); + } else { + staffWrapper = new LambdaQueryWrapper<>(); + staffWrapper.eq(GridstaffInfoPingyinEntity::getGridCode, item.getOrgCode()); + staffList = gridstaffInfoPingyinDao.selectList(staffWrapper); + if (CollectionUtils.isNotEmpty(staffList)) { + for (GridstaffInfoPingyinEntity staff : staffList) { + entity.setGridUserCardid(staff.getCardNum()); + entity.setGridUserName(staff.getNickName()); + if (StringUtils.isNotBlank(staff.getCardNum())) { + break; + } + } + } + } + entity.setReportTime(item.getReportTime()); + entity.setHappenTime(item.getHappenDate()); + entity.setHappenPlace(item.getHappenPlace()); + String eventDescription = item.getEventDescription(); + //如果不为空 长度控制3000以内 + if (StringUtils.isNotBlank(eventDescription) && eventDescription.length() > NumConstant.THREE_THOUSAND) { + eventDescription = eventDescription.substring(NumConstant.ZERO, NumConstant.THREE_THOUSAND); + } + eventDescription = StrUtil.filterEmoji(eventDescription); + entity.setEventDescription(eventDescription); + entity.setWaysOfResolving(item.getWaysOfResolving()); + //业务不确定 + if (("03").equals(item.getStatus())) { + entity.setSuccessfulOrNo("Y"); + } else { + entity.setSuccessfulOrNo("N"); + } + entity.setCompleteLevel(item.getCompleteLevel()); + entity.setCompleteTime(item.getCompleteTime()); + entity.setLng(item.getLng()); + entity.setLat(item.getLat()); + entity.setIsDel("N"); + entity.setUpdateTime(new Date()); + + //业务不包含 一级分类里 如果是03 矛盾纠纷 则涉及人数写2(目前业务不支持 所以应产品需求 填2) + if ("03".equals(item.getParentEventCategory())) { + entity.setNumberInvolved(NumConstant.TWO); + } + return entity; + }).collect(Collectors.toList()); + log.info("数据拼装结果" + entityList); + //过滤掉必填字段为空的数据 + entityList = entityList.stream().filter(item -> + StringUtils.isNotBlank(item.getGridCode()) && StringUtils.isNotBlank(item.getGridName()) && + StringUtils.isNotBlank(item.getEventCategory()) && StringUtils.isNotBlank(item.getGridUserName()) && + StringUtils.isNotBlank(item.getGridUserCardid()) && null != item.getReportTime() && + null != item.getHappenTime() && StringUtils.isNotBlank(item.getHappenPlace()) && + StringUtils.isNotBlank(item.getGridUserCardid()) && StringUtils.isNotBlank(item.getEventDescription()) && + StringUtils.isNotBlank(item.getWaysOfResolving()) && null != item.getLng() && null != item.getLat() + ).collect(Collectors.toList()); + log.info("数据过滤结果" + entityList.size()); + if (NumConstant.ZERO_STR.equals(initFlag)) { + entityList.forEach(entity -> { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(EventreportPingyinEntity::getEventCode, entity.getEventCode()); + EventreportPingyinEntity event = baseDao.selectOne(wrapper); + if (null == event) { + baseDao.insert(entity); + } else { + baseDao.update(entity, wrapper); + } + }); + } else { + for (EventreportPingyinEntity entity : entityList) { + try { + baseDao.insert(entity); + } catch (Exception e) { + log.error(e.toString()); + } + } + } + + + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridInfoPingyinServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridInfoPingyinServiceImpl.java new file mode 100755 index 0000000000..c2d915155f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridInfoPingyinServiceImpl.java @@ -0,0 +1,228 @@ +package com.epmet.opendata.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.IndexCalConstant; +import com.epmet.dto.org.result.CustomerAgencyDTO; +import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.opendata.dao.GridInfoPingyinDao; +import com.epmet.opendata.dto.constant.DataWorkerConstant; +import com.epmet.opendata.dto.form.ExractGridInfoPingYinFormDTO; +import com.epmet.opendata.entity.GridInfoPingyinEntity; +import com.epmet.opendata.service.GridInfoPingyinService; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + + +/** + * 平阴区网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Service +public class GridInfoPingyinServiceImpl extends BaseServiceImpl implements GridInfoPingyinService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + + /** + * 抽取customer_agency到grid_info_pingyin表 + * + * @param formDTO + */ + @Override + public void exractAgency(ExractGridInfoPingYinFormDTO formDTO) { + // 1.查询组织基础信息,customer_agency.code为空的不抽取 + com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class); + if (DataWorkerConstant.ALL.equals(formDTO.getType())) { + formDTO1.setDelFlag("0"); + } else if (formDTO.getType().contains(DataWorkerConstant.CREATE)) { + formDTO1.setDelFlag(NumConstant.ZERO_STR); + } else if (formDTO.getType().contains(DataWorkerConstant.CHANGE)) { + formDTO1.setDelFlag(NumConstant.ZERO_STR); + } else if (formDTO.getType().contains(DataWorkerConstant.DELETE)) { + formDTO1.setDelFlag(NumConstant.ONE_STR); + } + Result> result = dataStatisticalOpenFeignClient.getAgencyBaseInfo(formDTO1); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + if (null == result.getData() || result.getData().size() < NumConstant.ONE) { + return; + } + // 2.封装数据 + List gridInfoList = new ArrayList<>(); + result.getData().forEach(ag -> { + GridInfoPingyinEntity entity = new GridInfoPingyinEntity(); + entity.setQxBm("370124"); + entity.setQxMc("平阴县"); + entity.setGridCode(ag.getCode()); + entity.setGridName(ag.getOrganizationName()); + entity.setIsDel("N"); + if (Constant.DISTRICT.equals(ag.getLevel())) { + entity.setGridLevel("03"); + } else if (Constant.STREET.equals(ag.getLevel())) { + entity.setGridLevel("04"); + } else if (Constant.COMMUNITY.equals(ag.getLevel())) { + entity.setGridLevel("06"); + } + entity.setLat(new BigDecimal(ag.getLatitude())); + entity.setLng(new BigDecimal(ag.getLongitude())); + gridInfoList.add(entity); + }); + // 3、初始化传all;新增或者编辑 + if (DataWorkerConstant.ALL.equals(formDTO.getType())) { + // 全删,全增 + baseDao.deleteAllAgencyData(); + // 一次100 + List> partition = ListUtils.partition(gridInfoList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + this.insertBatch(list); + }); + + } else if (formDTO.getType().contains(DataWorkerConstant.CREATE)) { + // 单独新增组织 + this.insertBatch(gridInfoList); + + } else if (formDTO.getType().contains(DataWorkerConstant.CHANGE)) { + // 修改组织时,先根据code查询,如果有数据,更新 + for (GridInfoPingyinEntity entity : gridInfoList) { + + List orginList = baseDao.selectByGridCode(entity.getGridCode()); + + if (CollectionUtils.isNotEmpty(orginList)) { + + // 更新网格名称、网格层级、网格中心点的经度,网格中心点纬度 + for (GridInfoPingyinEntity oigin : orginList) { + baseDao.updateSomeCol(oigin.getGridCode(), entity.getGridName(), entity.getGridLevel(), entity.getLng(), entity.getLat()); + } + + } else { + // 插入 + baseDao.insert(entity); + } + } + }else if(formDTO.getType().contains(DataWorkerConstant.DELETE)){ + // 要删除的组织id + for (GridInfoPingyinEntity entity : gridInfoList) { + List orginList = baseDao.selectByGridCode(entity.getGridCode()); + if (CollectionUtils.isNotEmpty(orginList)) { + for (GridInfoPingyinEntity oigin : orginList) { + baseDao.deleteByCode(oigin.getGridCode()); + } + } + } + } + + } + + /** + * 抽取customer_grid到grid_info_pingyin表 + * + * @param formDTO + */ + @Override + public void exractGrid(ExractGridInfoPingYinFormDTO formDTO) { + // 1.查询网格基础信息 + com.epmet.dto.org.form.GridBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.org.form.GridBaseInfoFormDTO.class); + if (StringUtils.isBlank(formDTO.getType())||DataWorkerConstant.ALL.equals(formDTO.getType())) { + formDTO1.setDelFlag("0"); + } else if (formDTO.getType().contains(DataWorkerConstant.CREATE)) { + formDTO1.setDelFlag(NumConstant.ZERO_STR); + } else if (formDTO.getType().contains(DataWorkerConstant.CHANGE)) { + formDTO1.setDelFlag(NumConstant.ZERO_STR); + } else if (formDTO.getType().contains(DataWorkerConstant.DELETE)) { + formDTO1.setDelFlag(NumConstant.ONE_STR); + } + Result> result = dataStatisticalOpenFeignClient.getGridBaseInfo(formDTO1); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + if (null == result.getData() || result.getData().size() < NumConstant.ONE) { + return; + } + + // 2.封装数据 + List gridInfoList = new ArrayList<>(); + result.getData().forEach(ag -> { + GridInfoPingyinEntity entity = new GridInfoPingyinEntity(); + entity.setQxBm("370124"); + entity.setQxMc("平阴县"); + entity.setGridCode(ag.getCode()); + entity.setGridName(ag.getGridName()); + entity.setGridLevel("07"); + entity.setIsDel("N"); + entity.setUpdateTime(new Date()); + if (ag.getLatitude().length() > 10) { + entity.setLat(new BigDecimal(ag.getLatitude().substring(0, 10))); + } else { + entity.setLat(new BigDecimal(ag.getLatitude())); + } + if (ag.getLongitude().length() > 10) { + entity.setLng(new BigDecimal(ag.getLongitude().substring(0, 10))); + } else { + entity.setLng(new BigDecimal(ag.getLongitude())); + } + gridInfoList.add(entity); + }); + // 3、初始化传all;新增或者编辑 + if (DataWorkerConstant.ALL.equals(formDTO.getType())) { + // 全删,全增 + baseDao.deleteAllGridData(); + // 一次100 + List> partition = ListUtils.partition(gridInfoList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + this.insertBatch(list); + }); + } else if (formDTO.getType().contains(DataWorkerConstant.CREATE)) { + // 单独新增组织 + this.insertBatch(gridInfoList); + + } else if (formDTO.getType().contains(DataWorkerConstant.CHANGE)) { + // 修改组织时,先根据code查询,如果有数据,更新 + for (GridInfoPingyinEntity entity : gridInfoList) { + + List orginList = baseDao.selectByGridCode(entity.getGridCode()); + + if (CollectionUtils.isNotEmpty(orginList)) { + + // 更新网格名称、网格层级、网格中心点的经度,网格中心点纬度 + for (GridInfoPingyinEntity oigin : orginList) { + baseDao.updateSomeCol(oigin.getGridCode(), entity.getGridName(), entity.getGridLevel(), entity.getLng(), entity.getLat()); + } + + } else { + // 插入 + baseDao.insert(entity); + } + } + }else if(formDTO.getType().contains(DataWorkerConstant.DELETE)){ + // 要删除的网格id + for (GridInfoPingyinEntity entity : gridInfoList) { + List orginList = baseDao.selectByGridCode(entity.getGridCode()); + if (CollectionUtils.isNotEmpty(orginList)) { + for (GridInfoPingyinEntity oigin : orginList) { + baseDao.deleteByCode(oigin.getGridCode()); + } + } + } + } + + } + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridstaffInfoPingyinServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridstaffInfoPingyinServiceImpl.java new file mode 100755 index 0000000000..3f7fffb0ec --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridstaffInfoPingyinServiceImpl.java @@ -0,0 +1,147 @@ +package com.epmet.opendata.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CustomerGridStaffListFormDTO; +import com.epmet.dto.form.GridStaffUploadtFormDTO; +import com.epmet.dto.result.CustomerGridStaffListResultDTO; +import com.epmet.dto.result.GridStaffUploadResultDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.opendata.dao.GridstaffInfoPingyinDao; +import com.epmet.opendata.dto.form.GridStaffInfoFormDTO; +import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; +import com.epmet.opendata.entity.GridstaffInfoPingyinEntity; +import com.epmet.opendata.service.GridstaffInfoPingyinService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 平阴区网格员基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Service +@Slf4j +public class GridstaffInfoPingyinServiceImpl extends BaseServiceImpl implements GridstaffInfoPingyinService { + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + + @Override + @Transactional(rollbackFor = Exception.class) + public void gridStaffInfo(GridStaffInfoFormDTO formDTO) { + //1.查询客户网格下工作人员【存在网格code的网格下的工作人员】 + CustomerGridStaffListFormDTO org = new CustomerGridStaffListFormDTO(); + org.setCustomerId(formDTO.getCustomerId()); + Result> orgList = govOrgOpenFeignClient.gridStaff(org); + if (!orgList.success()) { + throw new RenException("查询客户网格下工作人员列表信息失败:".concat(orgList.toString())); + } + log.info(String.format("网格员数据同步,查询到网格下工作人员记录共%s条", orgList.getData().size())); + + //2.查询客户工作人员基础信息【客户下未被禁用的有效工作人员信息】 + GridStaffUploadtFormDTO user = new GridStaffUploadtFormDTO(); + user.setCustomerId(formDTO.getCustomerId()); + Result> userList = epmetUserOpenFeignClient.customerStaff(user); + if (!userList.success()) { + throw new RenException("查询客户下工作人员基础信息失败:".concat(userList.toString())); + } + log.info(String.format("网格员数据同步,查询到客户下工作人员基础信息记录共%s条", userList.getData().size())); + Map map = userList.getData().stream().collect(Collectors.toMap(GridStaffUploadResultDTO::getGridUserId, m -> m, (k1, k2) -> k1)); + + //3.拼装数据 + List entityList = new ArrayList(); + if (!CollectionUtils.isEmpty(orgList.getData()) && !CollectionUtils.isEmpty(userList.getData())) { + for (CustomerGridStaffListResultDTO gs : orgList.getData()) { + if (map.containsKey(gs.getGridUserId())) { + GridStaffUploadResultDTO us = map.get(gs.getGridUserId()); + GridstaffInfoPingyinEntity entity = ConvertUtils.sourceToTarget(us, GridstaffInfoPingyinEntity.class); + entity.setQxBm("370124"); + entity.setQxMc("平阴县"); + entity.setGridCode(gs.getGridCode()); + entity.setGridName(gs.getGridName()); + entity.setSex("0".equals(us.getSex()) ? "9" : us.getSex()); + if ("Y".equals(entity.getIsLeave())) { + entity.setLeaveDate(us.getDate()); + } + entityList.add(entity); + } + } + } + + //4.删除表中历史数据 + baseDao.del(); + + //5.批量新增数据 + log.info(String.format("网格员数据同步,本次共同步%s条记录", entityList.size())); + insertBatch(entityList); + + } + + + /** + * @Author sun + * @Description 网格员信息中间库同步 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void getStaffBaseInfo(StaffBaseInfoFormDTO formDTO) { + log.info("网格工作人员信息同步,入参对象值: " + JSON.toJSONString(formDTO, true)); + //1.查询工作人员网格信息和基础信息 + com.epmet.dto.user.form.StaffBaseInfoFormDTO formDTO1 = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.user.form.StaffBaseInfoFormDTO.class); + Result> result = dataStatisticalOpenFeignClient.getStaffBaseInfo(formDTO1); + if (!result.success()) { + throw new RenException(result.getInternalMsg()); + } + if (CollectionUtils.isEmpty(result.getData())) { + return; + } + + //2.中间库新增/修改数据【基本一个人一条数据,程序按批量处理】 + result.getData().forEach(r -> { + GridstaffInfoPingyinEntity entity = ConvertUtils.sourceToTarget(r, GridstaffInfoPingyinEntity.class); + entity.setQxBm("370124"); + entity.setQxMc("平阴县"); + entity.setGridCode(r.getCode()); + entity.setGridName(r.getGridName()); + entity.setIsLeave(r.getIsLeave()); + entity.setLeaveDate(r.getLeaveDate()); + entity.setGridUserId(r.getStaffId()); + entity.setCardNum(r.getIdCard()); + //按网格查询人员是否存在,存在更新否则新增 + GridstaffInfoPingyinEntity gs = baseDao.selectByCodeAndStaffId(r.getCode(), r.getStaffId()); + log.info(String.format("网格工作人员信息同步,当前操作人员信息,姓名:%s staffId:%s", entity.getNickName(), entity.getGridUserId())); + if (null != gs) { + entity.setUpdateTime(new Date()); + baseDao.edit(entity); + } else { + insert(entity); + } + }); + + } + + +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridstaffWorkInfoPingyinServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridstaffWorkInfoPingyinServiceImpl.java new file mode 100755 index 0000000000..a4e98d714f --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridstaffWorkInfoPingyinServiceImpl.java @@ -0,0 +1,150 @@ +package com.epmet.opendata.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.StrUtil; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.dto.form.patrol.PatrolQueryFormDTO; +import com.epmet.dto.result.PatrolRoutineWorkResult; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.opendata.dao.GridstaffWorkInfoPingyinDao; +import com.epmet.opendata.dto.form.UpsertPatrolRecordForm; +import com.epmet.opendata.entity.GridstaffWorkInfoPingyinEntity; +import com.epmet.opendata.service.GridstaffWorkInfoPingyinService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * 平阴区网格员例行工作信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-07-22 + */ +@Slf4j +@Service +public class GridstaffWorkInfoPingyinServiceImpl extends BaseServiceImpl implements GridstaffWorkInfoPingyinService { + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Override + public Boolean insertBaseGridWorkRecordV2(UpsertPatrolRecordForm patrolRecordForm) { + log.info("insertBaseGridWorkRecordV2 param:{}", JSON.toJSONString(patrolRecordForm)); + ValidatorUtils.validateEntity(patrolRecordForm, AddGroup.class); + // 构建传参 + PatrolQueryFormDTO midPatrolFormDTO = buildParam(patrolRecordForm); + if (StringUtils.isBlank(patrolRecordForm.getId())) { + Integer row; + do { + row = baseDao.delAllGridStaffWorkInfoPY(); + } while (row == NumConstant.ONE_THOUSAND); + } + List data; + do { + Result> record = epmetUserOpenFeignClient.getPatrolRoutineWorkListV2(midPatrolFormDTO); + if (record == null || !record.success()) { + log.error("获取例行工作记录V2失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + data = record.getData(); + if (CollectionUtils.isEmpty(data)) { + //数据已被删除了 + //暂时设置error 用于排错 + log.error("获取例行工作记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO)); + int effectRow = baseDao.deleteById(patrolRecordForm.getId()); + log.warn("del effectRow:{}", effectRow); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + data.forEach(d -> { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(d.getGridId()); + if (null == gridInfo) { + log.warn("未查询到网格信息:" + d.getGridId()); + return; + } + String s = StrUtil.filterEmoji(d.getWorkContent()); + d.setWorkContent(s); + d.setGridCode(gridInfo.getCode()); + d.setGridName(gridInfo.getGridName()); + }); + insertNewRecordBatch(data); + midPatrolFormDTO.setPageNo(midPatrolFormDTO.getPageNo() + 1); + } while (data.size() == NumConstant.ONE_THOUSAND); + return true; + } + + /** + * Desc: 数据存入 + * + * @param newEntities + * @author zxc + * @date 2022/7/22 14:17 + */ + @Transactional(rollbackFor = Exception.class) + public void insertGridStaffWorkInfoPY(List newEntities) { + if (!CollectionUtils.isEmpty(newEntities)) { + List> partition = ListUtils.partition(newEntities, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + this.insertBatch(p); + }); + } + } + + private Boolean insertNewRecordBatch(List list) { + List insertList = new ArrayList<>(); + list.forEach(o -> { + if (StringUtils.isBlank(o.getGridCode())) { + return; + } + insertList.add(buildNewEntity(o)); + }); + //insert + if (CollectionUtils.isEmpty(insertList)) { + log.error("新构建要插入的数据为空,param:{}", JSON.toJSONString(list)); + return false; + } + insertGridStaffWorkInfoPY(insertList); + return true; + } + + private GridstaffWorkInfoPingyinEntity buildNewEntity(PatrolRoutineWorkResult record) { + GridstaffWorkInfoPingyinEntity entity = ConvertUtils.sourceToTarget(record, GridstaffWorkInfoPingyinEntity.class); + entity.setQxBm("370124"); + entity.setQxMc("平阴县"); + entity.setHappenTime(DateUtils.parseDate(record.getHappenTime().concat(" 00:00:00"), DateUtils.DATE_PATTERN)); + entity.setWorkResult(NumConstant.ONE == record.getIsNormal() ? "Y" : "N"); + entity.setWorkType(record.getWorkTypeSecondCode()); + entity.setRecoredInsertTime(record.getCreatedTime()); + entity.setUpdateTime(record.getUpdatedTime()); + entity.setId(null); + entity.setIsDel("N"); + return entity; + } + + @NotNull + private PatrolQueryFormDTO buildParam(UpsertPatrolRecordForm patrolRecordForm) { + PatrolQueryFormDTO midPatrolFormDTO = new PatrolQueryFormDTO(); + midPatrolFormDTO.setCustomerId(patrolRecordForm.getCustomerId()); + midPatrolFormDTO.setId(StringUtils.isBlank(patrolRecordForm.getId()) ? "" : patrolRecordForm.getId()); + midPatrolFormDTO.setPageNo(patrolRecordForm.getPageNo()); + midPatrolFormDTO.setPageSize(NumConstant.ONE_THOUSAND); + return midPatrolFormDTO; + } +} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridDailyworkDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridDailyworkDao.xml index 3047bc30c9..da5b05eec7 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridDailyworkDao.xml +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseGridDailyworkDao.xml @@ -3,33 +3,22 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/EventreportPingyinDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/EventreportPingyinDao.xml new file mode 100755 index 0000000000..6688632c7b --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/EventreportPingyinDao.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM eventreport_pingyin + + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridInfoPingyinDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridInfoPingyinDao.xml new file mode 100755 index 0000000000..c2eeb0baa9 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridInfoPingyinDao.xml @@ -0,0 +1,34 @@ + + + + + + + delete from grid_info_pingyin where grid_level !='07' + + + + + delete from grid_info_pingyin where grid_level ='07' + + + + + + update grid_info_pingyin + set grid_name = #{gridName}, + grid_level = #{gridLevel}, + lng = #{lng}, + lat = #{lat}, + update_time = now() + where grid_code = #{gridCode} and is_del = 'N' + + + + update grid_info_pingyin set is_del = 'Y',update_time = now() + where grid_code = #{gridCode} + + diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridstaffInfoPingyinDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridstaffInfoPingyinDao.xml new file mode 100755 index 0000000000..81143e89e0 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridstaffInfoPingyinDao.xml @@ -0,0 +1,38 @@ + + + + + + + UPDATE gridstaff_info_pingyin + SET grid_name = #{gridName}, + nick_name = #{nickName}, + card_num = #{cardNum}, + phonenumber = #{phonenumber}, + sex = #{sex} + WHERE + grid_user_id = #{gridUserId} + AND grid_code = #{gridCode} + + + + delete from gridstaff_info_pingyin + + + + + \ No newline at end of file diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridstaffWorkInfoPingyinDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridstaffWorkInfoPingyinDao.xml new file mode 100755 index 0000000000..ea3bc11030 --- /dev/null +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/GridstaffWorkInfoPingyinDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + delete from gridstaff_work_info_pingyin LIMIT 1000 + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java index 71efe0c029..5f6e2685a3 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/CustomerStaffDTO.java @@ -138,4 +138,10 @@ public class CustomerStaffDTO implements Serializable { * 登录密码 */ private String password; + + /** + * 身份证号 + */ + private String idCard; + } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffUploadtFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffUploadtFormDTO.java new file mode 100644 index 0000000000..78cd488d87 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GridStaffUploadtFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @description: 网格工作人员数据上报-查询客户网格下有效工作人员信息数据 + * @author: sun + */ +@NoArgsConstructor +@Data +public class GridStaffUploadtFormDTO { + + /** + * 客户Id + */ + private String customerId; + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridStaffUploadResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridStaffUploadResultDTO.java new file mode 100644 index 0000000000..35e485df82 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GridStaffUploadResultDTO.java @@ -0,0 +1,58 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.util.Date; + +/** + * @description: 网格工作人员数据上报-查询客户网格下有效工作人员信息数据 + * @author: sun + */ +@Data +public class GridStaffUploadResultDTO { + /** + * 区县系统中的网格员唯一编码 + */ + private String gridUserId; + + /** + * 网格员姓名 + */ + private String nickName; + + /** + * 网格员身份证号码 + */ + private String cardNum; + + /** + * 网格员手机号 + */ + private String phonenumber; + + /** + * 网格员性别,应符合10.31中性别,不要有 其他 + */ + private String sex; + + /** + * 网格员类型,符合《标准》10.3 + */ + private String userType; + + /** + * 网格员信息编辑插入、更新时间,,县市区填写 + */ + private Date updateTime; + + /** + * 是否离职,格式为Y:是、N:否 + */ + private String isLeave; + + /** + * 离职时间,格式为“YYYY-MM-DD” + */ + private Date date; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolRoutineWorkResult.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolRoutineWorkResult.java index d0040279cb..ce558ef5c5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolRoutineWorkResult.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PatrolRoutineWorkResult.java @@ -22,6 +22,8 @@ public class PatrolRoutineWorkResult implements Serializable { private String customerId; private String gridId; + private String gridCode; + private String gridName; private String title; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index d6f6215b11..e37454ed35 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -689,6 +689,9 @@ public interface EpmetUserOpenFeignClient { @PostMapping(value = "/epmetuser/patrolroutinework/selectList") Result> getPatrolRoutineWorkList(@RequestBody PatrolQueryFormDTO patrolQueryFormDTO); + @PostMapping(value = "/epmetuser/patrolroutinework/selectListV2") + Result> getPatrolRoutineWorkListV2(@RequestBody PatrolQueryFormDTO patrolQueryFormDTO); + /** * 获取ic_resi_user * @param icResiUserId @@ -865,4 +868,7 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/customerstaff/edittostaff") Result editToStaff(@RequestBody CustomerStaffDTO formDTO); + + @PostMapping("/epmetuser/customerstaff/customerstaff") + Result> customerStaff(@RequestBody GridStaffUploadtFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index b6133865ad..71711e66a8 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -510,6 +510,11 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getPatrolRoutineWorkList", patrolQueryFormDTO); } + @Override + public Result> getPatrolRoutineWorkListV2(PatrolQueryFormDTO patrolQueryFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getPatrolRoutineWorkListV2", patrolQueryFormDTO); + } + @Override public Result getIcResiUserDTO(String icResiUserId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getIcResiUserDTO", icResiUserId); @@ -661,4 +666,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "editToStaff", formDTO); } + @Override + public Result> customerStaff(GridStaffUploadtFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "customerStaff", formDTO); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index cebe012041..215af4eab1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -43,6 +43,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -221,7 +222,9 @@ public class CustomerStaffController { if (result.success()) { OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); mq.setCustomerId(fromDTO.getCustomerId()); - mq.setOrgId(result.getData().getUserId()); + List st = new ArrayList<>(); + st.add(result.getData().getUserId()); + mq.setStaffIdList(st); mq.setOrgType("staff"); mq.setType("staff_create"); SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); @@ -245,7 +248,9 @@ public class CustomerStaffController { if (result.success()) { OrgOrStaffMQMsg mq = new OrgOrStaffMQMsg(); mq.setCustomerId(fromDTO.getCustomerId()); - mq.setOrgId(fromDTO.getStaffId()); + List st = new ArrayList<>(); + st.add(fromDTO.getStaffId()); + mq.setStaffIdList(st); mq.setOrgType("staff"); mq.setType("staff_change"); SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendOrgStaffMqMsg(mq); @@ -510,5 +515,14 @@ public class CustomerStaffController { return new Result(); } + /** + * @Author sun + * @Description 网格工作人员数据上报-查询客户网格下有效工作人员信息数据 + **/ + @PostMapping(value = "customerstaff") + public Result> customerStaff(@RequestBody GridStaffUploadtFormDTO formDTO) { + return new Result>().ok(customerStaffService.customerStaff(formDTO)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java index f018a32789..d004630d41 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/PatrolRoutineWorkController.java @@ -47,6 +47,13 @@ public class PatrolRoutineWorkController { Page data = gridUserWorkService.listPage(formDTO); return new Result().ok(data.getResult()); } + + @NoRepeatSubmit + @PostMapping("selectListV2") + public Result> gridUserWorkV2(@RequestBody PatrolQueryFormDTO formDTO){ + Page data = gridUserWorkService.listPage(formDTO); + return new Result().ok(data.getResult()); + } /** * @Description 添加例行工作 * @param formDTO diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index 3cce3ff4b6..b34065223f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -230,5 +230,7 @@ public interface CustomerStaffDao extends BaseDao { **/ List gridStaffMobileList(List staffIdList); + List getStaffByCustomerId(@Param("customerId") String customerId); + void edit(CustomerStaffDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java index 86bedb482c..690bf326c2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/CustomerStaffEntity.java @@ -101,4 +101,9 @@ public class CustomerStaffEntity extends BaseEpmetEntity { * 登录密码 */ private String password; + + /** + * 身份证号 + */ + private String idCard; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index 6e6000b6db..f6ca859101 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -353,4 +353,6 @@ public interface CustomerStaffService extends BaseService { Result deptToAddStaff(StaffSubmitFromDTO fromDTO); void editToStaff(CustomerStaffDTO formDTO); + + List customerStaff(GridStaffUploadtFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index ea686ef3c8..0acbb46a51 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -915,4 +915,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerStaff(GridStaffUploadtFormDTO formDTO) { + //1.查询客户下有效工作人员信息 + return baseDao.getStaffByCustomerId(formDTO.getCustomerId()); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 62a9312c6d..c8eba6538b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -471,4 +471,23 @@ AND user_id = #{userId} + +