From 508caf19c97921f7345636d10c9660037e09cd9b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 22 Jul 2022 15:42:06 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8A=BD=E5=8F=96=E5=88=B0pingyin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/org/result/CustomerAgencyDTO.java | 10 ++ .../feign/DataStatisticalOpenFeignClient.java | 4 +- .../resources/mapper/org/CustomerGridDao.xml | 2 + .../mapper/org/StatsCustomerAgencyDao.xml | 2 + .../form/ExractGridInfoPingYinFormDTO.java | 38 ++++ .../controller/GridInfoPingyinController.java | 39 +++-- .../opendata/dao/GridInfoPingyinDao.java | 17 +- .../OpenDataOrgChangeEventListener.java | 30 +++- .../service/GridInfoPingyinService.java | 15 +- .../impl/GridInfoPingyinServiceImpl.java | 164 ++++++++++++++++++ .../resources/mapper/GridInfoPingyinDao.xml | 21 +++ 11 files changed, 318 insertions(+), 24 deletions(-) create mode 100644 epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/ExractGridInfoPingYinFormDTO.java 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/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 67f56957dc..1c865240ea 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,8 +36,8 @@ 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) +@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 { /** 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..8622167974 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 @@ -160,6 +160,8 @@ customer_grid WHERE del_flag = '0' AND customer_id = #{customerId} + and CODE is not null + and CODE !='' #{gridId} 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..105a4efcc7 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 @@ -216,6 +216,8 @@ customer_agency WHERE del_flag = '0' AND customer_id = #{customerId} + and CODE is not null + and CODE !='' #{agencyId} 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..d57c25a387 --- /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,38 @@ +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】 + */ + @NotBlank(message = "操作类型【新增:add 修改删除:edit 初始化所有数据:all】不能为空", groups = {GridInfo.class}) + private String type; +} + 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 index 26e84cad1a..2a1ac80444 100755 --- 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 @@ -1,19 +1,14 @@ 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 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.*; - -import javax.servlet.http.HttpServletResponse; -import java.util.Map; +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; /** @@ -26,6 +21,28 @@ import java.util.Map; @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/dao/GridInfoPingyinDao.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/GridInfoPingyinDao.java index fc6be9e1db..e070cc30ce 100755 --- 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 @@ -3,6 +3,10 @@ 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; /** * 平阴区网格表 @@ -12,5 +16,16 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface GridInfoPingyinDao extends BaseDao { - + + int deleteAllAgencyData(); + + int deleteAllGridData(); + + List selectByGridCode(String gridCode); + + int updateSomeCol(@Param("id") Long id, + @Param("gridName")String gridName, + @Param("gridLevel")Integer gridLevel, + @Param("lng")BigDecimal lng, + @Param("lat")BigDecimal lat); } \ No newline at end of file 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..02fc563a78 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,31 @@ 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); + 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/service/GridInfoPingyinService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/GridInfoPingyinService.java index 096739ee37..3feaabc3eb 100755 --- 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 @@ -1,10 +1,9 @@ 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; -import java.util.Map; - /** * 平阴区网格表 * @@ -12,5 +11,17 @@ import java.util.Map; * @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/impl/GridInfoPingyinServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridInfoPingyinServiceImpl.java index 2e0574706a..d9e505adef 100755 --- 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 @@ -1,11 +1,27 @@ package com.epmet.opendata.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.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.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.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + /** * 平阴区网格表 @@ -15,5 +31,153 @@ import org.springframework.stereotype.Service; */ @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); + 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()); + if ("district".equals(ag.getLevel())) { + entity.setGridLevel(3); + } else if ("street".equals(ag.getLevel())) { + entity.setGridLevel(4); + } else if ("community".equals(ag.getLevel())) { + entity.setGridLevel(6); + } + entity.setLat(new BigDecimal(ag.getLatitude())); + entity.setLng(new BigDecimal(ag.getLongitude())); + gridInfoList.add(entity); + }); + // 3、初始化传all;新增或者编辑 + if ("all".equals(formDTO.getType())) { + // 全删,全增 + baseDao.deleteAllAgencyData(); + // 一次100 + List> partition = ListUtils.partition(gridInfoList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + this.insertBatch(list); + }); + + } else if ("add".equals(formDTO.getType())) { + // 单独新增组织 + this.insertBatch(gridInfoList); + + } else if ("edit".equals(formDTO.getType())) { + // 修改组织时,先根据code查询,如果有数据,更新 + for (GridInfoPingyinEntity entity : gridInfoList) { + + List orginList = baseDao.selectByGridCode(entity.getGridCode()); + + if (CollectionUtils.isNotEmpty(orginList)) { + + // 更新网格名称、网格层级、网格中心点的经度,网格中心点纬度 + for (GridInfoPingyinEntity oigin : orginList) { + baseDao.updateSomeCol(oigin.getId(), entity.getGridName(), entity.getGridLevel(), entity.getLng(), entity.getLat()); + } + + } else { + // 插入 + baseDao.insert(entity); + } + } + } + + } + + /** + * 抽取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); + 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(7); + 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 ("all".equals(formDTO.getType())) { + // 全删,全增 + baseDao.deleteAllGridData(); + // 一次100 + List> partition = ListUtils.partition(gridInfoList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + this.insertBatch(list); + }); + } else if ("add".equals(formDTO.getType())) { + // 单独新增组织 + this.insertBatch(gridInfoList); + + } else if ("edit".equals(formDTO.getType())) { + // 修改组织时,先根据code查询,如果有数据,更新 + for (GridInfoPingyinEntity entity : gridInfoList) { + + List orginList = baseDao.selectByGridCode(entity.getGridCode()); + + if (CollectionUtils.isNotEmpty(orginList)) { + + // 更新网格名称、网格层级、网格中心点的经度,网格中心点纬度 + for (GridInfoPingyinEntity oigin : orginList) { + baseDao.updateSomeCol(oigin.getId(), entity.getGridName(), entity.getGridLevel(), entity.getLng(), entity.getLat()); + } + + } else { + // 插入 + baseDao.insert(entity); + } + } + } + + } + } \ 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 index 3cb20d2d76..fd75c023f0 100755 --- 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 @@ -22,5 +22,26 @@ + + delete from grid_info_pingyin where grid_level !='7' + + + + delete from grid_info_pingyin where grid_level ='7' + + + + + + update grid_info_pingyin + set grid_name = #{gridName}, + grid_level = #{gridLevel}, + lng = #{lng}, + lat = #{lat} + where id = #{id} + \ No newline at end of file From 1846909e2b8de063627a64308583773459e72d46 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 22 Jul 2022 15:43:25 +0800 Subject: [PATCH 02/12] DataStatisticalOpenFeignClient --- .../java/com/epmet/feign/DataStatisticalOpenFeignClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 1c865240ea..7bdcd41b37 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,8 +36,8 @@ import java.util.List; * @author: jianjun liu */ //url="http://localhost:8108" -@FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallbackFactory = DataStatisticalOpenFeignClientFallBackFactory.class, url = "http://localhost:8108") -// @FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallbackFactory = DataStatisticalOpenFeignClientFallBackFactory.class) +// @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 { /** From 4f55bf2bbbc7ef6bf7b0c38b77c35abb76988f20 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 22 Jul 2022 15:52:16 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E6=96=B0=E7=89=88=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E7=AC=AC=E4=B8=89=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/basereport/form/EventInfoFormDTO.java | 7 + .../feign/DataStatisticalOpenFeignClient.java | 3 +- ...ataStatisticalOpenFeignClientFallBack.java | 5 + .../controller/DataReportingController.java | 5 +- .../screen/ScreenProjectDataDao.java | 1 + .../epmet/service/DataReportingService.java | 9 ++ .../screen/ScreenProjectDataService.java | 2 +- .../impl/ScreenProjectDataServiceImpl.java | 5 + .../impl/DataReportingServiceImpl.java | 63 +++++++++ .../screen/ScreenProjectDataDao.xml | 74 +++++++++++ .../EventreportPingyinController.java | 34 +++-- .../opendata/dao/EventreportPingyinDao.java | 2 +- .../OpenDataProjectChangeEventListener.java | 5 +- .../service/EventreportPingyinService.java | 9 ++ .../impl/EventreportPingyinServiceImpl.java | 125 ++++++++++++++++++ .../mapper/EventreportPingyinDao.xml | 3 + 16 files changed, 333 insertions(+), 19 deletions(-) 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/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 7bdcd41b37..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 @@ -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..36a31e24cc 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 查询网格下的项目分类 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..f611edf8f7 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 @@ -309,6 +309,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..9501d90fd6 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 @@ -201,12 +201,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.getProjectList(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(); //如果是孔村、榆山、锦水的项目需要关联分类字典表 @@ -333,4 +393,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..68e2d9d27f 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 '370124' AS qxBm, + '平阴县' AS qxMc, + w.SECOND_WORK_TYPE AS workType, + w.GRID_ID, + w.GRID_NAME, + concat(w.HAPPEN_TIME,' 00:00:00') as happenTimeString, + w.WORK_RESULT, + w.WORK_CONTENT, + w.update_time, + w.create_time as recoredInsertTime + FROM base_grid_dailywork w + WHERE w.CUSTOMER_ID = #{customerId} + ORDER BY w.CREATE_TIME ASC + LIMIT #{size},1000 + 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 index 44396702fc..ea3bc11030 100755 --- 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 @@ -18,6 +18,9 @@ + + delete from gridstaff_work_info_pingyin LIMIT 1000 + \ No newline at end of file From fa20c3cbee39c1521527833bf719045654ebe8af Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 22 Jul 2022 16:23:05 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E4=B8=8D=E5=90=8C=E6=AD=A5=E4=B8=93?= =?UTF-8?q?=E5=B1=9E=E7=BD=91=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/org/CustomerGridDao.xml | 1 + 1 file changed, 1 insertion(+) 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 8622167974..5d6dc4042c 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 @@ -162,6 +162,7 @@ AND customer_id = #{customerId} and CODE is not null and CODE !='' + and grid_name not like '%专属网格' #{gridId} From ecf1072176a09418969c22f93c2bec9666a59731 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 22 Jul 2022 16:41:44 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E4=BE=8B=E8=A1=8C=E5=B7=A5=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../opendata/service/impl/BaseGridDailyworkServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java index 6c2e15dbe2..9542670330 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseGridDailyworkServiceImpl.java @@ -189,7 +189,7 @@ public class BaseGridDailyworkServiceImpl extends BaseServiceImpl Date: Fri, 22 Jul 2022 16:45:45 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E6=96=B0=E7=89=88=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E7=AC=AC=E4=B8=89=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/DataReportingServiceImpl.java | 1 + .../service/impl/EventreportPingyinServiceImpl.java | 8 ++++++++ 2 files changed, 9 insertions(+) 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 344911d767..22a853c0ed 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 @@ -350,6 +350,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; } 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 index ca06381b14..082b46ae5d 100755 --- 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 @@ -93,6 +93,14 @@ public class EventreportPingyinServiceImpl extends BaseServiceImpl(); + staffWrapper.eq(GridstaffInfoPingyinEntity::getGridCode, item.getOrgCode()); + staffList = gridstaffInfoPingyinDao.selectList(staffWrapper); + if (CollectionUtils.isNotEmpty(staffList)) { + entity.setGridUserCardid(staffList.get(NumConstant.ZERO).getCardNum()); + entity.setGridUserName(staffList.get(NumConstant.ZERO).getNickName()); + } } entity.setReportTime(item.getReportTime()); From 56c91544f17ec85373878c300fd17417ba91a971 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 22 Jul 2022 16:53:24 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E6=96=B0=E7=89=88=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E7=AC=AC=E4=B8=89=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/EventreportPingyinServiceImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 index 082b46ae5d..5c097e2a54 100755 --- 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 @@ -98,8 +98,13 @@ public class EventreportPingyinServiceImpl extends BaseServiceImpl Date: Fri, 22 Jul 2022 16:55:46 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=91=98=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=8A=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/feign/GovOrgOpenFeignClient.java | 2 +- .../epmet/feign/fallback/GovOrgOpenFeignClientFallback.java | 2 +- .../com/epmet/controller/CustomerStaffGridController.java | 6 +++--- .../java/com/epmet/service/CustomerStaffGridService.java | 2 +- .../epmet/service/impl/CustomerStaffGridServiceImpl.java | 3 ++- .../src/main/resources/mapper/CustomerStaffGridDao.xml | 2 +- .../service/impl/GridstaffInfoPingyinServiceImpl.java | 4 ++-- 7 files changed, 11 insertions(+), 10 deletions(-) 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 8ffbd28528..8967a44663 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 @@ -696,7 +696,7 @@ public interface GovOrgOpenFeignClient { @PostMapping("/gov/org/coverage/dictinit/{customerId}") Result dictInit(@PathVariable(value = "customerId") String customerId); - @PostMapping("/gov/org/customerstaffgrid/gridstaff") + @PostMapping("/gov/org/customerstaffgrid/gridstafflist") Result> gridStaff(CustomerGridStaffListFormDTO dto); } 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 c64544ef0f..9f16e0dc8e 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 @@ -447,7 +447,7 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { @Override public Result> gridStaff(CustomerGridStaffListFormDTO dto) { - return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridStaff", 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/CustomerStaffGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffGridController.java index 392594a1da..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 @@ -161,8 +161,8 @@ public class CustomerStaffGridController { * @Author sun * @Description 网格下工作人员列表 **/ - @PostMapping(value = "gridstaff") - public Result> gridStaff(@RequestBody CustomerGridStaffListFormDTO formDTO) { - return new Result>().ok(customerStaffGridService.gridStaff(formDTO)); + @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/service/CustomerStaffGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffGridService.java index 899256eaf4..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 @@ -144,5 +144,5 @@ public interface CustomerStaffGridService extends BaseService getAllStaffByGridId(String gridId); - List gridStaff(CustomerGridStaffListFormDTO formDTO); + List gridStaffList(CustomerGridStaffListFormDTO formDTO); } 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 c80d01bb9e..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 @@ -206,7 +206,8 @@ public class CustomerStaffGridServiceImpl extends BaseServiceImpl gridStaff(CustomerGridStaffListFormDTO formDTO) { + public List gridStaffList(CustomerGridStaffListFormDTO formDTO) { + //查询客户下未被禁用的工作人员基本信息 return baseDao.getGridStaffByCustomerId(formDTO.getCustomerId()); } 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 1cca1f20a0..a6569342fd 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 @@ -205,7 +205,7 @@ a.user_id gridUserId FROM customer_staff_grid a - INNER JOIN customer_grid b ON a.grid_id = b.id AND b.del_flag = '0' + INNER JOIN customer_grid b ON a.grid_id = b.id AND b.del_flag = '0' AND b.`code` is not null WHERE a.del_flag = '0' AND a.customer_id = #{customerId} 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 index f8d7b78a79..9af3b733fa 100755 --- 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 @@ -44,7 +44,7 @@ public class GridstaffInfoPingyinServiceImpl extends BaseServiceImpl> orgList = govOrgOpenFeignClient.gridStaff(org); @@ -53,7 +53,7 @@ public class GridstaffInfoPingyinServiceImpl extends BaseServiceImpl> userList = epmetUserOpenFeignClient.customerStaff(user);