From 588031204c45cff1fc478f61d13aef0de855f644 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 11 Mar 2022 16:19:42 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=A2=9E=E5=8A=A0work?= =?UTF-8?q?=5Fevent=E6=9D=A5=E6=BA=90=EF=BC=8C=E4=B8=BA=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E5=91=98=E4=B8=8A=E6=8A=A5=E4=BA=8B=E4=BB=B6=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=AE=BE=E8=AE=A1=E5=88=B0=E7=9A=84=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactAgencyGovernDailyEntity.java | 9 ++++++- .../datastats/impl/DataStatsServiceImpl.java | 5 +++- .../mapper/datastats/DatsStatsDao.xml | 10 ++++--- .../dto/extract/FactAgencyGovernDailyDTO.java | 9 +++++++ .../dto/extract/FactGridGovernDailyDTO.java | 9 +++++++ .../com/epmet/constant/ProjectConstant.java | 2 ++ .../extract/FactAgencyGovernDailyEntity.java | 8 ++++++ .../extract/FactGridGovernDailyEntity.java | 11 +++++++- .../FactAgencyGovernDailyServiceImpl.java | 27 +++++++++++++++++++ .../impl/FactGridGovernDailyServiceImpl.java | 16 ++++++++++- .../impl/ProjectExtractServiceImpl.java | 6 ++--- .../impl/ScreenProjectSettleServiceImpl.java | 16 +++++++++++ .../migration/V0.0.30__add_project_origin.sql | 13 +++++++++ .../extract/FactOriginProjectMainDailyDao.xml | 4 +-- .../dto/form/ProjectApprovalFormDTO.java | 11 ++++++++ .../com/epmet/constant/ProjectConstant.java | 5 ++++ .../controller/ProjectTraceController.java | 5 ++++ .../service/impl/ProjectTraceServiceImpl.java | 12 +++++++-- .../db/migration/V0.0.20__project_origin.sql | 2 ++ .../src/main/resources/mapper/ProjectDao.xml | 4 +-- 20 files changed, 168 insertions(+), 16 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.30__add_project_origin.sql create mode 100644 epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.20__project_origin.sql diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java index 77bcd7cc34..a0dc4073d4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/FactAgencyGovernDailyEntity.java @@ -179,6 +179,13 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { * 当前组织内结案的项目中:由区直部门结案的项目总数 */ private Integer districtDeptClosedCount; - + /** + * 17、当前组织内:来源于工作人员上报事件的项目:结案已解决数 + */ + private Integer workEventResolvedCount; + /** + * 18、当前组织内:来源于工作人员上报事件的项目:结案无需解决数 + */ + private Integer workEventUnResolvedCount; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 527b6a484b..ce0372f485 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1197,8 +1197,11 @@ public class DataStatsServiceImpl implements DataStatsService, ResultDataResolve Integer projectUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getApprovalProjectUnResolvedCount).sum(); Integer eventResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getEventResolvedCount).sum(); Integer eventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getEventUnResolvedCount).sum(); + Integer workEventResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getWorkEventResolvedCount).sum(); + Integer workEventUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getWorkEventUnResolvedCount).sum(); Integer closedProjectTotal = issueResolvedCount + issueUnResolvedCount+projectResolvedCount - + projectUnResolvedCount + eventResolvedCount + eventUnResolvedCount; + + projectUnResolvedCount + eventResolvedCount + eventUnResolvedCount + + workEventResolvedCount + workEventUnResolvedCount; resultDTO.setProblemResolvedCount(closedProjectTotal); resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount)); resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, closedProjectTotal)); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 891e6f2cf4..5d3d6577ce 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -630,7 +630,8 @@ `level` AS level, ISSUE_PROJECT_RESOLVED_COUNT+ISSUE_PROJECT_UN_RESOLVED_COUNT +APPROVAL_PROJECT_RESOLVED_COUNT+APPROVAL_PROJECT_UN_RESOLVED_COUNT - +EVENT_RESOLVED_COUNT+EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, + +EVENT_RESOLVED_COUNT+EVENT_UN_RESOLVED_COUNT + +WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio, concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio, concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio, @@ -652,7 +653,8 @@ grid_id AS gridId, ISSUE_PROJECT_RESOLVED_COUNT+ISSUE_PROJECT_UN_RESOLVED_COUNT +APPROVAL_PROJECT_RESOLVED_COUNT+APPROVAL_PROJECT_UN_RESOLVED_COUNT - +EVENT_RESOLVED_COUNT+EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, + +EVENT_RESOLVED_COUNT+EVENT_UN_RESOLVED_COUNT + +WORK_EVENT_RESOLVED_COUNT+WORK_EVENT_UN_RESOLVED_COUNT AS problemResolvedCount, concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio, concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio, concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio, @@ -689,7 +691,9 @@ APPROVAL_PROJECT_RESOLVED_COUNT, APPROVAL_PROJECT_UN_RESOLVED_COUNT, EVENT_RESOLVED_COUNT, - EVENT_UN_RESOLVED_COUNT + EVENT_UN_RESOLVED_COUNT, + WORK_EVENT_RESOLVED_COUNT, + WORK_EVENT_UN_RESOLVED_COUNT FROM fact_agency_govern_daily WHERE diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java index a550775779..5767491aa3 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactAgencyGovernDailyDTO.java @@ -138,6 +138,15 @@ public class FactAgencyGovernDailyDTO implements Serializable { */ private Integer eventUnResolvedCount; + /** + * 17、当前组织内:来源于工作人员上报事件的项目:结案已解决数 + */ + private Integer workEventResolvedCount; + /** + * 18、当前组织内:来源于工作人员上报事件的项目:结案无需解决数 + */ + private Integer workEventUnResolvedCount; + /** * 未出当前网格的,结案项目数 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java index b8d585f00f..e1122d933b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactGridGovernDailyDTO.java @@ -149,6 +149,15 @@ public class FactGridGovernDailyDTO implements Serializable { */ private Integer eventUnResolvedCount; + /** + * 21、当前组织内:来源于工作人员上报事件的项目:结案已解决数 + */ + private Integer workEventResolvedCount; + /** + * 22、当前组织内:来源于工作人员上报事件的项目:结案无需解决数 + */ + private Integer workEventUnResolvedCount; + /** * 15、未出当前网格的,结案项目数=11+12+13+14 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index 1bb5176a49..07cb835339 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -83,6 +83,8 @@ public interface ProjectConstant { String PROJECT_ORIGIN_AGENCY="agency"; String PROJECT_ORIGIN_EVENT="resi_event"; + + String PROJECT_ORIGIN_WORK_EVENT="work_event"; /** * 自办 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java index 95f48fdeee..523f482902 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java @@ -158,6 +158,14 @@ public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { * 12、当前组织内:来源于事件的项目:结案无需解决数 */ private Integer eventUnResolvedCount; + /** + * 17、当前组织内:来源于工作人员上报事件的项目:结案已解决数 + */ + private Integer workEventResolvedCount; + /** + * 18、当前组织内:来源于工作人员上报事件的项目:结案无需解决数 + */ + private Integer workEventUnResolvedCount; /** * 未出当前网格的,结案项目数 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java index 827a6fdf75..204a3591ff 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java @@ -177,6 +177,14 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { * 16、当前组织内:来源于事件的项目:结案无需解决数 */ private Integer eventUnResolvedCount; + /** + * 17、当前组织内:来源于工作人员上报事件的项目:结案已解决数 + */ + private Integer workEventResolvedCount; + /** + * 18、当前组织内:来源于工作人员上报事件的项目:结案无需解决数 + */ + private Integer workEventUnResolvedCount; /** @@ -204,7 +212,6 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { //界面展示 this.problemResolvedCount = NumConstant.ZERO; this.groupSelfGovernRatio=BigDecimal.ZERO; - this.gridSelfGovernProjectTotal=NumConstant.ZERO; this.communityClosedRatio=BigDecimal.ZERO; this.streetClosedRatio=BigDecimal.ZERO; this.districtDeptClosedRatio=BigDecimal.ZERO; @@ -219,6 +226,8 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { this.approvalProjectUnResolvedCount=NumConstant.ZERO; this.eventResolvedCount=NumConstant.ZERO; this.eventUnResolvedCount=NumConstant.ZERO; + this.workEventResolvedCount=NumConstant.ZERO; + this.workEventUnResolvedCount=NumConstant.ZERO; this.inGroupTopicResolvedCount=NumConstant.ZERO; this.inGroupTopicUnResolvedCount=NumConstant.ZERO; this.fromIssueResolvedInGridCount=NumConstant.ZERO; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index 52b6310caf..ccf0ee8597 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -260,6 +260,31 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl workEventProjectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.RESOLVED, + ProjectConstant.PROJECT_ORIGIN_WORK_EVENT); + if (!eventProjectResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = eventProjectResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setWorkEventResolvedCount(dto.getSum()); + } + }); + } + //2022.03.11 当前组织内:来源于工作人员上报事件的项目:结案无需解决数 + Map workEventProjectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.UNRESOLVED, + ProjectConstant.PROJECT_ORIGIN_WORK_EVENT); + if (!eventProjectUnResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = eventProjectUnResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setWorkEventUnResolvedCount(dto.getSum()); + } + }); + } + // 2.党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) agencyGovernDailyList.forEach(item -> { int count = item.getInGroupTopicResolvedCount() + item.getInGroupTopicUnResolvedCount(); @@ -396,6 +421,8 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED); Map eventProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_EVENT,DimObjectStatusConstant.RESOLVED); Map eventProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_EVENT,DimObjectStatusConstant.UNRESOLVED); + Map workEventProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_WORK_EVENT,DimObjectStatusConstant.RESOLVED); + Map workEventProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_WORK_EVENT,DimObjectStatusConstant.UNRESOLVED); Map inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ZERO_STR); Map inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ZERO_STR); Map dtoMap=getGovernGridClosedTotalCommonDTOMap(customerId,gridIds); @@ -167,6 +169,16 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl 1) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index d4a154acbd..21e456a9dd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -119,6 +119,22 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic meta.setLongitude(new BigDecimal(projectInfo.getLocateLongitude())); } meta.setProjectAddress(projectInfo.getLocateAddress()); + } else if (ProjectConstant.PROJECT_ORIGIN_WORK_EVENT.equals(projectInfo.getOrigin())) { + //直接立项的话 项目内容是项目背景 经纬度添加 + meta.setOrgType(OrgTypeConstant.GRID); + meta.setOrgId(projectInfo.getOriginId()); + //上面的initNewScreenProjectData已经赋值了orgName=组织名称 + meta.setProjectContent(projectInfo.getBackGround()); + meta.setLinkUserId(projectInfo.getCreatedBy()); + meta.setLinkName(projectInfo.getCreatedBy()); + if (StringUtils.isNotBlank(projectInfo.getLocateDimension())) { + meta.setLatitude(new BigDecimal(projectInfo.getLocateDimension())); + } + if (StringUtils.isNotBlank(projectInfo.getLocateLongitude())) { + meta.setLongitude(new BigDecimal(projectInfo.getLocateLongitude())); + } + meta.setProjectAddress(projectInfo.getLocateAddress()); + meta.setOrgName(meta.getTempGridName()); } //项目满意度得分 meta.setSatisfactionScore(projectService.calProjectSatisfactionScore(param.getCustomerId(),meta.getProjectId())); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.30__add_project_origin.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.30__add_project_origin.sql new file mode 100644 index 0000000000..2a35d61d5f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.30__add_project_origin.sql @@ -0,0 +1,13 @@ +ALTER TABLE `epmet_data_statistical`.`fact_origin_project_main_daily` + MODIFY COLUMN `ORIGIN` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '项目来源 来源:议题issue 组织agency,事件resi_event 工作人员上报:work_event' AFTER `PIDS`; +ALTER TABLE `epmet_evaluation_index`.`screen_project_data` + MODIFY COLUMN `ORIGIN` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '来源:议题issue 项目立项:agency 事件:resi_event; add1015\r\n工作人员上报:work_event' AFTER `ALL_PARENT_IDS`; + + +ALTER TABLE `epmet_data_statistical`.`fact_agency_govern_daily` + ADD COLUMN `WORK_EVENT_RESOLVED_COUNT` int(11) NULL DEFAULT 0 COMMENT '17、当前组织内:来源于工作人员上报事件的项目:结案已解决数' AFTER `EVENT_UN_RESOLVED_COUNT`, + ADD COLUMN `WORK_EVENT_UN_RESOLVED_COUNT` int(11) NULL DEFAULT 0 COMMENT '18、当前组织内:来源于工作人员上报事件的项目:结案无需解决数' AFTER `WORK_EVENT_RESOLVED_COUNT`; + +ALTER TABLE `epmet_data_statistical`.`fact_grid_govern_daily` + ADD COLUMN `WORK_EVENT_RESOLVED_COUNT` int(11) NULL DEFAULT 0 COMMENT '21、当前组织内:来源于工作人员上报事件的项目:结案已解决数' AFTER `EVENT_UN_RESOLVED_COUNT`, + ADD COLUMN `WORK_EVENT_UN_RESOLVED_COUNT` int(11) NULL DEFAULT 0 COMMENT '22、当前组织内:来源于工作人员上报事件的项目:结案无需解决数' AFTER `WORK_EVENT_RESOLVED_COUNT`; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index a6ba0e7a8b..c7a3d015f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -1184,7 +1184,7 @@ FROM fact_origin_project_main_daily WHERE - ORIGIN = 'agency' + ORIGIN = 'work_event' AND CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} @@ -1202,7 +1202,7 @@ FROM fact_origin_project_main_daily WHERE - ORIGIN = 'agency' + ORIGIN = 'work_event' AND CUSTOMER_ID = #{customerId} AND DATE_ID <= #{dateId} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java index d269a4aeaa..bf00afa2b7 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import org.hibernate.validator.constraints.Length; @@ -64,5 +65,15 @@ public class ProjectApprovalFormDTO implements Serializable { private String app; private String client; private String userId; + /** + * 立项类型 直接立项:agency,上报事件:work_event + */ + @NotBlank(message = "立项类型不能为空",groups = {ProjectApprovalFormDTO.ApprovalCategory.class}) + private String type; + /** + * 网格ID + */ + @NotBlank(message = "网格ID不能为空",groups = {AddGroup.class}) + private String gridId; } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java index 612debd512..77b6b21601 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -15,6 +15,11 @@ public interface ProjectConstant { */ String AGENCY = "agency"; + /** + * 项目来源-网格员上报事件 + */ + String WORK_EVENT = "work_event"; + String RESI_EVENT="resi_event"; /** * 状态-待处理 diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java index 66074acfa2..5d1cb318ba 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java @@ -7,6 +7,8 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.constant.ProjectConstant; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.service.ProjectProcessService; @@ -356,6 +358,9 @@ public class ProjectTraceController { @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_APPROVAL) public Result projectApproval(@LoginUser TokenDto tokenDTO, @RequestBody ProjectApprovalFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO,ProjectApprovalFormDTO.ApprovalCategory.class); + if (ProjectConstant.WORK_EVENT.equals(formDTO.getType())) { + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + } formDTO.setCustomerId(tokenDTO.getCustomerId()); formDTO.setApp(tokenDTO.getApp()); formDTO.setClient(tokenDTO.getClient()); diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java index 53e1bd4c6c..d55fb3fa7a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java @@ -382,8 +382,13 @@ public class ProjectTraceServiceImpl implements ProjectTraceS ProjectEntity projectEntity = new ProjectEntity(); projectEntity.setCustomerId(formDTO.getCustomerId()); projectEntity.setAgencyId(loginUser.getAgencyId()); - projectEntity.setOrigin(ProjectConstant.AGENCY); - projectEntity.setOriginId(loginUser.getAgencyId()); + if (ProjectConstant.WORK_EVENT.equals(formDTO.getType())) { + projectEntity.setOrigin(ProjectConstant.WORK_EVENT); + projectEntity.setOriginId(formDTO.getGridId()); + } else { + projectEntity.setOrigin(ProjectConstant.AGENCY); + projectEntity.setOriginId(loginUser.getAgencyId()); + } projectEntity.setTitle(formDTO.getTitle()); projectEntity.setBackGround(formDTO.getBackGround()); projectEntity.setStatus(ProjectConstant.PENDING); @@ -413,6 +418,9 @@ public class ProjectTraceServiceImpl implements ProjectTraceS } } }); + if (ProjectConstant.WORK_EVENT.equals(formDTO.getType())) { + processEntity.setGridId(formDTO.getGridId()); + } projectProcessService.insert(processEntity); //3-3.项目人员表批量新增数据 diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.20__project_origin.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.20__project_origin.sql new file mode 100644 index 0000000000..2e490baa26 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.20__project_origin.sql @@ -0,0 +1,2 @@ +ALTER TABLE `epmet_gov_project`.`project` + MODIFY COLUMN `ORIGIN` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '来源:议题issue 项目立项:agency 事件:resi_event 工作人员上报:work_event' AFTER `AGENCY_ID`; \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index 0ce0ccba89..3d6dc43b7f 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -313,7 +313,7 @@ project WHERE DEL_FLAG = '0' AND CREATED_TIME BETWEEN #{patrolStartTime} AND #{patrolEndTime} - AND ORIGIN = 'agency' + AND ORIGIN = 'work_event' AND CREATED_BY = #{userId} + + + 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 d46e8e11545409a288616322038239026429984a Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 16 Mar 2022 17:20:52 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=BF=85=E9=A1=BB=E5=85=A8=E5=B9=B2=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/redis/RedisKeys.java | 10 +++++++++- .../java/com/epmet/redis/GovCustomerMenuRedis.java | 12 ++++-------- .../service/impl/GovCustomerMenuServiceImpl.java | 5 ++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 0798627046..e09d7c1615 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -734,6 +734,14 @@ public class RedisKeys { } public static String getCustomerMenuList(String customerId, Integer type) { - return rootPrefix.concat("oper:access:nav:customerId:").concat(customerId).concat(":type:")+type; + return getCustomerMenuListPrefix().concat(customerId).concat(":type:")+type; + } + + /** + * desc:菜单缓存前缀 + * @return + */ + public static String getCustomerMenuListPrefix() { + return rootPrefix.concat("oper:access:nav:customerId:"); } } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java index 3cc19b8ae2..6d2ec60e64 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java @@ -17,6 +17,7 @@ package com.epmet.redis; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.dto.GovMenuDTO; @@ -66,16 +67,11 @@ public class GovCustomerMenuRedis { /** * desc:删除客户菜单缓存 - * @param customerId - * @param type * @see com.epmet.enums.MenuTypeEnum */ - public void delCustomerMenu(String customerId, Integer type) { - if (checkParam(customerId, type)) { - String key = RedisKeys.getCustomerMenuList(customerId, type); - redisUtils.delete(key); - } - + public void delAllCustomerMenu() { + String key = RedisKeys.getCustomerMenuListPrefix().concat(StrConstant.STAR); + redisUtils.delete(key); } private boolean checkParam(String customerId, Integer type) { diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java index 95e4f2f8d2..a5933f8e58 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java @@ -28,7 +28,6 @@ import com.epmet.dao.GovCustomerMenuDao; import com.epmet.dto.GovCustomerMenuDTO; import com.epmet.dto.form.MenuConfigFormDTO; import com.epmet.entity.GovCustomerMenuEntity; -import com.epmet.enums.MenuTypeEnum; import com.epmet.redis.GovCustomerMenuRedis; import com.epmet.service.GovCustomerMenuService; import org.apache.commons.lang3.StringUtils; @@ -119,8 +118,8 @@ public class GovCustomerMenuServiceImpl extends BaseServiceImpl govCustomerMenuRedis.delCustomerMenu(customerId, MenuTypeEnum.MENU.value())); + //删除全部客户缓存 + govCustomerMenuRedis.delAllCustomerMenu(); } @Override From 303703a316f6a93b497c7e4875c364bf11e22bd9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 16 Mar 2022 17:45:08 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=BF=85=E9=A1=BB=E5=85=A8=E5=B9=B2=E6=8E=89=20*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/redis/GovCustomerMenuRedis.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java index 6d2ec60e64..6190a7c4c0 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java @@ -71,7 +71,7 @@ public class GovCustomerMenuRedis { */ public void delAllCustomerMenu() { String key = RedisKeys.getCustomerMenuListPrefix().concat(StrConstant.STAR); - redisUtils.delete(key); + redisUtils.deleteByPattern(key); } private boolean checkParam(String customerId, Integer type) { From 3a27ac452f02eb3b0ac3e102242d411d93cf23cc Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 16 Mar 2022 19:21:14 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E6=A0=B9=E6=8D=AEid=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=B9=E6=B3=95=20=E5=B9=B6=E5=A1=AB?= =?UTF-8?q?=E5=85=85=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/config/MybatisPlusConfig.java | 6 +++++ .../epmet/commons/mybatis/dao/BaseDao.java | 4 ++-- .../interceptor/MybatisPlusSqlInjector.java | 23 +++++++++++++++++++ .../commons/mybatis/mapper/MyBaseMapper.java | 21 +++++++++++++++++ .../epmetuser/test/UserControllerTest.java | 12 ++++++++++ 5 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java create mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java index 8ef978f3c3..d5537bb17d 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java @@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; import com.epmet.commons.mybatis.interceptor.DataFilterInterceptor; +import com.epmet.commons.mybatis.interceptor.MybatisPlusSqlInjector; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; @@ -44,5 +45,10 @@ public class MybatisPlusConfig { interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); return interceptor; } + @Bean + @Order(2) + public MybatisPlusSqlInjector mybatisPlusSqlInjector(){ + return new MybatisPlusSqlInjector(); + } } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java index f23017b6f7..30b95eaa4c 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java @@ -8,7 +8,7 @@ package com.epmet.commons.mybatis.dao; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.epmet.commons.mybatis.mapper.MyBaseMapper; /** * 基础Dao @@ -16,6 +16,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @author Mark sunlightcs@gmail.com * @since 1.0.0 */ -public interface BaseDao extends BaseMapper { +public interface BaseDao extends MyBaseMapper { } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java new file mode 100644 index 0000000000..21cc58edd8 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java @@ -0,0 +1,23 @@ +package com.epmet.commons.mybatis.interceptor; + +import com.baomidou.mybatisplus.core.injector.AbstractMethod; +import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector; +import com.baomidou.mybatisplus.extension.injector.methods.LogicDeleteByIdWithFill; + +import java.util.List; + +/** + * desc:mybatisPlus拦截器 + * + * @author: LiuJanJun + * @date: 2022/3/16 6:33 下午 + * @version: 1.0 + */ +public class MybatisPlusSqlInjector extends DefaultSqlInjector { + @Override + public List getMethodList(Class mapperClass) { + final List methods = super.getMethodList(mapperClass); + methods.add(new LogicDeleteByIdWithFill()); + return methods; + } +} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java new file mode 100644 index 0000000000..13d589e918 --- /dev/null +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java @@ -0,0 +1,21 @@ +package com.epmet.commons.mybatis.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * desc:自定义mapper方法 + * + * @author: LiuJanJun + * @date: 2022/3/16 6:42 下午 + * @version: 1.0 + */ +public interface MyBaseMapper extends BaseMapper { + /** + * 根据Id逻辑删除 并 填充其他字段的值 id必填 + * + * @param entity 要删除的实体对象 + * @return 受影响记录数量 + */ + int deleteByIdWithFill(Entity entity); + +} diff --git a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java index 06d674a4e3..a777c0c4da 100644 --- a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java +++ b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java @@ -1,7 +1,9 @@ package com.epmet.epmetuser.test; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.dao.CustomerStaffDao; import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.entity.CustomerStaffEntity; import com.epmet.service.UserService; import org.junit.Test; import org.junit.runner.RunWith; @@ -16,10 +18,20 @@ public class UserControllerTest { @Autowired private UserService userService; + @Autowired + private CustomerStaffDao customerStaffDao; + @Test public void getLoginUserDetails() { LoginUserDetailsResultDTO loginUserDetails = userService.getLoginUserDetails(AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, "4aaab913d9f11d90a2cb4dd21b075259"); System.out.println(loginUserDetails); } + @Test + public void del() { + CustomerStaffEntity entity = new CustomerStaffEntity(); + //entity.setId("1476792429129445378"); + entity.setRealName("刘建军3"); + customerStaffDao.deleteByIdWithFill(entity); + } } From 6da2a6682f7abdc0a2941c9243557275c025f9b0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 17 Mar 2022 09:08:40 +0800 Subject: [PATCH 08/11] =?UTF-8?q?Revert=20"=E6=A0=B9=E6=8D=AEid=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=88=A0=E9=99=A4=E6=96=B9=E6=B3=95=20=E5=B9=B6?= =?UTF-8?q?=E5=A1=AB=E5=85=85=E5=AD=97=E6=AE=B5"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3a27ac45 --- .../mybatis/config/MybatisPlusConfig.java | 6 ----- .../epmet/commons/mybatis/dao/BaseDao.java | 4 ++-- .../interceptor/MybatisPlusSqlInjector.java | 23 ------------------- .../commons/mybatis/mapper/MyBaseMapper.java | 21 ----------------- .../epmetuser/test/UserControllerTest.java | 12 ---------- 5 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java delete mode 100644 epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java index d5537bb17d..8ef978f3c3 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/config/MybatisPlusConfig.java @@ -12,7 +12,6 @@ import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; import com.epmet.commons.mybatis.interceptor.DataFilterInterceptor; -import com.epmet.commons.mybatis.interceptor.MybatisPlusSqlInjector; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; @@ -45,10 +44,5 @@ public class MybatisPlusConfig { interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); return interceptor; } - @Bean - @Order(2) - public MybatisPlusSqlInjector mybatisPlusSqlInjector(){ - return new MybatisPlusSqlInjector(); - } } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java index 30b95eaa4c..f23017b6f7 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/dao/BaseDao.java @@ -8,7 +8,7 @@ package com.epmet.commons.mybatis.dao; -import com.epmet.commons.mybatis.mapper.MyBaseMapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; /** * 基础Dao @@ -16,6 +16,6 @@ import com.epmet.commons.mybatis.mapper.MyBaseMapper; * @author Mark sunlightcs@gmail.com * @since 1.0.0 */ -public interface BaseDao extends MyBaseMapper { +public interface BaseDao extends BaseMapper { } diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java deleted file mode 100644 index 21cc58edd8..0000000000 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/interceptor/MybatisPlusSqlInjector.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.epmet.commons.mybatis.interceptor; - -import com.baomidou.mybatisplus.core.injector.AbstractMethod; -import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector; -import com.baomidou.mybatisplus.extension.injector.methods.LogicDeleteByIdWithFill; - -import java.util.List; - -/** - * desc:mybatisPlus拦截器 - * - * @author: LiuJanJun - * @date: 2022/3/16 6:33 下午 - * @version: 1.0 - */ -public class MybatisPlusSqlInjector extends DefaultSqlInjector { - @Override - public List getMethodList(Class mapperClass) { - final List methods = super.getMethodList(mapperClass); - methods.add(new LogicDeleteByIdWithFill()); - return methods; - } -} diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java deleted file mode 100644 index 13d589e918..0000000000 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/mapper/MyBaseMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.epmet.commons.mybatis.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * desc:自定义mapper方法 - * - * @author: LiuJanJun - * @date: 2022/3/16 6:42 下午 - * @version: 1.0 - */ -public interface MyBaseMapper extends BaseMapper { - /** - * 根据Id逻辑删除 并 填充其他字段的值 id必填 - * - * @param entity 要删除的实体对象 - * @return 受影响记录数量 - */ - int deleteByIdWithFill(Entity entity); - -} diff --git a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java index a777c0c4da..06d674a4e3 100644 --- a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java +++ b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/UserControllerTest.java @@ -1,9 +1,7 @@ package com.epmet.epmetuser.test; import com.epmet.commons.tools.constant.AppClientConstant; -import com.epmet.dao.CustomerStaffDao; import com.epmet.dto.result.LoginUserDetailsResultDTO; -import com.epmet.entity.CustomerStaffEntity; import com.epmet.service.UserService; import org.junit.Test; import org.junit.runner.RunWith; @@ -18,20 +16,10 @@ public class UserControllerTest { @Autowired private UserService userService; - @Autowired - private CustomerStaffDao customerStaffDao; - @Test public void getLoginUserDetails() { LoginUserDetailsResultDTO loginUserDetails = userService.getLoginUserDetails(AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, "4aaab913d9f11d90a2cb4dd21b075259"); System.out.println(loginUserDetails); } - @Test - public void del() { - CustomerStaffEntity entity = new CustomerStaffEntity(); - //entity.setId("1476792429129445378"); - entity.setRealName("刘建军3"); - customerStaffDao.deleteByIdWithFill(entity); - } } From ebbd84821b8271485e1f34aa72cf064eeec986ea Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 17 Mar 2022 09:35:20 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=85=8D=E7=BD=AE=20=E5=88=97=E5=AE=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/TableHeaderResultDTO.java | 1 + .../db/migration/V0.0.14__ic_form_query_add_witdh.sql | 2 ++ .../src/main/resources/mapper/IcFormItemDao.xml | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java index dd39f668e7..fbe06770ad 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java @@ -17,6 +17,7 @@ public class TableHeaderResultDTO implements Serializable { private String label; private String columnName; private String itemType; + private Integer width; private List options; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql new file mode 100644 index 0000000000..b4563ed03c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql @@ -0,0 +1,2 @@ +ALTER TABLE `epmet_oper_customize`.`ic_form_query_builder` + ADD COLUMN `WIDTH` int(3) NULL COMMENT '列宽' AFTER `QUERY_TYPE`; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml index 9af84eaee4..8ac6634525 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -77,7 +77,8 @@ m.id as item_id, m.LABEL, m.COLUMN_NAME, - m.item_type + m.item_type, + m.width FROM ic_form_item m WHERE From 1e379e4d0b46db309646de017c7fe06eababbc6a Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 17 Mar 2022 09:40:56 +0800 Subject: [PATCH 10/11] =?UTF-8?q?Revert=20"=E6=B7=BB=E5=8A=A0=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E6=9F=A5=E8=AF=A2=E9=85=8D=E7=BD=AE=20=E5=88=97?= =?UTF-8?q?=E5=AE=BD"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ebbd8482 --- .../main/java/com/epmet/dto/result/TableHeaderResultDTO.java | 1 - .../db/migration/V0.0.14__ic_form_query_add_witdh.sql | 2 -- .../src/main/resources/mapper/IcFormItemDao.xml | 3 +-- 3 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java index fbe06770ad..dd39f668e7 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/TableHeaderResultDTO.java @@ -17,7 +17,6 @@ public class TableHeaderResultDTO implements Serializable { private String label; private String columnName; private String itemType; - private Integer width; private List options; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql deleted file mode 100644 index b4563ed03c..0000000000 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.14__ic_form_query_add_witdh.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `epmet_oper_customize`.`ic_form_query_builder` - ADD COLUMN `WIDTH` int(3) NULL COMMENT '列宽' AFTER `QUERY_TYPE`; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml index 8ac6634525..9af84eaee4 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcFormItemDao.xml @@ -77,8 +77,7 @@ m.id as item_id, m.LABEL, m.COLUMN_NAME, - m.item_type, - m.width + m.item_type FROM ic_form_item m WHERE From d3fe13dc9cce973932095dde93abb746148ebfb6 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 17 Mar 2022 10:08:15 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E5=B7=A1=E6=9F=A5=E5=85=88=E6=B5=8B?= =?UTF-8?q?=E6=B5=8B=E7=A8=8B=E5=BA=8F=20=E7=A8=B3=E5=AE=9A=E5=90=8E=20?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E5=81=9C=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/UserPatrolRecordServiceImpl.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java index c32e1809d6..064b6c9219 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java @@ -85,7 +85,7 @@ public class UserPatrolRecordServiceImpl extends BaseServiceImpl{ UserPatrolRecordEntity recordEntity = buildEntity(o); - //update - int effectRow = baseDao.updateById(recordEntity); - if (effectRow == NumConstant.ZERO) { - baseDao.insert(recordEntity); - } + this.saveOrUpdate(recordEntity); UserPatrolDetailEntity detailEntity = buildDetailEntity(o); - //先删除再新增 - userPatrolDetailService.deleteByPatrolId(recordEntity.getId()); - boolean insert = userPatrolDetailService.insert(detailEntity); + userPatrolDetailService.saveOrUpdate(detailEntity); }); return true;