From 943ffcff81c4189535a096834cf6baa34bdc52e7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 18 May 2022 14:44:46 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/ProjectManageListFormDTO.java | 5 +---- .../main/java/com/epmet/controller/ProjectController.java | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectManageListFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectManageListFormDTO.java index e0e7eacecc..54d327354c 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectManageListFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectManageListFormDTO.java @@ -16,8 +16,6 @@ public class ProjectManageListFormDTO extends PageFormDTO implements Serializabl private static final long serialVersionUID = -3317804468566708838L; - public interface ProjectManageListForm{} - /** * 标题 */ @@ -34,9 +32,8 @@ public class ProjectManageListFormDTO extends PageFormDTO implements Serializabl private String endDate; /** - * all:全部,closed:已关闭,pending:待处理 + * null就是全部,closed:已关闭,pending:待处理 */ - @NotBlank(message = "status不能为空",groups = ProjectManageListForm.class) private String status; private String userId; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java index 2f862559de..4e09cbf193 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java @@ -346,7 +346,6 @@ public class ProjectController { */ @PostMapping("project-list") public Result projectList(@LoginUser TokenDto tokenDto,@RequestBody ProjectManageListFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, ProjectManageListFormDTO.ProjectManageListForm.class); formDTO.setUserId(tokenDto.getUserId()); formDTO.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(projectService.projectList(formDTO)); From 334e69b3612d22f20ec552e3e095bb516849f316 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 18 May 2022 14:51:04 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=8D=8F=E5=8A=9E=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcPartyUnitDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml index 646eaedb99..c3e86c3964 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -121,7 +121,7 @@ CREATED_TIME FROM ic_community_self_organization WHERE DEL_FLAG = '0' - AND CONCAT(PIDS,':',AGENCY_ID) LIKE CONCAT('%',#{agencyId},'%') + AND CONCAT(PIDS,':',ORG_ID) LIKE CONCAT('%',#{agencyId},'%') ) t ORDER BY CREATED_TIME desc From 148e77e61809d788dae879690574549465d5501c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 18 May 2022 14:55:16 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=8A=A5=E4=BA=8B-=E7=AB=8B=E9=A1=B9=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BD=91=E6=A0=BCID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/EventToProjectFormDTO.java | 5 +++++ .../java/com/epmet/service/impl/ProjectTraceServiceImpl.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java index ecc93498b7..39e4f6f06e 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java @@ -104,4 +104,9 @@ public class EventToProjectFormDTO implements Serializable { * 协办单位类型,1社区自组织,2联建单位 */ private String assistanceUnitType; + + /** + * 网格ID + */ + private String gridId; } 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 d597fedeff..273bfc29a4 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 @@ -705,7 +705,7 @@ public class ProjectTraceServiceImpl implements ProjectTraceS //事件已经立项,不能重复操作 ResiEventEntity resiEventEntity=resiEventService.getById(formDTO.getEventId()); //TODO 兼容新事件表 - String gridId = ""; + String gridId = formDTO.getGridId(); if(null==resiEventEntity||resiEventEntity.getShiftProject()){ throw new RenException(EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getCode(),EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getMsg()); } From e083ad76c47ac4fefae45d1264ed8e8bca787f94 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 18 May 2022 15:01:09 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-project-server/src/main/resources/mapper/ProjectDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2befd8ed97..f453fa9fd9 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 @@ -598,7 +598,7 @@ AND DATE_FORMAT(p.CREATED_TIME,'%Y%m%d') #{endDate} - + AND p.`STATUS` = #{status} GROUP BY t.PROJECT_ID From 820f558278ced9ba1594c362d576003a21489a2d Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 18 May 2022 15:23:32 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=AE=A1=E7=90=86=5F?= =?UTF-8?q?=E7=AB=8B=E9=A1=B9=E3=80=81=E8=BD=AC=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/IcDemandFormDTO.java | 3 + .../epmet/dto/form/IcEventAddEditFormDTO.java | 2 +- .../dto/form/IcEventToProjectFormDTO.java | 110 +++++++++ .../epmet/controller/IcEventController.java | 29 +++ .../com/epmet/service/IcEventService.java | 16 +- .../epmet/service/ProjectTraceService.java | 6 + .../service/impl/IcEventServiceImpl.java | 58 ++++- .../service/impl/ProjectTraceServiceImpl.java | 230 ++++++++++++++++++ 8 files changed, 449 insertions(+), 5 deletions(-) create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToProjectFormDTO.java diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java index 657bea778f..78c5c7becc 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java @@ -30,6 +30,9 @@ public class IcDemandFormDTO implements Serializable { public interface UpdateInternalGroup { } + @NotBlank(message = "事件id不能为空",groups = AddInternalGroup.class) + private String icEventId; + @NotBlank(message = "需求id不能为空",groups = UpdateInternalGroup.class) private String demandRecId; diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java index b3fd086a1c..caa87021bb 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java @@ -92,7 +92,7 @@ public class IcEventAddEditFormDTO implements Serializable { /** * 立项接口入参对象 */ - private EventToProjectFormDTO project; + private IcEventToProjectFormDTO project; /** * 转需求接口入参对象 */ diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToProjectFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToProjectFormDTO.java new file mode 100644 index 0000000000..7c5bf3fc6c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToProjectFormDTO.java @@ -0,0 +1,110 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 事件管理-立项 + * + * @author sun + */ +@Data +public class IcEventToProjectFormDTO implements Serializable { + private static final long serialVersionUID = 3392008990676159012L; + + public interface AddUserInternalGroup { + } + + public interface ApprovalCategory extends CustomerClientShowGroup { + } + + /** + * 事件id + */ + @NotBlank(message = "事件id不能为空", groups = AddUserInternalGroup.class) + private String icEventId; + /** + * 项目方案 1000 + */ + @Length(min = 1, max = 1000, message = "项目方案1000字", groups = {ApprovalCategory.class}) + private String publicReply; + /** + * 内部备注 1000 + * 21.08.09 直接立项的内部备注是必填的,然后议题转项目和我要直报转项目的都是非必填的 + */ + //@Length(min = 1, max = 1000, message = "内部备注1000字", groups = {ApprovalCategory.class}) + private String internalRemark; + + /** + * 吹哨勾选的工作人员信息集合,不可为空 + */ + @Valid + private List staffList; + /** + * 项目所选分类集合,不可为空 + */ + @Valid + private List categoryList; + /** + * 项目所选标签集合 + */ + private List tagList; + + @Length(min = 1, max = 20, message = "项目标题不能超过20位", groups = {ApprovalCategory.class}) + private String title; + + /** + * 公开答复对应文件集合 + */ + private List publicFile; + /** + * 内部备注对应文件集合 + */ + private List internalFile; + + //定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置] + private String locateAddress; + //定位经度 + private String locateLongitude; + //定位纬度 + private String locateDimension; + + + + //以下参数从token中获取 + /** + * 当前用户id + */ + @NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class) + private String userId; + + /** + * 当前客户id + */ + @NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) + private String customerId; + + private String app; + private String client; + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空", groups = AddUserInternalGroup.class) + private String gridId; + /** + * 协办单位ID + */ + private String assistanceUnitId; + + /** + * 协办单位类型,1社区自组织,2联建单位 + */ + private String assistanceUnitType; +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java index 1b9674f7da..c03e541af8 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java @@ -14,6 +14,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcEventDTO; import com.epmet.dto.form.*; +import com.epmet.dto.form.demand.ReportDemandFormDTO; import com.epmet.dto.result.IcEventListResultDTO; import com.epmet.dto.result.IcEventMonthlyIncrementResultDTO; import com.epmet.dto.result.IcEventResultDTO; @@ -153,6 +154,34 @@ public class IcEventController { return new Result(); } + /** + * @Author sun + * @Description 事件管理-立项 + **/ + @PostMapping("icEventToProject") + public Result icEventToProject(@LoginUser TokenDto tokenDto, @RequestBody IcEventToProjectFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setApp(tokenDto.getApp()); + formDTO.setClient(tokenDto.getClient()); + ValidatorUtils.validateEntity(formDTO,IcEventToProjectFormDTO.ApprovalCategory.class,IcEventToProjectFormDTO.AddUserInternalGroup.class); + icEventService.icEventToProject(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 事件管理-转需求 + **/ + @PostMapping("icEventToDemand") + public Result icEventToDemand(@LoginUser TokenDto tokenDto, @RequestBody IcDemandFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setDemandUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcDemandFormDTO.Add.class,IcDemandFormDTO.AddInternalGroup.class); + icEventService.icEventToDemand(formDTO); + return new Result(); + } + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java index 9921fb6b85..eb146d45a4 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java @@ -3,9 +3,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcEventDTO; -import com.epmet.dto.form.IcEventAddEditFormDTO; -import com.epmet.dto.form.IcEventListFormDTO; -import com.epmet.dto.form.IcEventReplyFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.IcEventListResultDTO; import com.epmet.dto.result.IcEventMonthlyIncrementResultDTO; import com.epmet.dto.result.IcEventResultDTO; @@ -106,4 +104,16 @@ public interface IcEventService extends BaseService { * @Description 事件管理-回复 **/ void reply(IcEventReplyFormDTO formDTO); + + /** + * @Author sun + * @Description 事件管理-立项 + **/ + void icEventToProject(IcEventToProjectFormDTO formDTO); + + /** + * @Author sun + * @Description 事件管理-转需求 + **/ + void icEventToDemand(IcDemandFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java index 133711aea9..2b8d2a88e1 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java @@ -205,4 +205,10 @@ public interface ProjectTraceService { * @Date 2022/1/4 15:33 */ void approvaledListExport(HttpServletResponse response, ApprovaledListFromDTO formDTO); + + /** + * 事件管理-事件立项 + * @author sun + */ + EventToProjectResultDTO icEventToProject(IcEventToProjectFormDTO formDTO); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java index 2a12250265..29582535e0 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java @@ -208,7 +208,7 @@ public class IcEventServiceImpl extends BaseServiceImpl recIdResult = epmetHeartOpenFeignClient.icEventToDemand(formDTO); + if (!recIdResult.success() || recIdResult.getData() == null) { + throw new RenException(recIdResult.getCode(), recIdResult.getMsg()); + } + + //3.更新事件数据 + entity.setOperationType("2"); + entity.setOperationId(recIdResult.getData().getDemandRecId()); + entity.setLatestOperatedTime(new Date()); + baseDao.updateById(entity); + + //4.新增操作记录 + IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getDemandUserId(), new Date(), "shift_demand", "shift_demand"); + icEventOperationLogService.insert(logEntity); + + } + + } \ No newline at end of file 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 273bfc29a4..4046d89bf6 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 @@ -1225,4 +1225,234 @@ public class ProjectTraceServiceImpl implements ProjectTraceS epmetMessageOpenFeignClient.saveUserMessage(userMessage); } + + /** + * 事件管理-事件立项【赶时间没空兼容】 + * @author sun + */ + @Override + public EventToProjectResultDTO icEventToProject(IcEventToProjectFormDTO formDTO) { + //判断是否存在已立项 + List projectEntityList = projectService.getByOriginId(formDTO.getIcEventId()); + if (!CollectionUtils.isEmpty(projectEntityList)) { + throw new RenException(EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getCode(), EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getMsg()); + } + List staffList = formDTO.getStaffList(); + //1.文字内容安全校验 + List list = new ArrayList<>(); + list.add(formDTO.getTitle()); + list.add(formDTO.getPublicReply()); + list.add(formDTO.getPublicReply()); + list.add(formDTO.getInternalRemark()); + safetyCheck(list); + //2.数据准备 + //2-1获取当前工作人员基本信息 + EventToProjectFormDTO eventToProjectFormDTO = ConvertUtils.sourceToTarget(formDTO, EventToProjectFormDTO.class); + LoginUserDetailsResultDTO loginUser = queryLoginUserInfo(eventToProjectFormDTO); + + //2-2.调用gov-org服务,获取所有勾选人员以及议题数据对应的组织信息、部门信息、网格信息用于对处理部门和ORG_ID_PATH字段的赋值使用 + AgencyDeptGridResultDTO agencyDeptGrid = getAgencyDeptGridRes(formDTO.getStaffList(), loginUser.getAgencyId()); + + //2-3.调用issue服务,查询分类、标签数据信息 + CategoryTagResultDTO categoryTagResultDTO = queryCategoryTagRes(eventToProjectFormDTO); + List categoryList = categoryTagResultDTO.getCategoryList(); + List tagList = categoryTagResultDTO.getTagList(); + + //2-4.批量查询被勾选工作人员基础信息 + List staffInfoList = queryStaffListRes(formDTO.getStaffList(), formDTO.getUserId()); + + //3.封装保存业务数据 + //3-1.项目主表新增数据 + ProjectEntity projectEntity = new ProjectEntity(); + projectEntity.setCustomerId(formDTO.getCustomerId()); + //立项人的所属组织id + projectEntity.setAgencyId(loginUser.getAgencyId()); + projectEntity.setOrigin("ic_event"); + projectEntity.setOriginId(formDTO.getIcEventId()); + projectEntity.setTitle(formDTO.getTitle()); + projectEntity.setBackGround(formDTO.getPublicReply()); + projectEntity.setGridId(formDTO.getGridId()); + projectEntity.setStatus(ProjectConstant.PENDING); + projectEntity.setOrgIdPath(loginUser.getOrgIdPath()); + projectEntity.setLocateAddress(null == formDTO.getLocateAddress() ? "" : formDTO.getLocateAddress()); + projectEntity.setLocateLongitude(null == formDTO.getLocateLongitude() ? "" : formDTO.getLocateLongitude()); + projectEntity.setLocateDimension(null == formDTO.getLocateDimension() ? "" : formDTO.getLocateDimension()); + projectService.insert(projectEntity); + + //3-2.项目进展表新增第一个节点数据 + ProjectProcessEntity processEntity = new ProjectProcessEntity(); + processEntity.setProjectId(projectEntity.getId()); + processEntity.setCustomerId(formDTO.getCustomerId()); + processEntity.setStaffId(formDTO.getUserId()); + processEntity.setOperation(ProjectConstant.OPERATION_CREATED); + processEntity.setOperationName(ProjectConstant.OPERATION_PROJECT_APPROVAL); + processEntity.setPublicReply(formDTO.getPublicReply()); + processEntity.setInternalRemark(formDTO.getInternalRemark()); + processEntity.setAssistanceUnitId(formDTO.getAssistanceUnitId()); + processEntity.setAssistanceUnitType(formDTO.getAssistanceUnitType()); + agencyDeptGrid.getAgencyList().forEach(agency -> { + if (loginUser.getAgencyId().equals(agency.getId())) { + processEntity.setDepartmentName(agency.getOrganizationName()); + processEntity.setAgencyId(agency.getId()); + if (org.apache.commons.lang3.StringUtils.isBlank(agency.getPids()) || org.apache.commons.lang3.StringUtils.equals(NumConstant.ZERO_STR, agency.getPids().trim()) || "".equals(agency.getPids().trim())) { + processEntity.setOrgIdPath(agency.getId()); + } else { + processEntity.setOrgIdPath(agency.getPids().concat(":").concat(agency.getId())); + } + } + }); + projectProcessService.insert(processEntity); + + //3-3.项目人员表批量新增数据 + List entityList = new ArrayList<>(); + staffList.forEach(ts -> { + ProjectStaffEntity entity = ConvertUtils.sourceToTarget(ts, ProjectStaffEntity.class); + entity.setOrgId(ts.getAgencyId()); + entity.setProjectId(projectEntity.getId()); + entity.setProcessId(processEntity.getId()); + entity.setIsHandle(ProjectConstant.UNHANDLED); + agencyDeptGrid.getAgencyList().forEach(agency -> { + if (ts.getAgencyId().equals(agency.getId())) { + entity.setCustomerId(agency.getCustomerId()); + entity.setOrgIdPath(("".equals(agency.getPids()) ? "" : agency.getPids() + ":") + agency.getId()); + entity.setDepartmentName(agency.getOrganizationName()); + } + }); + if (org.apache.commons.lang3.StringUtils.isNotBlank(ts.getDepartmentId())) { + agencyDeptGrid.getDeptList().forEach(dept -> { + if (ts.getDepartmentId().equals(dept.getId())) { + entity.setDepartmentName(entity.getDepartmentName() + "-" + dept.getDepartmentName()); + } + }); + } + if (org.apache.commons.lang3.StringUtils.isNotBlank(ts.getGridId())) { + agencyDeptGrid.getGridList().forEach(grid -> { + if (ts.getGridId().equals(grid.getId())) { + entity.setDepartmentName(entity.getDepartmentName() + "-" + grid.getGridName()); + } + }); + } + entityList.add(entity); + }); + projectStaffService.insertBatch(entityList); + + //3-4.项目附件表新增数据 + if ((null != formDTO.getPublicFile() && formDTO.getPublicFile().size() > NumConstant.ZERO) + || (null != formDTO.getInternalFile() && formDTO.getInternalFile().size() > NumConstant.ZERO)) { + projectService.saveFile(formDTO.getPublicFile(), formDTO.getInternalFile(), formDTO.getCustomerId(), projectEntity.getId(), processEntity.getId()); + } + + //3-5.项目分类表新增数据 + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getCategoryList())) { + List categoryEntityList = new ArrayList<>(); + formDTO.getCategoryList().forEach(item -> { + categoryList.forEach(ca -> { + if (item.getId().equals(ca.getId())) { + ProjectCategoryEntity entity = new ProjectCategoryEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setProjectId(projectEntity.getId()); + entity.setCategoryId(item.getId()); + entity.setCategoryPids(ca.getPids()); + entity.setCategoryCode(ca.getCategoryCode()); + entity.setGridId(formDTO.getGridId()); + categoryEntityList.add(entity); + } + }); + }); + projectCategoryService.insertBatch(categoryEntityList); + } + + //3-6.项目标签表新增数据 + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getTagList())) { + List tagEntityList = new ArrayList<>(); + formDTO.getTagList().forEach(item -> { + tagList.forEach(ta -> { + if (item.getId().equals(ta.getId())) { + ProjectTagsEntity entity = new ProjectTagsEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setProjectId(projectEntity.getId()); + entity.setTagId(item.getId()); + entity.setTagName(ta.getTagName()); + tagEntityList.add(entity); + } + }); + }); + projectTagsService.insertBatch(tagEntityList); + } + + //3-7:初始化机关-项目时间关联数据 + Date current = new Date(); + List projectStaffIds = entityList.stream().map(ProjectStaffEntity::getId).distinct().collect(Collectors.toList()); + if (!org.apache.commons.collections4.CollectionUtils.isEmpty(projectStaffIds)) { + List container = new LinkedList<>(); + projectStaffIds.forEach(o -> { + ProjectOrgRelationEntity period = new ProjectOrgRelationEntity(); + period.setProjectStaffId(o); + period.setInformedDate(current); + period.setSourceOperation(ProjectConstant.OPERATION_CREATED); + period.setCreatedBy(formDTO.getUserId()); + container.add(period); + }); + relationDao.insertBatch(container); + } + + //4.推送站内信、微信、短信消息 + //4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息 + if (!shiftProjectMessage(formDTO.getStaffList(), formDTO.getCustomerId(), formDTO.getTitle(), projectEntity.getId()).success()) { + throw new RenException("事件转为项目,推送站内信失败"); + } + + //4-2.以及政府端调用epmet-message服务,给工作端工作人员推送微信订阅消息 + if (!wxmpShiftProjectMessage(formDTO.getStaffList(), formDTO.getCustomerId(), formDTO.getTitle()).success()) { + logger.error("事件转为项目,推送微信订阅消息失败!"); + } + + //4-3.吹哨短信消息 + List smsList = new ArrayList<>(); + staffList.forEach(staff -> { + staffInfoList.forEach(st -> { + if (staff.getStaffId().equals(st.getStaffId())) { + ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO(); + sms.setCustomerId(st.getCustomerId()); + sms.setMobile(st.getMobile()); + sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_TRANSFER); + sms.setParameterKey("send_msg"); + smsList.add(sms); + } + }); + }); + Result result = epmetMessageOpenFeignClient.projectSendMsg(smsList); + if (!result.success()) { + logger.error("项目吹哨,发送手机短信失败" + JSON.toJSONString(result)); + } + + //5.项目实时统计消息 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String mqMsgBrief = String.format("创建了\"%s\"的项目", formDTO.getTitle()); + ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectEntity.getCustomerId(), ProjectConstant.OPERATION_CREATED, + projectEntity.getId(), + formDTO.getUserId(), + new Date(), + mqMsgBrief, + IpUtils.getIpAddr(request), + loginUserUtil.getLoginUserApp(), + loginUserUtil.getLoginUserClient()); + boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(mqMsg); + if (!msgResult) { + log.error("项目实时统计消息发送失败"); + } + // 数据上链 + try { + blockChainUploadService.send2BlockChain(projectEntity, processEntity, entityList, null); + } catch (Exception e) { + String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e); + log.error("【项目流转】上链失败,错误信息:{}", errorMsg); + } + + EventToProjectResultDTO resultDTO = new EventToProjectResultDTO(); + resultDTO.setProjectId(projectEntity.getId()); + return resultDTO; + } + + } From 429c677f65770fd58958297032ef8ff0a37496c5 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 18 May 2022 15:39:16 +0800 Subject: [PATCH 6/6] =?UTF-8?q?xiangmu=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/ProjectManageListResultDTO.java | 4 ++-- .../com/epmet/service/impl/ProjectServiceImpl.java | 13 ++++++------- .../src/main/resources/mapper/ProjectDao.xml | 1 - 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java index c0bce880b1..4cb79ebdf7 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java @@ -53,7 +53,7 @@ public class ProjectManageListResultDTO implements Serializable { /** * 滞留天数 */ - private Integer detentionDays; + private String detentionDays; /** * 状态 @@ -77,7 +77,7 @@ public class ProjectManageListResultDTO implements Serializable { this.shiftProjectTime = ""; this.projectScheme = ""; this.internalRemark = ""; - this.detentionDays = NumConstant.ZERO; + this.detentionDays = NumConstant.ZERO_STR; this.status = ""; this.departmentNameList = new ArrayList<>(); this.projectId = ""; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 6214f00200..76a3149704 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -3191,9 +3191,8 @@ public class ProjectServiceImpl extends BaseServiceImpl result = new PageData<>(new ArrayList<>(),NumConstant.ZERO); - int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); - formDTO.setPageNo(pageIndex); - List projectManageList = baseDao.getProjectManageList(formDTO); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getProjectManageList(formDTO)); + List projectManageList = pageInfo.getList(); if (CollectionUtils.isNotEmpty(projectManageList)){ // 获取滞留天数 Integer days = getDays(ConvertUtils.sourceToTarget(formDTO, ProjectListFromDTO.class)); @@ -3210,23 +3209,23 @@ public class ProjectServiceImpl extends BaseServiceImpl departmentNameList = new ArrayList<>(); if (ProjectConstant.CLOSED.equals(p.getStatus())) { p.setDepartmentNameList(departmentNameList); - p.setDetentionDays(NumConstant.ZERO); + p.setDetentionDays(NumConstant.ZERO_STR); } else { ProjectDTO projectDTO = ConvertUtils.sourceToTarget(p, ProjectDTO.class); projectDTO.setId(p.getProjectId()); if (p.getIsHandle().equals("unhandled")){ String detentionDays = getDetentionDays(projectDTO); if (!ONE_DAY.equals(detentionDays) && Integer.parseInt(detentionDays) > days) { - p.setDetentionDays(Integer.valueOf(detentionDays)); + p.setDetentionDays(detentionDays); } else { - p.setDetentionDays(Integer.valueOf(detentionDays)); + p.setDetentionDays(detentionDays); } } departmentNameList = baseDao.selectDepartmentNameList(projectDTO); p.setDepartmentNameList(departmentNameList); } }); - result.setTotal(projectManageList.size()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); result.setList(projectManageList); } return result; 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 f453fa9fd9..e01a45275c 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 @@ -603,6 +603,5 @@ GROUP BY t.PROJECT_ID ORDER BY p.CREATED_TIME DESC - LIMIT #{pageNo}, #{pageSize} \ No newline at end of file