From 332f1541309bc0a3b8c5ca9707f0c81204555a4d Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 16 Mar 2022 10:46:34 +0800 Subject: [PATCH 01/14] =?UTF-8?q?mq=E5=8F=82=E6=95=B0bug=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../opendata/mq/listener/OpenDataOrgChangeEventListener.java | 1 + .../opendata/mq/listener/OpenDataStaffChangeEventListener.java | 1 + 2 files changed, 2 insertions(+) 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 7c0989aa64..928489f8b0 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 @@ -83,6 +83,7 @@ public class OpenDataOrgChangeEventListener implements MessageListenerConcurrent 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 { 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 96f0301bb7..ad7bd79b62 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 @@ -85,6 +85,7 @@ public class OpenDataStaffChangeEventListener implements MessageListenerConcurre dto.setType(obj.getType()); List staffIdList = new ArrayList<>(); staffIdList.add(obj.getOrgId()); + dto.setStaffIdList(staffIdList); SpringContextUtils.getBean(ExUserService.class).getStaffBaseInfo(dto); } catch (RenException e) { // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 From 3c0e86430bcf77fa7285a5c589877eddf775ecbf Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 16 Mar 2022 14:40:37 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E7=BB=84=E7=BB=87=E3=80=81=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=95=B0=E6=8D=AE=E5=90=8C=E6=AD=A5=E4=B8=AD=E4=BB=8B?= =?UTF-8?q?=E5=BA=93=E8=A1=A8=E5=AD=97=E6=AE=B5=E5=8F=98=E5=8A=A8=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/ExDeptDao.xml | 10 +++++----- .../src/main/resources/mapper/ExUserDao.xml | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml index 0d7af2fa2b..0de6a47003 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExDeptDao.xml @@ -10,7 +10,7 @@ - when qx_dept_name = #{item.qxDeptName} then #{item.qxDeptId} + when dept_name = #{item.qxDeptName} then #{item.qxDeptId} @@ -18,7 +18,7 @@ - when qx_dept_name = #{item.qxDeptName} then #{item.qxDeptId} + when dept_name = #{item.qxDeptName} then #{item.qxDeptName} @@ -26,7 +26,7 @@ - when qx_dept_name = #{item.qxDeptName} then #{item.qxDeptCode} + when dept_name = #{item.qxDeptName} then #{item.qxDeptCode} @@ -34,7 +34,7 @@ - when qx_dept_name = #{item.qxDeptName} then #{item.qxCustomerId} + when dept_name = #{item.qxDeptName} then #{item.qxCustomerId} @@ -43,7 +43,7 @@ WHERE 1=1 - qx_dept_name = #{item.qxDeptName} + dept_name = #{item.qxDeptName} diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExUserDao.xml b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExUserDao.xml index 3d904577fd..c56d93b581 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExUserDao.xml +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/ExUserDao.xml @@ -7,10 +7,18 @@ UPDATE ex_user + + + + when (login_name = #{item.qxMobile} ) then #{item.qxUserId} + + + + - when (qx_user_id = #{item.qxUserId} ) then #{item.qxUserName} + when (login_name = #{item.qxMobile} ) then #{item.qxUserName} @@ -18,7 +26,7 @@ - when (qx_user_id = #{item.qxUserId} ) then #{item.qxMobile} + when (login_name = #{item.qxMobile} ) then #{item.qxMobile} @@ -26,7 +34,7 @@ - when (qx_user_id = #{item.qxUserId} ) then #{item.qxCustomerId} + when (login_name = #{item.qxMobile} ) then #{item.qxCustomerId} @@ -34,7 +42,7 @@ WHERE 1=1 - (qx_user_id = #{item.qxUserId} ) + (login_name = #{item.qxMobile} ) From b7abc3eb1c64bb855a96ad18a7b77bb57787519f Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 16 Mar 2022 15:26:02 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/org/CustomerStaffGridDTO.java | 2 +- .../com/epmet/controller/DemoController.java | 11 +++ .../FactOriginProjectMainDailyDao.java | 10 +++ .../screen/ScreenProjectDataDao.java | 10 +++ .../com/epmet/dao/project/ProjectDao.java | 10 +++ .../com/epmet/service/HistoryDataService.java | 19 +++++ .../FactOriginProjectMainDailyService.java | 10 +++ ...FactOriginProjectMainDailyServiceImpl.java | 16 ++++ .../screen/ScreenProjectDataService.java | 10 +++ .../impl/ScreenProjectDataServiceImpl.java | 15 ++++ .../service/impl/HistoryDataServiceImpl.java | 75 +++++++++++++++++++ .../epmet/service/project/ProjectService.java | 10 +++ .../project/impl/ProjectServiceImpl.java | 16 ++++ .../extract/FactOriginProjectMainDailyDao.xml | 14 ++++ .../screen/ScreenProjectDataDao.xml | 15 ++++ .../resources/mapper/org/CustomerGridDao.xml | 1 + .../resources/mapper/project/ProjectDao.xml | 12 +++ 17 files changed, 255 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/HistoryDataService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/HistoryDataServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/CustomerStaffGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/CustomerStaffGridDTO.java index b792e6ea15..3e318c72d4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/CustomerStaffGridDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/CustomerStaffGridDTO.java @@ -20,7 +20,6 @@ package com.epmet.dto.org; import lombok.Data; import java.io.Serializable; -import java.util.Date; /** @@ -46,6 +45,7 @@ public class CustomerStaffGridDTO implements Serializable { * 网格ID */ private String gridId; + private String gridName; /** * 上级组织ID */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 84cb0c6964..b84b8bc30b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -41,6 +41,7 @@ import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimCustomerEntity; import com.epmet.entity.stats.DimDateEntity; import com.epmet.entity.stats.DimMonthEntity; +import com.epmet.service.HistoryDataService; import com.epmet.service.StatsDemoService; import com.epmet.service.StatsPartyMemberVanguardService; import com.epmet.service.evaluationindex.extract.dataToIndex.*; @@ -60,6 +61,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; @@ -139,6 +141,8 @@ public class DemoController { private DimCustomerService dimCustomerService; @Autowired private ScreenProjectDataService screenProjectDataService; + @Resource + private HistoryDataService historyDataService; @GetMapping("testAlarm") public void testAlarm() { @@ -1139,4 +1143,11 @@ public class DemoController { long l = (end - start) / 1000; return new Result().ok("gridAndOrgDaily耗时" + l+ "s"); } + + + @PostMapping("projectHistoryData") + public Result projectHistoryData(@RequestBody ExtractOriginFormDTO formDTO) { + historyDataService.projectAddGridId(formDTO.getCustomerId()); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index 7d1c6903ab..66d2d286f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -23,6 +23,7 @@ import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.TransferRightRatioResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.pingyin.result.*; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; @@ -550,4 +551,13 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getMemberProjectCount(@Param("customerId") String customerId, @Param("dateId") String dateId); + /** + * 更新历史数据 + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/3/16 9:48 + */ + void updateHistoryData(CustomerStaffGridDTO dto); + } 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 bf82610651..db2b42ba5b 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 @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.result.DataCheckDTO; import com.epmet.dto.screen.result.GridAndOrgCategoryCountResultDTO; @@ -122,4 +123,13 @@ public interface ScreenProjectDataDao extends BaseDao { * @Date 2022/3/7 16:00 */ List getCheckResult(ExtractOriginFormDTO formDTO); + + /** + * 更新历史数据 + * @Param list + * @Return + * @Author zhaoqifeng + * @Date 2022/3/16 9:48 + */ + void updateHistoryData(CustomerStaffGridDTO dto); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index e154508f30..5930a90611 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ProjectDTO; +import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.project.*; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.project.ProjectEntity; @@ -204,4 +205,13 @@ public interface ProjectDao extends BaseDao { * @return */ List getEventList(@Param("customerId") String customerId, @Param("projectId") String projectId); + + /** + * 更新历史数据 + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/3/16 9:48 + */ + void updateHistoryData(CustomerStaffGridDTO dto); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/HistoryDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/HistoryDataService.java new file mode 100644 index 0000000000..f2ac7a321d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/HistoryDataService.java @@ -0,0 +1,19 @@ +package com.epmet.service; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2022/3/15 10:09 + */ +public interface HistoryDataService { + /** + * 网格员立项来源改为work_event + * + * @Param customerId + * @Return + * @Author zhaoqifeng + * @Date 2022/3/15 10:13 + */ + void projectAddGridId(String customerId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 6e1268f727..965b6536db 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -23,6 +23,7 @@ import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.TransferRightRatioResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.pingyin.result.*; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; @@ -490,4 +491,13 @@ public interface FactOriginProjectMainDailyService extends BaseService> */ Map> getMemberProjectCount(String customerId, String dateId, Integer type); + + /** + * 更新项目表历史数据 + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/3/16 9:46 + */ + void updateHistoryData(CustomerStaffGridDTO dto); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index a307aaf171..d0ee740780 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -31,6 +31,7 @@ import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.TransferRightRatioResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.pingyin.result.*; import com.epmet.dto.result.CostDayResultDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; @@ -44,6 +45,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; 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.math.BigDecimal; @@ -734,5 +736,19 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl staffGridList = customerGridService.getCustomerStaffGridList(customerId); + List staffInfoList = userService.getStaffByRoleKey(customerId, RoleKeyConstants.ROLE_KEY_GRID_MEMBER); + if (CollectionUtils.isEmpty(staffGridList) || CollectionUtils.isEmpty(staffInfoList)) { + return; + } + Map staffMap = staffInfoList.stream().collect(Collectors.toMap(StaffRoleInfoDTO :: getStaffId, + Function.identity())); + List list = staffGridList.stream().filter(p -> null != staffMap.get(p.getStaffId())).map(item -> { + StaffRoleInfoDTO staffInfo = staffMap.get(item.getStaffId()); + CustomerStaffGridDTO dto = ConvertUtils.sourceToTarget(item, CustomerStaffGridDTO.class); + dto.setStaffId(staffInfo.getStaffId()); + return dto; + }).collect(Collectors.toList()); + + list.forEach(part -> { + //更新project表 + projectService.updateHistoryData(part); + //更新fact_origin_project_main_daily + factOriginProjectMainDailyService.updateHistoryData(part); + //更新screen_project_data + screenProjectDataService.updateHistoryData(part); + }); + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index 23367bfa06..bd8584c7c1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -20,6 +20,7 @@ package com.epmet.service.project; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.ProjectDTO; +import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; import com.epmet.dto.project.ResiEventDTO; @@ -204,4 +205,13 @@ public interface ProjectService extends BaseService { * @return */ Map getEventList(String customerId, String projectId); + + /** + * 更新项目表历史数据 + * @Param dto + * @Return + * @Author zhaoqifeng + * @Date 2022/3/16 9:46 + */ + void updateHistoryData(CustomerStaffGridDTO dto); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index 9b409ce75f..75cd4ff714 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectDao; import com.epmet.dto.ProjectDTO; +import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.project.*; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; @@ -31,6 +32,7 @@ import com.epmet.service.project.ProjectService; import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; @@ -263,5 +265,19 @@ public class ProjectServiceImpl extends BaseServiceImpl + + + UPDATE + fact_origin_project_main_daily + SET + ORIGIN = 'work_event', + ORIGIN_ID = #{gridId}, + GRID_ID = #{gridId} + WHERE + PROJECT_CREATOR = #{staffId} + AND CUSTOMER_ID = #{customerId} + AND AGENCY_ID = #{agencyId} + AND ORIGIN = 'agency' + 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 95c907ce97..51f9a0fcb6 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 @@ -458,4 +458,19 @@ AGENCY_ID, DATE_ID DESC + + + UPDATE + screen_project_data + SET + ORIGIN = 'work_event', + ORG_TYPE = 'grid', + ORG_ID = #{gridId}, + ORG_NAME = #{gridName} + WHERE + PROJECT_CREATOR = #{staffId} + AND CUSTOMER_ID = #{customerId} + AND ORG_ID = #{agencyId} + AND ORIGIN = 'agency' + 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 adcaf8e50d..e6cd7f3321 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 @@ -120,6 +120,7 @@ ca.PID, cg.PIDS, csg.GRID_ID, + cg.GRID_NAME, csg.USER_ID AS staffId FROM customer_staff_grid csg diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 7b92a7b440..f309d79bf4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -268,4 +268,16 @@ and rero.CUSTOMER_ID = #{customerId} + + UPDATE + project + SET + ORIGIN = 'work_event', + ORIGIN_ID = #{gridId} + WHERE + CREATED_BY = #{staffId} + AND CUSTOMER_ID = #{customerId} + AND AGENCY_ID = #{agencyId} + AND ORIGIN = 'agency' + From 630ff1508f45d0912497b22f9ce31410d84b47b3 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 16 Mar 2022 17:33:07 +0800 Subject: [PATCH 04/14] . --- .../main/java/com/epmet/controller/MemoDifficultyController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/MemoDifficultyController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/MemoDifficultyController.java index 07fca9ad3c..def6d05162 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/MemoDifficultyController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/MemoDifficultyController.java @@ -92,6 +92,7 @@ public class MemoDifficultyController { @PostMapping("detail") public Result detail(@RequestBody MemoDifficultyDetailFromDTO fromDTO){ + ValidatorUtils.validateEntity(fromDTO, MemoDifficultyDetailFromDTO.Detail.class); return new Result().ok(memoDifficultyService.detail(fromDTO)); } From a7359ba6629ba96e23e03c040eaaa1ec0cdd868e Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 16 Mar 2022 20:22:50 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/GridController.java | 11 ----------- 1 file changed, 11 deletions(-) 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 0c1470d26f..20c4dd4aef 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 @@ -241,15 +241,4 @@ public class GridController { return new Result(); } - /** - * desc:移除网格内的工作人员关系 并迁移到组织 - * @author jianjun liu - * @remark: 如果是网格添加的则解除关系后将注册关系改为对应的组织 如果不是则直接解除关系(相当于移除该人员与网格的关系) - */ - @PostMapping("removeGridStaff2Agency/{gridId}") - //@RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_TRANSFER) - public Result removeGridStaff2Agency( @PathVariable String gridId){ - customerGridService.abandonGridForDealBizData(gridId); - return new Result(); - } } From 814a2e339616526d238bc7c861f85ea230af0143 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 16 Mar 2022 20:39:46 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E5=BC=83=E7=94=A8=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CustomerGridServiceImpl.java | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) 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 87b3c6163e..f57f99bcdf 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 @@ -972,7 +972,6 @@ public class CustomerGridServiceImpl extends BaseServiceImpl updateGrid=new LambdaUpdateWrapper<>(); - updateGrid.set(CustomerGridEntity::getAbandonFlag,true); - updateGrid.eq(CustomerGridEntity::getId,formDTO.getGridId()); - baseDao.update(null,updateGrid); CustomerOrgRedis.delGridInfo(formDTO.getGridId()); } @@ -1014,24 +1005,28 @@ public class CustomerGridServiceImpl extends BaseServiceImpl updateList = new ArrayList<>(); staffList.forEach(staffOrg->{ - if(OrgTypeEnum.GRID.getCode().equals(staffOrg.getOrgType())){ - StaffOrgRelationEntity entity = new StaffOrgRelationEntity(); - entity.setId(staffOrg.getId()); - entity.setOrgType(OrgTypeEnum.AGENCY.getCode()); - GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(staffOrg.getOrgId()); - if (gridInfo == null || StringUtils.isBlank(gridInfo.getPid())){ - log.error("abandonGridForDealBizData agencyId:{} is not exist",gridInfo.getPid()); - return; - } - entity.setOrgId(gridInfo.getPid()); - updateList.add(entity); + //只有工作人员是网格添加的才处理 + if(!OrgTypeEnum.GRID.getCode().equals(staffOrg.getOrgType())) { + return; + } + StaffOrgRelationEntity entity = new StaffOrgRelationEntity(); + entity.setId(staffOrg.getId()); + entity.setOrgType(OrgTypeEnum.AGENCY.getCode()); + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(staffOrg.getOrgId()); + if (gridInfo == null || StringUtils.isBlank(gridInfo.getPid())) { + assert gridInfo != null; + log.error("abandonGridForDealBizData grid:{} pid is not exist", JSON.toJSONString(gridInfo)); + return; } + entity.setOrgId(gridInfo.getPid()); + updateList.add(entity); }); //更新工作人员组织关系 String customerId = staffList.get(NumConstant.ZERO).getCustomerId(); updateGridStaff2Agency(customerId,gridId, staffList, updateList); //清空工作人员缓存 staffList.forEach(staff->CustomerStaffRedis.delStaffInfoFormCache(customerId,staff.getStaffId())); + } catch (Exception e) { log.error("abandonGridForDealBizData exception", e); throw e; @@ -1051,11 +1046,18 @@ public class CustomerGridServiceImpl extends BaseServiceImpl badgeResult = epmetUserFeignClient.deleteBadgeCertificateAuditing(customerId,gridId); if (badgeResult == null || !badgeResult.success()){ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"删除未审核徽章失败,请稍后重试"); } + + //处理成功,隐藏网格 + LambdaUpdateWrapper updateGrid=new LambdaUpdateWrapper<>(); + updateGrid.set(CustomerGridEntity::getAbandonFlag,true); + updateGrid.eq(CustomerGridEntity::getId,gridId); + baseDao.update(null,updateGrid); } } From 0702034ca76db3300651e5512ba22daef47cbbc8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 16 Mar 2022 21:03:46 +0800 Subject: [PATCH 07/14] =?UTF-8?q?"modify-reg-grid"=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=BD=91=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/EpmetHeartOpenFeignClient.java | 8 ++ .../EpmetHeartOpenFeignClientFallback.java | 11 ++ .../controller/ResiVolunteerController.java | 11 ++ .../java/com/epmet/dao/VolunteerInfoDao.java | 7 ++ .../epmet/service/VolunteerInfoService.java | 6 ++ .../impl/VolunteerInfoServiceImpl.java | 10 ++ .../resources/mapper/VolunteerInfoDao.xml | 13 +++ .../epmet/dto/form/ModifyRegGridFormDTO.java | 26 +++++ .../com/epmet/controller/UserController.java | 16 +++ .../java/com/epmet/service/UserService.java | 6 ++ .../epmet/service/impl/UserServiceImpl.java | 101 ++++++++++++++++-- 11 files changed, 208 insertions(+), 7 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ModifyRegGridFormDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index 1a3f20439a..25cf270549 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -84,4 +84,12 @@ public interface EpmetHeartOpenFeignClient { */ @PostMapping("/heart/resi/volunteer/count") Result getVolunteerCount(@RequestBody VolunteerCommonFormDTO input); + + /** + * 修改志愿者的注册网格 + * @param volunteerInfoDTO + * @return + */ + @PostMapping("/heart/resi/volunteer/modifyVolunteerGrid") + Result modifyVolunteerGrid(@RequestBody VolunteerInfoDTO volunteerInfoDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java index aab5bdb70d..06bdc642c9 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java @@ -77,4 +77,15 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli public Result getVolunteerCount(VolunteerCommonFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getVolunteerCount", input); } + + /** + * 修改志愿者的注册网格 + * + * @param volunteerInfoDTO + * @return + */ + @Override + public Result modifyVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "modifyVolunteerGrid", volunteerInfoDTO); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java index 39da0690af..410cbdf981 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -159,4 +159,15 @@ public class ResiVolunteerController { Integer volunteerCount = volunteerInfoService.getVolunteerCount(customerId, agencyId); return new Result().ok(volunteerCount); } + + /** + * 修改志愿者注册信息_的网格信息 + * @param volunteerInfoDTO + * @return + */ + @PostMapping("modifyVolunteerGrid") + public Result modifyVolunteerGrid(@RequestBody VolunteerInfoDTO volunteerInfoDTO){ + volunteerInfoService.modifyVolunteerGrid(volunteerInfoDTO); + return new Result(); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java index ab0b65bf9c..2aa3afa166 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java @@ -74,4 +74,11 @@ public interface VolunteerInfoDao extends BaseDao { * @date 2020.08.13 10:06 **/ List selectVolunteerIds(@Param("customerId")String customerId); + + /** + * 修改志愿者注册信息_网格信息 + * @param volunteerInfoDTO + * @return + */ + int updateVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java index f9db916bbe..7cd4d30769 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java @@ -111,4 +111,10 @@ public interface VolunteerInfoService extends BaseService { * @return */ Integer getVolunteerCount(String customerId, String agencyId); + + /** + * 修改志愿者注册信息_的网格信息 + * @param volunteerInfoDTO + */ + void modifyVolunteerGrid(VolunteerInfoDTO volunteerInfoDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index 71417dbb2e..846e342657 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -414,4 +414,14 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl + + + UPDATE volunteer_info + SET GRID_ID = #{gridId}, + GRID_NAME = #{gridName}, + PID = #{pid}, + PIDS = #{pids}, + UPDATED_TIME = NOW() + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND user_id = #{userId} + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ModifyRegGridFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ModifyRegGridFormDTO.java new file mode 100644 index 0000000000..b54c57ca09 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ModifyRegGridFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +@Data +public class ModifyRegGridFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class) + private String userId; + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + @NotBlank(message = "请选择您所在的网格", groups = AddUserShowGroup.class) + private String gridId; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java index 5d5870439e..3f8b17f323 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java @@ -210,4 +210,20 @@ public class UserController { ValidatorUtils.validateEntity(findIcUserFormDTO,FindIcUserFormDTO.AddUserInternalGroup.class); return new Result().ok(userService.findIcUser(findIcUserFormDTO)); } + + /** + * 居民端-修改注册网格 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping(value = "modify-reg-grid") + public Result modifyRegGrid(@LoginUser TokenDto tokenDto,@RequestBody ModifyRegGridFormDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,ModifyRegGridFormDTO.AddUserShowGroup.class, + ModifyRegGridFormDTO.AddUserInternalGroup.class); + userService.modifyRegGrid(formDTO); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java index 132ef019a7..5ee692c7de 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java @@ -121,4 +121,10 @@ public interface UserService extends BaseService { * @return */ EpmetUserFamilyDTO findIcUser(FindIcUserFormDTO findIcUserFormDTO); + + /** + * 居民端-修改注册网格 + * @param formDTO + */ + void modifyRegGrid(ModifyRegGridFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java index af2a9e2513..44db1b1f5f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java @@ -1,26 +1,27 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; 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.exception.RenException; +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.CpUserDetailRedis; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserConstant; -import com.epmet.dao.UserDao; -import com.epmet.dao.UserResiInfoDao; -import com.epmet.dao.UserRoleDao; -import com.epmet.dao.UserWechatDao; +import com.epmet.dao.*; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.entity.UserBaseInfoEntity; -import com.epmet.entity.UserEntity; -import com.epmet.entity.UserWechatEntity; +import com.epmet.entity.*; +import com.epmet.feign.EpmetHeartOpenFeignClient; import com.epmet.feign.EpmetPointOpenFeignClient; import com.epmet.feign.GovOrgFeignClient; +import com.epmet.redis.UserBaseInfoRedis; import com.epmet.service.IcResiUserService; import com.epmet.service.UserBaseInfoService; import com.epmet.service.UserService; @@ -31,6 +32,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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.Arrays; @@ -63,6 +65,16 @@ public class UserServiceImpl extends BaseServiceImpl implem private UserResiInfoDao userResiInfoDao; @Autowired private IcResiUserService icResiUserService; + @Autowired + private RegisterRelationDao registerRelationDao; + @Autowired + private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient; + @Autowired + private ResiUserBadgeDao resiUserBadgeDao; + @Autowired + private UserBadgeCertificateRecordDao userBadgeCertificateRecordDao; + @Autowired + private UserBaseInfoRedis userBaseInfoRedis; private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class); @@ -417,4 +429,79 @@ public class UserServiceImpl extends BaseServiceImpl implem return result; } + /** + * 居民端-修改注册网格 + * + * @param formDTO + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void modifyRegGrid(ModifyRegGridFormDTO formDTO) { + GridInfoCache newGridInfo= CustomerOrgRedis.getGridInfo(formDTO.getGridId()); + if (null == newGridInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "居民端_修改注册网格:查询当前网格信息异常", "服务器开小差了..."); + } + //修改register_relation表 + //原始注册记录 + LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); + wrapper.eq(RegisterRelationEntity::getCustomerId,formDTO.getCustomerId()) + .eq(RegisterRelationEntity::getUserId,formDTO.getUserId()) + .eq(RegisterRelationEntity::getFirstRegister, NumConstant.ONE_STR); + RegisterRelationEntity originReg=registerRelationDao.selectOne(wrapper); + if(null==originReg){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "居民端_修改注册网格:查询用户原始注册网格记录异常", "服务器开小差了..."); + } + //1、删除废弃网格的 + registerRelationDao.deleteById(originReg.getId()); + //2、当前选择的网格,是否有记录,有更新没有删除 + LambdaQueryWrapper query=new LambdaQueryWrapper(); + query.eq(RegisterRelationEntity::getCustomerId,formDTO.getCustomerId()) + .eq(RegisterRelationEntity::getUserId,formDTO.getUserId()) + .eq(RegisterRelationEntity::getGridId, formDTO.getGridId()); + RegisterRelationEntity nowReg=registerRelationDao.selectOne(query); + if (null != nowReg) { + nowReg.setFirstRegister(NumConstant.ONE_STR); + nowReg.setRegister(NumConstant.ONE_STR); + nowReg.setParticipation(NumConstant.ONE_STR); + registerRelationDao.updateById(nowReg); + } else { + RegisterRelationEntity insert=new RegisterRelationEntity(); + insert.setCustomerId(formDTO.getCustomerId()); + insert.setGridId(formDTO.getGridId()); + insert.setUserId(formDTO.getUserId()); + insert.setFirstRegister(NumConstant.ONE_STR); + insert.setRegister(NumConstant.ONE_STR); + insert.setParticipation(NumConstant.ONE_STR); + registerRelationDao.insert(insert); + } + + //2、修改历史徽章表 + LambdaUpdateWrapper recUpdate=new LambdaUpdateWrapper<>(); + recUpdate.set(UserBadgeCertificateRecordEntity::getGridId,newGridInfo.getId()); + recUpdate.eq(UserBadgeCertificateRecordEntity::getCustomerId,formDTO.getCustomerId()) + .eq(UserBadgeCertificateRecordEntity::getUserId,formDTO.getUserId()); + userBadgeCertificateRecordDao.update(null,recUpdate); + + LambdaUpdateWrapper badgeUpdate=new LambdaUpdateWrapper<>(); + badgeUpdate.set(ResiUserBadgeEntity::getGridId,newGridInfo.getId()); + badgeUpdate.eq(ResiUserBadgeEntity::getCustomerId,formDTO.getCustomerId()) + .eq(ResiUserBadgeEntity::getUserId,formDTO.getUserId()); + resiUserBadgeDao.update(null,badgeUpdate); + + //3、修改支援者信息表 + VolunteerInfoDTO volunteerInfoDTO=new VolunteerInfoDTO(); + volunteerInfoDTO.setCustomerId(formDTO.getCustomerId()); + volunteerInfoDTO.setUserId(formDTO.getUserId()); + volunteerInfoDTO.setGridId(newGridInfo.getId()); + volunteerInfoDTO.setPid(newGridInfo.getPid()); + volunteerInfoDTO.setPids(newGridInfo.getPids()); + volunteerInfoDTO.setGridName(newGridInfo.getGridName()); + Result volunteerRes=epmetHeartOpenFeignClient.modifyVolunteerGrid(volunteerInfoDTO); + if (!volunteerRes.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "居民端_修改注册网格:修改用户志愿者信息异常", "服务器开小差了..."); + } + //4、删除用户缓存信息 + userBaseInfoRedis.clearUserCache(Arrays.asList(formDTO.getUserId())); + } + } From 3a8cb6317c010921463014b599448de4b7d2f494 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 17 Mar 2022 09:34:55 +0800 Subject: [PATCH 08/14] =?UTF-8?q?/resi/guide/user/entergrid=E5=B1=85?= =?UTF-8?q?=E6=B0=91=E8=BF=9B=E7=BD=91=E6=A0=BC=E5=8A=A0=E4=B8=AA=E9=98=B2?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/UserGuideController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java index 42920ff788..94c19dfdfe 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/controller/UserGuideController.java @@ -2,6 +2,7 @@ package com.epmet.controller; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -29,6 +30,7 @@ public class UserGuideController { @Autowired private UserAccessService userAccessService; + @NoRepeatSubmit @PostMapping("entergrid") Result enterGrid(@LoginUser TokenDto token, @RequestBody UserEnterGridFormDTO userEnterGridFormDTO){ logger.info("进网格TokenDto:"+ JSON.toJSON(token)); From 485f360692dda85b61337291d60d0780839382cd Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 17 Mar 2022 09:42:53 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E4=B9=A6=E8=AE=B0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/MemoConcernDTO.java | 4 +- .../java/com/epmet/dto/MemoDifficultyDTO.java | 2 +- .../dto/form/AddMemoDifficultyFromDTO.java | 7 +- .../com/epmet/entity/MemoConcernEntity.java | 4 +- .../epmet/entity/MemoDifficultyEntity.java | 2 +- .../migration/V0.0.21__create_memo_table.sql | 86 +++++++++++++++++++ 6 files changed, 96 insertions(+), 9 deletions(-) create mode 100644 epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.21__create_memo_table.sql diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/MemoConcernDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/MemoConcernDTO.java index 7ccc04ee24..eb1a825736 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/MemoConcernDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/MemoConcernDTO.java @@ -61,13 +61,13 @@ public class MemoConcernDTO implements Serializable { private String content; /** - * 计划执行时间 + * 预计关怀时间 */ @JsonFormat(pattern="yyyy-MM-dd HH:mm") private Date scheduledTime; /** - * 实际执行时间 + * 实际执行时间(预留字段) */ @JsonFormat(pattern="yyyy-MM-dd HH:mm") private Date actualTime; diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/MemoDifficultyDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/MemoDifficultyDTO.java index 90b9505e75..0f1e94e071 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/MemoDifficultyDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/MemoDifficultyDTO.java @@ -45,7 +45,7 @@ public class MemoDifficultyDTO implements Serializable { private String remark; /** - * 计划执行时间 + * 预计处理时间 */ @JsonFormat(pattern="yyyy-MM-dd HH:mm") private Date scheduledTime; diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AddMemoDifficultyFromDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AddMemoDifficultyFromDTO.java index dda956c0b6..3fe64af31d 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AddMemoDifficultyFromDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AddMemoDifficultyFromDTO.java @@ -5,7 +5,6 @@ import com.epmet.dto.MemoAttachmentDTO; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import org.hibernate.validator.constraints.Length; -import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -34,21 +33,23 @@ public class AddMemoDifficultyFromDTO implements Serializable { * 内容 */ @NotBlank(message = "难点堵点内容不能为空", groups = { AddMemoDifficulty.class }) - @Length(max = 500, message = "难点堵点内容最长为50个字", groups = { AddMemoDifficulty.class }) + @Length(max = 500, message = "难点堵点内容最多为50个字", groups = { AddMemoDifficulty.class }) private String content; /** * 解决方式 */ + @Length(max = 500, message = "解决方式最多为500个字", groups = { AddMemoDifficulty.class }) private String resolveWay; /** * 备注 */ + @Length(max = 200, message = "备注最多为200个字", groups = { AddMemoDifficulty.class }) private String remark; /** - * 计划执行时间 + * 预计处理时间 */ @JsonFormat(pattern="yyyy-MM-dd HH:mm") private Date scheduledTime; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/MemoConcernEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/MemoConcernEntity.java index 59a2770876..dce8dc6672 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/MemoConcernEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/MemoConcernEntity.java @@ -51,12 +51,12 @@ public class MemoConcernEntity extends BaseEpmetEntity { private String content; /** - * 计划执行时间 + * 预计关怀时间 */ private Date scheduledTime; /** - * 实际执行时间 + * 实际执行时间(预留字段) */ private Date actualTime; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/MemoDifficultyEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/MemoDifficultyEntity.java index 32d6263849..e73a444598 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/MemoDifficultyEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/MemoDifficultyEntity.java @@ -41,7 +41,7 @@ public class MemoDifficultyEntity extends BaseEpmetEntity { private String remark; /** - * 计划执行时间 + * 预计处理时间 */ private Date scheduledTime; diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.21__create_memo_table.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.21__create_memo_table.sql new file mode 100644 index 0000000000..e719505e40 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.21__create_memo_table.sql @@ -0,0 +1,86 @@ +CREATE TABLE `memo_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `REMIND_MSG_ID` varchar(64) NOT NULL COMMENT 'REMIND_MSG.ID 业务(工作日志、难点堵点、人员关怀)表Id', + `FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b', + `ATTACHMENT_FORMAT` varchar(64) NOT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址', + `DURATION` int(11) DEFAULT '0' COMMENT '语音或视频时长,秒', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='备忘录-附件表'; + +CREATE TABLE `memo_attr` ( + `ID` varchar(32) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `REMIND_TIME` datetime DEFAULT NULL COMMENT '提醒时间', + `TYPE` varchar(32) NOT NULL COMMENT '业务类型 人员关怀:concern;难点堵点:difficulty;工作日志:work_diary', + `READ_FLAG` tinyint(1) NOT NULL DEFAULT '0' COMMENT '阅读标记1 已读;0未读', + `RECEIVER` varchar(32) NOT NULL COMMENT '接收人ID', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='备忘录-属性(通知)表'; + +CREATE TABLE `memo_concern` ( + `ID` varchar(32) NOT NULL COMMENT '唯一标识(同memo_attr表Id)', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `CONCERN_TYPE` varchar(64) DEFAULT NULL COMMENT '关怀类型', + `RESI_NAME` varchar(64) NOT NULL COMMENT '关怀人员', + `PHONE` varchar(64) DEFAULT NULL COMMENT '关怀对象电话', + `ADDRESS` varchar(64) DEFAULT NULL COMMENT '关怀对象地址', + `CONTENT` varchar(1024) NOT NULL COMMENT '关怀事项', + `SCHEDULED_TIME` datetime DEFAULT NULL COMMENT '预计关怀时间', + `ACTUAL_TIME` datetime DEFAULT NULL COMMENT '实际执行时间(预留字段)', + `STATUS` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态 0未完成 1已完成', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '操作人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='备忘录-人文关怀'; + +CREATE TABLE `memo_difficulty` ( + `ID` varchar(32) NOT NULL COMMENT '唯一标识(同memo_attr表Id)', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `CONTENT` varchar(1024) NOT NULL COMMENT '内容', + `RESOLVE_WAY` varchar(512) DEFAULT NULL COMMENT '解决方式', + `REMARK` varchar(255) DEFAULT NULL COMMENT '备注', + `SCHEDULED_TIME` datetime DEFAULT NULL COMMENT '预计处理时间', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='备忘录-难点读点'; + +CREATE TABLE `memo_work_diary` ( + `ID` varchar(32) NOT NULL COMMENT '唯一标识(同memo_attr表Id)', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `CONTENT` varchar(1024) NOT NULL COMMENT '内容', + `WORK_TYPE` varchar(64) DEFAULT NULL COMMENT '工作事项', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='备忘录-工作日志'; \ No newline at end of file From 1c69bbf8a61520110da60a1c05435bc30a199978 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 17 Mar 2022 09:44:23 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E7=BD=91=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/UserServiceImpl.java | 46 ++++++++----------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java index 44db1b1f5f..a6f88e5c0f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java @@ -442,38 +442,28 @@ public class UserServiceImpl extends BaseServiceImpl implem throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "居民端_修改注册网格:查询当前网格信息异常", "服务器开小差了..."); } //修改register_relation表 - //原始注册记录 - LambdaQueryWrapper wrapper=new LambdaQueryWrapper(); - wrapper.eq(RegisterRelationEntity::getCustomerId,formDTO.getCustomerId()) + LambdaQueryWrapper originWrapper=new LambdaQueryWrapper(); + originWrapper.eq(RegisterRelationEntity::getCustomerId,formDTO.getCustomerId()) .eq(RegisterRelationEntity::getUserId,formDTO.getUserId()) .eq(RegisterRelationEntity::getFirstRegister, NumConstant.ONE_STR); - RegisterRelationEntity originReg=registerRelationDao.selectOne(wrapper); - if(null==originReg){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "居民端_修改注册网格:查询用户原始注册网格记录异常", "服务器开小差了..."); - } - //1、删除废弃网格的 - registerRelationDao.deleteById(originReg.getId()); - //2、当前选择的网格,是否有记录,有更新没有删除 - LambdaQueryWrapper query=new LambdaQueryWrapper(); - query.eq(RegisterRelationEntity::getCustomerId,formDTO.getCustomerId()) + //1、删除废弃网格的(现在生产存在同一个用户相同的网格id多条记录,所以用delete方法) + registerRelationDao.delete(originWrapper); + + //2、删除用户与当前选择的网格的关系,新插入一条注册关系, + LambdaQueryWrapper deleteWrapper=new LambdaQueryWrapper(); + deleteWrapper.eq(RegisterRelationEntity::getCustomerId,formDTO.getCustomerId()) .eq(RegisterRelationEntity::getUserId,formDTO.getUserId()) .eq(RegisterRelationEntity::getGridId, formDTO.getGridId()); - RegisterRelationEntity nowReg=registerRelationDao.selectOne(query); - if (null != nowReg) { - nowReg.setFirstRegister(NumConstant.ONE_STR); - nowReg.setRegister(NumConstant.ONE_STR); - nowReg.setParticipation(NumConstant.ONE_STR); - registerRelationDao.updateById(nowReg); - } else { - RegisterRelationEntity insert=new RegisterRelationEntity(); - insert.setCustomerId(formDTO.getCustomerId()); - insert.setGridId(formDTO.getGridId()); - insert.setUserId(formDTO.getUserId()); - insert.setFirstRegister(NumConstant.ONE_STR); - insert.setRegister(NumConstant.ONE_STR); - insert.setParticipation(NumConstant.ONE_STR); - registerRelationDao.insert(insert); - } + registerRelationDao.delete(deleteWrapper); + + RegisterRelationEntity insert=new RegisterRelationEntity(); + insert.setCustomerId(formDTO.getCustomerId()); + insert.setGridId(formDTO.getGridId()); + insert.setUserId(formDTO.getUserId()); + insert.setFirstRegister(NumConstant.ONE_STR); + insert.setRegister(NumConstant.ONE_STR); + insert.setParticipation(NumConstant.ONE_STR); + registerRelationDao.insert(insert); //2、修改历史徽章表 LambdaUpdateWrapper recUpdate=new LambdaUpdateWrapper<>(); From 1f55065e3f3b2280be4c6a263caa3a2469946fee Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 17 Mar 2022 10:21:39 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/org/result/CustomerGridDTO.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java index 752bb721cd..9c2d142132 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerGridDTO.java @@ -131,4 +131,9 @@ public class CustomerGridDTO implements Serializable { * 所有上级组织名 */ private String allParentName; + + /** + * 弃用标记 + */ + private Integer abandonFlag; } From 59940aab45c78835040a0958ad951dd95716b110 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 17 Mar 2022 10:33:35 +0800 Subject: [PATCH 12/14] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/govorg/CustomerGridDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml index adc659eae6..0625e55ce5 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml @@ -174,8 +174,8 @@ cg.* FROM customer_grid cg LEFT JOIN customer_agency ca ON (ca.ID = cg.PID AND ca.DEL_FLAG = '0') - WHERE cg.DEL_FLAG = '0' - AND cg.ID = #{gridId} + WHERE cg.ID = #{gridId} + AND cg.DEL_FLAG = '0' From d83b3f1cb82db99c39cabcf954905259aae58762 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 17 Mar 2022 10:35:31 +0800 Subject: [PATCH 13/14] abandon_flag not null --- .../src/main/resources/db/migration/V0.0.13__abandon_grid.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.13__abandon_grid.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.13__abandon_grid.sql index 1822215609..37fbf05faa 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.13__abandon_grid.sql +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.13__abandon_grid.sql @@ -1,3 +1,3 @@ alter table customer_grid -add column ABANDON_FLAG TINYINT(1) default '0' +add column ABANDON_FLAG TINYINT(1) NOT NULL default '0' comment '弃用:1;正常使用:0' after SYNC_FLAG; \ No newline at end of file From 565af14f737d51751b34f789dac99ad13d5881fb Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 17 Mar 2022 11:04:17 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/redis/common/CustomerOrgRedis.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java index 4fbf63be42..c44a7030db 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerOrgRedis.java @@ -1,6 +1,7 @@ package com.epmet.commons.tools.redis.common; import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.redis.RedisKeys; @@ -52,6 +53,7 @@ public class CustomerOrgRedis { public static GridInfoCache getGridInfo(String gridId){ String key = RedisKeys.getGridInfoKey(gridId); Map grid = customerOrgRedis.redisUtils.hGetAll(key); + log.info("grid is {}", JSON.toJSONString(grid)); if (!CollectionUtils.isEmpty(grid)) { return ConvertUtils.mapToEntity(grid, GridInfoCache.class); } @@ -63,6 +65,7 @@ public class CustomerOrgRedis { //throw new RenException("没有此网格信息..."); return null; } + log.info("select grid info is {}", JSON.toJSONString(gridInfoResult.getData())); Map map = BeanUtil.beanToMap(gridInfoResult.getData(), false, true); customerOrgRedis.redisUtils.hMSet(key, map); return gridInfoResult.getData();