diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/IcEventComDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/IcEventComDTO.java new file mode 100644 index 0000000000..529bc6c34a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/IcEventComDTO.java @@ -0,0 +1,38 @@ +package com.epmet.commons.tools.dto.commondto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2022/10/11 13:08 + */ +@Data +public class IcEventComDTO implements Serializable { + private static final long serialVersionUID = -5166489408303997740L; + /** + * 事件Id + */ + private String icEventId; + /** + * 事件内容 + */ + private String eventContent; + /** + * 处理中:processing;已办结:closed_case + */ + private String status; + + /** + * 0:已回复 1:已转项目 2:已转需求3:转议题 + */ + private String operationType; + + /** + * 项目、需求ID、议题id + */ + private String operationId; +} + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/TopicInfoComDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/TopicInfoComDTO.java new file mode 100644 index 0000000000..65c001b97f --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/commondto/TopicInfoComDTO.java @@ -0,0 +1,65 @@ +package com.epmet.commons.tools.dto.commondto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/10/11 13:06 + */ +@Data +public class TopicInfoComDTO implements Serializable { + private static final long serialVersionUID = 4242861917113716511L; + /** + * 话题id + */ + private String topicId; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 图片列表 + */ + private List topicImgs; + + /** + * 话题语音-2022.10.10 + */ + private List topicVoices; + + /** + * 话题发表人(山东路168-尹女士) + */ + private String publishedUser; + + /** + * 话题发表时间 (时间戳 毫秒级) + */ + private Long publishedTime; + + + private String releaseTime; + + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + + /** + * 话题所属小组id + */ + private String groupId; + + /** + * 话题所属小组名称 + */ + private String groupName; + +} + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHsjcResDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHsjcResDTO.java index 4dcf8869a1..001c7fe0ae 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHsjcResDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHsjcResDTO.java @@ -6,7 +6,7 @@ import java.util.List; /** - * @Description + * @Description 核酸结果查询 * @Author yzm * @Date 2022/9/26 17:04 */ 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 7cb132b0f5..23a7f1dd3c 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 @@ -57,7 +57,6 @@ 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); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java index 6427301a18..e04227d5dc 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java @@ -3,6 +3,7 @@ package com.epmet.commons.tools.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.scan.param.*; @@ -16,6 +17,7 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; /** * 扫描内容工具类 @@ -31,6 +33,15 @@ public class ScanContentUtils { * @return */ public static Result imgSyncScan(String url, ImgScanParamDTO param) { + //start 测试环境停机了,先这样改试试 + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + if(EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())||EnvEnum.DEV.getCode().equals(currentEnv.getCode())){ + SyncScanResult syncScanResult=new SyncScanResult(); + syncScanResult.setSuccessDataIds(param.getTasks().stream().map(c -> c.getDataId()).collect(Collectors.toList())); + syncScanResult.setAllPass(true); + return new Result().ok(syncScanResult); + }//end + log.debug("imgSyncScan param:{}", JSON.toJSONString(param)); if (StringUtils.isBlank(url) || param == null) { throw new RenException("参数错误"); @@ -57,6 +68,15 @@ public class ScanContentUtils { * @return */ public static Result textSyncScan(String url, TextScanParamDTO param) { + //start 测试环境停机了,先这样改试试 + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + if(EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())||EnvEnum.DEV.getCode().equals(currentEnv.getCode())){ + SyncScanResult syncScanResult=new SyncScanResult(); + syncScanResult.setSuccessDataIds(param.getTasks().stream().map(c -> c.getDataId()).collect(Collectors.toList())); + syncScanResult.setAllPass(true); + return new Result().ok(syncScanResult); + }//end + log.debug("textSyncScan param:{}", JSON.toJSONString(param)); if (StringUtils.isBlank(url) || param == null) { throw new RenException("参数错误"); diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationDTO.java index 4565baf59c..a6a7f8f18c 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationDTO.java @@ -73,6 +73,8 @@ public class IssueApplicationDTO implements Serializable { * 网格ID 居民端议题对应一个网格Id */ private String gridId; + private String orgId; + private String orgIdPath; /** * 审核通过后对应的 议题id diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueListResultDTO.java index f1561c2a1b..32186f5212 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueListResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueListResultDTO.java @@ -108,7 +108,10 @@ public class IssueListResultDTO implements Serializable { @JsonIgnore private String applyStatus; - + /** + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event + */ + private String sourceType; public IssueListResultDTO() { this.issueId = ""; this.issueTitle = ""; @@ -129,5 +132,6 @@ public class IssueListResultDTO implements Serializable { this.projectId = ""; this.issueClosedTime = 0L; this.issueApplicationId = ""; + this.sourceType=""; } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationEntity.java index 1e6671bfa7..ff45b8a88c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationEntity.java @@ -70,6 +70,9 @@ public class IssueApplicationEntity extends BaseEpmetEntity { */ private String gridId; + private String orgId; + private String orgIdPath; + /** * 审核通过后对应的 议题id */ diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationDao.xml index 08db0e9088..fdd1ff4c5f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationDao.xml @@ -12,7 +12,12 @@ ia.TOPIC_ID, iah.REASON AS rejectedReason, ia.grid_id, - ia.apply_status + ia.apply_status, + ( + case when ia.TOPIC_ID is not null then 'resi_topic' + else '' + end + ) as sourceType FROM issue_application_history iah LEFT JOIN issue_application ia ON iah.ISSUE_APPLICATION_ID = ia.ID AND ia.APPLY_STATUS = 'rejected' WHERE ia.DEL_FLAG = 0 @@ -31,7 +36,12 @@ ISSUE_TITLE, UNIX_TIMESTAMP(CREATED_TIME) AS auditingTime, TOPIC_ID, - grid_id + grid_id, + ( + case when TOPIC_ID is not null then 'resi_topic' + else '' + end + ) as sourceType FROM issue_application WHERE DEL_FLAG = 0 AND ( diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml index 495473205c..82c3c09f32 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml @@ -12,7 +12,8 @@ ISSUE_TITLE AS issueTitle , UNIX_TIMESTAMP(CREATED_TIME) AS createTime, SUGGESTION, - grid_id + grid_id, + SOURCE_TYPE as sourceType FROM issue WHERE DEL_FLAG = '0' AND ISSUE_STATUS = #{issueStatus} @@ -30,7 +31,8 @@ SUGGESTION , UNIX_TIMESTAMP(SHIFTED_TIME) AS shiftProjectTime, grid_id, - issue_title + issue_title, + SOURCE_TYPE as sourceType FROM issue WHERE DEL_FLAG = '0' AND ISSUE_STATUS = 'shift_project' 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 27d88957b5..168d343a79 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 @@ -173,6 +173,7 @@ public interface EpmetHeartOpenFeignClient { /** * desc:根据来源id 删除需求 只删主表 + * 服务需求相关表都删除:ic_user_demand_rec、ic_user_demand_service、ic_user_demand_satisfaction、ic_user_demand_operate_log * @param originId * @param origin * @return diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 99894e3165..6c294e4608 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -398,6 +398,7 @@ public class IcUserDemandRecController implements ResultDataResolver { /** * desc:根据来源id 删除需求 只删主表 + * 2022.10.12:删除服务需求:ic_user_demand_rec、ic_user_demand_service、ic_user_demand_satisfaction、ic_user_demand_operate_log * @param originId * @param origin * @return diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index ce4b03c9b7..68d30ddc19 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -268,6 +268,7 @@ public interface IcUserDemandRecService extends BaseService wrapper = new LambdaUpdateWrapper(); - wrapper.eq(IcUserDemandRecEntity::getOriginId, originId) - .eq(IcUserDemandRecEntity::getOrigin,origin) - .set(IcUserDemandRecEntity::getUpdatedTime,new Date()) - .set(IcUserDemandRecEntity::getCreatedBy,loginUserUtil.getLoginUserId()) - .set(IcUserDemandRecEntity::getDelFlag,NumConstant.ONE_STR); - return baseDao.update(null, wrapper); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + queryWrapper.eq(IcUserDemandRecEntity::getOrigin,origin).eq(IcUserDemandRecEntity::getOriginId,originId); + IcUserDemandRecEntity recEntity = baseDao.selectOne(queryWrapper); + if (null == recEntity) { + return 0; + } + //删除服务需求 + deleteUserDemand(Arrays.asList(recEntity.getId())); + return 1; + } + + /** + * 删除服务需求 + * ic_user_demand_rec、ic_user_demand_service、ic_user_demand_satisfaction、ic_user_demand_operate_log + * @param ids + */ + @Transactional(rollbackFor = Exception.class) + public void deleteUserDemand(List ids) { + Date nowTime = new Date(); + String currentUserId = loginUserUtil.getLoginUserId(); + for (String id : ids) { + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); + wrapper.eq(IcUserDemandRecEntity::getId, id) + .set(IcUserDemandRecEntity::getUpdatedTime, nowTime) + .set(IcUserDemandRecEntity::getUpdatedBy, currentUserId) + .set(IcUserDemandRecEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null, wrapper); + + LambdaUpdateWrapper serviceWrapper = new LambdaUpdateWrapper(); + serviceWrapper.eq(IcUserDemandServiceEntity::getDemandRecId, id) + .set(IcUserDemandServiceEntity::getUpdatedTime, nowTime) + .set(IcUserDemandServiceEntity::getUpdatedBy, currentUserId) + .set(IcUserDemandServiceEntity::getDelFlag, NumConstant.ONE_STR); + demandServiceDao.update(null, serviceWrapper); + + LambdaUpdateWrapper statWrapper = new LambdaUpdateWrapper(); + statWrapper.eq(IcUserDemandSatisfactionEntity::getDemandRecId, id) + .set(IcUserDemandSatisfactionEntity::getUpdatedTime, nowTime) + .set(IcUserDemandSatisfactionEntity::getUpdatedBy, currentUserId) + .set(IcUserDemandSatisfactionEntity::getDelFlag, NumConstant.ONE_STR); + demandSatisfactionDao.update(null, statWrapper); + + LambdaUpdateWrapper logWrapper = new LambdaUpdateWrapper(); + logWrapper.eq(IcUserDemandOperateLogEntity::getDemandRecId, id) + .set(IcUserDemandOperateLogEntity::getUpdatedTime, nowTime) + .set(IcUserDemandOperateLogEntity::getUpdatedBy, currentUserId) + .set(IcUserDemandOperateLogEntity::getDelFlag, NumConstant.ONE_STR); + operateLogDao.update(null, logWrapper); + } } /** @@ -563,6 +612,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl attachmentList; } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AllIssueListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AllIssueListFormDTO.java new file mode 100644 index 0000000000..619ae8baad --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AllIssueListFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/9 16:52 + * @DESC + */ +@Data +public class AllIssueListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -9150357859854770833L; + + private String startTime; + private String endTime; + private String issueStatus; + private String issueTitle; + private String orgId; + private String orgType; + private String customerId; + private String userId; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AuditListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AuditListFormDTO.java new file mode 100644 index 0000000000..0fefeb06d2 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AuditListFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/9 17:07 + * @DESC + */ +@Data +public class AuditListFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 5924913199706972596L; + + private String startTime; + private String endTime; + private String issueTitle; + private String orgId; + private String orgType; + + /** + * under_auditing:待审核;rejected:驳回; + */ + private String applyStatus; + + private String customerId; + private String userId; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CloseIssueFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CloseIssueFormDTO.java index d633a49564..eee04a2b61 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CloseIssueFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CloseIssueFormDTO.java @@ -17,11 +17,17 @@ public class CloseIssueFormDTO implements Serializable { @NotBlank(message = "议题Id不能为空") private String issueId; + /** + * resolved已解决 + * unresolved未解决 + */ @NotBlank(message = "解决状态不能为空") private String resolveType; @NotBlank(message = "关闭理由不能为空") @Length(max=1000,message = "手机号不能超过1000位") private String closeReason; + + private String currentUserId; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/DelIssueFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/DelIssueFormDTO.java new file mode 100644 index 0000000000..5bfd830570 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/DelIssueFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/10/12 11:00 + */ +@Data +public class DelIssueFormDTO { + @NotBlank(message = "customerId不能为空") + private String customerId; + @NotBlank(message = "userId不能为空") + private String userId; + @Valid + @NotEmpty(message = "issueIds不能为空") + private List issueIds; +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java index d9339a0e97..3c2caa5909 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCategoryTagListFormDTO.java @@ -15,7 +15,8 @@ public class IssueCategoryTagListFormDTO implements Serializable { private static final long serialVersionUID = 2599592072265715951L; @NotBlank(message = "议题ID不能为空",groups = {ProjectCategoryTagListFormDTO.CategoryTag.class}) private String issueId; - + @NotBlank(message = "customerId不能为空",groups = {ProjectCategoryTagListFormDTO.CategoryTag.class}) + private String customerId; public interface CategoryTag{} } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/PublishIssueFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/PublishIssueFormDTO.java new file mode 100644 index 0000000000..a965c22ed4 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/PublishIssueFormDTO.java @@ -0,0 +1,123 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + +/** + * @Description + * @Author yzm + * @Date 2022/10/10 9:32 + */ +@Data +public class PublishIssueFormDTO implements Serializable { + private static final long serialVersionUID = 1713711343683095564L; + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 议题状态 表决中:voting 已转项目:shift_project 已关闭:closed + */ + @NotBlank(message = "议题状态不能为空", groups = AddUserShowGroup.class) + private String issueStatus; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event + */ + @NotBlank(message = "议题来源不能为空", groups = AddUserShowGroup.class) + private String sourceType; + + /** + * 来源ID eg:2223232(当SOURCE_TYPE为"resi_topic"时,这里指话题的ID) + */ + private String sourceId; + + /** + * 议题名称 最多20字 + */ + @NotBlank(message = "issueTitle不能为空", groups = AddUserShowGroup.class) + private String issueTitle; + + /** + * 建议 最多1000字 + */ + @NotBlank(message = "suggestion不能为空", groups = AddUserShowGroup.class) + private String suggestion; + + /** + * 客户ID + */ + @NotBlank(message = "customerId不能为空", groups = AddUserShowGroup.class) + private String customerId; + + /** + * 网格ID 居民端议题对应一个网格Id + */ + @NotBlank(message = "gridId不能为空", groups = AddUserShowGroup.class) + private String gridId; + + /** + * 所属机关 【数据权限-非必填】11:22:33(agencyId)数据权限控制 + */ + @NotBlank(message = "orgIdPath不能为空", groups = AddUserShowGroup.class) + private String orgIdPath; + + /** + * 组织ID 【数据权限-非必填】agencyId + */ + @NotBlank(message = "orgId不能为空", groups = AddUserShowGroup.class) + private String orgId; + + /** + * 表决发起日期(转议题日期) + */ + @NotNull(message = "表决发起日期(转议题日期)不能为空", groups = AddUserShowGroup.class) + private Date decidedTime; + + /** + * 地址 + */ + @NotBlank(message = "address不能为空", groups = AddUserShowGroup.class) + private String address; + + /** + * 经度 + */ + @NotBlank(message = "经度不能为空", groups = AddUserShowGroup.class) + private String longitude; + + /** + * 纬度 + */ + @NotBlank(message = "纬度不能为空", groups = AddUserShowGroup.class) + private String latitude; + + /** + * 创建人 + */ + @NotBlank(message = "议题发起人(createdBy)不能为空", groups = AddUserShowGroup.class) + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + private String eventReportUserName; +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/SelectIssueVotingDetailFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/SelectIssueVotingDetailFormDTO.java index fb51463348..d0f2ad3c41 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/SelectIssueVotingDetailFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/SelectIssueVotingDetailFormDTO.java @@ -17,4 +17,9 @@ public class SelectIssueVotingDetailFormDTO implements Serializable { private String issueId; private String gridId; + + /** + * 来源类型 不为空的时候根据类型处理 + */ + private String sourceType; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/VoteFormDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/VoteFormDTO.java index 44655fbb8b..b3816f3a24 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/VoteFormDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/VoteFormDTO.java @@ -28,5 +28,11 @@ public class VoteFormDTO implements Serializable { */ private String createdBy; + /** + * 当 sourceType = issue 时,是直接创建议题,无需加入小组即可表决 + * 默认为resi_topic + */ + private String sourceType = "resi_topic"; + } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AllIssueListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AllIssueListResultDTO.java new file mode 100644 index 0000000000..0efcb2566a --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AllIssueListResultDTO.java @@ -0,0 +1,64 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2022/10/9 16:49 + * @DESC + */ +@Data +public class AllIssueListResultDTO implements Serializable { + + private static final long serialVersionUID = -3447913619727610107L; + + /** + * 所属网格 + */ + private String gridName; + private String gridId; + private String orgId; + + /** + * 议题标题 + */ + private String issueTitle; + + /** + * 议题建议 + */ + private String suggestion; + + /** + * 议题创建时间 + */ + private String createdTime; + + /** + * 支持数 + */ + private Integer supportCount; + + /** + * 反对数 + */ + private Integer oppositionCount; + + /** + * 议题状态 + */ + private String issueStatus; + private String issueStatusName; + private String issueId; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event + */ + private String sourceType; + + private Date decidedTime; + private Date votingDeadline; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AuditListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AuditListResultDTO.java new file mode 100644 index 0000000000..5878ca9864 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AuditListResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/9 17:04 + * @DESC + */ +@Data +public class AuditListResultDTO implements Serializable { + + private static final long serialVersionUID = -9143726703244316997L; + + + /** + * 所属网格 + */ + private String gridName; + private String gridId; + private String orgId; + + /** + * 议题标题 + */ + private String issueTitle; + + /** + * 议题建议 + */ + private String suggestion; + + private String applyStatus; + private String applyStatusName; + + private String applyTime; + + private String issueApplicationId; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java index 08bfdca9e6..68b2b4367e 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * @Description @@ -38,4 +39,15 @@ public class ClosedIssueListResultDTO implements Serializable { * 话题id */ private String sourceId; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String sourceType; + + /** + * 发布议题的图片 + */ + private List issueImgs; + } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovIssueDetailResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovIssueDetailResultDTO.java index 5d87d13144..c82a6a79ce 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovIssueDetailResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovIssueDetailResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -53,6 +54,7 @@ public class GovIssueDetailResultDTO implements Serializable { * 议题来源 例如 resi_topic * */ private String sourceType; + private String sourceId; /** * 当议题没有转成详情时此项为"" @@ -64,4 +66,16 @@ public class GovIssueDetailResultDTO implements Serializable { * */ private Long votingDeadline; + public GovIssueDetailResultDTO() { + this.issueTitle = ""; + this.issueStatus = ""; + this.topicInfo = new GovTopicOfIssueInfoResultDTO(); + this.issuePublisherMobile = ""; + this.issueSuggestion = ""; + this.belongsGridName = ""; + this.issueInitiator = ""; + this.sourceType = ""; + this.projectId = ""; + this.votingDeadline = NumConstant.ZERO_L; + } } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovTopicOfIssueInfoResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovTopicOfIssueInfoResultDTO.java index 1ddcdd85da..40fe5ceafa 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovTopicOfIssueInfoResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/GovTopicOfIssueInfoResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -53,4 +55,15 @@ public class GovTopicOfIssueInfoResultDTO implements Serializable { * 话题所属小组名称 */ private String groupName; + + public GovTopicOfIssueInfoResultDTO() { + this.topicId = ""; + this.topicContent = ""; + this.photoList = new ArrayList<>(); + this.topicPublisher = ""; + this.topicPublishTime = NumConstant.ZERO_L; + this.topicPublisherMobile = ""; + this.groupId = ""; + this.groupName = ""; + } } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueAdvanceResDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueAdvanceResDTO.java new file mode 100644 index 0000000000..9fa5741fe3 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueAdvanceResDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.util.List; + +/** + * @Description 议题的处理进展(包含转项目后的进展)内部服务之间调用 + * @Author yzm + * @Date 2022/10/11 9:43 + */ +@Data +public class IssueAdvanceResDTO { + private String issueId; + /** + * 议题状态(voting 已转项目:shift_project 已关闭:closed) + */ + private String issueStatus; + private List processList; +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProfileDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProfileDTO.java new file mode 100644 index 0000000000..ce7311130c --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProfileDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/10/8 12:58 + */ +@Data +public class IssueProfileDTO { + private String issueId; + private String sourceId; + private String longitude; + private String latitude; + /** + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event + */ + private String issueSourceType; + /** + * 发布议题的图片 + */ + private List issueImgs; +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java index f63ea2d492..c87d9e5f51 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import java.io.Serializable; import java.util.Date; +import java.util.List; /** * @Author zxc @@ -15,7 +16,7 @@ import java.util.Date; public class IssueResultDTO implements Serializable { private static final long serialVersionUID = -1L; - + private String issueId; /** * 议题标题 */ @@ -53,4 +54,16 @@ public class IssueResultDTO implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date shiftIssueTime; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String sourceType; + + private String sourceId; + + /** + * 发布议题的图片 + */ + private List issueImgs; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPubIssuesAuditingResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPubIssuesAuditingResultDTO.java index 4af11fb3f2..e666b9b9cb 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPubIssuesAuditingResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/MyPubIssuesAuditingResultDTO.java @@ -50,4 +50,6 @@ public class MyPubIssuesAuditingResultDTO implements Serializable { @JsonIgnore private String topicId; + private String sourceType; + } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTO.java index 05b17f9d57..731a1e5b57 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTO.java @@ -5,7 +5,7 @@ import lombok.Data; import java.io.Serializable; /** - * @Author zxc + * @Author zxc 就是他issue * 议题处理进展 */ @Data @@ -37,5 +37,6 @@ public class ProcessListResultDTO implements Serializable { * 进展id(操作记录表id) */ private String processId; + private String type; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTOBak.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTOBak.java new file mode 100644 index 0000000000..d3e8b4ed84 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProcessListResultDTOBak.java @@ -0,0 +1,39 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2022/10/11 11:13 + */ +@Data +public class ProcessListResultDTOBak { + + /** + * 处理进展名称(表决中、转项目、流转中已结案、已关闭) + */ + private String processName; + + /** + * 已转项目进展记录时间 + */ + private Long processTime; + + /** + * 处理部门(处理人所属的机关单位名称) + */ + private String departmentName; + + /** + * 进展说明 + */ + private String progressDesc; + + /** + * 进展id(操作记录表id) + */ + private String processId; + private String type; +} + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java index 2ac18595ea..038d40a90d 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * @Description 政府端/居民段查看表决中议题列表返参 @@ -18,7 +19,10 @@ public class VotingIssueListResultDTO implements Serializable { * 议题发布时间 * */ private Long issuePublishTime; - + /** + * 议题发布时间 + */ + private String issuePublishTimeStr; /** * 议题Id * */ @@ -38,4 +42,14 @@ public class VotingIssueListResultDTO implements Serializable { * 来源话题的id */ private String sourceId; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String sourceType; + + /** + * 发布议题的图片 + */ + private List issueImgs; } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 2392e4d2fa..097dbeba8c 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -34,7 +34,7 @@ import java.util.Map; * @date 2020/6/4 13:37 */ @FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallbackFactory = GovIssueOpenFeignClientFallBackFactory.class) -//@FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallbackFactory = GovIssueOpenFeignClientFallBackFactory.class,url = "localhost:8101") +// @FeignClient(name = ServiceConstant.GOV_ISSUE_SERVER, fallbackFactory = GovIssueOpenFeignClientFallBackFactory.class,url = "localhost:8101") public interface GovIssueOpenFeignClient { /** @@ -336,7 +336,11 @@ public interface GovIssueOpenFeignClient { @PostMapping(value = "/gov/issue/issueprojectcategorydict/getprojectcategory") Result> getProjectCategory(@RequestBody List list); - + /** + * 调用此方法建议分页!!!! + * @param formDTO + * @return + */ @PostMapping("/gov/issue/issue/unresolvedlist") Result> getUnresolvedList(@RequestBody ShiftProjectListFromDTO formDTO); @@ -395,4 +399,37 @@ public interface GovIssueOpenFeignClient { @PostMapping(value = "/gov/issue/issueprojectcategorydict/first/{customerId}") Result> queryFirstCategory(@PathVariable("customerId") String customerId); + + /** + * 根据议题ids查询议题简要信息 + * @param issueIds + * @return + */ + @PostMapping("/gov/issue/issue/getIssueProfile") + Result> getIssueProfile(@RequestBody List issueIds); + + /** + * 事件转议题 + * @param issueFormDTO + * @return + */ + @PostMapping("/gov/issue/issue/publishIssue") + Result publishIssue(@RequestBody PublishIssueFormDTO issueFormDTO); + + /** + * 议题处理进展:(只包含发起议题、关闭议题) + * @param formDTO + * @return + */ + @PostMapping("/gov/issue/issueprocess/issueprocess") + Result queryIssueProcess(@RequestBody IssueIdFormDTO formDTO); + + /** + * 删除事件时,事件转了议题,调用此方法,删除议题 + * 批量删除议题(议题如果转了项目,此方法不删除项目!) + * @param delIssueFormDTO + * @return 删除的议题中,转为了项目,返回议题id,上层再单独去删除项目 + */ + @PostMapping("/gov/issue/issue/deleteIssueInternal") + Result> deleteIssueInternal(@RequestBody DelIssueFormDTO delIssueFormDTO); } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java index be2f187945..b76d3ce734 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -332,5 +332,48 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryFirstCategory", customerId); } + /** + * 根据议题ids查询议题简要信息 + * + * @param issueIds + * @return + */ + @Override + public Result> getIssueProfile(List issueIds) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getIssueProfile", issueIds); + } + + /** + * 事件转议题 + * + * @param issueFormDTO + * @return + */ + @Override + public Result publishIssue(PublishIssueFormDTO issueFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "publishIssue", issueFormDTO); + } + /** + * 议题处理进展,(只包含发起议题、关闭议题) + * + * @param formDTO + * @return + */ + @Override + public Result queryIssueProcess(IssueIdFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryIssueProcess", formDTO); + } + + /** + * 删除事件时,事件转了议题,调用此方法,删除议题 + * 批量删除议题(议题如果转了项目,此方法不删除项目!) + * + * @param delIssueFormDTO + * @return 删除的议题中,转为了项目,返回项目id,上层再单独去删除项目 + */ + @Override + public Result> deleteIssueInternal(DelIssueFormDTO delIssueFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "deleteIssueInternal", delIssueFormDTO); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index 7741561d9f..db38938089 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -179,7 +179,9 @@ callerRunsPolicy false - https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + https://epmet-open.elinkservice.cn/api/epmetscan/api https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java index 2a0cf7b35f..8cb2d2d0da 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java @@ -36,4 +36,9 @@ public interface UserMessageConstant { */ String PROJECT_RESOLVED_MSG = "您收到一条【%s】的新信息,请您尽快处理。"; + /** + * 议题转项目消息模板 + */ + String PUB_ISSUE_SHIFT_PROJECT_MSG = "您发表的议题\"%s\"的问题,已由%s部门处理,请查看。"; + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java index 8317eb8ab0..25f4af86f9 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java @@ -2,16 +2,15 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.enums.RequirePermissionEnum; +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.constant.IssueConstant; import com.epmet.dto.form.*; -import com.epmet.dto.result.ApplicationDetailWorkResultDTO; -import com.epmet.dto.result.ApplicationHistoryResDTO; -import com.epmet.dto.result.ApplicationHistoryWorkResultDTO; -import com.epmet.dto.result.IssueApplicationResDTO; +import com.epmet.dto.result.*; import com.epmet.service.IssueApplicationHistoryService; import com.epmet.service.IssueApplicationService; import com.epmet.service.IssueService; @@ -21,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; /** @@ -130,4 +131,38 @@ public class IssueAuditController { public Result audit(@LoginUser TokenDto token, @RequestBody IssueAuditionFormDTO param){ return new Result().ok(issueService.audit(token,param)); } + + /** + * Desc: 审核列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/10/9 17:11 + */ + @PostMapping("auditList") + public Result> auditList(@RequestBody AuditListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result>().ok(issueApplicationService.auditList(formDTO)); + } + + @PostMapping("auditListExport") + public void auditListExport(@RequestBody AuditListFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + issueApplicationService.auditListExport(formDTO,response); + } + + /** + * Desc: 补全议题审核表历史数据 + * @param + * @author zxc + * @date 2022/10/10 10:55 + */ + @PostMapping("initIssueApplicationHistoryData") + public Result initIssueApplicationHistoryData(){ + issueApplicationService.initIssueApplicationHistoryData(); + return new Result(); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java index 6f459a71ad..6df8e177c3 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCategoryController.java @@ -106,7 +106,8 @@ public class IssueCategoryController { * @Author sun **/ @PostMapping("categorytaglist") - public Result categoryTagList(@RequestBody IssueCategoryTagListFormDTO formDTO) { + public Result categoryTagList(@LoginUser TokenDto tokenDto,@RequestBody IssueCategoryTagListFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(formDTO, IssueCategoryTagListFormDTO.CategoryTag.class); return new Result().ok(issueCategoryService.categoryTagList(formDTO)); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java index ec49c3bb81..efb1ede9f1 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java @@ -1,6 +1,8 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.form.PageFormDTO; +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; @@ -13,9 +15,12 @@ import com.epmet.resi.group.dto.group.result.GroupShiftProjectListResultDTO; import com.epmet.resi.group.dto.group.result.GroupVotingListResultDTO; import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO; import com.epmet.service.IssueService; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; /** @@ -280,7 +285,11 @@ public class IssueController { return new Result>().ok(issueService.canEvaluateProjectCountBatch(issueIds)); } - + /** + * 无需解决:结案选择无需解决的项目、关闭选择无需解决的议题 + * @param formDTO + * @return + */ @PostMapping("unresolvedlist") public Result> getUnresolvedList(@RequestBody ShiftProjectListFromDTO formDTO){ return new Result>().ok(issueService.getUnResolvedList(formDTO)); @@ -333,5 +342,78 @@ public class IssueController { return new Result().ok(issueService.issueAuditReset(gridId)); } + /** + * Desc: 创建议题【直接创建】 + * @param formDTO + * @author zxc + * @date 2022/10/8 09:03 + */ + @PostMapping("createIssue") + public Result createIssue(@LoginUser TokenDto tokenDto,@RequestBody IssueDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,IssueDTO.IssueForm.class); + issueService.createIssue(formDTO); + return new Result(); + } + + /** + * 根据议题ids查询议题简要信息 + * @param issueIds + * @return + */ + @PostMapping("getIssueProfile") + public Result> getIssueProfile(@RequestBody List issueIds) { + if (CollectionUtils.isEmpty(issueIds)) { + return new Result<>(); + } + return new Result>().ok(issueService.getIssueProfile(issueIds)); + } + + /** + * Desc: 查询所有议题 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/10/9 16:59 + */ + @PostMapping("allIssueList") + public Result> allIssueList(@RequestBody AllIssueListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + return new Result>().ok(issueService.allIssueList(formDTO)); + } + + @PostMapping("allIssueListExport") + public void allIssueListExport(@RequestBody AllIssueListFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + issueService.allIssueListExport(formDTO,response); + } + + /** + * 发布议题 + * 事件转议题 + * @param issueFormDTO + * @return + */ + @PostMapping("publishIssue") + public Result publishIssue(@RequestBody PublishIssueFormDTO issueFormDTO) { + ValidatorUtils.validateEntity(issueFormDTO, PublishIssueFormDTO.AddUserShowGroup.class); + return new Result().ok(issueService.publishIssue(issueFormDTO)); + } + + /** + * 删除事件时,事件转了议题,调用此方法,删除议题 + * 批量删除议题(议题如果转了项目,此方法不删除项目!) + * @param delIssueFormDTO + * @return 删除的议题中,转为了项目,返回项目id,上层再单独去删除项目 + */ + @PostMapping("deleteIssueInternal") + public Result> deleteIssueInternal(@RequestBody DelIssueFormDTO delIssueFormDTO){ + ValidatorUtils.validateEntity(delIssueFormDTO); + return new Result>().ok(issueService.deleteIssueInternal(delIssueFormDTO)); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java index a77e531b26..ec413629df 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueManageController.java @@ -43,8 +43,9 @@ public class IssueManageController { * @Description 议题管理-关闭议题 **/ @PostMapping("closeissue") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_CLOSE) + // @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_CLOSE) public Result closeIssue(@LoginUser TokenDto tokenDTO, @RequestBody CloseIssueFormDTO formDTO) { + formDTO.setCurrentUserId(tokenDTO.getUserId()); ValidatorUtils.validateEntity(formDTO); issueService.closeIssue(formDTO); return new Result(); @@ -88,6 +89,11 @@ public class IssueManageController { return new Result().ok(issueVoteStatisticalService.votingTrend(issueId)); } + @PostMapping("votingTrendV2") + public Result votingTrendV2(@RequestBody IssueIdFormDTO issueId){ + return new Result().ok(issueVoteStatisticalService.votingTrendV2(issueId)); + } + /** * @Description 满意度评价列表——已关闭 * @param formDTO @@ -196,6 +202,7 @@ public class IssueManageController { @PostMapping("progress") @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_ISSUE_DETAIL) public Result> processList(@RequestBody IssueIdFormDTO issueId){ + ValidatorUtils.validateEntity(issueId); return new Result>().ok(issueProcessService.processList(issueId)); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProcessController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProcessController.java index 737b187ad1..5250066ed8 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProcessController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProcessController.java @@ -27,6 +27,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IssueProcessDTO; import com.epmet.dto.form.IssueIdFormDTO; +import com.epmet.dto.result.IssueAdvanceResDTO; import com.epmet.dto.result.ProcessListResultDTO; import com.epmet.excel.IssueProcessExcel; import com.epmet.service.IssueProcessService; @@ -103,4 +104,13 @@ public class IssueProcessController { return new Result>().ok(issueProcessService.processList(issueId)); } + /** + * 议题的处理进展,(只包含发起议题、关闭议题) + * @param issueId + * @return + */ + @PostMapping("issueprocess") + public Result queryIssueProcess(@RequestBody IssueIdFormDTO issueId){ + return new Result().ok(issueProcessService.queryIssueProcess(issueId)); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java index 33296076b6..4f2ede6325 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueApplicationDao.java @@ -19,8 +19,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IssueApplicationDTO; +import com.epmet.dto.form.AuditListFormDTO; import com.epmet.dto.form.IssueAppQueryFormDTO; import com.epmet.dto.form.UserPubAuditingIssueFormDTO; +import com.epmet.dto.result.AuditListResultDTO; import com.epmet.dto.result.IssueApplicationResDTO; import com.epmet.dto.result.UserPubAuditingIssueResDTO; import com.epmet.entity.IssueApplicationEntity; @@ -74,4 +76,28 @@ public interface IssueApplicationDao extends BaseDao { */ List selectTopicIdList(@Param("topicIdList") List topicIdList); + /** + * Desc: 待审核,驳回列表 + * @param formDTO + * @author zxc + * @date 2022/10/10 13:42 + */ + List auditList(AuditListFormDTO formDTO); + + /** + * Desc: 补全数据 + * @param + * @author zxc + * @date 2022/10/10 13:42 + */ + List initIssueApplicationHistoryData(); + + /** + * Desc: 批量更新议题审核组织信息 + * @param list + * @author zxc + * @date 2022/10/10 13:42 + */ + void updateIssueApplication(List list); + } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueAttachmentDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueAttachmentDao.java new file mode 100644 index 0000000000..828bea698e --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueAttachmentDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.IssueAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * issue库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-30 + */ +@Mapper +public interface IssueAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java index 650e4ac227..42fb7ca9bf 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCategoryDao.java @@ -42,7 +42,7 @@ public interface IssueCategoryDao extends BaseDao { * @Description 查询议题绑定的分类名称,按排序升序 * @Author sun **/ - List selectIssueCategoryList(@Param("issueId") String issueId); + List selectIssueCategoryList(@Param("customerId")String customerId,@Param("issueId") String issueId); /** * @param formDTO diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java index 1c5ae213ee..ce3dc28a1c 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java @@ -308,4 +308,12 @@ public interface IssueDao extends BaseDao { */ Integer selectAuditIssue(@Param("gridId")String gridId); + /** + * 根据议题ids查询议题简要信息 + * @param issueIds + * @return + */ + List selectIssueProfile(@Param("issueIds") List issueIds); + + List allIssueList(AllIssueListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueApplicationEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueApplicationEntity.java index 8ec3f59be1..f61f5e6917 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueApplicationEntity.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueApplicationEntity.java @@ -70,6 +70,9 @@ public class IssueApplicationEntity extends BaseEpmetEntity { */ private String gridId; + private String orgId; + private String orgIdPath; + /** * 审核通过后对应的 议题id */ @@ -85,4 +88,16 @@ public class IssueApplicationEntity extends BaseEpmetEntity { */ private String approveStaffId; + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueAttachmentEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueAttachmentEntity.java new file mode 100644 index 0000000000..b7016bd587 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueAttachmentEntity.java @@ -0,0 +1,82 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * issue库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_attachment") +public class IssueAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 业务id + */ + private String businessId; + + /** + * 议题:issue + */ + private String attachTo; + + /** + * 附件名 + */ + private String name; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String format; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String type; + + /** + * 附件地址 + */ + private String url; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java index fa33418bc6..7f47f3cfa1 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java @@ -43,7 +43,7 @@ public class IssueEntity extends BaseEpmetEntity { private String issueStatus; /** - * 来源类型 eg:resi_topic + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event */ private String sourceType; @@ -112,4 +112,19 @@ public class IssueEntity extends BaseEpmetEntity { */ private Date closedTime; + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AllIssueListExportExcel.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AllIssueListExportExcel.java new file mode 100644 index 0000000000..5a4a508506 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AllIssueListExportExcel.java @@ -0,0 +1,42 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/10/11 16:30 + * @DESC + */ +@Data +public class AllIssueListExportExcel { + + @ExcelProperty(value = "所属网格") + @ColumnWidth(20) + private String gridName; + + @ExcelProperty(value = "议题标题") + @ColumnWidth(20) + private String issueTitle; + + @ExcelProperty(value = "议题建议") + @ColumnWidth(20) + private String suggestion; + + @ExcelProperty(value = "议题创建时间") + @ColumnWidth(20) + private String createdTime; + + @ExcelProperty(value = "支持数") + @ColumnWidth(20) + private Integer supportCount; + + @ExcelProperty(value = "反对数") + @ColumnWidth(20) + private Integer oppositionCount; + + @ExcelProperty(value = "议题状态") + @ColumnWidth(20) + private String issueStatusName; +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AuditListExportExcel.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AuditListExportExcel.java new file mode 100644 index 0000000000..f6aac9792c --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AuditListExportExcel.java @@ -0,0 +1,34 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +/** + * @Author zxc + * @DateTime 2022/10/11 16:45 + * @DESC + */ +@Data +public class AuditListExportExcel { + + @ExcelProperty(value = "所属网格") + @ColumnWidth(20) + private String gridName; + + @ExcelProperty(value = "议题标题") + @ColumnWidth(20) + private String issueTitle; + + @ExcelProperty(value = "议题建议") + @ColumnWidth(20) + private String suggestion; + + @ExcelProperty(value = "状态") + @ColumnWidth(20) + private String applyStatusName; + + @ExcelProperty(value = "提交审核时间") + @ColumnWidth(20) + private String applyTime; +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovProjectFeignClient.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovProjectFeignClient.java index 38331b5780..d0e29cf063 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovProjectFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/GovProjectFeignClient.java @@ -2,11 +2,9 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.ProcessProjectIdFormDTO; import com.epmet.dto.form.ShiftProjectFormDTO; import com.epmet.dto.form.ShiftProjectsFromDTO; import com.epmet.dto.result.IssueProjectResultDTO; -import com.epmet.dto.result.ProcessListResultDTO; import com.epmet.dto.result.ShiftProjectResultDTO; import com.epmet.feign.fallback.GovProjectFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; @@ -43,9 +41,9 @@ public interface GovProjectFeignClient { /** * @Description 议题处理进展——已转项目 - * @param formDTO + * @param formDTO 该方法已经放到了GovProjectOpenFeignClient * @author zxc - */ + *//* @PostMapping("/gov/project/projectprocess/projectprocesslist") - Result> projectProcessList(@RequestBody ProcessProjectIdFormDTO formDTO); + Result> projectProcessList(@RequestBody ProcessProjectIdFormDTO formDTO);*/ } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovProjectFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovProjectFeignClientFallBack.java index c8185fa47e..a120f582ac 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovProjectFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/feign/fallback/GovProjectFeignClientFallBack.java @@ -3,11 +3,9 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.ProcessProjectIdFormDTO; import com.epmet.dto.form.ShiftProjectFormDTO; import com.epmet.dto.form.ShiftProjectsFromDTO; import com.epmet.dto.result.IssueProjectResultDTO; -import com.epmet.dto.result.ProcessListResultDTO; import com.epmet.dto.result.ShiftProjectResultDTO; import com.epmet.feign.GovProjectFeignClient; import org.springframework.stereotype.Component; @@ -26,10 +24,11 @@ public class GovProjectFeignClientFallBack implements GovProjectFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getProjectByIssue", fromDTO); } - @Override + //该方法已经放到了GovProjectOpenFeignClient + /*@Override public Result> projectProcessList(ProcessProjectIdFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "projectProcessList", formDTO); - } + }*/ @Override public Result issueShiftProject(ShiftProjectFormDTO formDTO) { diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java index aecc10b0b5..5b00541fb0 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java @@ -20,8 +20,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IssueApplicationDTO; +import com.epmet.dto.form.AuditListFormDTO; import com.epmet.dto.form.IssueAppQueryFormDTO; import com.epmet.dto.form.UserPubAuditingIssueFormDTO; +import com.epmet.dto.result.AuditListResultDTO; import com.epmet.dto.result.IssueApplicationResDTO; import com.epmet.dto.result.UserPubAuditingIssueResDTO; import com.epmet.entity.IssueApplicationEntity; @@ -32,6 +34,8 @@ import com.epmet.resi.group.dto.group.result.ApplicationDetailResultDTO; import com.epmet.resi.group.dto.group.result.ApplicationHistoryResultDTO; import com.epmet.resi.group.dto.group.result.ApplicationListResultDTO; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -150,4 +154,9 @@ public interface IssueApplicationService extends BaseService notIssueToTopicIds(List topicIdList); + + PageData auditList(AuditListFormDTO formDTO); + void auditListExport(AuditListFormDTO formDTO, HttpServletResponse response) throws IOException; + + void initIssueApplicationHistoryData(); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueAttachmentService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueAttachmentService.java new file mode 100644 index 0000000000..1ca53e2103 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueAttachmentService.java @@ -0,0 +1,78 @@ +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.IssueAttachmentDTO; +import com.epmet.entity.IssueAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * issue库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-30 + */ +public interface IssueAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-09-30 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-09-30 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return IssueAttachmentDTO + * @author generator + * @date 2022-09-30 + */ + IssueAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-09-30 + */ + void save(IssueAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-09-30 + */ + void update(IssueAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-09-30 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java index 5717b27db0..489470c850 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCategoryService.java @@ -27,6 +27,7 @@ import com.epmet.dto.result.IssueCategoryTagListResultDTO; import com.epmet.dto.result.ProjectCategoryTagResultDTO; import com.epmet.entity.IssueCategoryEntity; +import java.util.Date; import java.util.List; import java.util.Map; @@ -132,4 +133,5 @@ public interface IssueCategoryService extends BaseService { **/ void saveCategory(IssueSaveCategoryFormDTO formDTO); + void delByIssueId(String issueId, String userId, Date delTime); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProcessService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProcessService.java index b3b8a300ab..025d10baca 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProcessService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProcessService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IssueProcessDTO; import com.epmet.dto.form.IssueIdFormDTO; +import com.epmet.dto.result.IssueAdvanceResDTO; import com.epmet.dto.result.ProcessListResultDTO; import com.epmet.entity.IssueProcessEntity; @@ -109,4 +110,11 @@ public interface IssueProcessService extends BaseService { * @date 2020.05.13 16:42 **/ int insertOne(IssueProcessDTO issueProcessDTO); + + /** + * 议题的处理进展,(只包含发起议题、关闭议题) + * @param issueId + * @return + */ + IssueAdvanceResDTO queryIssueProcess(IssueIdFormDTO issueId); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java index 1296374261..4ccd839e72 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java @@ -14,6 +14,8 @@ import com.epmet.resi.group.dto.group.result.GroupShiftProjectListResultDTO; import com.epmet.resi.group.dto.group.result.GroupVotingListResultDTO; import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Set; @@ -343,6 +345,7 @@ public interface IssueService extends BaseService { /** * 无需解决解决列表 + * 无需解决:结案选择无需解决的项目、关闭选择无需解决的议题 * @author zhaoqifeng * @date 2021/7/27 16:58 * @param fromDTO @@ -384,4 +387,43 @@ public interface IssueService extends BaseService { */ Boolean issueAuditReset(String gridId); + /** + * Desc: 创建议题【直接创建】 + * @param issueDTO + * @author zxc + * @date 2022/10/8 09:03 + */ + void createIssue(IssueDTO issueDTO); + + /** + * 根据议题ids查询议题简要信息 + * @param issueIds + * @return + */ + List getIssueProfile(List issueIds); + + /** + * Desc: 查询所有议题 + * @param formDTO + * @author zxc + * @date 2022/10/9 16:58 + */ + PageData allIssueList(AllIssueListFormDTO formDTO); + void allIssueListExport(AllIssueListFormDTO formDTO, HttpServletResponse response) throws IOException; + + /** + * 发布议题 + * 事件转议题 + * @param issueFormDTO + * @return + */ + IssueDTO publishIssue(PublishIssueFormDTO issueFormDTO); + + /** + * 删除事件时,事件转了议题,调用此方法,删除议题 + * 批量删除议题(议题如果转了项目,此方法不删除项目!) + * @param delIssueFormDTO + * @return 删除的议题中,转为了项目,返回议题id,上层再单独去删除项目 + */ + List deleteIssueInternal(DelIssueFormDTO delIssueFormDTO); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java index b7970e8793..a99f1a96c7 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueTagsService.java @@ -26,6 +26,7 @@ import com.epmet.dto.form.IssueTagsSaveFormDTO; import com.epmet.dto.result.AddTagResultDTO; import com.epmet.entity.IssueTagsEntity; +import java.util.Date; import java.util.List; import java.util.Map; @@ -122,4 +123,6 @@ public interface IssueTagsService extends BaseService { * @date 2020/12/10 上午9:37 */ void issueTagSave(IssueTagsSaveFormDTO form, TokenDto tokenDto); + + void delByIssueId(String issueId, String userId, Date delTime); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java index a1aec7c5f1..d9f8c8c7dc 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueVoteStatisticalService.java @@ -28,6 +28,7 @@ import com.epmet.dto.result.EvaluationListResultDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.dto.result.VoteResultDTO; import com.epmet.dto.result.VotingTrendResultDTO; +import com.epmet.entity.IssueEntity; import com.epmet.entity.IssueVoteStatisticalEntity; import java.util.List; @@ -115,6 +116,7 @@ public interface IssueVoteStatisticalService extends BaseService page(Map params) { @@ -136,6 +140,8 @@ public class IssueApplicationHistoryServiceImpl extends BaseServiceImpl result = resiGroupOpenFeignClient.applicationDetail(formDTO); if (!result.success()){ throw new RenException("工作端查询待审核||已驳回 申请详情失败......"); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java index 074b7bcd39..7332720abd 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java @@ -17,19 +17,39 @@ package com.epmet.service.impl; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.dao.IssueApplicationDao; import com.epmet.dto.IssueApplicationDTO; +import com.epmet.dto.form.AuditListFormDTO; import com.epmet.dto.form.IssueAppQueryFormDTO; import com.epmet.dto.form.UserPubAuditingIssueFormDTO; +import com.epmet.dto.result.AllIssueListResultDTO; +import com.epmet.dto.result.AuditListResultDTO; import com.epmet.dto.result.IssueApplicationResDTO; import com.epmet.dto.result.UserPubAuditingIssueResDTO; import com.epmet.entity.IssueApplicationEntity; +import com.epmet.excel.AllIssueListExportExcel; +import com.epmet.excel.AuditListExportExcel; import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO; import com.epmet.resi.group.dto.group.form.ApplicationListFormDTO; @@ -39,13 +59,17 @@ import com.epmet.resi.group.dto.group.result.ApplicationListResultDTO; import com.epmet.service.IssueApplicationService; import com.epmet.utils.ModuleConstants; import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.*; /** * 话题转议题申请表 @@ -54,6 +78,7 @@ import java.util.Map; * @since v1.0.0 2020-11-17 */ @Service +@Slf4j public class IssueApplicationServiceImpl extends BaseServiceImpl implements IssueApplicationService { @Override @@ -186,4 +211,98 @@ public class IssueApplicationServiceImpl extends BaseServiceImpl auditList(AuditListFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("查询工作人员信息失败:"+formDTO.getUserId()); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + formDTO.setOrgType(ModuleConstants.ISSUE_PROCESS_ORG_TYPE_AGENCY); + } + PageData result = new PageData<>(new ArrayList(),NumConstant.ZERO_L); + if (formDTO.getIsPage()){ + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.auditList(formDTO)); + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + }else { + List auditListResultDTOS = baseDao.auditList(formDTO); + result.setList(auditListResultDTOS); + result.setTotal(auditListResultDTOS.size()); + } + if (CollectionUtils.isNotEmpty(result.getList())){ + result.getList().forEach(l -> { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); + if(null == gridInfo){ + throw new EpmetException("查询网格信息失败:"+l.getGridId()); + } + l.setGridName(gridInfo.getGridNamePath()); + }); + } + return result; + } + + @Override + public void auditListExport(AuditListFormDTO formDTO, HttpServletResponse response) throws IOException { + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "议题审核列表" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), AuditListExportExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + List list = null; + do { + PageData data = auditList(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), AuditListExportExcel.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + @Override + public void initIssueApplicationHistoryData() { + Integer no = NumConstant.ONE; + Integer size; + do { + PageInfo pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> baseDao.initIssueApplicationHistoryData()); + List list = pageInfo.getList(); + size = list.size(); + if (CollectionUtils.isNotEmpty(list)){ + for (IssueApplicationDTO l : list) { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); + if (null == gridInfo){ + log.warn("查询网格信息失败:"+l.getGridId()); + continue; + } + l.setOrgId(gridInfo.getPid()); + l.setOrgIdPath(gridInfo.getPids()); + } + updateIssueApplication(list); + } + no++; + }while (size.compareTo(NumConstant.ONE_HUNDRED) == NumConstant.ZERO); + } + + @Transactional(rollbackFor = Exception.class) + public void updateIssueApplication(List list){ + baseDao.updateIssueApplication(list); + } + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueAttachmentServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueAttachmentServiceImpl.java new file mode 100644 index 0000000000..e9d0c69b54 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueAttachmentServiceImpl.java @@ -0,0 +1,82 @@ +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IssueAttachmentDao; +import com.epmet.dto.IssueAttachmentDTO; +import com.epmet.entity.IssueAttachmentEntity; +import com.epmet.service.IssueAttachmentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * issue库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-30 + */ +@Service +public class IssueAttachmentServiceImpl extends BaseServiceImpl implements IssueAttachmentService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, IssueAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, IssueAttachmentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public IssueAttachmentDTO get(String id) { + IssueAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, IssueAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(IssueAttachmentDTO dto) { + IssueAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IssueAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(IssueAttachmentDTO dto) { + IssueAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IssueAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java index c86e5d926d..2fda58fd28 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java @@ -18,6 +18,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; @@ -44,10 +45,7 @@ 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; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -130,7 +128,7 @@ public class IssueCategoryServiceImpl extends BaseServiceImpl categoryList = baseDao.selectIssueCategoryList(formDTO.getIssueId()); + List categoryList = baseDao.selectIssueCategoryList(formDTO.getCustomerId(),formDTO.getIssueId()); if (categoryList.size() > NumConstant.ZERO) { resultDTO.setCategoryList(categoryList); } @@ -224,4 +222,13 @@ public class IssueCategoryServiceImpl extends BaseServiceImpl wrapper = new LambdaUpdateWrapper(); + wrapper.eq(IssueCategoryEntity::getIssueId, issueId) + .set(IssueCategoryEntity::getUpdatedTime, delTime) + .set(IssueCategoryEntity::getUpdatedBy, userId) + .set(IssueCategoryEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null, wrapper); + } } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java index 5e47cc5a4a..b53f885c0f 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java @@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; @@ -32,9 +34,12 @@ import com.epmet.dto.IssueDTO; import com.epmet.dto.IssueProcessDTO; import com.epmet.dto.form.IssueIdFormDTO; import com.epmet.dto.form.ProcessProjectIdFormDTO; +import com.epmet.dto.result.IssueAdvanceResDTO; import com.epmet.dto.result.ProcessListResultDTO; +import com.epmet.dto.result.ProcessListResultDTOBak; +import com.epmet.dto.result.ProjectProcessListResultDTO; import com.epmet.entity.IssueProcessEntity; -import com.epmet.feign.GovProjectFeignClient; +import com.epmet.feign.GovProjectOpenFeignClient; import com.epmet.service.IssueProcessService; import com.epmet.service.IssueService; import org.apache.commons.lang3.StringUtils; @@ -60,11 +65,11 @@ public class IssueProcessServiceImpl extends BaseServiceImpl page(Map params) { @@ -140,33 +145,61 @@ public class IssueProcessServiceImpl extends BaseServiceImpl processList(IssueIdFormDTO issueId) { List listResult = new ArrayList(); IssueDTO issueDTO = issueService.get(issueId.getIssueId()); + if(null==issueDTO){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"议题不存在","议题不存在"); + } String issueStatus = issueDTO.getIssueStatus(); if (issueStatus.equals(IssueConstant.ISSUE_CLOSED)){ //已关闭——处理进展 listResult = baseDao.issueProcess(issueId); + return listResult; }else if (issueStatus.equals(IssueConstant.ISSUE_SHIFT_PROJECT)){ //已转项目——处理进展 String projectId = issueProjectRelationDao.selectProjectIdByIssueId(issueId.getIssueId()); if (!StringUtils.isBlank(projectId)) { ProcessProjectIdFormDTO formDTO = new ProcessProjectIdFormDTO(); formDTO.setProjectId(projectId); - Result> resultDTO = govProjectFeignClient.projectProcessList(formDTO); + Result> resultDTO = govProjectOpenFeignClient.projectProcessList(formDTO); if (!resultDTO.success()){ throw new RenException(IssueConstant.PROJECT_PROCESS_LIST_FAILURE); } if (!CollectionUtils.isEmpty(resultDTO.getData())){ - listResult = resultDTO.getData(); - } - //转议题信息 - ProcessListResultDTO issueProcessResultDTO = issueProcessDao.issueBeginInfo(issueId); - if (null != issueProcessResultDTO) { - listResult.add(issueProcessResultDTO); + listResult.addAll(ConvertUtils.sourceToTarget(resultDTO.getData(),ProcessListResultDTO.class)); } } - }else { - return new ArrayList<>(); + } + //转议题信息 + ProcessListResultDTO issueProcessResultDTO = issueProcessDao.issueBeginInfo(issueId); + if (null != issueProcessResultDTO) { + listResult.add(issueProcessResultDTO); } return listResult; } + /** + * 议题处理进展(只包含发起议题、关闭议题) + * + * @param issueId + * @return + */ + @Override + public IssueAdvanceResDTO queryIssueProcess(IssueIdFormDTO issueId) { + IssueDTO issueDTO = issueService.get(issueId.getIssueId()); + List processList=new ArrayList<>(); + if (issueDTO.getIssueStatus().equals(IssueConstant.ISSUE_CLOSED)){ + //已关闭——处理进展 + processList = baseDao.issueProcess(issueId); + }else{ + //转议题信息 + ProcessListResultDTO issueProcessResultDTO = issueProcessDao.issueBeginInfo(issueId); + if (null != issueProcessResultDTO) { + processList.add(issueProcessResultDTO); + } + } + IssueAdvanceResDTO issueAdvanceResDTO=new IssueAdvanceResDTO(); + issueAdvanceResDTO.setIssueId(issueDTO.getId()); + issueAdvanceResDTO.setIssueStatus(issueDTO.getIssueStatus()); + issueAdvanceResDTO.setProcessList(ConvertUtils.sourceToTarget(processList, ProcessListResultDTOBak.class)); + return issueAdvanceResDTO; + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java index 99cc85eecf..2ae8d5e288 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSatisfactionDetailServiceImpl.java @@ -178,10 +178,9 @@ public class IssueSatisfactionDetailServiceImpl extends BaseServiceImpl imp private IssueVoteDetailService issueVoteDetailService; @Autowired private DistributedLock distributedLock; + @Autowired + private IssueAttachmentService issueAttachmentService; @Value("${openapi.scan.server.url}") private String scanApiUrl; @Value("${openapi.scan.method.textSyncScan}") private String textSyncScanMethod; + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; @Override public PageData page(Map params) { @@ -209,13 +228,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp //议题信息 IssueResultDTO issueResult = issueDao.issueDetail(issueDetail); if (null != issueResult && StringUtils.isNotBlank(issueResult.getGridId())) { - BelongGridNameFormDTO formDTO = new BelongGridNameFormDTO(); - formDTO.setGridId(issueResult.getGridId()); - Result result = govOrgOpenFeignClient.getGridNameByGridId(formDTO); - logger.info("根据网格id查询网格名称接口返参:" + JSON.toJSONString(result)); - if (result.success() && null != result.getData()) { - issueResult.setGridName(result.getData().getBelongsGridName()); - } + GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(issueResult.getGridId()); + issueResult.setGridName(null != gridInfoCache ? gridInfoCache.getGridNamePath() : StrConstant.EPMETY_STR); } return issueResult; } @@ -376,8 +390,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp result.setAuditSwitch(ifOpen ? ModuleConstants.AUDIT_SWITCH_OPEN : ModuleConstants.AUDIT_SWITCH_CLOSE); //2.居民端组长提交议题审核 - - //默认打开 + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(param.getGridId()); + if (null == gridInfo){ + throw new EpmetException("查询网格信息失败:"+param.getGridId()); + } + //默认打开 //2.1查询是否存在application记录 Map applicationParam = new HashMap<>(); applicationParam.put(ModuleConstants.FIELD_JAVA_TOPIC_ID, param.getTopicId()); @@ -390,6 +407,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp if(ifOpen) { //首次提交 新增application IssueApplicationDTO newApplication = ConvertUtils.sourceToTarget(param, IssueApplicationDTO.class); + newApplication.setOrgId(gridInfo.getPid()); + newApplication.setOrgIdPath(gridInfo.getPids()); newApplication.setApplyStatus(defaultStatusUnderAuditing); newApplication.setId(UUID.randomUUID().toString().replace("-", "")); applicationService.save(newApplication); @@ -558,8 +577,6 @@ public class IssueServiceImpl extends BaseServiceImpl imp app2update.setIssueId(issueResult.getIssueId()); } - }else { - throw new RenException(topicInfo.getInternalMsg()); } @@ -591,7 +608,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp boolean flag = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient) .sendGroupAchievementMqMsg(new GroupAchievementMQMsg(application.getCustomerId(), application.getGroupId(), AchievementTypeEnum.TOISSUE.getCode())); if (!flag) { - logger.error("发送(小组成就)系统消息到message服务失败"); + logger.warn("发送(小组成就)系统消息到message服务失败"); } return app2update.getIssueId(); } @@ -606,7 +623,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Override public List votingList(CommonIssueListFormDTO issueListForm) { PageHelper.startPage(issueListForm.getPageNo(), issueListForm.getPageSize(), issueListForm.getIsPage()); - return baseDao.selectVotingList(issueListForm); + List resultList=baseDao.selectVotingList(issueListForm); + return resultList; } /** @@ -619,7 +637,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Override public List closedList(CommonIssueListFormDTO issueListForm) { PageHelper.startPage(issueListForm.getPageNo(), issueListForm.getPageSize(), issueListForm.getIsPage()); - return baseDao.selectClosedList(issueListForm); + List resultDTOList=baseDao.selectClosedList(issueListForm); + return resultDTOList; } /** @@ -633,7 +652,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp public GovIssueDetailResultDTO issueDetailGov(IssueDetailFormDTO issueParam) { //1.得到议题信息 IssueEntity issueDetail = selectById(issueParam.getIssueId()); - + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(issueDetail.getGridId()); + if(null == gridInfo){ + throw new EpmetException("查询网格信息失败"+issueDetail.getGridId()); + } + GovIssueDetailResultDTO issueInfo = new GovIssueDetailResultDTO(); //2.1如果此条议题来源自话题 if(StringUtils.equals(ModuleConstants.ISSUE_FROM_TOPIC,issueDetail.getSourceType())){ GovTopicIssueInfoFormDTO topicParam = new GovTopicIssueInfoFormDTO(); @@ -645,10 +668,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp resiGroupFeignClient.topicInfoForIssueDetailGov(topicParam); if(topicResult.success() && null != topicResult.getData()){ GovTopicOfIssueInfoResultDTO topicInfo = ConvertUtils.sourceToTarget(topicResult.getData(),GovTopicOfIssueInfoResultDTO.class); - GovIssueDetailResultDTO issueInfo = ConvertUtils.sourceToTarget(topicResult.getData(),GovIssueDetailResultDTO.class); + issueInfo = ConvertUtils.sourceToTarget(topicResult.getData(),GovIssueDetailResultDTO.class); issueInfo.setIssueStatus(issueDetail.getIssueStatus()); issueInfo.setIssueSuggestion(issueDetail.getSuggestion()); issueInfo.setIssueTitle(issueDetail.getIssueTitle()); + issueInfo.setSourceId(issueDetail.getSourceId()); issueInfo.setVotingDeadline(null == issueDetail.getVotingDeadline() ? NumConstant.ZERO_L : issueDetail.getVotingDeadline().getTime()/NumConstant.ONE_THOUSAND); issueInfo.setTopicInfo(topicInfo); @@ -660,6 +684,29 @@ public class IssueServiceImpl extends BaseServiceImpl imp return issueInfo; } //查询话题失败异常 + }else if (ModuleConstants.ISSUE.equals(issueDetail.getSourceType())){ + issueInfo = ConvertUtils.sourceToTarget(issueDetail,GovIssueDetailResultDTO.class); + issueInfo.setIssueSuggestion(issueDetail.getSuggestion()); + Result> userResult = userOpenFeignClient.queryUserBaseInfo(Arrays.asList(issueDetail.getCreatedBy())); + if (!userResult.success() || CollectionUtils.isEmpty(userResult.getData())){ + throw new EpmetException("查询居民信息失败"); + } + UserBaseInfoResultDTO user = userResult.getData().get(NumConstant.ZERO); + issueInfo.setIssueInitiator(user.getShowName()); + issueInfo.setIssuePublisherMobile(user.getMobile()); + issueInfo.setBelongsGridName(gridInfo.getGridNamePath()); + return issueInfo; + }else { + issueInfo = ConvertUtils.sourceToTarget(issueDetail,GovIssueDetailResultDTO.class); + issueInfo.setIssueSuggestion(issueDetail.getSuggestion()); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(issueDetail.getCustomerId(), issueDetail.getCreatedBy()); + if (null == staffInfo){ + throw new EpmetException("查询工作人员信息失败:"+issueDetail.getCreatedBy()); + } + issueInfo.setIssueInitiator(staffInfo.getRealName()); + issueInfo.setIssuePublisherMobile(staffInfo.getMobile()); + issueInfo.setBelongsGridName(gridInfo.getGridNamePath()); + return issueInfo; } return null; @@ -675,50 +722,37 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Transactional(rollbackFor = Exception.class) public void closeIssue(CloseIssueFormDTO formDTO) { //公开回复内容审核 - if (StringUtils.isNotBlank(formDTO.getCloseReason())) { - TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); - TextTaskDTO taskDTO = new TextTaskDTO(); - taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); - taskDTO.setContent(formDTO.getCloseReason()); - textScanParamDTO.getTasks().add(taskDTO); - Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); - if (!textSyncScanResult.success()){ - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); - } else { - if (!textSyncScanResult.getData().isAllPass()) { - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); - } - } - } + checkCloseReason(formDTO.getCloseReason()); - Date date = new Date(); + Date nowTime = new Date(); //1:更新议题详情表数据 IssueEntity entity = baseDao.selectById(formDTO.getIssueId()); if (null == entity) { - throw new RenException(IssueConstant.SELECT_EXCEPTION); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.SELECT_EXCEPTION,"议题不存在"); } if (IssueConstant.ISSUE_CLOSED.equals(entity.getIssueStatus())) { - throw new RenException(IssueConstant.OPERATION_EXCEPTION); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.OPERATION_EXCEPTION,"议题不存在"); } entity.setIssueStatus(IssueConstant.ISSUE_CLOSED); entity.setCloseReason(formDTO.getCloseReason()); entity.setResolveType(formDTO.getResolveType()); - entity.setVotingDeadline(date); - entity.setClosedTime(date); + entity.setVotingDeadline(nowTime); + entity.setClosedTime(nowTime); if (baseDao.updateById(entity) < NumConstant.ONE) { throw new RenException(IssueConstant.UPPDATE_EXCEPTION); } //2:调用gov-org服务,查询组织网格名称 - AgencyGridResultDTO agencyGridResultDTO = new AgencyGridResultDTO(); + /*AgencyGridResultDTO agencyGridResultDTO = new AgencyGridResultDTO(); agencyGridResultDTO.setAgencyId(entity.getOrgId()); agencyGridResultDTO.setGridId(entity.getGridId()); Result resultDTO = govOrgFeignClient.getAgencyAndGrid(agencyGridResultDTO); if (!resultDTO.success() || null == resultDTO.getData()) { throw new RenException(IssueConstant.SELECT_GOV_ORG_EXCEPTION); } - agencyGridResultDTO = resultDTO.getData(); - + agencyGridResultDTO = resultDTO.getData();*/ + //上面代码注释,改用缓存 + GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(entity.getGridId()); //3:议题进展记录表新增数据 IssueProcessEntity processEntity = new IssueProcessEntity(); processEntity.setIssueId(formDTO.getIssueId()); @@ -726,30 +760,28 @@ public class IssueServiceImpl extends BaseServiceImpl imp processEntity.setOrgType(IssueConstant.ISSUE_GRID); processEntity.setOrgId(entity.getGridId()); processEntity.setOperationExplain(formDTO.getCloseReason()); - processEntity.setOrgName(agencyGridResultDTO.getAgencyName() + "-" + agencyGridResultDTO.getGridName()); + // processEntity.setOrgName(agencyGridResultDTO.getAgencyName() + "-" + agencyGridResultDTO.getGridName()); + processEntity.setOrgName(gridInfoCache.getGridNamePath()); + processEntity.setCreatedTime(nowTime); + processEntity.setUpdatedTime(nowTime); + processEntity.setCustomerId(entity.getCustomerId()); issueProcessDao.insert(processEntity); //4:调用epmet-message服务,给居民端话题创建人和议题发起人发送消息 - //4.1:调用resi-group查询话题创建人数据(目前议题来源只有来自话题) - Result resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); - if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) { - throw new RenException(IssueConstant.SELECT_TOPIC_EXCEPTION); - } - ResiTopicDTO topicDTO = resultTopicDTO.getData(); - //4.2:创建消息模板 - String messageContent = ""; - if (IssueConstant.ISSUE_RESOLVED.equals(formDTO.getResolveType())) { - messageContent = String.format(UserMessageConstant.ISSUE_RESOLVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason()); - } else if (IssueConstant.ISSUE_UNRESOLVED.equals(formDTO.getResolveType())) { - messageContent = String.format(UserMessageConstant.ISSUE_UNRESOLVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason()); - } - //4.3:调用服务,发送消息 - if (!saveUserMessageList(topicDTO, messageContent, entity).success()) { - throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION); - } - //4.4:2020.10.26 添加推送微信订阅消息功能 sun - if (!saveWxmpMessageList(topicDTO, messageContent, entity).success()) { - logger.error("议题关闭,推送微信订阅消息失败!"); + if (entity.getSourceType().equals(ModuleConstants.ISSUE_FROM_TOPIC)){ + //4.1:调用resi-group查询话题创建人数据(目前议题来源只有来自话题) + sendToTopicAndShiftIssueResiUser(entity.getSourceId(),formDTO.getResolveType(),entity,formDTO.getCloseReason()); + }else if(entity.getSourceType().equals("ic_event")){ + ColseProjectOrDemandFormDTO colseProjectOrDemandFormDTO=new ColseProjectOrDemandFormDTO(); + colseProjectOrDemandFormDTO.setCustomerId(entity.getCustomerId()); + colseProjectOrDemandFormDTO.setIcEventId(entity.getSourceId()); + colseProjectOrDemandFormDTO.setType("issue"); + colseProjectOrDemandFormDTO.setUserId(formDTO.getCurrentUserId()); + colseProjectOrDemandFormDTO.setCloseCaseTime(nowTime); + Result result = govProjectOpenFeignClient.closeProjectOrDemand(colseProjectOrDemandFormDTO); + if (!result.success()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"议题关闭异常,该议题来源于事件,回写事件信息失败","议题关闭异常:事件办结异常"); + } } try { @@ -757,12 +789,57 @@ public class IssueServiceImpl extends BaseServiceImpl imp SelectIssueVotingDetailFormDTO dto = new SelectIssueVotingDetailFormDTO(); dto.setGridId(entity.getGridId()); dto.setIssueId(formDTO.getIssueId()); + dto.setSourceType(entity.getSourceType()); issueVoteDetailService.updateVote(dto); }catch (RenException e){ logger.error(e.getInternalMsg()); } } + /** + * 议题关闭时,填写的关闭理由,走内容审核 + * @param closeReason + */ + private void checkCloseReason(String closeReason) { + if (StringUtils.isNotBlank(closeReason)) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + taskDTO.setContent(closeReason); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + } + + private void sendToTopicAndShiftIssueResiUser(String topicId,String resolveType,IssueEntity issueEntity,String closeReason) { + Result resultTopicDTO = resiGroupFeignClient.getTopicById(topicId); + if (resultTopicDTO.success() &&null != resultTopicDTO.getData()) { + ResiTopicDTO topicDTO = resultTopicDTO.getData(); + //4.2:创建消息模板 + String messageContent = ""; + if (IssueConstant.ISSUE_RESOLVED.equals(resolveType)) { + messageContent = String.format(UserMessageConstant.ISSUE_RESOLVED_MSG, topicDTO.getTopicContent(), closeReason); + } else if (IssueConstant.ISSUE_UNRESOLVED.equals(resolveType)) { + messageContent = String.format(UserMessageConstant.ISSUE_UNRESOLVED_MSG, topicDTO.getTopicContent(), closeReason); + } + //4.3:调用服务,发送消息 + if (!saveUserMessageList(topicDTO, messageContent, issueEntity).success()) { + throw new RenException(IssueConstant.SAVE_MSG_EXCEPTION); + } + //4.4:2020.10.26 添加推送微信订阅消息功能 sun + if (!saveWxmpMessageList(topicDTO, messageContent, issueEntity).success()) { + logger.warn("议题关闭,推送微信订阅消息失败!"); + } + } + } + /** * @Description 关闭议题时给话题创建人和议题发起人发送消息 * @author sun @@ -938,7 +1015,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp } try{ - issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null); + issueVoteStatisticalService.syncVotingCacheToDbByParams(entity,null); }catch(RenException e){ logger.error(e.getInternalMsg()); } @@ -1005,18 +1082,21 @@ public class IssueServiceImpl extends BaseServiceImpl imp //因需要保证议题表中的转项目时间与创建项目时间一致 因此先新增项目数据再更新议题数据 //2:调用resi-group查询话题创建人数据(目前议题来源只有来自话题),为了到项目服务初始数据以及发送消息使用 - Result resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); - if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.SELECT_TOPIC_EXCEPTION,IssueConstant.SELECT_TOPIC_EXCEPTION); + if("resi_topic".equals(entity.getSourceType())){ + Result resultTopicDTO = resiGroupFeignClient.getTopicById(entity.getSourceId()); + if (!resultTopicDTO.success() || null == resultTopicDTO.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),IssueConstant.SELECT_TOPIC_EXCEPTION,IssueConstant.SELECT_TOPIC_EXCEPTION); + } + ResiTopicDTO topicDTO = resultTopicDTO.getData(); + formDTO.setTopicDTO(topicDTO); } - ResiTopicDTO topicDTO = resultTopicDTO.getData(); - formDTO.setTopicDTO(topicDTO); //3:调用gov-project服务,新增项目各业务表初始数据 formDTO.setCategoryList(categoryList); formDTO.setGridId(entity.getGridId()); List tagList = issueTagsService.getTagsByIssue(formDTO.getIssueId()); formDTO.setTagList(tagList); + // 议题转项目!!!!!!!!!!!!在这步 Result resultDTO = govProjectFeignClient.issueShiftProject(formDTO); if (!resultDTO.success() || null == resultDTO.getData()) { logger.error(resultDTO.getInternalMsg()); @@ -1065,9 +1145,9 @@ public class IssueServiceImpl extends BaseServiceImpl imp //6:缓存中网格下表决中的议题总数减1 govIssueRedis.subtractWorkGrassrootsIssueRedDotValue(entity.getGridId()); try{ - issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null); + issueVoteStatisticalService.syncVotingCacheToDbByParams(entity,null); }catch(RenException e){ - logger.error(e.getInternalMsg()); + logger.error("subtractWorkGrassrootsIssueRedDotValue报错:"+e.getInternalMsg()); } @@ -1104,32 +1184,50 @@ public class IssueServiceImpl extends BaseServiceImpl imp List msgList = new ArrayList<>(); //1:创建话题发起人、议题发表人消息对象 - UserMessageFormDTO msgDTO = new UserMessageFormDTO(); - msgDTO.setCustomerId(entity.getCustomerId()); - msgDTO.setGridId(entity.getGridId()); - msgDTO.setApp(AppClientConstant.APP_RESI); - msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE); - String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); - msgDTO.setMessageContent(topicIssueMessage); - msgDTO.setReadFlag(ReadFlagConstant.UN_READ); - msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); + if ("resi_topic".equals(entity.getSourceType()) && null != formDTO.getTopicDTO()) { + UserMessageFormDTO msgDTO = new UserMessageFormDTO(); + msgDTO.setCustomerId(entity.getCustomerId()); + msgDTO.setGridId(entity.getGridId()); + msgDTO.setApp(AppClientConstant.APP_RESI); + msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE); + String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); + msgDTO.setMessageContent(topicIssueMessage); + msgDTO.setReadFlag(ReadFlagConstant.UN_READ); + msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); - //21.09.10:记录消息类型和对应的业务id - msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); - msgDTO.setTargetId(entity.getId()); + //21.09.10:记录消息类型和对应的业务id + msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); + msgDTO.setTargetId(entity.getId()); - msgList.add(msgDTO); - //话题人和议题人是同一个人时则只发送一条居民消息 - if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { - UserMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, UserMessageFormDTO.class); - msgIssue.setUserId(entity.getCreatedBy()); + msgList.add(msgDTO); - //21.09.10:记录消息类型和对应的业务id - msgIssue.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); - msgIssue.setTargetId(entity.getId()); + //话题人和议题人是同一个人时则只发送一条居民消息 + if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { + UserMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, UserMessageFormDTO.class); + msgIssue.setUserId(entity.getCreatedBy()); - msgList.add(msgIssue); + //21.09.10:记录消息类型和对应的业务id + msgIssue.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); + msgIssue.setTargetId(entity.getId()); + + msgList.add(msgIssue); + } + }else{ + //居民端发布的议题,只给议题发布人发送消息 + UserMessageFormDTO msgDTO = new UserMessageFormDTO(); + msgDTO.setCustomerId(entity.getCustomerId()); + msgDTO.setGridId(entity.getGridId()); + msgDTO.setApp(AppClientConstant.APP_RESI); + msgDTO.setTitle(UserMessageConstant.ISSUE_TITLE); + String issueMessage = String.format(UserMessageConstant.PUB_ISSUE_SHIFT_PROJECT_MSG, entity.getIssueTitle(), issueProjectResultDTO.getOrgName()); + msgDTO.setMessageContent(issueMessage); + msgDTO.setReadFlag(ReadFlagConstant.UN_READ); + msgDTO.setUserId(entity.getCreatedBy()); + msgDTO.setMessageType(UserMessageTypeConstant.ISSUE_SHIFT_PROJECT); + msgDTO.setTargetId(entity.getId()); + msgList.add(msgDTO); } + //2:创建项目工作人员消息对象 String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, entity.getIssueTitle()); //所选人员如果即在部门下又在网格下则只发一条消息 @@ -1161,20 +1259,34 @@ public class IssueServiceImpl extends BaseServiceImpl imp */ private Result wxmpShiftProjectMessage(IssueProjectResultDTO issueProjectResultDTO, ShiftProjectFormDTO formDTO, IssueEntity entity) { List msgList = new ArrayList<>(); - //1:创建话题发起人、议题发表人消息对象 - WxSubscribeMessageFormDTO msgDTO = new WxSubscribeMessageFormDTO(); - msgDTO.setCustomerId(entity.getCustomerId()); - msgDTO.setClientType(AppClientConstant.APP_RESI); - msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); - msgDTO.setBehaviorType(UserMessageConstant.WXMP_ISSUE_TITLE); - String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); - msgDTO.setMessageContent(topicIssueMessage); - msgDTO.setMessageTime(new Date()); - msgDTO.setGridId(entity.getGridId()); - msgList.add(msgDTO); - //话题人和议题人是同一个人时则只发送一条居民消息 - if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { - WxSubscribeMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, WxSubscribeMessageFormDTO.class); + if ("resi_topic".equals(entity.getSourceType()) && null != formDTO.getTopicDTO()) { + //1:创建话题发起人、议题发表人消息对象 + WxSubscribeMessageFormDTO msgDTO = new WxSubscribeMessageFormDTO(); + msgDTO.setCustomerId(entity.getCustomerId()); + msgDTO.setClientType(AppClientConstant.APP_RESI); + msgDTO.setUserId(formDTO.getTopicDTO().getCreatedBy()); + msgDTO.setBehaviorType(UserMessageConstant.WXMP_ISSUE_TITLE); + String topicIssueMessage = String.format(UserMessageConstant.ISSUE_SHIFT_PROJECT_MSG, formDTO.getTopicDTO().getTopicContent(), issueProjectResultDTO.getOrgName()); + msgDTO.setMessageContent(topicIssueMessage); + msgDTO.setMessageTime(new Date()); + msgDTO.setGridId(entity.getGridId()); + msgList.add(msgDTO); + //话题人和议题人是同一个人时则只发送一条居民消息 + if (!formDTO.getTopicDTO().getCreatedBy().equals(entity.getCreatedBy())) { + WxSubscribeMessageFormDTO msgIssue = ConvertUtils.sourceToTarget(msgDTO, WxSubscribeMessageFormDTO.class); + msgIssue.setUserId(entity.getCreatedBy()); + msgList.add(msgIssue); + } + }else{ + //只给议题发布人发送微信消息 + WxSubscribeMessageFormDTO msgIssue = new WxSubscribeMessageFormDTO(); + msgIssue.setCustomerId(entity.getCustomerId()); + msgIssue.setClientType(AppClientConstant.APP_RESI); + msgIssue.setBehaviorType(UserMessageConstant.WXMP_ISSUE_TITLE); + String topicIssueMessage = String.format(UserMessageConstant.PUB_ISSUE_SHIFT_PROJECT_MSG, entity.getIssueTitle(), issueProjectResultDTO.getOrgName()); + msgIssue.setMessageContent(topicIssueMessage); + msgIssue.setMessageTime(new Date()); + msgIssue.setGridId(entity.getGridId()); msgIssue.setUserId(entity.getCreatedBy()); msgList.add(msgIssue); } @@ -1342,11 +1454,11 @@ public class IssueServiceImpl extends BaseServiceImpl imp throw new RenException("查询议题来源网格名称失败......"); } list.forEach(l -> gridNameList.getData().stream().filter(o -> l.getGridId().equals(o.getGridId())).forEach(o -> l.setTopicReleaseGridName(o.getGridName()))); - Result> groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(list.stream().map(m -> m.getTopicId()).collect(Collectors.toList()))); + Result> groupNameList = resiGroupOpenFeignClient.selectGroupInfo(new GroupInfoFormDTO(list.stream().filter(l -> l.getSourceType().equals(ModuleConstants.ISSUE_FROM_TOPIC)).map(m -> m.getTopicId()).collect(Collectors.toList()))); if (!groupNameList.success()){ throw new RenException("查询议题来源小组名称失败......"); } - list.forEach(l -> groupNameList.getData().stream().filter(g -> l.getTopicId().equals(g.getTopicId())).forEach(g -> l.setTopicReleaseGroupName(g.getTopicGroupName()))); + list.forEach(l -> groupNameList.getData().stream().filter(g -> org.apache.commons.lang3.StringUtils.isNotBlank(l.getTopicId()) && l.getTopicId().equals(g.getTopicId())).forEach(g -> l.setTopicReleaseGroupName(g.getTopicGroupName()))); } return list; } @@ -1500,12 +1612,14 @@ public class IssueServiceImpl extends BaseServiceImpl imp if (!CollectionUtils.isEmpty(votedCount)){ userIds.addAll(votedCount); } - // 话题创建者 - Result topicCreatedUser = resiGroupOpenFeignClient.topicCreatedUser(issueEntity.getSourceId()); - if (!topicCreatedUser.success()){ - throw new RenException("【查询话题创建者失败】["+topicCreatedUser.getMsg()+"]"); + if("resi_topic".equals(issueEntity.getSourceType())){ + // 话题创建者 + Result topicCreatedUser = resiGroupOpenFeignClient.topicCreatedUser(issueEntity.getSourceId()); + if (!topicCreatedUser.success()){ + throw new RenException("【查询话题创建者失败】["+topicCreatedUser.getMsg()+"]"); + } + userIds.add(topicCreatedUser.getData()); } - userIds.add(topicCreatedUser.getData()); // 去重 return userIds.stream().distinct().collect(Collectors.toList()); } @@ -1572,7 +1686,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp /** * 无需解决解决列表 - * + * 无需解决:结案选择无需解决的项目、关闭选择无需解决的议题 * @param fromDTO * @return java.util.List * @author zhaoqifeng @@ -1581,28 +1695,56 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Override public List getUnResolvedList(ShiftProjectListFromDTO fromDTO) { List resultList = new ArrayList<>(); + List allList = new ArrayList<>(); + //1、该网格下已关闭且无需解决的议题 List issueList = baseDao.selectUnResolvedList(fromDTO.getGridId()); if (CollectionUtils.isNotEmpty(issueList)) { - resultList.addAll(issueList); + allList.addAll(issueList); } + //2、来源于议题的项目,结案无需解决的项目 List projectList = govProjectOpenFeignClient.getUnResolvedList(fromDTO).getData(); if (CollectionUtils.isNotEmpty(projectList)) { - resultList.addAll(projectList); + allList.addAll(projectList); } - if (CollectionUtils.isNotEmpty(resultList)) { - resultList = resultList.stream().sorted(Comparator.comparing(UnResolvedResultDTO::getClosedTime).reversed()).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(allList)) { + allList = allList.stream().sorted(Comparator.comparing(UnResolvedResultDTO::getClosedTime).reversed()).collect(Collectors.toList()); if (fromDTO.getIsPage()) { int fromIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); int toIndex = fromDTO.getPageNo() * fromDTO.getPageSize(); - if (fromIndex >= resultList.size()) { + if (fromIndex >= allList.size()) { return new ArrayList<>(); } - if (toIndex > resultList.size()) { - toIndex = resultList.size(); + if (toIndex > allList.size()) { + toIndex = allList.size(); } - resultList = resultList.subList(fromIndex, toIndex); + resultList = allList.subList(fromIndex, toIndex); } } + //重新查询一下所有议题的来源类型, 且来源于事件的议题,赋值icEventInfo + List issueIds=resultList.stream().map(i -> i.getIssueId()).collect(Collectors.toList()); + List issueEntityList = CollectionUtils.isEmpty(issueIds) ? new ArrayList<>() : baseDao.selectBatchIds(issueIds); + if(CollectionUtils.isNotEmpty(issueEntityList)){ + Map eventMap=new HashMap<>(); + // 来源于事件的 + List icEventIds = issueEntityList.stream().filter(t -> t.getSourceType().equals("ic_event")).map(i -> i.getSourceId()).collect(Collectors.toList()); + if (!org.springframework.util.CollectionUtils.isEmpty(icEventIds)) { + Result> eventInfoRes = govProjectOpenFeignClient.batchSelectById(icEventIds); + if (eventInfoRes.success() && !org.springframework.util.CollectionUtils.isEmpty(eventInfoRes.getData())) { + eventMap = eventInfoRes.getData().stream().collect(Collectors.toMap(IcEventDTO::getId, o -> o, (o1, o2) -> o1)); + } + } + Map issueMap=issueEntityList.stream().collect(Collectors.toMap(IssueEntity::getId, o -> o, (o1, o2) -> o1)); + Map finalEventMap = eventMap; + resultList.forEach(vi -> { + vi.setIssueSourceType(null != issueMap.get(vi.getIssueId()) ? issueMap.get(vi.getIssueId()).getSourceType() : StrConstant.EPMETY_STR); + IcEventDTO event = finalEventMap.get(vi.getSourceId()); + if (null != event) { + IcEventComDTO eventComDTO = ConvertUtils.sourceToTarget(event, IcEventComDTO.class); + eventComDTO.setIcEventId(event.getId()); + vi.setIcEventInfo(eventComDTO); + } + }); + } return resultList; } @@ -1766,5 +1908,299 @@ public class IssueServiceImpl extends BaseServiceImpl imp return false; } + /** + * Desc: 创建议题【直接创建】 + * @param issueDTO + * @author zxc + * @date 2022/10/8 09:03 + */ + @Override + public void createIssue(IssueDTO issueDTO) { + // 先审核 + if (org.apache.commons.lang3.StringUtils.isNotBlank(issueDTO.getIssueTitle()) || org.apache.commons.lang3.StringUtils.isNotBlank(issueDTO.getSuggestion())) { + TextScanParamDTO textScan = new TextScanParamDTO(); + //标题 + TextTaskDTO taskTitle = new TextTaskDTO(); + taskTitle.setContent(issueDTO.getIssueTitle()); + taskTitle.setDataId(IdWorker.getIdStr()); + textScan.getTasks().add(taskTitle); + //建议 + TextTaskDTO taskSuggestion = new TextTaskDTO(); + taskSuggestion.setDataId(IdWorker.getIdStr()); + taskSuggestion.setContent(issueDTO.getSuggestion()); + textScan.getTasks().add(taskSuggestion); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScan); + if (!textSyncScanResult.success()) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + logger.error(String.format(TopicConstant.SHIFT_ISSUE, issueDTO.getIssueTitle(), issueDTO.getSuggestion())); + throw new EpmetException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + if (CollectionUtils.isNotEmpty(issueDTO.getAttachmentList())){ + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + issueDTO.getAttachmentList().forEach(url -> { + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(IdWorker.getIdStr()); + task.setUrl(url.getUrl()); + imgScanParamDTO.getTasks().add(task); + }); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()){ + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + throw new EpmetException(EpmetErrorCode.IMG_SCAN_FAILED.getCode()); + } + } + } + + // 是否开启 + String openStatus = configurationParameterService.checkIssueAuditSwitchIfOpen(issueDTO.getCustomerId()); + if (ModuleConstants.AUDIT_SWITCH_OPEN.equals(openStatus)){ + // 审核表 历史表 + IssueApplicationEntity iae = ConvertUtils.sourceToTarget(issueDTO, IssueApplicationEntity.class); + iae.setApplyStatus(ModuleConstants.UNDER_AUDITING); + applicationService.insert(iae); + IssueApplicationHistoryEntity iahe = new IssueApplicationHistoryEntity(); + iahe.setCustomerId(issueDTO.getCustomerId()); + iahe.setIssueApplicationId(iae.getId()); + iahe.setActionType(ModuleConstants.UNDER_AUDITING); + historyService.insert(iahe); + insertAtt(issueDTO.getAttachmentList(),iae.getId(),ModuleConstants.ISSUE_APPLICATION,issueDTO.getCustomerId()); + }else { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(issueDTO.getGridId()); + if(null == gridInfo){ + throw new EpmetException("查询网格信息失败"+issueDTO.getGridId()); + } + Result> userResult = userOpenFeignClient.queryUserBaseInfo(Arrays.asList(issueDTO.getUserId())); + if (!userResult.success() || CollectionUtils.isEmpty(userResult.getData())){ + throw new EpmetException("查询居民信息失败:"+issueDTO.getUserId()); + } + // 议题 议题进程 + issueDTO.setOrgId(gridInfo.getPid()); + issueDTO.setOrgIdPath(gridInfo.getPids()); + IssueEntity e = ConvertUtils.sourceToTarget(issueDTO, IssueEntity.class); + e.setIssueStatus(ModuleConstants.ISSUE_STATUS_VOTING); + e.setSourceType(ModuleConstants.ISSUE); + e.setDecidedTime(new Date()); + baseDao.insert(e); + IssueProcessEntity issueProcessEntity = new IssueProcessEntity(); + issueProcessEntity.setIssueId(e.getId()); + issueProcessEntity.setIssueStatus(ModuleConstants.ISSUE_STATUS_VOTING); + issueProcessEntity.setOrgType(ModuleConstants.ISSUE_PROCESS_ORG_TYPE_GRID); + issueProcessEntity.setOrgId(issueDTO.getGridId()); + UserBaseInfoResultDTO user = userResult.getData().get(NumConstant.ZERO); + issueProcessEntity.setOperationExplain(user.getShowName() + "发表议题【"+issueDTO.getSuggestion()+"】"); + issueProcessEntity.setOrgName(gridInfo.getGridNamePath()); + issueProcessEntity.setCustomerId(issueDTO.getCustomerId()); + issueProcessService.insert(issueProcessEntity); + insertAtt(issueDTO.getAttachmentList(),e.getId(),ModuleConstants.ISSUE,issueDTO.getCustomerId()); + } + + } + + /** + * Desc: 附件插入 + * @param sourceList 附件集合 + * @param businessId 业务ID + * @param attachTo + * @param customerId + * @author zxc + * @date 2022/10/8 09:01 + */ + private void insertAtt(Collection sourceList,String businessId,String attachTo,String customerId){ + if (CollectionUtils.isNotEmpty(sourceList)){ + List list = ConvertUtils.sourceToTarget(sourceList, IssueAttachmentEntity.class); + Integer sort = NumConstant.ZERO; + for (IssueAttachmentEntity e : list) { + e.setCustomerId(customerId); + e.setBusinessId(businessId); + e.setAttachTo(attachTo); + e.setStatus(ModuleConstants.AUDITION_TYPE_AUTO_PASSED); + e.setSort(sort); + sort++; + } + issueAttachmentService.insertBatch(list); + } + } + + /** + * 根据议题ids查询议题简要信息 + * + * @param issueIds + * @return + */ + @Override + public List getIssueProfile(List issueIds) { + if(CollectionUtils.isEmpty(issueIds)){ + return new ArrayList<>(); + } + return baseDao.selectIssueProfile(issueIds); + } + + /** + * Desc: 查询所有议题 + * @param formDTO + * @author zxc + * @date 2022/10/9 16:58 + */ + @Override + public PageData allIssueList(AllIssueListFormDTO formDTO) { + if (org.apache.commons.lang3.StringUtils.isBlank(formDTO.getOrgId())){ + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("查询工作人员信息失败:"+formDTO.getUserId()); + } + formDTO.setOrgId(staffInfo.getAgencyId()); + formDTO.setOrgType(ModuleConstants.ISSUE_PROCESS_ORG_TYPE_AGENCY); + } + PageData result = new PageData<>(new ArrayList(),NumConstant.ZERO_L); + if (formDTO.getIsPage()){ + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.allIssueList(formDTO)); + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + }else { + List allIssueListResultDTOS = baseDao.allIssueList(formDTO); + result.setList(allIssueListResultDTOS); + result.setTotal(allIssueListResultDTOS.size()); + } + if (CollectionUtils.isNotEmpty(result.getList())){ + for (AllIssueListResultDTO l : result.getList()) { + if (l.getIssueStatus().equals(ModuleConstants.ISSUE_STATUS_VOTING)){ + String endDate = null == l.getVotingDeadline() ? + DateUtils.format(new Date(),DATE_PATTERN) : + DateUtils.format(l.getVotingDeadline(),DATE_PATTERN); + String today = LocalDate.now().toString(); + if (today.equals(endDate)){ + PolyLineDTO polyLineDTO = issueVoteDetailDao.polyLineData(l.getIssueId(), endDate); + l.setSupportCount(l.getSupportCount() + polyLineDTO.getSupportIncrement()); + l.setOppositionCount(l.getOppositionCount() + polyLineDTO.getOppositionIncrement()); + } + } + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); + if(null == gridInfo){ + logger.warn("查询网格信息失败:"+l.getGridId()); + continue; + } + l.setGridName(gridInfo.getGridNamePath()); + } + } + return result; + } + + @Override + public void allIssueListExport(AllIssueListFormDTO formDTO, HttpServletResponse response) throws IOException { + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "议题管理" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), AllIssueListExportExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + List list = null; + do { + PageData data = allIssueList(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), AllIssueListExportExcel.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + logger.error("export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } + } + + /** + * 发布议题 + * 事件转议题 + * + * @param issueFormDTO + * @return + */ + @Transactional(rollbackFor = Exception.class) + @Override + public IssueDTO publishIssue(PublishIssueFormDTO issueFormDTO) { + // 事件转议题,是由工作端无需审核 + IssueEntity issueEntity = ConvertUtils.sourceToTarget(issueFormDTO, IssueEntity.class); + baseDao.insert(issueEntity); + + IssueProcessEntity issueProcessEntity = new IssueProcessEntity(); + issueProcessEntity.setIssueId(issueEntity.getId()); + issueProcessEntity.setIssueStatus(issueEntity.getIssueStatus()); + issueProcessEntity.setOrgType(ModuleConstants.ISSUE_PROCESS_ORG_TYPE_AGENCY); + CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(issueFormDTO.getCustomerId(),issueFormDTO.getCreatedBy()); + issueProcessEntity.setOrgId(staffInfo.getAgencyId()); + issueProcessEntity.setOperationExplain(String.format("【%s】发表的事件被【%s】转为议题【%s】", issueFormDTO.getEventReportUserName(), staffInfo.getAgencyName(), issueEntity.getIssueTitle())); + issueProcessEntity.setOrgName(staffInfo.getAgencyName()); + issueProcessEntity.setCustomerId(issueFormDTO.getCustomerId()); + issueProcessService.insert(issueProcessEntity); + + //查询网格的所属居民数 + AllResiByGridFormDTO allResiByGridFormDTO=new AllResiByGridFormDTO(); + allResiByGridFormDTO.setGridId(issueEntity.getGridId()); + Result regUserTotalRes=userOpenFeignClient.getAllResiByGrid(allResiByGridFormDTO); + //3.新增议题表决统计表 + IssueVoteStatisticalDTO voteStatistical = new IssueVoteStatisticalDTO(); + voteStatistical.setIssueId(issueEntity.getId()); + //应表决数,该网格下所有的居民 + voteStatistical.setVotableCount(regUserTotalRes.success() ? regUserTotalRes.getData() : NumConstant.ZERO); + issueVoteStatisticalService.save(voteStatistical); + VoteRedisFormDTO voteInitCache = new VoteRedisFormDTO(); + voteInitCache.setIssueId(issueEntity.getId()); + voteInitCache.setShouldVoteCount(regUserTotalRes.success() ? regUserTotalRes.getData() : NumConstant.ZERO); + issueVoteDetailRedis.set(voteInitCache); + + IssueDTO issueDTO = ConvertUtils.sourceToTarget(issueEntity, IssueDTO.class); + issueDTO.setIssueId(issueEntity.getId()); + return issueDTO; + } + /** + * 删除事件时,事件转了议题,调用此方法,删除议题 + * 批量删除议题(议题如果转了项目,此方法不删除项目!) + * 删除issue、issue_category、issue_tags + * @param delIssueFormDTO + * @return 删除的议题中,转为了项目,返回议题id,上层再单独去删除项目 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public List deleteIssueInternal(DelIssueFormDTO delIssueFormDTO) { + List shiftProjectIssueIds = new ArrayList<>(); + Date nowTime = new Date(); + for (String issueId : delIssueFormDTO.getIssueIds()) { + IssueEntity issueEntity = baseDao.selectById(issueId); + if (null == issueEntity) { + continue; + } + // 删除议题主表 + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); + wrapper.eq(IssueEntity::getId, issueId) + .set(IssueEntity::getUpdatedTime, nowTime) + .set(IssueEntity::getUpdatedBy, delIssueFormDTO.getUserId()) + .set(IssueEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null, wrapper); + // 删除议题分类关系表 + issueCategoryService.delByIssueId(issueId, delIssueFormDTO.getUserId(), nowTime); + // 删除议题标签关系表 + issueTagsService.delByIssueId(issueId, delIssueFormDTO.getUserId(), nowTime); + if ("shift_project".equals(issueEntity.getIssueStatus())) { + shiftProjectIssueIds.add(issueEntity.getId()); + } + } + return shiftProjectIssueIds; + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkRecordServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkRecordServiceImpl.java index 687ce57e47..2c02be5f3c 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkRecordServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkRecordServiceImpl.java @@ -9,10 +9,11 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.constant.IssueShareConstant; import com.epmet.dao.IssueShareLinkRecordDao; import com.epmet.dao.IssueShareLinkVisitRecordDao; +import com.epmet.dto.IssueDTO; import com.epmet.dto.IssueShareLinkRecordDTO; import com.epmet.dto.form.IssueCreateUrlFormDTO; import com.epmet.dto.form.IssueVisitFormDTO; @@ -20,9 +21,8 @@ import com.epmet.dto.result.IssueCreateUrlResultDTO; import com.epmet.dto.result.IssueVisitResultDTO; import com.epmet.entity.IssueShareLinkRecordEntity; import com.epmet.entity.IssueShareLinkVisitRecordEntity; -import com.epmet.resi.group.dto.topic.form.TopicBelongGroupFormDTO; -import com.epmet.resi.group.dto.topic.result.TopicBelongGroupResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +import com.epmet.service.IssueService; import com.epmet.service.IssueShareLinkRecordService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -118,19 +118,24 @@ public class IssueShareLinkRecordServiceImpl extends BaseServiceImpl topicInfo = resiGroupOpenFeignClient.selectTopicBelongGroup(topicBelongGroupFormDTO); - if (!topicInfo.success()){ - throw new RenException(IssueShareConstant.TOPIC_BELONG_GROUP_FAILURE); - } + IssueDTO issueEntity= SpringContextUtils.getBean(IssueService.class).get(formDTO.getIssueId()); + //并改成兼容,发现不需要查询话题的网格id, 索性注释了吧 + /*if("resi_topic".equals(issueEntity.getSourceType())){ + TopicBelongGroupFormDTO topicBelongGroupFormDTO = new TopicBelongGroupFormDTO(); + topicBelongGroupFormDTO.setTopicId(issueInfo.getTopicId()); + // 查询议题来源所属小组【话题所属小组】 + Result topicInfo = resiGroupOpenFeignClient.selectTopicBelongGroup(topicBelongGroupFormDTO); + if (!topicInfo.success()){ + throw new RenException(IssueShareConstant.TOPIC_BELONG_GROUP_FAILURE); + } + if (StringUtils.isBlank(topicInfo.getData().getGridId())){ + throw new RenException(IssueShareConstant.TOPIC_BELONG_GROUP_NULL); + } + }*/ IssueShareLinkRecordEntity entity = new IssueShareLinkRecordEntity(); entity.setCustomerId(issueInfo.getCustomerId()); - if (StringUtils.isBlank(topicInfo.getData().getGridId())){ - throw new RenException(IssueShareConstant.TOPIC_BELONG_GROUP_NULL); - } - entity.setGridId(topicInfo.getData().getGridId()); + // entity.setGridId(topicInfo.getData().getGridId());//注释原因同上 + entity.setGridId(issueEntity.getGridId()); entity.setIssueId(formDTO.getIssueId()); entity.setShareUserId(tokenDto.getUserId()); entity.setInviteContent(null); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java index 20e2d01e6e..1b303c85e9 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueSuggestionServiceImpl.java @@ -20,6 +20,7 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.StrConstant; 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.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; @@ -96,7 +97,7 @@ public class IssueSuggestionServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); if (!textSyncScanResult.success()) { - log.warn("居民端用户对议题发表建议,内容审核服务返回失败"); - throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + throw new EpmetException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(),EpmetErrorCode.TEXT_SCAN_FAILED.getMsg(),EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); } else { if (!textSyncScanResult.getData().isAllPass()) { - throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + throw new EpmetException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(),EpmetErrorCode.TEXT_SCAN_FAILED.getMsg(),EpmetErrorCode.TEXT_SCAN_FAILED.getMsg()); } } //赋值网格id IssueDTO issueDTO = issueService.get(dto.getIssueId()); if (null == issueDTO) { - throw new RenException(String.format("根据议题id%s,没有找到议题信息", dto.getIssueId())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),String.format("根据议题id%s,没有找到议题信息", dto.getIssueId()),"议题不存在"); } dto.setGridId(issueDTO.getGridId()); dto.setCustomerId(issueDTO.getCustomerId()); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java index 1d24217321..c1b7a5c69e 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueTagsServiceImpl.java @@ -18,6 +18,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; @@ -49,6 +50,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.Arrays; +import java.util.Date; import java.util.List; import java.util.Map; @@ -244,4 +246,13 @@ public class IssueTagsServiceImpl extends BaseServiceImpl wrapper = new LambdaUpdateWrapper(); + wrapper.eq(IssueTagsEntity::getIssueId, issueId) + .set(IssueTagsEntity::getUpdatedTime, delTime) + .set(IssueTagsEntity::getUpdatedBy, userId) + .set(IssueTagsEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null, wrapper); + } } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java index 10b4673ce9..eedfd2bb77 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteDetailServiceImpl.java @@ -40,10 +40,12 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.CheckTopicPublisherResultDTO; import com.epmet.dto.result.JoinVoteResultDTO; import com.epmet.entity.IssueVoteDetailEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.ResiGroupFeignClient; import com.epmet.redis.IssueVoteDetailRedis; import com.epmet.service.IssueService; import com.epmet.service.IssueVoteDetailService; +import com.epmet.utils.ModuleConstants; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -73,6 +75,8 @@ public class IssueVoteDetailServiceImpl extends BaseServiceImpl page(Map params) { @@ -140,7 +144,7 @@ public class IssueVoteDetailServiceImpl extends BaseServiceImpl integerResult = resiGroupFeignClient.votableCount(dto); - if (!integerResult.success()){ - throw new EpmetException("查询应表决人数失败..."); + /** + * 直接创建议题的,应表决数为网格下的注册居民数 + */ + if (formDTO.getSourceType().equals(ModuleConstants.ISSUE_FROM_TOPIC)){ + Result integerResult = resiGroupFeignClient.votableCount(dto); + if (!integerResult.success()){ + throw new EpmetException("查询应表决人数失败..."); + } + redisData.setShouldVoteCount(integerResult.getData()); + }else { + Result allResi = epmetUserOpenFeignClient.getAllResiByGrid(new AllResiByGridFormDTO(issueDTO.getGridId())); + if (!allResi.success()){ + throw new EpmetException("查询网格下的注册居民失败:"+issueDTO.getGridId()); + } + redisData.setShouldVoteCount(allResi.getData()); } - redisData.setShouldVoteCount(integerResult.getData()); issueVoteDetailRedis.set(redisData); Integer checkoutVoteCount = baseDao.checkoutVote(formDTO); if (checkoutVoteCount==0){ @@ -239,12 +250,21 @@ public class IssueVoteDetailServiceImpl extends BaseServiceImpl votableCount = resiGroupFeignClient.votableCount(gridId); - if(votableCount.success() && null != votableCount.getData()){ - voteCache.setShouldVoteCount(votableCount.getData()); - }else{ - voteCache.setShouldVoteCount(NumConstant.ZERO); + if (StringUtils.isBlank(formDTO.getSourceType())){ + Result votableCount = resiGroupFeignClient.votableCount(gridId); + if(votableCount.success() && null != votableCount.getData()){ + voteCache.setShouldVoteCount(votableCount.getData()); + }else{ + voteCache.setShouldVoteCount(NumConstant.ZERO); + } + }else { + Result allResi = epmetUserOpenFeignClient.getAllResiByGrid(new AllResiByGridFormDTO(formDTO.getGridId())); + if (!allResi.success()){ + throw new EpmetException("查询网格下的注册居民失败:"+formDTO.getGridId()); + } + voteCache.setShouldVoteCount(allResi.getData()); } + return voteCache; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index b28378b26c..1b33806f47 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -42,6 +43,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.IssueEntity; import com.epmet.entity.IssueVoteStatisticalEntity; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.ResiGroupFeignClient; import com.epmet.redis.IssueVoteDetailRedis; @@ -98,6 +100,8 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl page(Map params) { @@ -259,6 +263,50 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl allResiByGrid = epmetUserOpenFeignClient.getAllResiByGrid(new AllResiByGridFormDTO(issueEntity.getGridId())); + if (!allResiByGrid.success()){ + throw new EpmetException("查询网格下注册居民失败:"+issueEntity.getGridId()); + } + voteRedisFormDTO.setShouldVoteCount(allResiByGrid.getData()); + } + VotingTrendResultDTO votingTrendResultDTO = new VotingTrendResultDTO(); + BeanUtils.copyProperties(voteRedisFormDTO, votingTrendResultDTO); + votingTrendResultDTO.setRealityVoteCount(voteRedisFormDTO.getSupportAmount() + voteRedisFormDTO.getOppositionAmount()); + //DB获取表决 日统计详情 + List polyLineDTOS = issueVoteStatisticalDao.polyLineData(issueId); + String startDate = DateUtils.format(issueEntity.getDecidedTime(),DATE_PATTERN); + String endDate = null == issueEntity.getVotingDeadline() ? + DateUtils.format(new Date(),DATE_PATTERN) : + DateUtils.format(issueEntity.getVotingDeadline(),DATE_PATTERN); + List polyLine = getPolyLine(startDate, endDate); + String today = LocalDate.now().toString(); + if (today.equals(endDate)){ + PolyLineDTO polyLineDTO = issueVoteDetailDao.polyLineData(issueId.getIssueId(), endDate); + polyLine.get(polyLine.size() - NumConstant.ONE).setSupportIncrement(polyLineDTO.getSupportIncrement()); + polyLine.get(polyLine.size() - NumConstant.ONE).setOppositionIncrement(polyLineDTO.getOppositionIncrement()); + } + if (CollectionUtils.isEmpty(polyLineDTOS)){ + votingTrendResultDTO.setPolyLine(polyLine); + return votingTrendResultDTO; + } + polyLineDTOS.forEach(pd -> { + polyLine.forEach(p -> { + if (pd.getVoteDate().equals(p.getVoteDate())){ + p.setOppositionIncrement(pd.getOppositionIncrement()); + p.setSupportIncrement(pd.getSupportIncrement()); + } + }); + }); + votingTrendResultDTO.setPolyLine(polyLine); + return votingTrendResultDTO; + } + public List getPolyLine(String startTime, String endTime){ List result = new ArrayList<>(); Date start = DateUtils.parse(startTime, DATE_PATTERN); @@ -561,36 +609,50 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl votableCount = - resiGroupFeignClient.votableCount(gridParam); - if(votableCount.success() && null != votableCount.getData()){ + toUpd.setIssueId(issueEntity.getId()); + if ("resi_topic".equals(issueEntity.getSourceType())) { + CommonGridIdFormDTO gridParam = new CommonGridIdFormDTO(); + gridParam.setGridId(issueEntity.getGridId()); + Result votableCount = + resiGroupFeignClient.votableCount(gridParam); + if (votableCount.success() && null != votableCount.getData()) { toUpd.setVotableCount(votableCount.getData()); - } + }else{ + //先默认赋值0吧 + toUpd.setVotableCount(NumConstant.ZERO); + } + } else { + AllResiByGridFormDTO allResiByGridFormDTO=new AllResiByGridFormDTO(); + allResiByGridFormDTO.setGridId(issueEntity.getGridId()); + Result allResiByGrid=epmetUserOpenFeignClient.getAllResiByGrid(allResiByGridFormDTO); + if(allResiByGrid.success()){ + toUpd.setVotableCount(allResiByGrid.getData()); + }else{ + //先默认赋值0吧 + toUpd.setVotableCount(NumConstant.ZERO); + } + } if(StringUtils.isNotBlank(statisticalId)){ toUpd.setId(statisticalId); update(toUpd); }else{ - IssueVoteStatisticalDTO existedStatistical = getByIssueId(issueId); + IssueVoteStatisticalDTO existedStatistical = getByIssueId(issueEntity.getId()); if(null != existedStatistical && StringUtils.isNotBlank(existedStatistical.getId())){ toUpd.setId(existedStatistical.getId()); update(toUpd); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/utils/ModuleConstants.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/utils/ModuleConstants.java index b6a7f4cd49..f19e282f64 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/utils/ModuleConstants.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/utils/ModuleConstants.java @@ -178,4 +178,10 @@ public interface ModuleConstants { * 是否禁用 disable:禁用 */ String IS_DISABLE = "disable"; + + String UNDER_AUDITING = "under_auditing"; + + String ISSUE_APPLICATION = "issue_application"; + + String ISSUE = "issue"; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.18__alter_issue_type.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.18__alter_issue_type.sql new file mode 100644 index 0000000000..5015a8351b --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.18__alter_issue_type.sql @@ -0,0 +1,36 @@ +ALTER TABLE issue MODIFY COLUMN SOURCE_ID varchar(32) NULL COMMENT '来源ID eg:2223232(当SOURCE_TYPE为"resi_topic"时,这里指话题的ID),issue时为空' AFTER SOURCE_TYPE; +ALTER TABLE issue MODIFY COLUMN SOURCE_TYPE varchar(32) NULL COMMENT '来源类型 话题:resi_topic;直接立议题:issue;' AFTER ISSUE_STATUS; + +ALTER TABLE issue_application MODIFY COLUMN GROUP_ID varchar(64) NULL COMMENT '小组id' AFTER TOPIC_ID; +ALTER TABLE issue_application MODIFY COLUMN TOPIC_ID varchar(32) NULL COMMENT '话题id' AFTER APPLY_STATUS; + + +alter table issue add column ADDRESS VARCHAR(255) DEFAULT '' COMMENT '地址' AFTER `SUGGESTION`; +alter table issue add COLUMN LONGITUDE VARCHAR(64) DEFAULT'' COMMENT '经度' AFTER ADDRESS; +alter table issue add COLUMN LATITUDE VARCHAR(64) DEFAULT'' COMMENT '纬度' AFTER LONGITUDE; + +alter table issue_application add column ADDRESS VARCHAR(255) DEFAULT '' COMMENT '地址' AFTER `SUGGESTION`; +alter table issue_application add COLUMN LONGITUDE VARCHAR(64) DEFAULT'' COMMENT '经度' AFTER ADDRESS; +alter table issue_application add COLUMN LATITUDE VARCHAR(64) DEFAULT'' COMMENT '纬度' AFTER LONGITUDE; + +CREATE TABLE `issue_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `BUSINESS_ID` varchar(64) NOT NULL COMMENT '业务id', + `ATTACH_TO` varchar(32) DEFAULT NULL COMMENT '议题:issue', + `NAME` varchar(64) DEFAULT NULL COMMENT '附件名', + `FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `URL` varchar(255) NOT NULL COMMENT '附件地址', + `SORT` int(1) NOT NULL COMMENT '排序字段', + `STATUS` varchar(32) NOT NULL DEFAULT 'auto_passed' COMMENT '附件状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)\r\n现在图片是同步审核的,所以图片只有auto_passed一种状态', + `REASON` varchar(255) DEFAULT NULL COMMENT '失败原因', + `DURATION` int(11) DEFAULT 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='issue库附件表'; \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__alter_issue_application.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__alter_issue_application.sql new file mode 100644 index 0000000000..256b0ab6b6 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__alter_issue_application.sql @@ -0,0 +1,2 @@ +alter table issue_application add COLUMN ORG_ID VARCHAR(64) DEFAULT'' COMMENT '组织ID' AFTER GRID_ID; +alter table issue_application add COLUMN ORG_ID_PATH VARCHAR(1024) DEFAULT'' COMMENT '组织ID全路径,包括ORG_ID' AFTER ORG_ID; \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.20__issue_source.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.20__issue_source.sql new file mode 100644 index 0000000000..ac49a686de --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.20__issue_source.sql @@ -0,0 +1 @@ +alter table issue MODIFY COLUMN `SOURCE_TYPE` varchar(32) DEFAULT NULL COMMENT '来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event'; diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml index 2820a43019..64541d95c6 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml @@ -2,6 +2,28 @@ + + UPDATE issue_application + + + + when ID = #{i.id} then #{i.orgId} + + + + + when ID = #{i.id} then #{i.orgIdPath} + + + updated_time = now() + where 1=1 + + + ID = #{i.id} + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueAttachmentDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueAttachmentDao.xml new file mode 100644 index 0000000000..02e8513b09 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueAttachmentDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml index 078661e2a1..4a8deef951 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCategoryDao.xml @@ -16,7 +16,12 @@ a.sort AS "sort", CONCAT(b.category_name, '-', a.category_name) AS "category_name" FROM issue_project_category_dict a - INNER JOIN issue_project_category_dict b ON a.pid = b.id + INNER JOIN issue_project_category_dict b + ON (a.pid = b.id + and a.CUSTOMER_ID = #{customerId} + and b.CUSTOMER_ID = #{customerId} + and a.CUSTOMER_ID=b.CUSTOMER_ID + ) ) ip ON ic.category_id = ip.idd AND ic.customer_id = ip.customer_id WHERE diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 4dbcbb2e9a..77e9db60da 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -28,21 +28,46 @@ + + + + + + + + + + + + + + + - SELECT - source_id AS topicId, - issue_title AS issueTitle, - issue_status AS issueStatus, - suggestion AS issueSuggestion, - grid_id AS gridId, - created_by AS userId, - CREATED_TIME as shiftIssueTime + i.id as issueId, + ( + case when i.SOURCE_TYPE='resi_topic'then i.source_id + else '' + end + )as topicId, + i.source_id, + i.issue_title AS issueTitle, + i.issue_status AS issueStatus, + i.suggestion AS issueSuggestion, + i.grid_id AS gridId, + i.created_by AS userId, + i.CREATED_TIME as shiftIssueTime, + i.SOURCE_TYPE, + ia.URL FROM - issue + issue i + left join issue_attachment ia + on(i.id=ia.BUSINESS_ID and ia.del_flag='0') WHERE - id = #{issueId} - AND del_flag = 0 + i.id = #{issueId} + AND i.del_flag = 0 + - + i.created_time DESC + + + + + + + + + + + + + - SELECT - ID AS issueId, - IFNULL(ISSUE_TITLE,'') AS issueTitle, - IFNULL(CLOSE_REASON,'') AS solution, - UNIX_TIMESTAMP( created_time ) AS issueClosedTime, - SOURCE_ID AS sourceId + i.ID AS issueId, + IFNULL(i.ISSUE_TITLE,'') AS issueTitle, + IFNULL(i.CLOSE_REASON,'') AS solution, + UNIX_TIMESTAMP( i.created_time ) AS issueClosedTime, + i.SOURCE_ID AS sourceId, + i.SOURCE_TYPE, + ia.URL FROM - issue + issue i + left join issue_attachment ia + on(i.id=ia.BUSINESS_ID and ia.del_flag='0') WHERE - DEL_FLAG = '0' - AND GRID_ID = #{gridId} - AND ISSUE_STATUS = 'closed' - AND RESOLVE_TYPE = 'resolved' + i.DEL_FLAG = '0' + AND i.GRID_ID = #{gridId} + AND i.ISSUE_STATUS = 'closed' + AND i.RESOLVE_TYPE = 'resolved' ORDER BY - created_time DESC + i.created_time DESC - SELECT - ID AS issueId, - IFNULL(ISSUE_TITLE,'') AS issueTitle, - IFNULL(CLOSE_REASON,'') AS solution, - UNIX_TIMESTAMP( CLOSED_TIME ) AS closedTime, - SOURCE_ID AS sourceId + i.ID AS issueId, + IFNULL(i.ISSUE_TITLE,'') AS issueTitle, + IFNULL(i.CLOSE_REASON,'') AS solution, + UNIX_TIMESTAMP( i.CLOSED_TIME ) AS closedTime, + i.SOURCE_ID AS sourceId, + i.SOURCE_TYPE as issueSourceType, + i.LONGITUDE, + i.LATITUDE, + i.SOURCE_ID as topicId, + ia.url FROM - issue + issue i + left join issue_attachment ia + on(i.id=ia.BUSINESS_ID and ia.del_flag='0') WHERE - DEL_FLAG = '0' - AND GRID_ID = #{gridId} - AND ISSUE_STATUS = 'closed' - AND RESOLVE_TYPE = 'unresolved' + i.DEL_FLAG = '0' + AND i.GRID_ID = #{gridId} + AND i.ISSUE_STATUS = 'closed' + AND i.RESOLVE_TYPE = 'unresolved' @@ -770,4 +851,79 @@ AND APPLY_STATUS = 'under_auditing' AND GRID_ID = #{gridId} + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProcessDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProcessDao.xml index 00122cfade..60af2d5d12 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProcessDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProcessDao.xml @@ -102,13 +102,14 @@ SELECT - '转议题' AS processName, + '发起议题' AS processName, UNIX_TIMESTAMP( created_time ) AS processTime, operation_explain AS progressDesc, org_name AS departmentName, + 'issue' AS type, id AS processId FROM issue_process diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java index 3b14fc3266..3be3954934 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventDTO.java @@ -103,12 +103,12 @@ public class IcEventDTO implements Serializable { private Date closeCaseTime; /** - * 0:已回复 1:已转项目 1:已转需求 + * 0:已回复 1:已转项目 2:已转需求3:转议题 */ private String operationType; /** - * 项目、需求ID + * 项目、需求ID、议题id */ private String operationId; diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java index 19e7d38344..ac1812c5c7 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ColseProjectOrDemandFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.form; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** @@ -13,7 +14,7 @@ public class ColseProjectOrDemandFormDTO implements Serializable { private static final long serialVersionUID = -590440160577071133L; //事件管理Id private String icEventId; - //类型 需求:demand 项目:project + //类型 需求:demand 项目:project 议题:issue private String type; //服务方【事件被转需求,需求在办结时的服务方名称】 private String serviceParty; @@ -22,4 +23,11 @@ public class ColseProjectOrDemandFormDTO implements Serializable { private String customerId; private String userId; + + /** + * 项目的结案时间 + * 需求的完成时间 + * 议题的关闭时间 + */ + private Date closeCaseTime; } 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 07d9a8bcf9..31010e536f 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 @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import org.hibernate.validator.constraints.Length; +import javax.validation.Valid; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.io.Serializable; @@ -83,7 +84,7 @@ public class IcEventAddEditFormDTO implements Serializable { */ private String longitude; /** - * 处理方式[0:已回复 1:已转项目 2:已转需求] + * 0:已回复 1:已转项目 2:已转需求3:转议题 */ private String operationType; /** @@ -117,4 +118,10 @@ public class IcEventAddEditFormDTO implements Serializable { private String app; private String client; + /** + * 新增事件直接转议题 + */ + @Valid + private IcEventToIssueFormDTO issueInfo; + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToIssueFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToIssueFormDTO.java new file mode 100644 index 0000000000..e5b99e66d7 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToIssueFormDTO.java @@ -0,0 +1,64 @@ +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 javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @Author yzm + * @Date 2022/10/9 16:46 + */ +@Data +public class IcEventToIssueFormDTO implements Serializable { + private static final long serialVersionUID = -7227815962561508949L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface AddEventAndShiftIssue extends CustomerClientShowGroup { + } + /** + * 转议题默认传3即可;0:已回复 1:已转项目 2:已转需求3:转议题 + */ + @NotBlank(message = "处理方式不能为空", groups = AddUserInternalGroup.class) + private String operationType; + + @NotBlank(message = "事件id不能为空", groups = AddUserInternalGroup.class) + private String icEventId; + + // /** + // * 二类分类Id + // */ + // private String categoryId; + + /** + * 项目所选分类集合,不可为空 + */ + @Valid + @NotEmpty(message = "事件分类不能为空", groups = AddUserShowGroup.class) + private List categoryList; + + @NotBlank(message = "议题标题不能为空", groups = {AddUserShowGroup.class, AddEventAndShiftIssue.class}) + @Length(message = "议题标题最多输入120字",max = 120,groups = {AddUserShowGroup.class, AddEventAndShiftIssue.class}) + private String issueTitle; + + @Length(message = "处理建议最多输入1000字",max = 1000,groups = {AddUserShowGroup.class, AddEventAndShiftIssue.class}) + @NotBlank(message = "处理建议不能为空", groups = {AddUserShowGroup.class, AddEventAndShiftIssue.class}) + private String suggestion; + + @NotBlank(message = "customerId不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + @NotBlank(message = "currentUserId不能为空", groups = {AddUserInternalGroup.class}) + private String currentUserId; +} + diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java index beac1277a0..349db1d45c 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java @@ -117,15 +117,15 @@ public class IcEventListResultDTO implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date closeCaseTime; /** - * 0:已回复 1:已转项目 1:已转需求 + * 0:已回复 1:已转项目 2:已转需求3:转议题 */ private String operationType; /** - * 0:已回复 1:已转项目 1:已转需求 + * 0:已回复 1:已转项目 2:已转需求3:转议题 */ private String operationTypeName; /** - * 项目、需求ID + * 项目、需求ID、议题id */ private String operationId; /** diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java index 7b4b805e7e..4379252a67 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventProcessListResultDTO.java @@ -14,7 +14,7 @@ import java.util.List; public class IcEventProcessListResultDTO implements Serializable { private static final long serialVersionUID = 5762152044573235897L; - + private String issueId; /** * 项目ID */ diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesClosedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesClosedResultDTO.java index 46c2c9ff02..71378156e9 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesClosedResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesClosedResultDTO.java @@ -17,6 +17,8 @@ public class MyPubIssuesClosedResultDTO implements Serializable { * 议题id */ private String issueId; + private String sourceId; + private String sourceType; /** * 议题标题 @@ -36,11 +38,11 @@ public class MyPubIssuesClosedResultDTO implements Serializable { /** * 话题发表于哪个组 */ - private String topicReleaseGroupName; + private String topicReleaseGroupName = ""; /** * 话题发表于哪个网格 */ - private String topicReleaseGridName; + private String topicReleaseGridName = ""; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java index 8397d64b69..7931067f86 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyPubIssuesShiftProjectResultDTO.java @@ -45,4 +45,6 @@ public class MyPubIssuesShiftProjectResultDTO implements Serializable { private String topicReleaseGroupName; private String issueId; + private String sourceId; + private String sourceType; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java index ed9f0d8d16..a21e2f47d1 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.epmet.commons.tools.dto.commondto.IcEventComDTO; +import com.epmet.commons.tools.dto.commondto.TopicInfoComDTO; import lombok.Data; import lombok.NoArgsConstructor; @@ -20,14 +21,64 @@ public class PendingResultDTO implements Serializable { private static final long serialVersionUID = 2545519820222637112L; private String issueId; private String issueTitle; + /** + * 议题转成项目时间 + */ private Long issueShiftedTime; + /** + * 话题内容 + */ private String topicContent; + /** + * 当前处理部门名称数组 + */ private List currentHandleDepartMent; + /** + * 话题语音url列表 + */ private List topicVoices; + /** + * 话题内容 + */ private List topicImgs; + /** + * 项目的来源Id(话题或议题Id) + * sourceId=议题id + */ private String sourceId; - @JsonIgnore + // @JsonIgnore private String projectId; private String longitude; private String latitude; + /** + * 项目来源: + * 来源议题 issue + * 项目立项 agency + * 旧版事件上报 resi_event + * 工作人员上报(巡查) work_event + * 新版事件上报 ic_event + */ + private String projectOrigin; + /** + * 话题id + */ + private String topicId; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String issueSourceType; + /** + * 发布议题的图片 + */ + private List issueImgs; + + /** + * 话题信息-2022.10.10 + */ + private TopicInfoComDTO topicInfo; + /** + * 事件信息-2022.10.10 + */ + private IcEventComDTO icEventInfo; } 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 7c9bb481e8..daf846a3a5 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 @@ -75,7 +75,15 @@ public class ProjectManageListResultDTO implements Serializable { private Boolean processable; private Boolean returnable; - + /** + * 项目来源: + * 来源议题 issue + * 项目立项 agency + * 旧版事件上报 resi_event + * 工作人员上报(巡查) work_event + * 新版事件上报 ic_event + */ + private String origin; public ProjectManageListResultDTO() { this.gridName = ""; this.title = ""; @@ -86,5 +94,6 @@ public class ProjectManageListResultDTO implements Serializable { this.status = ""; this.departmentNameList = new ArrayList<>(); this.projectId = ""; + this.origin=""; } } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java index 14187406e3..88ad6068c7 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java @@ -1,5 +1,7 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.dto.commondto.IcEventComDTO; +import com.epmet.commons.tools.dto.commondto.TopicInfoComDTO; import lombok.Data; import java.io.Serializable; @@ -13,6 +15,7 @@ import java.util.List; @Data public class ResolvedResultDTO implements Serializable { private static final long serialVersionUID = -6670213622289052352L; + private String projectId; /** * 议题Id */ @@ -53,4 +56,34 @@ public class ResolvedResultDTO implements Serializable { private String longitude; private String latitude; + /** + * 项目来源: + * 来源议题 issue + * 项目立项 agency + * 旧版事件上报 resi_event + * 工作人员上报(巡查) work_event + * 新版事件上报 ic_event + */ + private String projectOrigin; + /** + * 话题id + */ + private String topicId; + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String issueSourceType; + /** + * 发布议题的图片 + */ + private List issueImgs; + + /** + * 话题信息-2022.10.10 + */ + private TopicInfoComDTO topicInfo; + /** + * 事件信息-2022.10.10 + */ + private IcEventComDTO icEventInfo; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java index 53f183c389..7d65a6a6b1 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java @@ -1,5 +1,7 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.dto.commondto.IcEventComDTO; +import com.epmet.commons.tools.dto.commondto.TopicInfoComDTO; import lombok.Data; import java.io.Serializable; @@ -52,4 +54,36 @@ public class UnResolvedResultDTO implements Serializable { private String topicContent; private String longitude; private String latitude; + + /** + * 项目来源: + * 来源议题 issue + * 项目立项 agency + * 旧版事件上报 resi_event + * 工作人员上报(巡查) work_event + * 新版事件上报 ic_event + */ + private String projectOrigin; + /** + * 话题id + */ + private String topicId; + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String issueSourceType; + /** + * 发布议题的图片 + */ + private List issueImgs; + private String projectId; + + /** + * 话题信息-2022.10.10 + */ + private TopicInfoComDTO topicInfo; + /** + * 事件信息-2022.10.10 + */ + private IcEventComDTO icEventInfo; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index 7907ac7ec5..8220889e9e 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -2,6 +2,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcEventDTO; import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.*; @@ -170,6 +171,7 @@ public interface GovProjectOpenFeignClient { /** * Desc: 需求完成/项目结案时 修改事件数据 + * 议题关闭时,如果议题来源于事件,也会调用此方法 * @author sun */ @PostMapping("gov/project/icEvent/closeprojectordemand") @@ -178,4 +180,20 @@ public interface GovProjectOpenFeignClient { @PostMapping("gov/project/project/staffpendingproject") Result> staffPendingProject(@RequestBody ProjectListFromDTO formDTO); + /** + * 批量查询事件信息 + * @param icEventIds + * @return + */ + @PostMapping("gov/project/icEvent/batchSelectById") + Result> batchSelectById(@RequestBody List icEventIds); + + /** + * @Description 议题处理进展——已转项目 + * @param formDTO + * @author zxc + */ + @PostMapping("/gov/project/projectprocess/projectprocesslist") + Result> projectProcessList(@RequestBody ProcessProjectIdFormDTO formDTO); + } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index 51f7922ba5..bfb6d57f89 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -3,6 +3,7 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IcEventDTO; import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.*; @@ -174,4 +175,22 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result> staffPendingProject(ProjectListFromDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "staffPendingProject",formDTO); } + + /** + * 批量查询事件信息 + * + * @param icEventIds + * @return + */ + @Override + public Result> batchSelectById(List icEventIds) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "batchSelectById",icEventIds); + } + + @Override + public Result> projectProcessList(ProcessProjectIdFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "projectProcessList", formDTO); + } + + } diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 375daa8dd2..abb978b7ce 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -219,8 +219,9 @@ callerRunsPolicy false - https://epmet-dev.elinkservice.cn/api/epmetscan/api - + + + https://epmet-open.elinkservice.cn/api/epmetscan/api https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 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 5105ca27bf..c7bd63814f 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 @@ -59,6 +59,12 @@ public class IcEventController { @Autowired private IcEventReplyService icEventReplyService; + /** + * 事件管理-列表 + * @param tokenDto + * @param formDTO + * @return + */ @RequestMapping("list") public Result> list(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); @@ -83,6 +89,12 @@ public class IcEventController { return new Result().ok(data); } + /** + * 事件管理-新增 + * @param tokenDto + * @param formDTO + * @return + */ @NoRepeatSubmit @PostMapping("add") public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcEventAddEditFormDTO formDTO){ @@ -91,6 +103,9 @@ public class IcEventController { formDTO.setUserId(tokenDto.getUserId()); formDTO.setApp(tokenDto.getApp()); formDTO.setClient(tokenDto.getClient()); + if("3".equals(formDTO.getOperationType())){ + ValidatorUtils.validateEntity(formDTO.getIssueInfo(),IcEventToIssueFormDTO.AddEventAndShiftIssue.class); + } icEventService.save(formDTO); return new Result(); } @@ -242,6 +257,21 @@ public class IcEventController { return new Result(); } + /** + * 事件转议题 + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("icEventToIssue") + public Result icEventToIssue(@LoginUser TokenDto tokenDto, @RequestBody IcEventToIssueFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCurrentUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(formDTO, IcEventToIssueFormDTO.AddUserShowGroup.class, IcEventToIssueFormDTO.AddUserInternalGroup.class); + icEventService.icEventToIssue(formDTO); + return new Result(); + } + /** * 事件分类分析-一级分类下事件数量 * @@ -334,6 +364,7 @@ public class IcEventController { /** * @Author sun * @Description 需求完成/项目结案时 修改事件数据 + * 议题关闭时,如果议题来源于事件,也会调用此方法 **/ @PostMapping("closeprojectordemand") public Result closeProjectOrDemand(@RequestBody ColseProjectOrDemandFormDTO formDTO) { @@ -382,7 +413,7 @@ public class IcEventController { @PostMapping("myreport-detail") public Result myReportDetail(@LoginUser TokenDto tokenDto, @RequestBody MyReportIcEvFormDTO formDTO) { formDTO.setCustomerId(tokenDto.getCustomerId()); - formDTO.setUserId(tokenDto.getUserId()); + // formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, MyReportIcEvFormDTO.DetailGroup.class); return new Result().ok(icEventService.myReportDetail(formDTO)); } @@ -512,6 +543,18 @@ public class IcEventController { return new Result>().ok(icEventService.icEventPageUserReported(formDTO)); } - + /** + * 批量查询事件信息 + * + * @param icEventIds + * @return + */ + @PostMapping("batchSelectById") + public Result> batchSelectById(@RequestBody List icEventIds) { + if (CollectionUtils.isEmpty(icEventIds)) { + return new Result<>(); + } + return new Result>().ok(icEventService.batchSelectById(icEventIds)); + } } 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 02f813b232..101a735cfe 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 @@ -279,7 +279,7 @@ public class ProjectController { } /** - * 无需解决项目列表 + * 无需解决项目列表 来源于议题,已结案,无需解决的项目 * @author zhaoqifeng * @date 2021/7/27 14:55 * @param formDTO @@ -451,4 +451,16 @@ public class ProjectController { } } + /** + * 纯属为了测试.... + * 如果项目结案了,事件没有回写可以调用此方法 + * @param tokenDto + * @param projectId + * @return + */ + @PostMapping("test-close/{projectId}") + public Result testClose(@LoginUser TokenDto tokenDto,@PathVariable("projectId")String projectId){ + projectService.modifyIcEvent(null,tokenDto.getUserId(),new Date(),projectId); + return new Result(); + } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java index e8829fda7a..c50f4b5fa7 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java @@ -15,5 +15,4 @@ import org.apache.ibatis.annotations.Param; public interface IcEventCategoryDao extends BaseDao { IcEventCategoryEntity selectByEventId(@Param("icEventId") String icEventId); - } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index 316fbc8de6..07786f5585 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -189,6 +189,14 @@ public interface ProjectDao extends BaseDao { */ List selectPendingListByGrid(@Param("gridId")String gridId); + /** + * 居民端议事厅-处理中列表 + * 查询的是已经转项目的议题,这里是查询来源于议题的项目 + * @param gridId + * @return + */ + List selectPendingListByGridV2(@Param("gridId")String gridId); + /** * 获取党建声音已结案列表 * @author zhaoqifeng diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java index ce8d9bdd6a..81c5635aaf 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java @@ -61,9 +61,9 @@ public class IcEventEntity extends BaseEpmetEntity { */ private String idCard; - /** - * 反映渠道【字典表】 - */ + /** + * 反映渠道【字典表】dictTypeKey:ic_event_source_type;随手拍随时讲0、多媒体反应1、社区电话2、12345:3、网格员手持终端:4 + */ private String sourceType; /** @@ -102,12 +102,12 @@ public class IcEventEntity extends BaseEpmetEntity { private Date closeCaseTime; /** - * 0:已回复 1:已转项目 2:已转需求 + * 0:已回复 1:已转项目 2:已转需求3:转议题 */ private String operationType; /** - * 项目、需求ID + * 项目、需求ID、议题id */ private String operationId; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java index 209d70d4f3..d41ff83514 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java @@ -48,6 +48,7 @@ public class IcEventOperationLogEntity extends BaseEpmetEntity { * 4、转需求:shift_demand * 5、办结:close_case; * 6、需求办结:close_demand + * 转议题:shift_to_issue */ private String actionCode; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java index b5199a8392..4d8163c9ae 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectEntity.java @@ -48,7 +48,12 @@ public class ProjectEntity extends BaseEpmetEntity { private String gridId; /** - * 来源:议题issue 项目立项:agency + * 项目来源: + * 来源议题 issue + * 项目立项 agency + * 旧版事件上报 resi_event + * 工作人员上报(巡查) work_event + * 新版事件上报 ic_event */ private String origin; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java index 90c9fd9524..fef4ca591a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java @@ -82,4 +82,12 @@ public interface IcEventCategoryService extends BaseService categoryEntities); } \ No newline at end of file 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 40a9f2e55d..d785949909 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 @@ -172,6 +172,7 @@ public interface IcEventService extends BaseService { /** * @Author sun * @Description 需求完成/项目结案时 修改事件数据 + * 议题关闭时,如果议题来源于事件,也会调用此方法 **/ void closeProjectOrDemand(ColseProjectOrDemandFormDTO formDTO); @@ -225,4 +226,16 @@ public interface IcEventService extends BaseService { PageData icEventPageUserReported(PageUserReportEventFormDTO formDTO); + /** + * 事件转议题 + * @param formDTO + */ + void icEventToIssue(IcEventToIssueFormDTO formDTO); + + /** + * 批量查询事件信息 + * @param icEventIds + * @return + */ + List batchSelectById(List icEventIds); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java index 9ae8a7fdee..4940a4fbb1 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectCategoryService.java @@ -26,6 +26,7 @@ import com.epmet.dto.form.ProjectSaveCategoryFormDTO; import com.epmet.dto.result.ProjectCategoryTagListResultDTO; import com.epmet.entity.ProjectCategoryEntity; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.Set; @@ -136,4 +137,13 @@ public interface ProjectCategoryService extends BaseService> getProjectCategoryMap(List projectIds); + + /** + * 根据项目id,删除项目分类,记录删除人、删除时间 + * @param projectId + * @param userId + * @param delTime + * @return + */ + int delByProjectId(String projectId, String userId, Date delTime); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index 7dba649107..f588edc374 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java @@ -11,6 +11,7 @@ import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Date; import java.util.List; import java.util.Map; @@ -308,7 +309,7 @@ public interface ProjectService extends BaseService { List getResolvedListByGrid(ShiftProjectListFromDTO fromDTO); /** - * 无需解决项目列表 + * 无需解决项目列表 来源于议题,已结案,无需解决的项目 * @author zhaoqifeng * @date 2021/7/27 14:40 * @param fromDTO @@ -399,11 +400,12 @@ public interface ProjectService extends BaseService { PageData orgProjectList(OrgProjectListFormDTO formDTO); /** - * desc:根据来源id和类型 删除项目 (只删了主表) + * desc:根据来源id和类型 删除项目 (只删了主表、项目分类表) * @param originId * @param origin * @return */ Integer deleteByOriginId(String originId, String origin); + void modifyIcEvent(ProjectEntity projectEntity, String userId, Date closeCaseTime, String projectId); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java index c1d4d6fac9..52a8b13be1 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java @@ -1,21 +1,26 @@ package com.epmet.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcEventCategoryDao; import com.epmet.dto.IcEventCategoryDTO; import com.epmet.entity.IcEventCategoryEntity; import com.epmet.service.IcEventCategoryService; +import org.apache.commons.collections4.CollectionUtils; 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 java.util.Arrays; +import java.util.Date; import java.util.List; import java.util.Map; @@ -27,7 +32,8 @@ import java.util.Map; */ @Service public class IcEventCategoryServiceImpl extends BaseServiceImpl implements IcEventCategoryService { - + @Autowired + private LoginUserUtil loginUserUtil; @Override public PageData page(Map params) { @@ -86,4 +92,18 @@ public class IcEventCategoryServiceImpl extends BaseServiceImpl categoryEntities) { + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); + wrapper.eq(IcEventCategoryEntity::getIcEventId,icEventId) + .set(IcEventCategoryEntity::getUpdatedTime,new Date()) + .set(IcEventCategoryEntity::getUpdatedBy,loginUserUtil.getLoginUserId()) + .set(IcEventCategoryEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null,wrapper); + if(CollectionUtils.isNotEmpty(categoryEntities)){ + this.insertBatch(categoryEntities); + } + } + } \ No newline at end of file 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 dda3a90647..b37344a620 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 @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -182,6 +183,10 @@ public class IcEventServiceImpl extends BaseServiceImpl issueRes=govIssueOpenFeignClient.publishIssue(issueFormDTO); + if (!issueRes.success() || null == issueRes.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件转议题异常,返参:" + JSON.toJSONString(issueRes), "事件转议题异常"); + } + formDTO.setOperationId(issueRes.getData().getIssueId()); + } //3.新增事件数据、附件数据、分类数据、回复数据、操作记录数据 //3-1.事件数据保存 @@ -282,7 +317,7 @@ public class IcEventServiceImpl extends BaseServiceImpl resultDTOResult = govIssueOpenFeignClient.getCategoryTagList(categoryTag); - if (!resultDTOResult.success()) { - throw new RenException("项目立项,调用issue服务查询分类、标签基础信息失败"); + if (!resultDTOResult.success() || CollectionUtils.isEmpty(resultDTOResult.getData().getCategoryList())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "调用issue服务查询分类基础信息失败", "分类信息查询异常"); } return resultDTOResult.getData(); } @@ -390,7 +429,7 @@ public class IcEventServiceImpl extends BaseServiceImpl effectRow = epmetHeartOpenFeignClient.deleteUserDemandByOriginId(entity.getId(), ProjectOriginEnum.IC_EVENT.getCode()); - log.info("delete userDemand result:{},eventId:{}", effectRow, id); + // log.info("delete userDemand result:{},eventId:{}", effectRow, id); + } else if(NumConstant.THREE_STR.equals(entity.getOperationType())){ + DelIssueFormDTO delIssueFormDTO = new DelIssueFormDTO(); + delIssueFormDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId()); + delIssueFormDTO.setUserId(loginUserUtil.getLoginUserId()); + delIssueFormDTO.setIssueIds(Arrays.asList(entity.getOperationId())); + // 删除议题, 议题转了项目的,再单独去删除项目 + Result> delIssueRes = govIssueOpenFeignClient.deleteIssueInternal(delIssueFormDTO); + if(delIssueRes.success()&&!CollectionUtils.isEmpty(delIssueRes.getData())){ + // 议题被转了项目,需要删除项目 + SpringContextUtils.getBean(ProjectService.class).deleteByOriginId(delIssueRes.getData().get(0), ProjectOriginEnum.ISSUE.getCode()); + } } LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); wrapper.eq(IcEventEntity::getId,id).set(IcEventEntity::getUpdatedTime,new Date()) - .set(IcEventEntity::getCreatedBy,loginUserUtil.getLoginUserId()) + .set(IcEventEntity::getUpdatedBy,loginUserUtil.getLoginUserId()) .set(IcEventEntity::getDelFlag,NumConstant.ONE_STR); baseDao.update(null,wrapper); + //把事件分类ic_event_category也删除了吧,以免后面数据分析用到这个表 + icEventCategoryService.delInsert(id,null); } } @@ -1048,58 +1105,58 @@ public class IcEventServiceImpl extends BaseServiceImpl list = baseDao.icEventList(formDTO); - if (!CollectionUtils.isEmpty(list)) { - resultDTO = list.get(0); - //查询网格名称(组织-网格) - List gridIds = list.stream().map(IcEventListResultDTO::getGridId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); - Result> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds); - List gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); - Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName, (key1, key2) -> key2)); - - //事件管理字典表数据 - Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode()); - Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); - - //封装数据 - if (gridInfoMap.containsKey(resultDTO.getGridId())) { - resultDTO.setGridName(gridInfoMap.get(resultDTO.getGridId())); - } - if (StringUtils.isNotBlank(resultDTO.getSourceType())) { - resultDTO.setSourceTypeName(statusMap.get(resultDTO.getSourceType())); - } - //每个事件对应的图片数据 - if(!CollectionUtils.isEmpty(resultDTO.getAttachmentList())){ - List imageList = new ArrayList<>(); - List voiceList = new ArrayList<>(); - resultDTO.getAttachmentList().forEach(file -> { - if ("image".equals(file.getType())) { - imageList.add(file.getUrl()); - } else if ("voice".equals(file.getType())) { - voiceList.add(file); - } - }); - resultDTO.setImageList(imageList); - resultDTO.setVoiceList(voiceList); - } + if(CollectionUtils.isEmpty(list)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"事件不存在","事件已删除"); + } + resultDTO = list.get(0); + //查询网格名称(组织-网格) + List gridIds = list.stream().map(IcEventListResultDTO::getGridId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()); + Result> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + List gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>(); + Map gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName, (key1, key2) -> key2)); + + //事件管理字典表数据 + Result> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode()); + Map statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); + + //封装数据 + if (gridInfoMap.containsKey(resultDTO.getGridId())) { + resultDTO.setGridName(gridInfoMap.get(resultDTO.getGridId())); + } + if (StringUtils.isNotBlank(resultDTO.getSourceType())) { + resultDTO.setSourceTypeName(statusMap.get(resultDTO.getSourceType())); + } + //每个事件对应的图片数据 + if(!CollectionUtils.isEmpty(resultDTO.getAttachmentList())){ + List imageList = new ArrayList<>(); + List voiceList = new ArrayList<>(); + resultDTO.getAttachmentList().forEach(file -> { + if ("image".equals(file.getType())) { + imageList.add(file.getUrl()); + } else if ("voice".equals(file.getType())) { + voiceList.add(file); + } + }); + resultDTO.setImageList(imageList); + resultDTO.setVoiceList(voiceList); + } - //分类信息 - if(StringUtils.isNotBlank(resultDTO.getCategoryId())){ - List categoryList = new ArrayList<>(); - categoryList.add(resultDTO.getCategoryId()); - CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); - for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ - if (ca.getId().equals(resultDTO.getCategoryId())) { - resultDTO.setParentCategoryId(ca.getPid()); - resultDTO.setCategoryId(ca.getId()); - resultDTO.setParentCategoryCode(ca.getParentCategoryCode()); - resultDTO.setCategoryCode(ca.getCategoryCode()); - resultDTO.setParentCategoryName(ca.getParentCategoryName()); - resultDTO.setCategoryName(ca.getCategoryName()); - } + //分类信息 + if(StringUtils.isNotBlank(resultDTO.getCategoryId())){ + List categoryList = new ArrayList<>(); + categoryList.add(resultDTO.getCategoryId()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList); + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + if (ca.getId().equals(resultDTO.getCategoryId())) { + resultDTO.setParentCategoryId(ca.getPid()); + resultDTO.setCategoryId(ca.getId()); + resultDTO.setParentCategoryCode(ca.getParentCategoryCode()); + resultDTO.setCategoryCode(ca.getCategoryCode()); + resultDTO.setParentCategoryName(ca.getParentCategoryName()); + resultDTO.setCategoryName(ca.getCategoryName()); } } } - return resultDTO; } @@ -1201,49 +1258,82 @@ public class IcEventServiceImpl extends BaseServiceImpl event = icEventReplyService.getByEventId(formDTO.getIcEventId()); - - //3.判断查询事件项目进展或需求进展信息 - //项目进展 + // operationType 0:已回复 1:已转项目 2:已转需求3:转议题 + //2.判断查询事件项目进展或需求进展信息或者议题进展 if ("1".equals(entity.getOperationType())) { + // 项目进展 ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO(); processListV2FormDTO.setProjectId(entity.getOperationId()); List project = projectTraceService.processListV2(processListV2FormDTO); List projectList = ConvertUtils.sourceToTarget(project, IcEventProcessListResultDTO.class); - projectList.forEach(p->p.setType("project")); + projectList.forEach(p -> p.setType("project")); resultList.addAll(projectList); - } - //需求进展 - if ("2".equals(entity.getOperationType())) { + } else if ("2".equals(entity.getOperationType())) { + // 需求进展 LinkedList demand = icEventOperationLogService.getByEventId(formDTO.getIcEventId()); resultList.addAll(demand); + } else if ("3".equals(entity.getOperationType())) { + // 议题处理进展 + IssueIdFormDTO issueIdFormDTO = new IssueIdFormDTO(); + issueIdFormDTO.setIssueId(entity.getOperationId()); + Result issueProcessRes = govIssueOpenFeignClient.queryIssueProcess(issueIdFormDTO); + if(!issueProcessRes.success()||CollectionUtils.isEmpty(issueProcessRes.getData().getProcessList())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件已转议题,议题处理进展查询异常", "事件已转议题,议题处理进展查询异常"); + } + IssueAdvanceResDTO issueAdvanceResDTO=issueProcessRes.getData(); + //如果议题已转项目,先放项目的处理进展 + if("shift_project".equals(issueAdvanceResDTO.getIssueStatus())){ + //根据议题id查询项目 + List projectEntityList=SpringContextUtils.getBean(ProjectService.class).getByOriginId(issueAdvanceResDTO.getIssueId()); + if(!CollectionUtils.isEmpty(projectEntityList)){ + // 项目进展 + ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO(); + processListV2FormDTO.setProjectId(projectEntityList.get(0).getId()); + List project = projectTraceService.processListV2(processListV2FormDTO); + List projectList = ConvertUtils.sourceToTarget(project, IcEventProcessListResultDTO.class); + projectList.forEach(p -> p.setType("project")); + resultList.addAll(projectList); + } + } + for(ProcessListResultDTOBak issueProcess:issueAdvanceResDTO.getProcessList()){ + IcEventProcessListResultDTO eventProcess=new IcEventProcessListResultDTO(); + eventProcess.setDepartmentName(issueProcess.getDepartmentName()); + eventProcess.setProcessId(issueProcess.getProcessId()); + eventProcess.setProcessName(issueProcess.getProcessName()); + eventProcess.setProcessTime(issueProcess.getProcessTime()); + eventProcess.setPublicReply(issueProcess.getProgressDesc()); + eventProcess.setIssueId(issueAdvanceResDTO.getIssueId()); + eventProcess.setType(issueProcess.getType()); + resultList.add(eventProcess); + } } + //最后拼上回复的!!!!!!!!!!!! + //3.查询事件回复信息 + LinkedList event = icEventReplyService.getByEventId(formDTO.getIcEventId()); resultList.addAll(event); - return resultList; } /** * @Author sun * @Description 需求完成/项目结案时 修改事件数据 + * 议题关闭时,如果议题来源于事件,也会调用此方法 **/ @Override public void closeProjectOrDemand(ColseProjectOrDemandFormDTO formDTO) { //1.查询事件数据 IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId()); if (null == entity || "closed_case".equals(entity.getStatus())) { - logger.error(String.format("事件不存在或已办结不允许修改,事件Id->%s", formDTO.getIcEventId())); + logger.warn(String.format("事件不存在或已办结不允许修改,事件Id->%s", formDTO.getIcEventId())); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件不存在或已办结不允许修改"); } //2.修改事件数据 entity.setStatus("closed_case"); - entity.setCloseCaseTime(new Date()); - entity.setLatestOperatedTime(new Date()); + entity.setCloseCaseTime(formDTO.getCloseCaseTime()); + entity.setLatestOperatedTime(formDTO.getCloseCaseTime()); entity.setDifficultPoint("0"); baseDao.updateById(entity); @@ -1255,7 +1345,31 @@ public class IcEventServiceImpl extends BaseServiceImpl + // AND ie.REPORT_USER_ID = #{userId} + // List list=baseDao.selectMyReport(formDTO); + if(CollectionUtils.isEmpty(list)){ + return null; + } if (!CollectionUtils.isEmpty(list)) { //封装数据 for (MyReportIcEvResDTO dto : list) { @@ -1672,4 +1792,94 @@ public class IcEventServiceImpl extends BaseServiceImpl(pageInfo.getList(), pageInfo.getTotal()); } + /** + * 事件转议题 + * + * @param formDTO + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void icEventToIssue(IcEventToIssueFormDTO formDTO) { + //校验下数据 + IcEventEntity icEventEntity=baseDao.selectById(formDTO.getIcEventId()); + if (null == icEventEntity || !"processing".equals(icEventEntity.getStatus())) { + log.error(String.format("事件不存在icEventId:%s",formDTO.getIcEventId())); + return; + } + //查询分类信息 + List categoryIdList = formDTO.getCategoryList().stream().map(CategoryOrTagFormDTO::getId).collect(Collectors.toList()); + CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryIdList); + Date nowTime = new Date(); + //调用issue服务转议题 + PublishIssueFormDTO issueFormDTO=new PublishIssueFormDTO(); + issueFormDTO.setIssueStatus("voting"); + issueFormDTO.setAddress(icEventEntity.getAddress()); + issueFormDTO.setLatitude(icEventEntity.getLatitude()); + issueFormDTO.setLongitude(icEventEntity.getLongitude()); + issueFormDTO.setIssueTitle(formDTO.getIssueTitle()); + issueFormDTO.setSuggestion(formDTO.getSuggestion()); + issueFormDTO.setGridId(icEventEntity.getGridId()); + issueFormDTO.setOrgId(icEventEntity.getAgencyId()); + issueFormDTO.setOrgIdPath(icEventEntity.getGridPids()); + issueFormDTO.setSourceType("ic_event"); + issueFormDTO.setSourceId(icEventEntity.getId()); + issueFormDTO.setCustomerId(formDTO.getCustomerId()); + issueFormDTO.setCreatedBy(formDTO.getCurrentUserId()); + issueFormDTO.setUpdatedBy(formDTO.getCurrentUserId()); + issueFormDTO.setCreatedTime(nowTime); + issueFormDTO.setUpdatedTime(nowTime); + issueFormDTO.setDecidedTime(nowTime); + issueFormDTO.setEventReportUserName(icEventEntity.getName()); + Result issueRes=govIssueOpenFeignClient.publishIssue(issueFormDTO); + if (!issueRes.success() || null == issueRes.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件转议题异常,返参:" + JSON.toJSONString(issueRes), "事件转议题异常"); + } + //校验通过之后..... + //1、修改事件相关信息 + icEventEntity.setOperationType(formDTO.getOperationType()); + icEventEntity.setOperationId(issueRes.getData().getIssueId()); + if("0".equals(icEventEntity.getSourceType())){ + //来源于随手拍的,居民端需要显示红点 + icEventEntity.setRedDot(NumConstant.ONE); + } + icEventEntity.setLatestOperatedTime(nowTime); + icEventEntity.setUpdatedTime(nowTime); + baseDao.updateById(icEventEntity); + //2、插入事件分类表 ic_event_category + //分类全删全增吧 + List categoryEntities=new ArrayList<>(); + for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ + IcEventCategoryEntity icEventCategoryEntity=new IcEventCategoryEntity(); + icEventCategoryEntity.setCustomerId(formDTO.getCustomerId()); + icEventCategoryEntity.setIcEventId(formDTO.getIcEventId()); + icEventCategoryEntity.setCategoryId(ca.getId()); + icEventCategoryEntity.setCategoryPids(ca.getPids()); + icEventCategoryEntity.setCategoryCode(ca.getCategoryCode()); + categoryEntities.add(icEventCategoryEntity); + } + icEventCategoryService.delInsert(formDTO.getIcEventId(),categoryEntities); + //3、插入操作日志表 ic_event_operation_log + IcEventOperationLogEntity logEntity = new IcEventOperationLogEntity(); + logEntity.setCustomerId(formDTO.getCustomerId()); + logEntity.setIcEventId(formDTO.getIcEventId()); + logEntity.setUserId(formDTO.getCurrentUserId()); + logEntity.setUserIdentity("staff"); + logEntity.setActionCode("shift_to_issue"); + logEntity.setActionDesc("转议题"); + logEntity.setOperateTime(nowTime); + icEventOperationLogService.insert(logEntity); + } + + /** + * 批量查询事件信息 + * + * @param icEventIds + * @return + */ + @Override + public List batchSelectById(List icEventIds) { + Listlist=baseDao.selectBatchIds(icEventIds); + return ConvertUtils.sourceToTarget(list,IcEventDTO.class); + } + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java index 91d609d8e2..4caf803355 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectCategoryServiceImpl.java @@ -19,6 +19,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; @@ -244,4 +245,20 @@ public class ProjectCategoryServiceImpl extends BaseServiceImpl wrapper = new LambdaUpdateWrapper(); + wrapper.eq(ProjectCategoryEntity::getProjectId, projectId) + .set(ProjectCategoryEntity::getUpdatedTime,delTime) + .set(ProjectCategoryEntity::getUpdatedBy,userId) + .set(ProjectCategoryEntity::getDelFlag,NumConstant.ONE_STR); + return baseDao.update(null, wrapper); + } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index b8b01aa5b9..4ab41b17a6 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -725,7 +725,8 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl issueIds = new ArrayList<>(); + issueIds.add(projectEntity.getOriginId()); + Result> issueRes = govIssueOpenFeignClient.getIssueProfile(issueIds); + if (issueRes.success() && CollectionUtils.isNotEmpty(issueRes.getData())) { + IssueProfileDTO issueProfileDTO = issueRes.getData().get(NumConstant.ZERO); + if ("ic_event".equals(issueProfileDTO.getIssueSourceType())) { + icEventFlag = true; + icEventId = issueProfileDTO.getSourceId(); + } + } + } else if ("ic_event".equals(projectEntity.getOrigin())) { + icEventId = projectEntity.getOriginId(); + } + if ("ic_event".equals(projectEntity.getOrigin()) || icEventFlag) { ColseProjectOrDemandFormDTO dto = new ColseProjectOrDemandFormDTO(); - dto.setCustomerId(fromDTO.getCustomerId()); - dto.setUserId(fromDTO.getUserId()); - dto.setIcEventId(projectEntity.getOriginId()); + dto.setCustomerId(projectEntity.getCustomerId()); + dto.setUserId(userId); + dto.setIcEventId(icEventId); dto.setType("project"); + dto.setCloseCaseTime(closeCaseTime); icEventService.closeProjectOrDemand(dto); } - //2022-5-19 sun end - } @Override @@ -1185,9 +1221,15 @@ public class ProjectServiceImpl extends BaseServiceImpl list = new ArrayList<>(); - ProjectRelatedPersonnelEntity entity1 = new ProjectRelatedPersonnelEntity(); - entity1.setCustomerId(issueDTO.getCustomerId()); - entity1.setProjectId(projectEntity.getId()); - entity1.setApp(AppClientConstant.APP_RESI); - entity1.setGridId(issueDTO.getGridId()); - entity1.setUserId(formDTO.getTopicDTO().getCreatedBy()); - entity1.setSourceType(AppClientConstant.TOPIC); - entity1.setSourceId(formDTO.getTopicDTO().getId()); - ProjectRelatedPersonnelEntity entity2 = ConvertUtils.sourceToTarget(entity1,ProjectRelatedPersonnelEntity.class); - entity2.setUserId(issueDTO.getCreatedBy()); - entity2.setSourceType(AppClientConstant.ISSUE); - entity2.setSourceId(issueDTO.getId()); - list.add(entity1); - list.add(entity2); + if("resi_topic".equals(formDTO.getIssueDTO().getSourceType())){ + //话题 + ProjectRelatedPersonnelEntity topic = new ProjectRelatedPersonnelEntity(); + topic.setCustomerId(issueDTO.getCustomerId()); + topic.setProjectId(projectEntity.getId()); + topic.setApp(AppClientConstant.APP_RESI); + topic.setGridId(issueDTO.getGridId()); + topic.setUserId(formDTO.getTopicDTO().getCreatedBy()); + topic.setSourceType(AppClientConstant.TOPIC); + topic.setSourceId(formDTO.getTopicDTO().getId()); + list.add(topic); + //议题 + ProjectRelatedPersonnelEntity issue = ConvertUtils.sourceToTarget(topic,ProjectRelatedPersonnelEntity.class); + issue.setUserId(issueDTO.getCreatedBy()); + issue.setSourceType(AppClientConstant.ISSUE); + issue.setSourceId(issueDTO.getId()); + list.add(issue); + }else{ + //只插入议题 + ProjectRelatedPersonnelEntity issue = new ProjectRelatedPersonnelEntity(); + issue.setCustomerId(issueDTO.getCustomerId()); + issue.setProjectId(projectEntity.getId()); + issue.setApp(AppClientConstant.APP_RESI); + issue.setGridId(issueDTO.getGridId()); + issue.setUserId(formDTO.getIssueDTO().getCreatedBy()); + issue.setSourceType(AppClientConstant.ISSUE); + issue.setSourceId(formDTO.getIssueDTO().getId()); + list.add(issue); + } projectRelatedPersonnelService.insertBatch(list); //项目分类和标签表初始数据 @@ -2219,7 +2276,7 @@ public class ProjectServiceImpl extends BaseServiceImpl(), null); } catch (Exception e) { String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e); - log.error("【项目流转】上链失败,错误信息:{}", errorMsg); + log.warn("【项目流转】上链失败,错误信息:{}", errorMsg); } } @@ -2883,8 +2941,10 @@ public class ProjectServiceImpl extends BaseServiceImpl getPendingList(ShiftProjectListFromDTO fromDTO) { + // PageInfo result = + // PageHelper.startPage(fromDTO.getPageNo(), fromDTO.getPageSize(), fromDTO.getIsPage()).doSelectPageInfo(() -> baseDao.selectPendingListByGrid(fromDTO.getGridId())); PageInfo result = - PageHelper.startPage(fromDTO.getPageNo(), fromDTO.getPageSize(), fromDTO.getIsPage()).doSelectPageInfo(() -> baseDao.selectPendingListByGrid(fromDTO.getGridId())); + PageHelper.startPage(fromDTO.getPageNo(), fromDTO.getPageSize(), fromDTO.getIsPage()).doSelectPageInfo(() -> baseDao.selectPendingListByGridV2(fromDTO.getGridId())); if (CollectionUtils.isNotEmpty(result.getList())) { result.getList().forEach(item -> { ProjectDTO dto = new ProjectDTO(); @@ -2919,6 +2979,7 @@ public class ProjectServiceImpl extends BaseServiceImpl getUnResolvedListByGrid(ShiftProjectListFromDTO fromDTO) { + //来源于议题,已结案,无需解决的项目 return baseDao.selectUnResolvedListByGrid(fromDTO.getGridId()); } @@ -3563,16 +3624,31 @@ public class ProjectServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } + /** + * 根据项目来源id, 删除项目主表,项目分类关系表 + * @param originId + * @param origin + * @return + */ + @Transactional(rollbackFor = Exception.class) @Override public Integer deleteByOriginId(String originId, String origin) { - LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); - wrapper.eq(ProjectEntity::getOriginId, originId) - .eq(ProjectEntity::getOrigin,origin) - .set(ProjectEntity::getUpdatedTime,new Date()) - .set(ProjectEntity::getCreatedBy,loginUserUtil.getLoginUserId()) - .set(ProjectEntity::getDelFlag,NumConstant.ONE_STR); - return baseDao.update(null, wrapper); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + queryWrapper.eq(ProjectEntity::getOriginId, originId) + .eq(ProjectEntity::getOrigin, origin); + ProjectEntity projectEntity = baseDao.selectOne(queryWrapper); + if (null != projectEntity) { + Date nowTime = new Date(); + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); + wrapper.eq(ProjectEntity::getId, projectEntity.getId()) + .set(ProjectEntity::getUpdatedTime, nowTime) + .set(ProjectEntity::getUpdatedBy, loginUserUtil.getLoginUserId()) + .set(ProjectEntity::getDelFlag, NumConstant.ONE_STR); + baseDao.update(null, wrapper); + projectCategoryService.delByProjectId(projectEntity.getId(), loginUserUtil.getLoginUserId(), nowTime); + return 1; + } + return 0; } - } diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.27__icevent_to_issue.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.27__icevent_to_issue.sql new file mode 100644 index 0000000000..c372ca3cee --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.27__icevent_to_issue.sql @@ -0,0 +1,6 @@ +ALTER TABLE ic_event MODIFY COLUMN `OPERATION_TYPE` CHAR ( 1 ) DEFAULT NULL COMMENT '0:已回复 1:已转项目 2:已转需求3:转议题'; +ALTER TABLE ic_event MODIFY COLUMN `OPERATION_ID` VARCHAR ( 32 ) DEFAULT NULL COMMENT '项目、需求ID、议题id'; + +alter TABLE ic_event_operation_log MODIFY COLUMN `ACTION_CODE` varchar(32) NOT NULL COMMENT '1、发布事件:add\r\n2、复:reply;3、立项:shift_project;4、转需求:shift_demand5、办结:close_case;6、需求办结:close_demand;转议题:shift_to_issue;项目结案:project_closed;议题关闭:close_issue'; + +alter TABLE ic_event_operation_log MODIFY COLUMN `ACTION_DESC` varchar(32) NOT NULL COMMENT '1、发布事件:publish;2、撤回事件:recall;n3、复:reply;n4、立项:shift_project;5、转需求: shift_demand;6、办结:close_case;7、需求办结:close_demand;8、选择是否已解决:choose_resolve;9、首次查看阅读事件:read_first:人大代表未读=>已读;工作人员待处理=>处理中;转议题:shift_to_issue;项目结案:project_closed;议题关闭:close_issue'; diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml index afb3965750..a5343119cf 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml @@ -17,5 +17,4 @@ del_flag = '0' AND ic_event_id = #{icEventId} - \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml index b0d42f5b0e..bd7853c4e0 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml @@ -170,7 +170,14 @@ ie.satisfaction, IF(ie.satisfaction = 'bad','不满意',IF (ie.satisfaction = 'good','基本满意',IF (ie.satisfaction = 'perfect','非常满意',''))) satisfactionName, ie.operation_type, - IF(ie.operation_type = '0','已回复',IF (ie.operation_type = '1','已转项目',IF (ie.operation_type = '2','已转需求',''))) operationTypeName, + ( + case when ie.operation_type = '0' then '已回复' + when ie.operation_type = '1' then '已转项目' + when ie.operation_type = '2' then '已转需求' + when ie.operation_type = '3' then '已转议题' + else '' + end + )as operationTypeName, ie.operation_id, ie.read_flag, ie.red_dot, 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 73c2f11384..b57ebeca72 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 @@ -336,18 +336,47 @@ AND a.ORIGIN = 'issue' ORDER BY a.CREATED_TIME DESC + + + + + + + + SELECT + COUNT(DISTINCT USER_ID) + FROM register_relation + WHERE DEL_FLAG = 0 + AND FIRST_REGISTER = '1' + AND grid_id = #{gridId} + +