From 313f8e3e047634522c5b09127d553a99e437399f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 30 Sep 2022 08:21:20 +0800 Subject: [PATCH 001/249] =?UTF-8?q?=E4=BF=AE=E6=94=B9issue=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/db/migration/V0.0.18__alter_issue_type.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.18__alter_issue_type.sql 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..ea9a1f3eb1 --- /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,2 @@ +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; From 96065a076081af65d73e96e1f75249714e4f2f2d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 30 Sep 2022 14:03:52 +0800 Subject: [PATCH 002/249] =?UTF-8?q?/resi/hall/issue/votinglist=E8=BF=94?= =?UTF-8?q?=E5=9B=9EissueImgs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/VotingIssueListResultDTO.java | 11 ++++++ .../epmet/service/impl/IssueServiceImpl.java | 3 +- .../src/main/resources/mapper/IssueDao.xml | 37 +++++++++++++------ .../dto/result/VotingIssueListResultDTO.java | 10 +++++ 4 files changed, 49 insertions(+), 12 deletions(-) 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..6725684610 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 政府端/居民段查看表决中议题列表返参 @@ -38,4 +39,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-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 8722a0c027..30054255d2 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -606,7 +606,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; } /** 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..acd64f9758 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 @@ -202,22 +202,37 @@ + + + + + + + + + + + - SELECT - ID AS issueId, - IFNULL(ISSUE_TITLE,'') AS issueTitle, - IFNULL(SUGGESTION,'')AS suggestion, - UNIX_TIMESTAMP( created_time ) AS issuePublishTime, - SOURCE_ID AS sourceId + i.ID AS issueId, + IFNULL(i.ISSUE_TITLE,'') AS issueTitle, + IFNULL(i.SUGGESTION,'')AS suggestion, + UNIX_TIMESTAMP( i.created_time ) AS issuePublishTime, + i.SOURCE_ID AS sourceId, + i.SOURCE_TYPE as sourceType, + ia.url FROM - issue + issue i + left join issue_attachment ia + on(i.id=ia.BUSINESS_ID) WHERE - DEL_FLAG = '0' - AND GRID_ID = #{gridId} - AND ISSUE_STATUS = 'voting' + i.DEL_FLAG = '0' + AND i.GRID_ID = #{gridId} + AND i.ISSUE_STATUS = 'voting' ORDER BY - created_time DESC + i.created_time DESC,ia.SORT asc diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java index 3b9bee2505..4209446f79 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VotingIssueListResultDTO.java @@ -40,11 +40,21 @@ public class VotingIssueListResultDTO implements Serializable { */ private String sourceId; + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String sourceType; + /** * 话题图片列表 */ private List topicImgs; + /** + * 发布议题的图片 + */ + private List issueImgs; + /** * 话题语音 */ From 0ae7ee65678ea53e94f97e96d0b38d4129e1fbd0 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 30 Sep 2022 14:21:25 +0800 Subject: [PATCH 003/249] =?UTF-8?q?=E6=9A=82=E6=8F=90=E4=B8=80=E6=B3=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/IssueAttachmentDTO.java | 116 ++++++++++++++++++ .../src/main/java/com/epmet/dto/IssueDTO.java | 32 ++++- .../com/epmet/controller/IssueController.java | 8 ++ .../com/epmet/dao/IssueAttachmentDao.java | 16 +++ .../epmet/entity/IssueAttachmentEntity.java | 82 +++++++++++++ .../java/com/epmet/entity/IssueEntity.java | 15 +++ .../epmet/service/IssueAttachmentService.java | 78 ++++++++++++ .../java/com/epmet/service/IssueService.java | 2 + .../impl/IssueAttachmentServiceImpl.java | 82 +++++++++++++ .../epmet/service/impl/IssueServiceImpl.java | 91 +++++++++++++- .../java/com/epmet/utils/ModuleConstants.java | 4 + .../migration/V0.0.18__alter_issue_type.sql | 30 +++++ .../resources/mapper/IssueAttachmentDao.xml | 6 + 13 files changed, 556 insertions(+), 6 deletions(-) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueAttachmentDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueAttachmentDao.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueAttachmentEntity.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueAttachmentService.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueAttachmentServiceImpl.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueAttachmentDao.xml diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueAttachmentDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueAttachmentDTO.java new file mode 100644 index 0000000000..d9d7f2b723 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueAttachmentDTO.java @@ -0,0 +1,116 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * issue库附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-09-30 + */ +@Data +public class IssueAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户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; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java index 5e7a6c8fdb..fd86c07eb7 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java @@ -19,8 +19,10 @@ package com.epmet.dto; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -34,6 +36,8 @@ public class IssueDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface IssueForm{} + /** * 议题ID */ @@ -67,12 +71,14 @@ public class IssueDTO implements Serializable { /** * 议题名称 最多20字 */ - private String issueTitle; + @NotBlank(message = "issueTitle不能为空",groups = IssueForm.class) + private String issueTitle; /** * 建议 最多1000字 */ - private String suggestion; + @NotBlank(message = "suggestion不能为空",groups = IssueForm.class) + private String suggestion; /** * 客户ID @@ -82,7 +88,8 @@ public class IssueDTO implements Serializable { /** * 网格ID 居民端议题对应一个网格Id */ - private String gridId; + @NotBlank(message = "gridId不能为空",groups = IssueForm.class) + private String gridId; /** * 所属机关 【数据权限-非必填】11:22:33(agencyId)数据权限控制 @@ -160,4 +167,23 @@ public class IssueDTO implements Serializable { private String projectId; private String issueId; + + /** + * 地址 + */ + @NotBlank(message = "address不能为空",groups = IssueForm.class) + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + private String userId; + + private List attachmentList; } \ No newline at end of file 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..aebbd3789e 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 @@ -333,5 +333,13 @@ public class IssueController { return new Result().ok(issueService.issueAuditReset(gridId)); } + @PostMapping("createIssue") + public Result createIssue(@LoginUser TokenDto tokenDto,@RequestBody IssueDTO formDTO){ + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + issueService.createIssue(formDTO); + return new Result(); + } + } 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/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..825e16cbbc 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 @@ -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/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/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java index 1296374261..8ac38fb970 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 @@ -384,4 +384,6 @@ public interface IssueService extends BaseService { */ Boolean issueAuditReset(String gridId); + void createIssue(IssueDTO issueDTO); + } 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/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 30054255d2..a4ca334de5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -17,7 +17,9 @@ 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.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.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; @@ -39,9 +41,7 @@ import com.epmet.dto.form.IssueAuditionFormDTO; import com.epmet.dto.form.IssueShiftedFromTopicFormDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.entity.IssueEntity; -import com.epmet.entity.IssueProcessEntity; -import com.epmet.entity.IssueProjectRelationEntity; +import com.epmet.entity.*; import com.epmet.feign.*; import com.epmet.redis.GovIssueRedis; import com.epmet.redis.IssueVoteDetailRedis; @@ -140,12 +140,16 @@ public class IssueServiceImpl 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) { @@ -1767,5 +1771,86 @@ public class IssueServiceImpl extends BaseServiceImpl imp return false; } + @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()); + } + issueDTO.setOrgId(gridInfo.getPid()); + issueDTO.setOrgIdPath(gridInfo.getPids()); + } + + } + 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); + } + } } 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..1a7f4dbffd 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,8 @@ public interface ModuleConstants { * 是否禁用 disable:禁用 */ String IS_DISABLE = "disable"; + + String UNDER_AUDITING = "under_auditing"; + + String ISSUE_APPLICATION = "issue_application"; } 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 index ea9a1f3eb1..446d74a28f 100644 --- 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 @@ -1,2 +1,32 @@ 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; + +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/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 From 7d9b15185b5675c0dc4e4464f8048a319b3f8458 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 30 Sep 2022 14:31:44 +0800 Subject: [PATCH 004/249] =?UTF-8?q?/resi/hall/issue/closedlist=E8=BF=94?= =?UTF-8?q?=E5=9B=9EissueImgs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/ClosedIssueListResultDTO.java | 12 ++++++ .../epmet/service/impl/IssueServiceImpl.java | 3 +- .../src/main/resources/mapper/IssueDao.xml | 41 +++++++++++++------ .../com/epmet/controller/IssueController.java | 5 +-- .../epmet/service/impl/IssueServiceImpl.java | 2 +- 5 files changed, 44 insertions(+), 19 deletions(-) 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-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 30054255d2..4761577b1c 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -620,7 +620,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; } /** 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 acd64f9758..a1e3a4acd1 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 @@ -226,7 +226,7 @@ FROM issue i left join issue_attachment ia - on(i.id=ia.BUSINESS_ID) + on(i.id=ia.BUSINESS_ID and ia.del_flag='0') WHERE i.DEL_FLAG = '0' AND i.GRID_ID = #{gridId} @@ -235,23 +235,38 @@ i.created_time DESC,ia.SORT asc + + + + + + + + + + + - 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,ia.sort asc + + SELECT + COUNT(DISTINCT USER_ID) + FROM register_relation + WHERE DEL_FLAG = 0 + AND FIRST_REGISTER = '1' + AND CUSTOMER_ID = #{gridId} + + From b9fab93c9d59b99a8f2d10127e501b88fb82bfc8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 8 Oct 2022 13:32:10 +0800 Subject: [PATCH 013/249] =?UTF-8?q?=E8=AE=AE=E4=BA=8B=E5=8E=85-=E5=A4=84?= =?UTF-8?q?=E7=90=86=E4=B8=AD=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/IssueProfileDTO.java | 19 +++++ .../epmet/feign/GovIssueOpenFeignClient.java | 8 +++ .../GovIssueOpenFeignClientFallBack.java | 11 +++ .../com/epmet/controller/IssueController.java | 13 ++++ .../src/main/java/com/epmet/dao/IssueDao.java | 6 ++ .../java/com/epmet/service/IssueService.java | 6 ++ .../epmet/service/impl/IssueServiceImpl.java | 21 ++++-- .../src/main/resources/mapper/IssueDao.xml | 14 ++++ .../epmet/dto/result/PendingResultDTO.java | 35 +++++++++- .../main/java/com/epmet/dao/ProjectDao.java | 8 +++ .../service/impl/ProjectServiceImpl.java | 4 +- .../src/main/resources/mapper/ProjectDao.xml | 25 +++++++ .../result/ResiTopicDetailResultDTO.java | 2 +- .../service/impl/ResiTopicServiceImpl.java | 1 + .../com/epmet/controller/IssueController.java | 3 +- .../java/com/epmet/service/IssueService.java | 3 +- .../epmet/service/impl/IssueServiceImpl.java | 69 +++++++++++++------ 17 files changed, 214 insertions(+), 34 deletions(-) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProfileDTO.java 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..1fb3b336e7 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueProfileDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2022/10/8 12:58 + */ +@Data +public class IssueProfileDTO { + private String issueId; + private String sourceId; + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String sourceType; +} + 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..5b79e535ac 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 @@ -395,4 +395,12 @@ 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); } 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..5f81cd7501 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,16 @@ 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); + } + } 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 aebbd3789e..c074d16352 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 @@ -13,6 +13,7 @@ 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.*; @@ -341,5 +342,17 @@ public class IssueController { 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)); + } } 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..24811e442e 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,10 @@ public interface IssueDao extends BaseDao { */ Integer selectAuditIssue(@Param("gridId")String gridId); + /** + * 根据议题ids查询议题简要信息 + * @param issueIds + * @return + */ + List selectIssueProfile(@Param("issueIds") List issueIds); } \ No newline at end of file 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 8ac38fb970..3ccc105c94 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 @@ -386,4 +386,10 @@ public interface IssueService extends BaseService { void createIssue(IssueDTO issueDTO); + /** + * 根据议题ids查询议题简要信息 + * @param issueIds + * @return + */ + List getIssueProfile(List issueIds); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 561a5dcd35..2e9a377e79 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -217,13 +217,6 @@ 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); } @@ -1895,4 +1888,18 @@ public class IssueServiceImpl extends BaseServiceImpl imp issueAttachmentService.insertBatch(list); } } + + /** + * 根据议题ids查询议题简要信息 + * + * @param issueIds + * @return + */ + @Override + public List getIssueProfile(List issueIds) { + if(CollectionUtils.isEmpty(issueIds)){ + return new ArrayList<>(); + } + return baseDao.selectIssueProfile(issueIds); + } } 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 080f01afe6..762876ad3e 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 @@ -819,4 +819,18 @@ AND APPLY_STATUS = 'under_auditing' AND GRID_ID = #{gridId} + + \ No newline at end of file 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..5d50dccb33 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,5 @@ package com.epmet.dto.result; -import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import lombok.NoArgsConstructor; @@ -20,14 +19,46 @@ 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; } 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/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 9e679c824b..dd36dd7694 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -2883,8 +2883,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(); 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..73291bb680 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,6 +336,31 @@ AND a.ORIGIN = 'issue' ORDER BY a.CREATED_TIME DESC + + + + + - SELECT i.id AS issueId, - i.SOURCE_TYPE AS sourceType, - IFNULL( i.SOURCE_ID, '' ) AS sourceId + i.SOURCE_TYPE AS issueSourceType, + IFNULL( i.SOURCE_ID, '' ) AS sourceId, + ia.url FROM issue i + left join issue_attachment ia + on(i.id=ia.BUSINESS_ID and ia.del_flag='0') WHERE i.DEL_FLAG = '0' 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 5d50dccb33..f4b76f8b96 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 @@ -61,4 +61,13 @@ public class PendingResultDTO implements Serializable { * 话题id */ private String topicId; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String issueSourceType; + /** + * 发布议题的图片 + */ + private List issueImgs; } diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 89528c9f4b..0c7d9ded4c 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -2,6 +2,8 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; 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.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; @@ -28,6 +30,7 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -499,40 +502,53 @@ public class IssueServiceImpl implements IssueService { @Override public List getProcessing(ShiftProjectListFromDTO formDTO) { //1、查询由议题转的项目,且正在处理中的 - List resultList = govProjectOpenFeignClient.getPendingList(formDTO).getData(); + Result> projectRes=govProjectOpenFeignClient.getPendingList(formDTO); + if(!projectRes.success()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getMsg()); + } + List resultList =projectRes.getData(); if (org.apache.commons.collections4.CollectionUtils.isEmpty(resultList)) { return new ArrayList<>(); } + // 话题信息 + HashMap rtm=new HashMap<>(); + // 议题信息 //2、根据议题id查询话题id List issueIds = resultList.stream().map(PendingResultDTO::getIssueId).collect(Collectors.toList()); - if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(issueIds)){ - //根据议题id查询话题id - Result> issueRes=govIssueOpenFeignClient.getIssueProfile(issueIds); - if (issueRes.success() && !CollectionUtils.isEmpty(issueRes.getData())) { - // 3、如果存在议题来源于话题 - List topicIds = issueRes.getData().stream().filter(t->t.getSourceType().equals("resi_topic")).map(IssueProfileDTO::getSourceId).collect(Collectors.toList()); - if(!CollectionUtils.isEmpty(topicIds)){ - //3.1 查询话题详情 - TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); - form.setTopicIdList(topicIds); - Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); - if (topicDetailsResult.success() && !CollectionUtils.isEmpty(topicDetailsResult.getData())) { - List topicDetails = topicDetailsResult.getData(); - HashMap rtm = convertTopicDetailList2MapV2(topicDetails); - resultList.forEach(vi -> { - ResiTopicDetailResultDTO rr = rtm.get(vi.getIssueId()); - vi.setTopicImgs(rr == null ? new ArrayList<>() : rr.getTopicImgs()); - vi.setTopicVoices(rr == null ? new ArrayList<>() : rr.getTopicImgs()); - vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); - vi.setLongitude(rr == null ? "" : rr.getLongitude()); - vi.setLatitude(rr == null ? "" : rr.getLatitude()); - vi.setTopicId(null == rr ? "" : rr.getTopicId()); - }); - } + // 根据议题id查询话题id + Result> issueRes = govIssueOpenFeignClient.getIssueProfile(issueIds); + + if (issueRes.success() && !CollectionUtils.isEmpty(issueRes.getData())) { + // 3、如果存在议题来源于话题 + List topicIds = issueRes.getData().stream().filter(t -> t.getIssueSourceType().equals("resi_topic")).map(IssueProfileDTO::getSourceId).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(topicIds)) { + // 3.1 查询话题详情 + TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); + form.setTopicIdList(topicIds); + Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); + if (topicDetailsResult.success() && !CollectionUtils.isEmpty(topicDetailsResult.getData())) { + List topicDetails = topicDetailsResult.getData(); + topicDetails.stream().forEach(t -> { + if(StringUtils.isNotBlank(t.getIssueId())){ + rtm.put(t.getIssueId(), t); + } + }); } - } - + Map issueMap=issueRes.getData().stream().collect(Collectors.toMap(IssueProfileDTO::getIssueId, o -> o, (o1, o2) -> o1)); + // 赋值话题信息、议题来源、议题图片 + resultList.forEach(vi -> { + ResiTopicDetailResultDTO rr = rtm.get(vi.getIssueId()); + vi.setTopicImgs(rr == null ? new ArrayList<>() : rr.getTopicImgs()); + vi.setTopicVoices(rr == null ? new ArrayList<>() : rr.getTopicImgs()); + vi.setTopicContent(rr == null ? StrConstant.EPMETY_STR : rr.getTopicContent()); + vi.setLongitude(rr == null ? StrConstant.EPMETY_STR : rr.getLongitude()); + vi.setLatitude(rr == null ? StrConstant.EPMETY_STR : rr.getLatitude()); + vi.setTopicId(null == rr ? StrConstant.EPMETY_STR : rr.getTopicId()); + IssueProfileDTO issue = issueMap.get(vi.getIssueId()); + vi.setIssueSourceType(null != issue ? issue.getIssueSourceType() : StrConstant.EPMETY_STR); + vi.setIssueImgs(null != issue ? issue.getIssueImgs() : new ArrayList<>()); + }); } return resultList; } From cc3a3fa3b010427328a77c9233498deda1e9b5f3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 8 Oct 2022 14:23:04 +0800 Subject: [PATCH 015/249] ClosedIssueListResultDTO --- .../com/epmet/dto/result/ClosedIssueListResultDTO.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java index da7574183f..74483df1b1 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/ClosedIssueListResultDTO.java @@ -56,4 +56,13 @@ public class ClosedIssueListResultDTO implements Serializable { private String topicContent; private String longitude; private String latitude; + /** + * 来源类型 话题:resi_topic;直接立议题:issue; + */ + private String sourceType; + + /** + * 发布议题的图片 + */ + private List issueImgs; } From bb6b615d79f351f6a258dc776ebeb52909e8a094 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 8 Oct 2022 14:51:41 +0800 Subject: [PATCH 016/249] =?UTF-8?q?/issue/closedproject=E5=B7=B2=E5=A4=84?= =?UTF-8?q?=E7=90=86-=E5=B7=B2=E7=BB=93=E6=A1=88=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/ResolvedResultDTO.java | 22 ++++++++ .../src/main/resources/mapper/ProjectDao.xml | 7 ++- .../epmet/service/impl/IssueServiceImpl.java | 56 ++++++++++++++----- 3 files changed, 68 insertions(+), 17 deletions(-) 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..3c676185b9 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 @@ -13,6 +13,7 @@ import java.util.List; @Data public class ResolvedResultDTO implements Serializable { private static final long serialVersionUID = -6670213622289052352L; + private String projectId; /** * 议题Id */ @@ -53,4 +54,25 @@ 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; } 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 73291bb680..8c3f58f3f5 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 @@ -361,17 +361,20 @@ ORDER BY a.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' @@ -824,6 +847,8 @@ + + @@ -834,6 +859,8 @@ i.id AS issueId, i.SOURCE_TYPE AS issueSourceType, IFNULL( i.SOURCE_ID, '' ) AS sourceId, + i.LONGITUDE, + i.LATITUDE, ia.url FROM issue i 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..cd3e689745 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 @@ -52,4 +52,27 @@ 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; } 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 8c3f58f3f5..ba340a2464 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 @@ -373,9 +373,10 @@ a.ORIGIN as projectOrigin FROM project a - INNER JOIN project_related_personnel b ON a.ID = b.PROJECT_ID - AND b.SOURCE_TYPE = 'issue' - AND b.GRID_ID = #{gridId} + INNER JOIN project_related_personnel b ON (a.ID = b.PROJECT_ID + AND b.SOURCE_TYPE = 'issue' + AND b.GRID_ID = #{gridId} + ) LEFT JOIN project_process c ON a.ID = c.PROJECT_ID AND c.OPERATION = 'close' WHERE @@ -385,20 +386,28 @@ AND a.CLOSED_STATUS = 'resolved' ORDER BY a.UPDATED_TIME DESC + From 8d05a101874d93d7b10f88517edd5ccf74feab99 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 8 Oct 2022 15:51:30 +0800 Subject: [PATCH 020/249] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/ProjectServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index dd36dd7694..42f3b122a5 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -649,6 +649,7 @@ public class ProjectServiceImpl extends BaseServiceImpl Date: Sat, 8 Oct 2022 15:55:08 +0800 Subject: [PATCH 021/249] url --- .../src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 5e7348b757..50861d9f3f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -931,6 +931,6 @@ public interface EpmetUserOpenFeignClient { * @author zxc * @date 2022/10/8 10:41 */ - @PostMapping("/epmetuser/resirelation/getAllResiByGrid") + @PostMapping("/epmetuser/registerrelation/getAllResiByGrid") Result getAllResiByGrid(@RequestBody AllResiByGridFormDTO formDTO); } From 5fe1e05166a9980c9fd8386734af7956b134b4d2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 8 Oct 2022 16:31:39 +0800 Subject: [PATCH 022/249] =?UTF-8?q?=E5=8F=91=E8=B5=B7=E8=AE=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IssueProcessDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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..2df1c162ba 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,7 +102,7 @@ SELECT - '转议题' AS processName, + '发起议题' AS processName, UNIX_TIMESTAMP( created_time ) AS processTime, operation_explain AS progressDesc, org_name AS departmentName, From ad62f03d10f518fbbe3144bf22616090a0f2d06a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 8 Oct 2022 16:43:14 +0800 Subject: [PATCH 023/249] =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E4=B8=8D=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/IssueController.java | 1 + 1 file changed, 1 insertion(+) 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 4befb7b97b..f27113c3e8 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 @@ -348,6 +348,7 @@ public class IssueController { 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(); } From 04564196b52d62098d8a6a6ba862a0e63414d6f9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 9 Oct 2022 10:14:31 +0800 Subject: [PATCH 024/249] =?UTF-8?q?=E5=8F=91=E5=B8=83=E7=9A=84=E8=AE=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E8=AE=AE=E9=A2=98=E8=BD=AC=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IssueDTO.java | 2 +- .../epmet/constant/UserMessageConstant.java | 5 + .../java/com/epmet/entity/IssueEntity.java | 2 +- .../epmet/service/impl/IssueServiceImpl.java | 115 ++++++++++++------ .../service/impl/ProjectServiceImpl.java | 55 ++++++--- 5 files changed, 120 insertions(+), 59 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java index fd86c07eb7..93d5602612 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java @@ -49,7 +49,7 @@ public class IssueDTO implements Serializable { private String issueStatus; /** - * 来源类型 eg:resi_topic + * 来源类型 话题:resi_topic;直接立议题:issue; */ private String sourceType; 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/entity/IssueEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java index 825e16cbbc..90a04596fb 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; */ private String sourceType; diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 80b36d2c33..4aac38aee6 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1025,18 +1025,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()); @@ -1124,32 +1127,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()); //所选人员如果即在部门下又在网格下则只发一条消息 @@ -1181,20 +1202,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); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 42f3b122a5..f4b8aa9907 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -1186,9 +1186,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); //项目分类和标签表初始数据 From c692768a8fc7d7d8439f257d676e8f9001f9cf8b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 9 Oct 2022 10:37:22 +0800 Subject: [PATCH 025/249] =?UTF-8?q?=E5=8F=91=E5=B8=83=E7=9A=84=E8=AE=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E8=AE=AE=E9=A2=98=E8=BD=AC=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/IssueVoteStatisticalService.java | 5 +-- .../epmet/service/impl/IssueServiceImpl.java | 4 +- .../impl/IssueVoteStatisticalServiceImpl.java | 37 +++++++++++++------ 3 files changed, 29 insertions(+), 17 deletions(-) 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 165bbc2c38..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; @@ -153,14 +154,12 @@ public interface IssueVoteStatisticalService extends BaseService imp } try{ - issueVoteStatisticalService.syncVotingCacheToDbByParams(formDTO.getIssueId(),entity.getGridId(),null); + issueVoteStatisticalService.syncVotingCacheToDbByParams(entity,null); }catch(RenException e){ logger.error(e.getInternalMsg()); } @@ -1088,7 +1088,7 @@ 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()); } 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 05963e6baa..8312ee3c6d 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 @@ -607,36 +607,49 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl votableCount = - resiGroupFeignClient.votableCount(gridParam); - if(votableCount.success() && null != votableCount.getData()){ + 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); From b386eebfa8e09949566731509916ef37dae71ccd Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 9 Oct 2022 10:48:13 +0800 Subject: [PATCH 026/249] issue_vote_statistical.issue_id --- .../src/main/java/com/epmet/service/impl/IssueServiceImpl.java | 2 +- .../com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 8fc490774f..2e8a14304a 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1090,7 +1090,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp try{ issueVoteStatisticalService.syncVotingCacheToDbByParams(entity,null); }catch(RenException e){ - logger.error(e.getInternalMsg()); + logger.error("subtractWorkGrassrootsIssueRedDotValue报错:"+e.getInternalMsg()); } 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 8312ee3c6d..d1d0856063 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 @@ -622,6 +622,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl Date: Sun, 9 Oct 2022 11:02:21 +0800 Subject: [PATCH 027/249] canEvaluateProjectCount --- .../com/epmet/service/impl/IssueServiceImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 2e8a14304a..53f86de42b 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1555,12 +1555,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()); } From 9be438913dc37cf10d3d5a9aa90ab25411a619a7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 9 Oct 2022 11:04:07 +0800 Subject: [PATCH 028/249] warn --- .../java/com/epmet/service/impl/ProjectServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index f4b8aa9907..c3c4976c79 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -730,7 +730,7 @@ public class ProjectServiceImpl extends BaseServiceImpl Date: Sun, 9 Oct 2022 11:14:09 +0800 Subject: [PATCH 029/249] =?UTF-8?q?=E4=B8=8A=E9=93=BE=E5=A4=B1=E8=B4=A5war?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/ProjectServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index c3c4976c79..ffb61404ea 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -2385,7 +2385,7 @@ public class ProjectServiceImpl extends BaseServiceImpl(), null); } catch (Exception e) { String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e); - log.error("【项目流转】上链失败,错误信息:{}", errorMsg); + log.warn("【项目流转】上链失败,错误信息:{}", errorMsg); } } From c2c445beb4bc58d2c9a76ce7a9f78c1bf147ce41 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 9 Oct 2022 11:22:36 +0800 Subject: [PATCH 030/249] transferV2 --- .../epmet/service/impl/ProjectProcessServiceImpl.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 Date: Sun, 9 Oct 2022 12:08:59 +0800 Subject: [PATCH 031/249] /trace/return-v2 warn --- .../java/com/epmet/service/impl/ProjectServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index ffb61404ea..ede20937fc 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -2241,7 +2241,7 @@ public class ProjectServiceImpl extends BaseServiceImpl Date: Sun, 9 Oct 2022 16:16:35 +0800 Subject: [PATCH 032/249] =?UTF-8?q?OPERATION=5FTYPE,OPERATION=5Fid,?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcEventDTO.java | 4 ++-- .../src/main/java/com/epmet/entity/IcEventEntity.java | 4 ++-- .../main/resources/db/migration/V0.0.27__icevent_to_issue.sql | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.27__icevent_to_issue.sql 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-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..db740ced18 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 @@ -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/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..2d539f2729 --- /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,2 @@ +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'; \ No newline at end of file From 5bb22c85217aec7188148af6edc9fd1dd64d0fe7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 9 Oct 2022 17:30:38 +0800 Subject: [PATCH 033/249] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E8=BD=AC=E8=AE=AE?= =?UTF-8?q?=E9=A2=98=E5=8D=95=E7=8B=AC=E7=9A=84api=EF=BC=8C=E6=9C=AA?= =?UTF-8?q?=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/IcEventToIssueFormDTO.java | 58 ++++++++++++++++++ .../epmet/controller/IcEventController.java | 15 +++++ .../com/epmet/dao/IcEventCategoryDao.java | 1 + .../java/com/epmet/entity/IcEventEntity.java | 6 +- .../entity/IcEventOperationLogEntity.java | 1 + .../epmet/service/IcEventCategoryService.java | 2 + .../com/epmet/service/IcEventService.java | 5 ++ .../impl/IcEventCategoryServiceImpl.java | 8 ++- .../service/impl/IcEventServiceImpl.java | 60 ++++++++++++++++++- .../resources/mapper/IcEventCategoryDao.xml | 4 +- 10 files changed, 153 insertions(+), 7 deletions(-) create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToIssueFormDTO.java 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..2bfbce4810 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToIssueFormDTO.java @@ -0,0 +1,58 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +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 { + } + + /** + * 转议题默认传3即可;0:已回复 1:已转项目 2:已转需求3:转议题 + */ + @NotBlank(message = "处理方式不能为空", groups = {IcEventToIssueFormDTO.AddUserInternalGroup.class}) + private String operationType; + + @NotBlank(message = "事件id不能为空", groups = IcEventToIssueFormDTO.AddUserInternalGroup.class) + private String icEventId; + + // /** + // * 二类分类Id + // */ + // private String categoryId; + + /** + * 项目所选分类集合,不可为空 + */ + @Valid + @NotEmpty(message = "事件分类不能为空", groups = IcEventToIssueFormDTO.AddUserShowGroup.class) + private List categoryList; + + @NotBlank(message = "议题标题不能为空", groups = IcEventToIssueFormDTO.AddUserShowGroup.class) + private String issueTitle; + @NotBlank(message = "处理建议不能为空", groups = IcEventToIssueFormDTO.AddUserShowGroup.class) + private String suggestion; + + @NotBlank(message = "customerId不能为空", groups = {IcEventToIssueFormDTO.AddUserInternalGroup.class}) + private String customerId; + @NotBlank(message = "currentUserId不能为空", groups = {IcEventToIssueFormDTO.AddUserInternalGroup.class}) + private String currentUserId; +} + 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..3b667b222c 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 @@ -242,6 +242,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(); + } + /** * 事件分类分析-一级分类下事件数量 * 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..6c96758c64 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 @@ -16,4 +16,5 @@ public interface IcEventCategoryDao extends BaseDao { IcEventCategoryEntity selectByEventId(@Param("icEventId") String icEventId); + int deleteByIcEventId(@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/entity/IcEventEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java index db740ced18..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; /** 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/service/IcEventCategoryService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java index 90c9fd9524..4ebabf00b8 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,6 @@ 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..ede1854804 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 @@ -225,4 +225,9 @@ public interface IcEventService extends BaseService { PageData icEventPageUserReported(PageUserReportEventFormDTO formDTO); + /** + * 事件转议题 + * @param formDTO + */ + void icEventToIssue(IcEventToIssueFormDTO formDTO); } 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..bc12413641 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,6 +1,5 @@ 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.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -86,4 +85,11 @@ public class IcEventCategoryServiceImpl extends BaseServiceImpl categoryEntities) { + baseDao.deleteByIcEventId(icEventId); + 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..d032ddc0fe 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 @@ -379,8 +379,8 @@ 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(); } @@ -1672,4 +1672,60 @@ 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(); + //转议题 + // todo + //校验通过之后..... + //1、修改事件 + icEventEntity.setOperationType(formDTO.getOperationType()); + icEventEntity.setOperationId("xxxxxtodo"); + 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); + } + } 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..62ac857408 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,7 @@ del_flag = '0' AND ic_event_id = #{icEventId} - + + delete from ic_event_category where ic_event_id = #{icEventId} + \ No newline at end of file From 66ee7a5d501484447055ed70814ac50d6bfbd664 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 10 Oct 2022 09:21:38 +0800 Subject: [PATCH 034/249] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E6=9A=82=E6=8F=90?= =?UTF-8?q?=E4=B8=80=E6=B3=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/AllIssueListFormDTO.java | 26 +++++++++ .../com/epmet/dto/form/AuditListFormDTO.java | 31 +++++++++++ .../dto/result/AllIssueListResultDTO.java | 55 +++++++++++++++++++ .../epmet/dto/result/AuditListResultDTO.java | 39 +++++++++++++ .../controller/IssueAuditController.java | 22 ++++++-- .../com/epmet/controller/IssueController.java | 17 ++++++ .../src/main/java/com/epmet/dao/IssueDao.java | 2 + .../service/IssueApplicationService.java | 4 ++ .../java/com/epmet/service/IssueService.java | 9 +++ .../impl/IssueApplicationServiceImpl.java | 7 +++ .../epmet/service/impl/IssueServiceImpl.java | 29 ++++++++++ .../src/main/resources/mapper/IssueDao.xml | 39 +++++++++++++ 12 files changed, 276 insertions(+), 4 deletions(-) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AllIssueListFormDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/AuditListFormDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AllIssueListResultDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AuditListResultDTO.java 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/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..7c01ab375a --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AllIssueListResultDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @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; +} 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..26a3ac0edd --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/AuditListResultDTO.java @@ -0,0 +1,39 @@ +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 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-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..adde0e0bd4 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; @@ -130,4 +129,19 @@ 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)); + } } 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 f27113c3e8..96946b1223 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; @@ -365,5 +367,20 @@ public class IssueController { } 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)); + } } 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 24811e442e..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 @@ -314,4 +314,6 @@ public interface IssueDao extends BaseDao { * @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/service/IssueApplicationService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java index aecc10b0b5..e51bec4d6b 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; @@ -150,4 +152,6 @@ public interface IssueApplicationService extends BaseService notIssueToTopicIds(List topicIdList); + + PageData auditList(AuditListFormDTO formDTO); } \ No newline at end of file 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 39ffbca330..b2fbe9a227 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 @@ -13,6 +13,7 @@ import com.epmet.resi.group.dto.group.result.GroupClosedListResultDTO; 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.github.pagehelper.Page; import java.util.List; import java.util.Map; @@ -399,4 +400,12 @@ public interface IssueService extends BaseService { * @return */ List getIssueProfile(List issueIds); + + /** + * Desc: 查询所有议题 + * @param formDTO + * @author zxc + * @date 2022/10/9 16:58 + */ + PageData allIssueList(AllIssueListFormDTO formDTO); } 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..e69bbba811 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 @@ -25,8 +25,10 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; 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.AuditListResultDTO; import com.epmet.dto.result.IssueApplicationResDTO; import com.epmet.dto.result.UserPubAuditingIssueResDTO; import com.epmet.entity.IssueApplicationEntity; @@ -186,4 +188,9 @@ public class IssueApplicationServiceImpl extends BaseServiceImpl auditList(AuditListFormDTO formDTO) { + return null; + } + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 53f86de42b..9bc48a612d 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1955,4 +1955,33 @@ public class IssueServiceImpl extends BaseServiceImpl imp } 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()); + } + return result; + } } 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 8f9c25afe3..c802a6244a 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 @@ -872,4 +872,43 @@ i.ID = #{issueId} + + + \ No newline at end of file From a8e09f7cbbcadbc323f0e29ba2cd7d059e2ade58 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 10 Oct 2022 09:36:44 +0800 Subject: [PATCH 035/249] ai --- .../src/main/resources/mapper/IssueDao.xml | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) 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 c802a6244a..06f323277a 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 @@ -876,18 +876,22 @@ \ No newline at end of file From 8ffec63243c0880689a887b98edfd727509bdff6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 10 Oct 2022 10:38:09 +0800 Subject: [PATCH 037/249] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E8=BD=AC=E8=AE=AE?= =?UTF-8?q?=E9=A2=981?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IssueDTO.java | 2 +- .../epmet/dto/form/PublishIssueFormDTO.java | 122 ++++++++++++++++++ .../epmet/feign/GovIssueOpenFeignClient.java | 8 ++ .../GovIssueOpenFeignClientFallBack.java | 11 +- .../com/epmet/controller/IssueController.java | 11 ++ .../java/com/epmet/entity/IssueEntity.java | 2 +- .../java/com/epmet/service/IssueService.java | 8 ++ .../epmet/service/impl/IssueServiceImpl.java | 45 +++++++ .../db/migration/V0.0.19__issue_source.sql | 1 + .../service/impl/IcEventServiceImpl.java | 34 ++++- .../migration/V0.0.27__icevent_to_issue.sql | 6 +- 11 files changed, 240 insertions(+), 10 deletions(-) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/PublishIssueFormDTO.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__issue_source.sql diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java index 93d5602612..487ca68aee 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java @@ -49,7 +49,7 @@ public class IssueDTO implements Serializable { private String issueStatus; /** - * 来源类型 话题:resi_topic;直接立议题:issue; + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event */ private String sourceType; 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..36fd0866d3 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/PublishIssueFormDTO.java @@ -0,0 +1,122 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +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 = "", groups = AddUserShowGroup.class) + private String orgIdPath; + + /** + * 组织ID 【数据权限-非必填】agencyId + */ + @NotBlank(message = "", groups = AddUserShowGroup.class) + private String orgId; + + /** + * 表决发起日期(转议题日期) + */ + @NotBlank(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/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 5b79e535ac..c0310ac6a0 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 @@ -403,4 +403,12 @@ public interface GovIssueOpenFeignClient { */ @PostMapping("/gov/issue/issue/getIssueProfile") Result> getIssueProfile(@RequestBody List issueIds); + + /** + * 事件转议题 + * @param issueFormDTO + * @return + */ + @PostMapping("/gov/issue/issue/publishIssue") + Result publishIssue(@RequestBody PublishIssueFormDTO issueFormDTO); } 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 5f81cd7501..8037939a4c 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 @@ -343,5 +343,14 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient 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); + } } 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 f27113c3e8..e9d7d0dca3 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 @@ -365,5 +365,16 @@ public class IssueController { } return new Result>().ok(issueService.getIssueProfile(issueIds)); } + /** + * 发布议题 + * 事件转议题 + * @param issueFormDTO + * @return + */ + @PostMapping("publishIssue") + public Result publishIssue(@RequestBody PublishIssueFormDTO issueFormDTO) { + ValidatorUtils.validateEntity(issueFormDTO, PublishIssueFormDTO.AddUserShowGroup.class); + return new Result().ok(issueService.publishIssue(issueFormDTO)); + } } 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 90a04596fb..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; /** - * 来源类型 话题:resi_topic;直接立议题:issue; + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event */ private String sourceType; 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 39ffbca330..57b6414dab 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 @@ -399,4 +399,12 @@ public interface IssueService extends BaseService { * @return */ List getIssueProfile(List issueIds); + + /** + * 发布议题 + * 事件转议题 + * @param issueFormDTO + * @return + */ + IssueDTO publishIssue(PublishIssueFormDTO issueFormDTO); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 53f86de42b..5dbdcff32c 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1955,4 +1955,49 @@ public class IssueServiceImpl extends BaseServiceImpl imp } return baseDao.selectIssueProfile(issueIds); } + + /** + * 发布议题 + * 事件转议题 + * + * @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】转为议题", issueFormDTO.getEventReportUserName(), staffInfo.getAgencyName())); + 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; + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__issue_source.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__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.19__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-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 d032ddc0fe..8ca9e087dd 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; @@ -1690,12 +1691,33 @@ public class IcEventServiceImpl extends BaseServiceImpl categoryIdList = formDTO.getCategoryList().stream().map(CategoryOrTagFormDTO::getId).collect(Collectors.toList()); CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryIdList); Date nowTime = new Date(); - //转议题 - // todo + //调用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.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、修改事件 + //1、修改事件相关信息 icEventEntity.setOperationType(formDTO.getOperationType()); - icEventEntity.setOperationId("xxxxxtodo"); + icEventEntity.setOperationId(issueRes.getData().getIssueId()); if("0".equals(icEventEntity.getSourceType())){ //来源于随手拍的,居民端需要显示红点 icEventEntity.setRedDot(NumConstant.ONE); @@ -1703,7 +1725,7 @@ public class IcEventServiceImpl extends BaseServiceImpl categoryEntities=new ArrayList<>(); for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){ @@ -1716,7 +1738,7 @@ public class IcEventServiceImpl extends BaseServiceImpl已读;工作人员待处理=>处理中;转议题:shift_to_issue'; From 76302314de4d0ff497432df837720fe225bb165b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 10 Oct 2022 10:47:43 +0800 Subject: [PATCH 038/249] =?UTF-8?q?=E6=9A=82=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/govissue/IssueApplicationDTO.java | 2 + .../govissue/IssueApplicationEntity.java | 3 ++ .../com/epmet/dto/IssueApplicationDTO.java | 2 + .../com/epmet/dao/IssueApplicationDao.java | 4 ++ .../epmet/entity/IssueApplicationEntity.java | 3 ++ .../epmet/service/impl/IssueServiceImpl.java | 9 +++- .../V0.0.19__alter_issue_application.sql | 2 + .../resources/mapper/IssueApplicationDao.xml | 41 +++++++++++++++++++ 8 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__alter_issue_application.sql 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-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/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueApplicationDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueApplicationDTO.java index 69185b4280..1138c33c7b 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueApplicationDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/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/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..5218d9a1e3 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,6 @@ public interface IssueApplicationDao extends BaseDao { */ List selectTopicIdList(@Param("topicIdList") List topicIdList); + List auditList(AuditListFormDTO 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 fb2d141926..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 */ diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 89a9a04222..315894265d 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -379,8 +379,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()); @@ -393,6 +396,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); 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/mapper/IssueApplicationDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml index 2820a43019..dca932e4e0 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 @@ -86,4 +86,45 @@ + + + \ No newline at end of file From 3338d6544cdff96ea78f77ef9bc5ebf3ec12ea20 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 10 Oct 2022 10:47:58 +0800 Subject: [PATCH 039/249] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/result/IcEventListResultDTO.java | 6 +++--- .../src/main/resources/mapper/IcEventDao.xml | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) 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-server/src/main/resources/mapper/IcEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml index dd94828eb2..f1602eb237 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 @@ -169,7 +169,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, From 5b2ffda7e6166102f89629e205447da0ea63883c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 10 Oct 2022 11:05:54 +0800 Subject: [PATCH 040/249] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E5=A4=84=E7=90=86?= =?UTF-8?q?=E8=BF=9B=E5=B1=95=E8=B0=83=E6=95=B4=EF=BC=9B=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=A4=84=E7=90=86=E8=BF=9B=E5=B1=95=E6=9C=AA=E5=AE=8C=E5=BE=85?= =?UTF-8?q?=E7=BB=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/feign/GovIssueOpenFeignClient.java | 8 +++++ .../GovIssueOpenFeignClientFallBack.java | 11 +++++++ .../controller/IssueManageController.java | 1 + .../service/impl/IssueProcessServiceImpl.java | 14 ++++----- .../service/impl/IcEventServiceImpl.java | 31 ++++++++++++------- 5 files changed, 46 insertions(+), 19 deletions(-) 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 c0310ac6a0..2d65ee9126 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 @@ -411,4 +411,12 @@ public interface GovIssueOpenFeignClient { */ @PostMapping("/gov/issue/issue/publishIssue") Result publishIssue(@RequestBody PublishIssueFormDTO issueFormDTO); + + /** + * 议题处理进展,这个接口小程序也在用,服务之间也在用 + * @param issueId + * @return + */ + @PostMapping("/gov/issue/manage/progress") + Result> queryIssueProcess(@RequestBody IssueIdFormDTO issueId); } 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 8037939a4c..fee75badad 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 @@ -353,4 +353,15 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient 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, "processList", formDTO); + } } 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 aa9c671e6d..3d0ca597c0 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 @@ -201,6 +201,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/service/impl/IssueProcessServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProcessServiceImpl.java index 5e47cc5a4a..6d33f38258 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 @@ -155,16 +155,14 @@ public class IssueProcessServiceImpl extends BaseServiceImpl(); + } + //转议题信息 + ProcessListResultDTO issueProcessResultDTO = issueProcessDao.issueBeginInfo(issueId); + if (null != issueProcessResultDTO) { + listResult.add(issueProcessResultDTO); } return listResult; } 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 8ca9e087dd..bcf82b4bf9 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 @@ -1202,29 +1202,38 @@ public class IcEventServiceImpl extends BaseServiceImpl event = icEventReplyService.getByEventId(formDTO.getIcEventId()); - + // operationType 0:已回复 1:已转项目 2:已转需求3:转议题 //3.判断查询事件项目进展或需求进展信息 - //项目进展 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())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件已转议题,议题处理进展查询异常", "事件已转议题,议题处理进展查询异常"); + } + // todo + + } + //最后拼上回复的 + //2.查询事件回复信息 + LinkedList event = icEventReplyService.getByEventId(formDTO.getIcEventId()); resultList.addAll(event); - return resultList; } From 4e0b7d4373f98634680d860e30915045398026d5 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 10 Oct 2022 11:13:40 +0800 Subject: [PATCH 041/249] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A1=A5=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IssueAuditController.java | 11 ++++++ .../com/epmet/dao/IssueApplicationDao.java | 4 +++ .../service/IssueApplicationService.java | 2 ++ .../impl/IssueApplicationServiceImpl.java | 34 +++++++++++++++++++ .../resources/mapper/IssueApplicationDao.xml | 26 ++++++++++++++ 5 files changed, 77 insertions(+) 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 adde0e0bd4..0a9d0a4304 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 @@ -144,4 +144,15 @@ public class IssueAuditController { formDTO.setUserId(tokenDto.getUserId()); return new Result>().ok(issueApplicationService.auditList(formDTO)); } + + /** + * Desc: 补全议题审核表历史数据 + * @param + * @author zxc + * @date 2022/10/10 10:55 + */ + public Result initIssueApplicationHistoryData(){ + issueApplicationService.initIssueApplicationHistoryData(); + return new Result(); + } } 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 5218d9a1e3..a1d2c89468 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 @@ -78,4 +78,8 @@ public interface IssueApplicationDao extends BaseDao { List auditList(AuditListFormDTO formDTO); + List initIssueApplicationHistoryData(); + + 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/service/IssueApplicationService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java index e51bec4d6b..023bb20a0e 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 @@ -154,4 +154,6 @@ public interface IssueApplicationService extends BaseService notIssueToTopicIds(List topicIdList); PageData auditList(AuditListFormDTO formDTO); + + void initIssueApplicationHistoryData(); } \ No newline at end of file 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 e69bbba811..24806fd924 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 @@ -21,7 +21,11 @@ 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.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IssueApplicationDao; import com.epmet.dto.IssueApplicationDTO; @@ -41,6 +45,8 @@ 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 org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -193,4 +199,32 @@ public class IssueApplicationServiceImpl extends BaseServiceImpl pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> baseDao.initIssueApplicationHistoryData()); + List list = pageInfo.getList(); + size = list.size(); + if (CollectionUtils.isNotEmpty(list)){ + list.forEach(l -> { + GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); + if (null == gridInfo){ + throw new EpmetException("查询网格信息失败:"+l.getGridId()); + } + 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/resources/mapper/IssueApplicationDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueApplicationDao.xml index dca932e4e0..c205c2004f 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 #{orgId} + + + + + when ID = #{i.ID} then #{ORG_ID_PATH} + + + updated_time = now() + where 1=1 + + + ID = #{i.ID} + + + + + + \ No newline at end of file From c80419517b3b22cc3abf423f4eeb206bf726081d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 10 Oct 2022 11:22:05 +0800 Subject: [PATCH 042/249] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=A4=84=E7=90=86?= =?UTF-8?q?=E8=BF=9B=E5=B1=95=E8=B0=83=E6=95=B4=EF=BC=9A=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?+=E4=BA=8B=E4=BB=B6=E5=9B=9E=E5=A4=8D=E3=80=81=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E8=BF=9B=E5=B1=95+=E4=BA=8B=E4=BB=B6=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E3=80=81=E8=AE=AE=E9=A2=98=E8=BF=9B=E5=B1=95=EF=BC=88?= =?UTF-8?q?=E5=90=AB=E9=A1=B9=E7=9B=AE=EF=BC=89+=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IcEventServiceImpl.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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 bcf82b4bf9..189811df46 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 @@ -1205,7 +1205,7 @@ public class IcEventServiceImpl extends BaseServiceImpl event = icEventReplyService.getByEventId(formDTO.getIcEventId()); resultList.addAll(event); return resultList; From fe09f4c88ebe61c325954fc5bf71dcefb11236a4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 10 Oct 2022 13:11:47 +0800 Subject: [PATCH 043/249] =?UTF-8?q?=E3=80=90%s=E3=80=91=E5=8F=91=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E4=BA=8B=E4=BB=B6=E8=A2=AB=E3=80=90%s=E3=80=91?= =?UTF-8?q?=E8=BD=AC=E4=B8=BA=E8=AE=AE=E9=A2=98=E3=80=90%s=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/IssueServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 315894265d..1e39c91726 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -2019,7 +2019,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp 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】转为议题", issueFormDTO.getEventReportUserName(), staffInfo.getAgencyName())); + issueProcessEntity.setOperationExplain(String.format("【%s】发表的事件被【%s】转为议题【%s】", issueFormDTO.getEventReportUserName(), staffInfo.getAgencyName(), issueEntity.getIssueTitle())); issueProcessEntity.setOrgName(staffInfo.getAgencyName()); issueProcessEntity.setCustomerId(issueFormDTO.getCustomerId()); issueProcessService.insert(issueProcessEntity); From 32238d6977615bbb57af68cfcea3372ec28b7db4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 10 Oct 2022 13:18:35 +0800 Subject: [PATCH 044/249] operationTypeName, --- .../java/com/epmet/controller/IcEventController.java | 12 ++++++++++++ .../src/main/resources/mapper/IcEventDao.xml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) 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 3b667b222c..f905215a44 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){ 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 f1602eb237..8f2e8049ba 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 @@ -176,7 +176,7 @@ when ie.operation_type = '3' then '已转议题' else '' end - )as operationTypeName + )as operationTypeName, ie.operation_id, ie.read_flag, ie.red_dot, From c88865c88d6f5343a5401c55cb9316912a29676b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 10 Oct 2022 13:21:40 +0800 Subject: [PATCH 045/249] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A1=A5=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/IssueAuditController.java | 1 + 1 file changed, 1 insertion(+) 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 0a9d0a4304..87dfa6027c 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 @@ -151,6 +151,7 @@ public class IssueAuditController { * @author zxc * @date 2022/10/10 10:55 */ + @PostMapping("initIssueApplicationHistoryData") public Result initIssueApplicationHistoryData(){ issueApplicationService.initIssueApplicationHistoryData(); return new Result(); From 2dfb87e3ada412309fc8e09b77e4607d1b34a311 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 10 Oct 2022 13:41:55 +0800 Subject: [PATCH 046/249] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A1=A5=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IssueApplicationServiceImpl.java | 9 ++++++--- .../src/main/resources/mapper/IssueApplicationDao.xml | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) 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 24806fd924..1dc8212e67 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 @@ -46,6 +46,7 @@ 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; @@ -62,6 +63,7 @@ import java.util.Map; * @since v1.0.0 2020-11-17 */ @Service +@Slf4j public class IssueApplicationServiceImpl extends BaseServiceImpl implements IssueApplicationService { @Override @@ -208,14 +210,15 @@ public class IssueApplicationServiceImpl extends BaseServiceImpl list = pageInfo.getList(); size = list.size(); if (CollectionUtils.isNotEmpty(list)){ - list.forEach(l -> { + for (IssueApplicationDTO l : list) { GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); if (null == gridInfo){ - throw new EpmetException("查询网格信息失败:"+l.getGridId()); + log.warn("查询网格信息失败:"+l.getGridId()); + continue; } l.setOrgId(gridInfo.getPid()); l.setOrgIdPath(gridInfo.getPids()); - }); + } updateIssueApplication(list); } no++; 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 c205c2004f..293d28f383 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 @@ -7,19 +7,19 @@ - when ID = #{i.ID} then #{orgId} + when ID = #{i.id} then #{i.orgId} - when ID = #{i.ID} then #{ORG_ID_PATH} + when ID = #{i.id} then #{i.orgIdPath} updated_time = now() where 1=1 - ID = #{i.ID} + ID = #{i.id} From af0653a296c33224a6e849a4fdd4a7ec2096a854 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 10 Oct 2022 14:08:37 +0800 Subject: [PATCH 047/249] =?UTF-8?q?=E5=BE=85=E5=AE=A1=E6=A0=B8=20=E9=A9=B3?= =?UTF-8?q?=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/AuditListResultDTO.java | 2 ++ .../com/epmet/dao/IssueApplicationDao.java | 18 ++++++++++ .../impl/IssueApplicationServiceImpl.java | 33 ++++++++++++++++++- .../resources/mapper/IssueApplicationDao.xml | 19 ++++++----- 4 files changed, 63 insertions(+), 9 deletions(-) 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 index 26a3ac0edd..5878ca9864 100644 --- 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 @@ -19,6 +19,8 @@ public class AuditListResultDTO implements Serializable { * 所属网格 */ private String gridName; + private String gridId; + private String orgId; /** * 议题标题 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 a1d2c89468..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 @@ -76,10 +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/service/impl/IssueApplicationServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationServiceImpl.java index 1dc8212e67..a37a1aad89 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 @@ -22,9 +22,11 @@ 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.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.dao.IssueApplicationDao; @@ -32,6 +34,7 @@ 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; @@ -52,6 +55,7 @@ import org.apache.commons.lang3.StringUtils; 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; @@ -198,7 +202,34 @@ public class IssueApplicationServiceImpl extends BaseServiceImpl auditList(AuditListFormDTO formDTO) { - return null; + 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 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 293d28f383..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 @@ -112,31 +112,34 @@ @@ -62,29 +65,20 @@ FROM ic_resi_user WHERE DEL_FLAG = '0' AND `STATUS` = '0' + + AND id_card in + + #{idCard} + + AND ( - + GRID_ID = #{l.orgId} - PIDS LIKE CONCAT('%',#{l.orgId},'%') + PIDS LIKE CONCAT(#{l.orgIdPath},'%') ) ORDER BY CREATED_TIME - - \ No newline at end of file + From 757f3cd0fe4a864524ea49541781912a528688ae Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 11 Oct 2022 14:49:04 +0800 Subject: [PATCH 077/249] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/ProcessListResultDTOBak.java | 1 + .../src/main/java/com/epmet/service/impl/IcEventServiceImpl.java | 1 + 2 files changed, 2 insertions(+) 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 index dc6c8787b9..d3e8b4ed84 100644 --- 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 @@ -34,5 +34,6 @@ public class ProcessListResultDTOBak { * 进展id(操作记录表id) */ private String processId; + private String type; } 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 c2d7aac1b3..73f5fc25c7 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 @@ -1287,6 +1287,7 @@ public class IcEventServiceImpl extends BaseServiceImpl Date: Tue, 11 Oct 2022 15:23:11 +0800 Subject: [PATCH 078/249] =?UTF-8?q?=E5=85=B3=E9=97=AD=E8=AE=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=9B=9E=E5=86=99=E4=BA=8B=E4=BB=B6=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IcUserDemandRecServiceImpl.java | 3 + .../com/epmet/dto/form/CloseIssueFormDTO.java | 6 + .../controller/IssueManageController.java | 3 +- .../epmet/service/impl/IssueServiceImpl.java | 113 +++++++++++------- ...e_source.sql => V0.0.20__issue_source.sql} | 0 .../dto/form/ColseProjectOrDemandFormDTO.java | 10 +- .../feign/GovProjectOpenFeignClient.java | 1 + .../epmet/controller/IcEventController.java | 1 + .../com/epmet/service/IcEventService.java | 1 + .../service/impl/IcEventServiceImpl.java | 33 ++++- .../service/impl/ProjectServiceImpl.java | 1 + .../migration/V0.0.27__icevent_to_issue.sql | 4 +- 12 files changed, 125 insertions(+), 51 deletions(-) rename epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/{V0.0.19__issue_source.sql => V0.0.20__issue_source.sql} (100%) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 86ad54bec4..572a6f39fb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -563,6 +563,7 @@ public class IcUserDemandRecServiceImpl 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()); @@ -765,31 +752,27 @@ 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服务,给居民端话题创建人和议题发起人发送消息 if (entity.getSourceType().equals(ModuleConstants.ISSUE_FROM_TOPIC)){ //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("议题关闭,推送微信订阅消息失败!"); + 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(),"议题关闭异常,该议题来源于事件,回写事件信息失败","议题关闭异常:事件办结异常"); } } @@ -805,6 +788,50 @@ public class IssueServiceImpl extends BaseServiceImpl imp } } + /** + * 议题关闭时,填写的关闭理由,走内容审核 + * @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 diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__issue_source.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.20__issue_source.sql similarity index 100% rename from epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.19__issue_source.sql rename to epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.20__issue_source.sql 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/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index d4fd341b7f..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 @@ -171,6 +171,7 @@ public interface GovProjectOpenFeignClient { /** * Desc: 需求完成/项目结案时 修改事件数据 + * 议题关闭时,如果议题来源于事件,也会调用此方法 * @author sun */ @PostMapping("gov/project/icEvent/closeprojectordemand") 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 bce6cc9f01..a139371cb2 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 @@ -364,6 +364,7 @@ public class IcEventController { /** * @Author sun * @Description 需求完成/项目结案时 修改事件数据 + * 议题关闭时,如果议题来源于事件,也会调用此方法 **/ @PostMapping("closeprojectordemand") public Result closeProjectOrDemand(@RequestBody ColseProjectOrDemandFormDTO formDTO) { 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 7421853c13..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); 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 c2d7aac1b3..72b4e5b033 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 @@ -1300,20 +1300,21 @@ public class IcEventServiceImpl extends BaseServiceImpl%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); @@ -1325,7 +1326,31 @@ public class IcEventServiceImpl extends BaseServiceImpl已读;工作人员待处理=>处理中;转议题:shift_to_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'; From acf79177a6aaf082c97ade870e79600710d9fffc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 11 Oct 2022 16:05:26 +0800 Subject: [PATCH 079/249] =?UTF-8?q?=E4=BA=8B=E4=BB=B6-=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=9B=E4=BA=8B=E4=BB=B6-=E3=80=8B=E8=AE=AE=E9=A2=98-?= =?UTF-8?q?=E3=80=8B=E9=A1=B9=E7=9B=AE;=E8=BF=992=E7=A7=8D=E6=83=85?= =?UTF-8?q?=E5=86=B5=E9=83=BD=E8=A6=81=E5=9B=9E=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ProjectServiceImpl.java | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index bbc37a04b5..b2e1c6f381 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -862,17 +862,42 @@ public class ProjectServiceImpl extends BaseServiceImpl issueIds =new ArrayList<>(); + issueIds.add(projectEntity.getOrigin()); + Result> issueRes=govIssueOpenFeignClient.getIssueProfile(issueIds); + if(issueRes.success()&&CollectionUtils.isNotEmpty(issueRes.getData())){ + if("ic_event".equals(issueRes.getData().get(NumConstant.ZERO).getIssueSourceType())){ + icEventFlag=true; + } + } + } + if ("ic_event".equals(projectEntity.getOrigin())||icEventFlag) { ColseProjectOrDemandFormDTO dto = new ColseProjectOrDemandFormDTO(); - dto.setCustomerId(fromDTO.getCustomerId()); - dto.setUserId(fromDTO.getUserId()); + dto.setCustomerId(projectEntity.getCustomerId()); + dto.setUserId(projectEntity.getUpdatedBy()); dto.setIcEventId(projectEntity.getOriginId()); dto.setType("project"); - dto.setCloseCaseTime(projectProcessEntity.getCreatedTime()); + dto.setCloseCaseTime(closeCaseTime); icEventService.closeProjectOrDemand(dto); } - //2022-5-19 sun end - } @Override From 638905600d526ef5637ebdbccedf9118446bb506 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 11 Oct 2022 16:12:59 +0800 Subject: [PATCH 080/249] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IssueApplicationHistoryServiceImpl.java | 6 ++ .../group/form/ApplicationDetailFormDTO.java | 5 ++ .../service/impl/GroupIssueServiceImpl.java | 74 ++++++++----------- 3 files changed, 42 insertions(+), 43 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationHistoryServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationHistoryServiceImpl.java index 7caa252331..ba8ce255f5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationHistoryServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueApplicationHistoryServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IssueApplicationHistoryDao; +import com.epmet.dto.IssueApplicationDTO; import com.epmet.dto.IssueApplicationHistoryDTO; import com.epmet.dto.form.ApplicationDetailWorkFormDTO; import com.epmet.dto.form.ApplicationHistoryWorkFormDTO; @@ -37,6 +38,7 @@ import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; import com.epmet.resi.group.dto.group.result.ApplicationDetailCopyResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.service.IssueApplicationHistoryService; +import com.epmet.service.IssueApplicationService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -62,6 +64,8 @@ public class IssueApplicationHistoryServiceImpl extends BaseServiceImpl 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/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplicationDetailFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplicationDetailFormDTO.java index 8dcccb0eae..2d84f8cb13 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplicationDetailFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplicationDetailFormDTO.java @@ -21,4 +21,9 @@ public class ApplicationDetailFormDTO implements Serializable { */ @NotBlank(message = "issueApplicationId不能为空",groups = {ApplicationDetail.class}) private String issueApplicationId; + + /** + * 话题ID是否为空 + */ + private Boolean topicIdIsNull; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java index fa5e644cf3..7d2b5fe87c 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/GroupIssueServiceImpl.java @@ -73,53 +73,41 @@ public class GroupIssueServiceImpl implements GroupIssueService { List userIds = new ArrayList<>(); ApplicationDetailResultDTO data = result.getData(); userIds.add(data.getUserId()); - TopicInfoResultDTO topicInfoResultDTO = resiGroupDao.selectTopicInfo(data.getTopicId()); - userIds.add(topicInfoResultDTO.getTopicUserId()); - // 查询小组类别 - ResiGroupEntity resiGroupEntity = resiGroupDao.selectById(topicInfoResultDTO.getGroupId()); - if (null == resiGroupEntity){ - throw new RenException("此小组信息不存在"); - } - List userInfos = resiTopicService.disPoseUserInfo(resiGroupEntity.getGroupType(), userIds); - if(CollectionUtils.isEmpty(userInfos)){ - throw new RenException("未查询到用户信息"); - } - userInfos.forEach(u -> { - if (u.getUserId().equals(data.getUserId())){ - data.setIssuePublisher(u.getReleaseUserName()); - data.setIssuePublisherMobile(u.getMobile()); + if (!applicationDetailFormDTO.getTopicIdIsNull()){ + TopicInfoResultDTO topicInfoResultDTO = resiGroupDao.selectTopicInfo(data.getTopicId()); + userIds.add(topicInfoResultDTO.getTopicUserId()); + // 查询小组类别 + ResiGroupEntity resiGroupEntity = resiGroupDao.selectById(topicInfoResultDTO.getGroupId()); + if (null == resiGroupEntity){ + throw new RenException("此小组信息不存在"); } - if (u.getUserId().equals(topicInfoResultDTO.getTopicUserId())){ - topicInfoResultDTO.setPublishedUser(u.getReleaseUserName()); - topicInfoResultDTO.setTopicPublishMobile(u.getMobile()); + List userInfos = resiTopicService.disPoseUserInfo(resiGroupEntity.getGroupType(), userIds); + if(CollectionUtils.isEmpty(userInfos)){ + throw new RenException("未查询到用户信息"); } - }); - /*Result> listResult = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); - if (!listResult.success()){ - throw new RenException("查询话题创建者,议题创建者失败......"); - } - listResult.getData().forEach(user -> { - if (user.getUserId().equals(data.getUserId())){ - data.setIssuePublisher(user.getStreet().concat("-").concat(user.getSurname()).concat(getMrOrMs(user.getGender()))); - data.setIssuePublisherMobile(user.getMobile()); + userInfos.forEach(u -> { + if (u.getUserId().equals(data.getUserId())){ + data.setIssuePublisher(u.getReleaseUserName()); + data.setIssuePublisherMobile(u.getMobile()); + } + if (u.getUserId().equals(topicInfoResultDTO.getTopicUserId())){ + topicInfoResultDTO.setPublishedUser(u.getReleaseUserName()); + topicInfoResultDTO.setTopicPublishMobile(u.getMobile()); + } + }); + List gridIds = new ArrayList<>(); + gridIds.add(data.getGridId()); + Result> gridListByGridIds = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + if (!gridListByGridIds.success()){ + throw new RenException("查询议题所属网格名称失败......"); } - if (user.getUserId().equals(topicInfoResultDTO.getTopicUserId())){ - topicInfoResultDTO.setPublishedUser(user.getStreet().concat("-").concat(user.getSurname()).concat(getMrOrMs(user.getGender()))); - topicInfoResultDTO.setTopicPublishMobile(user.getMobile()); - } - });*/ - List gridIds = new ArrayList<>(); - gridIds.add(data.getGridId()); - Result> gridListByGridIds = govOrgOpenFeignClient.getGridListByGridIds(gridIds); - if (!gridListByGridIds.success()){ - throw new RenException("查询议题所属网格名称失败......"); + gridListByGridIds.getData().forEach(grid -> { + if (grid.getGridId().equals(data.getGridId())){ + data.setGridName(grid.getGridName()); + } + }); + data.setTopicInfo(topicInfoResultDTO); } - gridListByGridIds.getData().forEach(grid -> { - if (grid.getGridId().equals(data.getGridId())){ - data.setGridName(grid.getGridName()); - } - }); - data.setTopicInfo(topicInfoResultDTO); return ConvertUtils.sourceToTarget(data,ApplicationDetailCopyResultDTO.class); } From e36345ac2a3b96a83e726d60aedfbffa0aeff7bf Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 11 Oct 2022 16:21:16 +0800 Subject: [PATCH 081/249] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=AA=E9=BB=98?= =?UTF-8?q?=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/VoteFormDTO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 e13771455c..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 @@ -30,8 +30,9 @@ public class VoteFormDTO implements Serializable { /** * 当 sourceType = issue 时,是直接创建议题,无需加入小组即可表决 + * 默认为resi_topic */ - private String sourceType; + private String sourceType = "resi_topic"; } From e7d2e5b03322f777102d5135bd374eed5af112fd Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 11 Oct 2022 16:42:52 +0800 Subject: [PATCH 082/249] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../topic/controller/ResiTopicController.java | 2 +- .../modules/topic/service/ResiTopicService.java | 2 +- .../topic/service/impl/ResiTopicServiceImpl.java | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index 1695aaba09..fb2ef52238 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -67,7 +67,7 @@ public class ResiTopicController { @PostMapping("gettopicdetail") public Result getTopicDetail(@LoginUser TokenDto tokenDto, @RequestBody ResiTopicDetailFormDTO topicDetailFormDTO ){ ValidatorUtils.validateEntity(topicDetailFormDTO); - return topicService.getTopicDetail(tokenDto,topicDetailFormDTO.getTopicId()); + return topicService.getTopicDetail(topicDetailFormDTO.getTopicId()); } /** diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index c6e8ea45db..10600d85bf 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java @@ -170,7 +170,7 @@ public interface ResiTopicService extends BaseService { * @Author wangc * @Date 2020.04.01 15:56 **/ - Result getTopicDetail(TokenDto tokenDto, String topicId); + Result getTopicDetail(String topicId); /** * @return List diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 2c1e2f57cf..6590ff1a60 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -36,6 +36,8 @@ import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.scan.param.ImgScanParamDTO; import com.epmet.commons.tools.scan.param.ImgTaskDTO; import com.epmet.commons.tools.scan.param.TextScanParamDTO; @@ -892,7 +894,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl getTopicDetail(TokenDto tokenDto, String topicId) { + public Result getTopicDetail(String topicId) { //1.获取话题基本信息 ResiTopicEntity topicDetail = baseDao.selectById(topicId); if(null == topicDetail || !StringUtils.equals(topicDetail.getId(),topicId)){ @@ -909,11 +911,9 @@ public class ResiTopicServiceImpl extends BaseServiceImpl gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); - if(gridInfoRes.success()&&null!=gridInfoRes.getData()){ - resultDTO.setGridName(gridInfoRes.getData().getGridNamePath()); + GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(resiGroupEntity.getGridId()); + if(null!=gridInfoCache){ + resultDTO.setGridName(gridInfoCache.getGridNamePath()); } } //2.查询话题附件 @@ -1327,7 +1327,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl getTopicDetailGov(String topicId) { - Result result = getTopicDetail(null,topicId); + Result result = getTopicDetail(topicId); if(result.success() && null != result.getData() && StringUtils.isNotBlank(result.getData().getTopicId())){ return new Result().ok(ConvertUtils.sourceToTarget(result.getData(),ResiTopicDetailResultDTO.class)); } @@ -1622,7 +1622,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl topicDetailResult = - getTopicDetail(null,topicIdFormDTO.getTopicId()); + getTopicDetail(topicIdFormDTO.getTopicId()); if(topicDetailResult.success() && null != topicDetailResult.getData()){ ResiTopicShiftIssueInitResultDTO result = ConvertUtils.sourceToTarget(topicDetailResult.getData(),ResiTopicShiftIssueInitResultDTO.class); try { From 6bee8fae5b95e1c293e4a86a510af477fb142249 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Tue, 11 Oct 2022 16:45:19 +0800 Subject: [PATCH 083/249] =?UTF-8?q?=E7=A6=81=E7=94=A8actuator=E7=AB=AF?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/src/main/resources/bootstrap.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 483f545f43..0aeca8950b 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -418,7 +418,11 @@ management: web: exposure: include: "*" +# enabled-by-default: false + endpoint: + gateway: + enabled: false health: show-details: ALWAYS From 42ac13a88cfda8ec0099f72093b712c9fe0d1a10 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 11 Oct 2022 16:51:04 +0800 Subject: [PATCH 084/249] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=95=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IssueAuditController.java | 10 ++++ .../com/epmet/controller/IssueController.java | 11 ++++ .../epmet/excel/AllIssueListExportExcel.java | 42 +++++++++++++++ .../com/epmet/excel/AuditListExportExcel.java | 34 ++++++++++++ .../service/IssueApplicationService.java | 3 ++ .../java/com/epmet/service/IssueService.java | 3 ++ .../impl/IssueApplicationServiceImpl.java | 52 +++++++++++++++++-- .../epmet/service/impl/IssueServiceImpl.java | 45 ++++++++++++++-- 8 files changed, 193 insertions(+), 7 deletions(-) create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AllIssueListExportExcel.java create mode 100644 epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/AuditListExportExcel.java 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 87dfa6027c..1b3bf0f045 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 @@ -20,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; /** @@ -145,6 +147,14 @@ public class IssueAuditController { return new Result>().ok(issueApplicationService.auditList(formDTO)); } + @PostMapping("auditListExport") + public Result auditListExport(@RequestBody AuditListFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + issueApplicationService.auditListExport(formDTO,response); + return new Result(); + } + /** * Desc: 补全议题审核表历史数据 * @param 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 834f8a0086..38d9fcafab 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 @@ -19,6 +19,8 @@ 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; /** @@ -382,6 +384,15 @@ public class IssueController { formDTO.setUserId(tokenDto.getUserId()); return new Result>().ok(issueService.allIssueList(formDTO)); } + + @PostMapping("allIssueListExport") + public Result allIssueListExport(@RequestBody AllIssueListFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + issueService.allIssueListExport(formDTO,response); + return new Result(); + } + /** * 发布议题 * 事件转议题 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/service/IssueApplicationService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueApplicationService.java index 023bb20a0e..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 @@ -34,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; @@ -154,6 +156,7 @@ 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/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java index 3fc5339009..6fb256e35e 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 @@ -15,6 +15,8 @@ import com.epmet.resi.group.dto.group.result.GroupVotingListResultDTO; import com.epmet.resi.group.dto.topic.form.TopicInfoFormDTO; import com.github.pagehelper.Page; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; import java.util.Set; @@ -408,6 +410,7 @@ public interface IssueService extends BaseService { * @date 2022/10/9 16:58 */ PageData allIssueList(AllIssueListFormDTO formDTO); + void allIssueListExport(AllIssueListFormDTO formDTO, HttpServletResponse response) throws IOException; /** * 发布议题 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 a37a1aad89..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,18 +17,27 @@ 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; @@ -39,6 +48,8 @@ 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; @@ -55,10 +66,10 @@ import org.apache.commons.lang3.StringUtils; 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 javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.*; /** * 话题转议题申请表 @@ -232,6 +243,39 @@ public class IssueApplicationServiceImpl extends BaseServiceImpl 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; diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index a3675369cb..26c9a93b6f 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1,4 +1,7 @@ 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.alibaba.nacos.client.utils.StringUtils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -28,9 +31,8 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; 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.ScanContentUtils; +import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.IssueConstant; import com.epmet.constant.ReadFlagConstant; @@ -46,6 +48,7 @@ import com.epmet.dto.form.IssueShiftedFromTopicFormDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.*; +import com.epmet.excel.AllIssueListExportExcel; import com.epmet.feign.*; import com.epmet.redis.GovIssueRedis; import com.epmet.redis.IssueVoteDetailRedis; @@ -76,6 +79,9 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.PrintWriter; import java.util.*; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -2071,6 +2077,39 @@ public class IssueServiceImpl extends BaseServiceImpl imp 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(); + } + } + } + /** * 发布议题 * 事件转议题 From ce7477974eee194ed82143551fad0b7fbd5bf890 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 11 Oct 2022 17:12:34 +0800 Subject: [PATCH 085/249] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E5=A4=84=E7=90=86?= =?UTF-8?q?=E8=BF=9B=E5=B1=95=E8=B0=83=E6=95=B4=EF=BC=88=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E8=AE=AE=E9=A2=98-=E5=B7=B2=E5=85=B3=E9=97=AD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/IssueProcessServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 fe813fbe07..d422e829da 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 @@ -152,6 +152,7 @@ public class IssueProcessServiceImpl extends BaseServiceImpl Date: Tue, 11 Oct 2022 17:23:46 +0800 Subject: [PATCH 086/249] =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=A4=84=E7=90=86?= =?UTF-8?q?=E8=BF=9B=E5=B1=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IssueProcessServiceImpl.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 d422e829da..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 @@ -189,11 +189,12 @@ public class IssueProcessServiceImpl extends BaseServiceImpl Date: Tue, 11 Oct 2022 17:31:38 +0800 Subject: [PATCH 087/249] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=95=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/IssueAuditController.java | 3 +-- .../src/main/java/com/epmet/controller/IssueController.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) 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 1b3bf0f045..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 @@ -148,11 +148,10 @@ public class IssueAuditController { } @PostMapping("auditListExport") - public Result auditListExport(@RequestBody AuditListFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws IOException { + 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); - return new Result(); } /** 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 38d9fcafab..f9cc14f21b 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 @@ -386,11 +386,10 @@ public class IssueController { } @PostMapping("allIssueListExport") - public Result allIssueListExport(@RequestBody AllIssueListFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws IOException { + 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); - return new Result(); } /** From 04cd2804f1a96f2d0f7643ab32fded41b86c5c2b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 11 Oct 2022 17:40:01 +0800 Subject: [PATCH 088/249] =?UTF-8?q?/gov/issue/issue/allIssueList=E8=BF=94?= =?UTF-8?q?=E5=9B=9EsourceType?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/govissue/result/IssueListResultDTO.java | 6 +++++- .../mapper/govissue/IssueApplicationDao.xml | 14 ++++++++++++-- .../main/resources/mapper/govissue/IssueDao.xml | 6 ++++-- 3 files changed, 21 insertions(+), 5 deletions(-) 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/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' From 7be2a77aec4bd9f2b31401c96a2fadec12cf6cc9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 11 Oct 2022 17:49:32 +0800 Subject: [PATCH 089/249] =?UTF-8?q?=E5=88=9A=E6=89=8D=E6=94=B9=E9=94=99?= =?UTF-8?q?=E4=BA=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/result/AllIssueListResultDTO.java | 5 +++++ 1 file changed, 5 insertions(+) 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 index 7c01ab375a..843b1e7a8b 100644 --- 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 @@ -52,4 +52,9 @@ public class AllIssueListResultDTO implements Serializable { private String issueStatus; private String issueStatusName; private String issueId; + + /** + * 来源类型 话题:resi_topic;直接立议题:issue;事件:ic_event + */ + private String sourceType; } From a06e2ee701ee4b8d8553a164cdfaf4e45cb3a080 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 11 Oct 2022 17:58:46 +0800 Subject: [PATCH 090/249] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=8C=E8=BF=94=E5=9B=9Eorigin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/ProjectManageListResultDTO.java | 11 ++++++++++- .../src/main/resources/mapper/ProjectDao.xml | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) 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-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index ba340a2464..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 @@ -612,6 +612,7 @@ p.CREATED_TIME AS shiftProjectTime, ps.IS_HANDLE, ps.CREATED_TIME AS updatedTime, + p.ORIGIN, t.* FROM (SELECT From 903820974e7b381445ea36303d8013ab2f74475b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 Oct 2022 09:37:24 +0800 Subject: [PATCH 091/249] =?UTF-8?q?/gov/project/icEvent/detail=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E8=AF=A6=E6=83=85=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=B7=B2=E5=88=A0=E9=99=A4=EF=BC=8C=E8=BF=94=E5=9B=9E?= =?UTF-8?q?9999=EF=BC=8C=E6=8F=90=E7=A4=BA=E4=BA=8B=E4=BB=B6=E5=B7=B2?= =?UTF-8?q?=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IcEventServiceImpl.java | 96 +++++++++---------- 1 file changed, 48 insertions(+), 48 deletions(-) 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 25a794d695..fa54ca0bbd 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 @@ -1087,58 +1087,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; } From ffef482287a224061007a7dc49d533ddd37cf1c7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 12 Oct 2022 10:05:54 +0800 Subject: [PATCH 092/249] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/IssueServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 26c9a93b6f..abfedfdb21 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -2066,13 +2066,14 @@ public class IssueServiceImpl extends BaseServiceImpl imp result.setTotal(allIssueListResultDTOS.size()); } if (CollectionUtils.isNotEmpty(result.getList())){ - result.getList().forEach(l -> { + for (AllIssueListResultDTO l : result.getList()) { GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); if(null == gridInfo){ - throw new EpmetException("查询网格信息失败:"+l.getGridId()); + logger.warn("查询网格信息失败:"+l.getGridId()); + continue; } l.setGridName(gridInfo.getGridNamePath()); - }); + } } return result; } From 5d062c668f4aace84a81a286ac0fcb1837668861 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 Oct 2022 10:34:54 +0800 Subject: [PATCH 093/249] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E6=96=B9=E6=B3=95=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/EpmetHeartOpenFeignClient.java | 1 + .../controller/IcUserDemandRecController.java | 1 + .../epmet/service/IcUserDemandRecService.java | 1 + .../impl/IcUserDemandRecServiceImpl.java | 63 ++++++++++++++++--- 4 files changed, 59 insertions(+), 7 deletions(-) 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::getCreatedBy, 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::getCreatedBy, 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::getCreatedBy, 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::getCreatedBy, currentUserId) + .set(IcUserDemandOperateLogEntity::getDelFlag, NumConstant.ONE_STR); + operateLogDao.update(null, logWrapper); + } } /** From 01f5256b40c5a93a5cafb17bd8beb07ab38fc6b3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 Oct 2022 10:37:45 +0800 Subject: [PATCH 094/249] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=90=8C=E6=97=B6=E5=8E=BB=E5=88=A0=E9=99=A4=E8=AE=AE?= =?UTF-8?q?=E9=A2=98=E3=80=81=E9=A1=B9=E7=9B=AE=E3=80=82todo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/IcEventServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 fa54ca0bbd..1c835bcf61 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 @@ -464,7 +464,10 @@ 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())){ + // 删除议题 + // todo } LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper(); wrapper.eq(IcEventEntity::getId,id).set(IcEventEntity::getUpdatedTime,new Date()) From 419a882c23c52572658c70e2beccbf024693a301 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 Oct 2022 10:57:02 +0800 Subject: [PATCH 095/249] =?UTF-8?q?=E6=9B=B4=E6=96=B0UpdatedBy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IcUserDemandRecServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 1bf66f63f2..8535dddcb8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -556,28 +556,28 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl wrapper = new LambdaUpdateWrapper(); wrapper.eq(IcUserDemandRecEntity::getId, id) .set(IcUserDemandRecEntity::getUpdatedTime, nowTime) - .set(IcUserDemandRecEntity::getCreatedBy, currentUserId) + .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::getCreatedBy, currentUserId) + .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::getCreatedBy, currentUserId) + .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::getCreatedBy, currentUserId) + .set(IcUserDemandOperateLogEntity::getUpdatedBy, currentUserId) .set(IcUserDemandOperateLogEntity::getDelFlag, NumConstant.ONE_STR); operateLogDao.update(null, logWrapper); } From b3d614a017fc713b210a5e8f7e400681fd7272b6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 Oct 2022 10:58:17 +0800 Subject: [PATCH 096/249] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E5=88=A0=E9=99=A4ic=5Fevent=5Fcategory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/IcEventCategoryDao.java | 2 -- .../epmet/service/IcEventCategoryService.java | 6 ++++++ .../impl/IcEventCategoryServiceImpl.java | 20 ++++++++++++++++--- .../service/impl/IcEventServiceImpl.java | 11 ++++++++-- .../service/impl/ProjectServiceImpl.java | 2 +- .../resources/mapper/IcEventCategoryDao.xml | 3 --- 6 files changed, 33 insertions(+), 11 deletions(-) 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 6c96758c64..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,6 +15,4 @@ import org.apache.ibatis.annotations.Param; public interface IcEventCategoryDao extends BaseDao { IcEventCategoryEntity selectByEventId(@Param("icEventId") String icEventId); - - int deleteByIcEventId(@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/service/IcEventCategoryService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java index 4ebabf00b8..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 @@ -83,5 +83,11 @@ 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/impl/IcEventCategoryServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java index bc12413641..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,20 +1,26 @@ 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; +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; @@ -26,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) { @@ -88,8 +95,15 @@ public class IcEventCategoryServiceImpl extends BaseServiceImpl categoryEntities) { - baseDao.deleteByIcEventId(icEventId); - this.insertBatch(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 1c835bcf61..715fafd992 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 @@ -448,6 +448,10 @@ public class IcEventServiceImpl extends BaseServiceImpl 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); } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index b2e1c6f381..0da1d55bb8 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -3621,7 +3621,7 @@ public class ProjectServiceImpl extends BaseServiceImpl - - delete from ic_event_category where ic_event_id = #{icEventId} - \ No newline at end of file From 99f2e6115232e0a803186ffe11a1f67e52a24c29 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 Oct 2022 11:42:43 +0800 Subject: [PATCH 097/249] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=EF=BC=88=E5=88=A0=E9=99=A4=E8=AE=AE=E9=A2=98=E3=80=81=E8=AE=AE?= =?UTF-8?q?=E9=A2=98=E5=88=86=E7=B1=BB=E3=80=81=E8=AE=AE=E9=A2=98=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E3=80=81=E5=88=A0=E9=99=A4=E9=A1=B9=E7=9B=AE=E3=80=81?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=86=E7=B1=BB=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/DelIssueFormDTO.java | 25 +++++++++++++ .../epmet/feign/GovIssueOpenFeignClient.java | 9 +++++ .../GovIssueOpenFeignClientFallBack.java | 11 ++++++ .../com/epmet/controller/IssueController.java | 12 +++++++ .../epmet/service/IssueCategoryService.java | 2 ++ .../java/com/epmet/service/IssueService.java | 9 ++++- .../com/epmet/service/IssueTagsService.java | 3 ++ .../impl/IssueCategoryServiceImpl.java | 15 +++++--- .../epmet/service/impl/IssueServiceImpl.java | 36 +++++++++++++++++++ .../service/impl/IssueTagsServiceImpl.java | 11 ++++++ .../epmet/service/ProjectCategoryService.java | 10 ++++++ .../com/epmet/service/ProjectService.java | 3 +- .../service/impl/IcEventServiceImpl.java | 12 +++++-- .../impl/ProjectCategoryServiceImpl.java | 17 +++++++++ .../service/impl/ProjectServiceImpl.java | 32 ++++++++++++----- 15 files changed, 190 insertions(+), 17 deletions(-) create mode 100644 epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/DelIssueFormDTO.java 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/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 58f010561f..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 @@ -423,4 +423,13 @@ public interface GovIssueOpenFeignClient { */ @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 590afb6b41..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 @@ -365,4 +365,15 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient 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/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 f9cc14f21b..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 @@ -403,5 +403,17 @@ public class IssueController { 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/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/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java index 6fb256e35e..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 @@ -13,7 +13,6 @@ import com.epmet.resi.group.dto.group.result.GroupClosedListResultDTO; 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.github.pagehelper.Page; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @@ -419,4 +418,12 @@ public interface IssueService extends BaseService { * @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/impl/IssueCategoryServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCategoryServiceImpl.java index c86e5d926d..6953874ade 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; /** @@ -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/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index abfedfdb21..312f76cab2 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -5,6 +5,7 @@ import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.fastjson.JSON; import com.alibaba.nacos.client.utils.StringUtils; 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.baomidou.mybatisplus.core.toolkit.IdWorker; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -2155,4 +2156,39 @@ public class IssueServiceImpl extends BaseServiceImpl imp 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/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-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 62c0040244..33a42bb28f 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 @@ -399,11 +399,10 @@ public interface ProjectService extends BaseService { PageData orgProjectList(OrgProjectListFormDTO formDTO); /** - * desc:根据来源id和类型 删除项目 (只删了主表) + * desc:根据来源id和类型 删除项目 (只删了主表、项目分类表) * @param originId * @param origin * @return */ Integer deleteByOriginId(String originId, String origin); - } 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 715fafd992..abddc4c099 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 @@ -471,8 +471,16 @@ public class IcEventServiceImpl extends BaseServiceImpl effectRow = epmetHeartOpenFeignClient.deleteUserDemandByOriginId(entity.getId(), ProjectOriginEnum.IC_EVENT.getCode()); // log.info("delete userDemand result:{},eventId:{}", effectRow, id); } else if(NumConstant.THREE_STR.equals(entity.getOperationType())){ - // 删除议题 - // todo + DelIssueFormDTO delIssueFormDTO = new DelIssueFormDTO(); + delIssueFormDTO.setCustomerId(delIssueFormDTO.getCustomerId()); + 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()) 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/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 0da1d55bb8..80d682cdff 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -19,6 +19,7 @@ package com.epmet.service.impl; import cn.afterturn.easypoi.excel.entity.TemplateExportParams; import com.alibaba.fastjson.JSON; +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; @@ -3615,16 +3616,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::getUpdatedBy,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; } - } From 5a8d8ffa4d95ece3c098ee221a7cd36d6a75fa4b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 Oct 2022 12:54:42 +0800 Subject: [PATCH 098/249] =?UTF-8?q?/resi/group/topic/selectdetail=E5=85=BC?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/IssueResultDTO.java | 2 ++ .../src/main/resources/mapper/IssueDao.xml | 8 +++++++- .../java/com/epmet/service/impl/IcEventServiceImpl.java | 2 +- .../modules/topic/service/impl/ResiTopicServiceImpl.java | 3 +++ .../java/com/epmet/service/impl/IssueServiceImpl.java | 2 +- 5 files changed, 14 insertions(+), 3 deletions(-) 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 a08efd39b4..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 @@ -60,6 +60,8 @@ public class IssueResultDTO implements Serializable { */ private String sourceType; + private String sourceId; + /** * 发布议题的图片 */ 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 effe000fe6..fb7e943e3a 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 @@ -31,6 +31,7 @@ + @@ -46,7 +47,12 @@ - SELECT * FROM data_sync_scope WHERE DEL_FLAG = '0' AND DATA_SYNC_CONFIG_ID = #{id}; + SELECT id, customer_id, data_sync_config_id, org_type, org_id, pid, org_id_path, del_flag FROM data_sync_scope WHERE DEL_FLAG = '0' AND DATA_SYNC_CONFIG_ID = #{id}; + SELECT + d.id, + d.`NAME`, + d.ID_CARD, + d.DEATH_DATE, + d.AGE, + d.ADDRESS, + d.IC_RESI_USER_ID, + d.GRID_ID, + d.AGENCY_ID + FROM + data_sync_record_death d + WHERE + d.DEL_FLAG = '0' + AND d.CUSTOMER_ID = #{customerId} + + AND d.PIDS LIKE concat( '%', #{agencyId}, '%' ) + + + AND d.ID_CARD LIKE concat('%',#{idCard},'%') + + + AND d.`NAME` LIKE concat('%',#{name},'%') + + ORDER BY + d.CREATED_TIME DESC + From 384c4195e7668d2703acfea2c5402706a5ad469e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 13 Oct 2022 14:47:16 +0800 Subject: [PATCH 123/249] =?UTF-8?q?=E5=88=97=E8=A1=A8=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E8=AF=81=E5=8F=B7=E5=8A=A0=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DataSyncRecordDeathController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDeathController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDeathController.java index 5281c4036a..c7fdd676c7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDeathController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDeathController.java @@ -1,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -32,6 +33,7 @@ public class DataSyncRecordDeathController { * @param formDTO * @return */ + @MaskResponse(fieldNames = {"idCard" }, fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD }) @RequestMapping("page") public Result> page(@LoginUser TokenDto tokenDto, @RequestParam DataSyncRecordDeathPageFormDTO formDTO){ formDTO.setStaffId(tokenDto.getUserId()); From c30b36b7bbe7ee0dced1b22bf02062a6e3a7e015 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 13 Oct 2022 14:51:44 +0800 Subject: [PATCH 124/249] daochu --- .../DataSyncRecordDeathController.java | 47 +++++++++++++++++++ .../impl/DataSyncRecordDeathServiceImpl.java | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDeathController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDeathController.java index c7fdd676c7..20ebd81810 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDeathController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDeathController.java @@ -1,17 +1,28 @@ package com.epmet.controller; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +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.dto.DataSyncRecordDeathDTO; import com.epmet.dto.form.dataSync.DataSyncRecordDeathPageFormDTO; import com.epmet.service.DataSyncRecordDeathService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; +import java.util.Date; import java.util.List; @@ -21,6 +32,7 @@ import java.util.List; * @author generator generator@elink-cn.com * @since v1.0.0 2022-10-11 */ +@Slf4j @RestController @RequestMapping("dataSyncRecordDeath") public class DataSyncRecordDeathController { @@ -68,5 +80,40 @@ public class DataSyncRecordDeathController { return new Result(); } + /** + * pc:数据比对-死亡人员数据-导出 + * @param tokenDto + * @param formDTO + * @param response + */ + @NoRepeatSubmit + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody DataSyncRecordDeathPageFormDTO formDTO, HttpServletResponse response) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setIsPage(false); + ExcelWriter excelWriter = null; + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + int pageNo = formDTO.getPageNo(); + try { + String today = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_MMDD); + String fileName = "数据比对-死亡人员数据".concat(today); + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), DataSyncRecordDeathDTO.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + PageData data = null; + do { + data = dataSyncRecordDeathService.page(formDTO); + formDTO.setPageNo(++pageNo); + excelWriter.write(data.getList(), writeSheet); + } while (org.apache.commons.collections4.CollectionUtils.isNotEmpty(data.getList()) && data.getList().size() == formDTO.getPageSize()); + } catch (Exception e) { + log.error("export exception", e); + } finally { + // 千万别忘记finish 会帮忙关闭流 + if (excelWriter != null) { + excelWriter.finish(); + } + } + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java index 2aecfec3c4..1246b82d47 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java @@ -43,7 +43,7 @@ public class DataSyncRecordDeathServiceImpl extends BaseServiceImpl page(DataSyncRecordDeathPageFormDTO formDTO) { CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); formDTO.setAgencyId(null != staffInfoCacheResult ? staffInfoCacheResult.getAgencyId() : null); - PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(),formDTO.getIsPage()); List records = baseDao.pageSelect(formDTO.getCustomerId(),formDTO.getIdCard(), formDTO.getName(), formDTO.getAgencyId()); PageInfo pi = new PageInfo<>(records); return new PageData<>(records, pi.getTotal()); From b09b4ad987f4fe974a41734f3a6fff56120f7f72 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 13 Oct 2022 14:56:33 +0800 Subject: [PATCH 125/249] DataSyncRecordDeathDTO --- .../com/epmet/dto/DataSyncRecordDeathDTO.java | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDeathDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDeathDTO.java index 780fdc1824..eeed519be6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDeathDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDeathDTO.java @@ -1,5 +1,8 @@ package com.epmet.dto; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; import lombok.Data; import java.io.Serializable; @@ -17,126 +20,158 @@ public class DataSyncRecordDeathDTO implements Serializable { private static final long serialVersionUID = 1L; + @ColumnWidth(50) + @ExcelProperty("所属网格") + private String gridName; /** * 主键 */ + @ExcelIgnore private String id; /** * 客户Id */ + @ExcelIgnore private String customerId; /** * 组织Id */ + @ExcelIgnore private String agencyId; /** * 组织的pids 含agencyId本身 */ + @ExcelIgnore private String pids; /** * 网格ID */ + @ExcelIgnore private String gridId; /** * 姓名 */ + @ColumnWidth(15) + @ExcelProperty("姓名") private String name; /** * 身份证 */ + @ColumnWidth(20) + @ExcelProperty("证件号") private String idCard; /** * 居民Id,ic_resi_user.id */ + @ExcelIgnore private String icResiUserId; /** * 年龄(享年) */ + @ColumnWidth(10) + @ExcelProperty("年龄") private String age; /** * 家庭住址 */ + @ColumnWidth(40) + @ExcelProperty("家庭住址") private String address; /** * 死亡时间 */ + @ColumnWidth(20) + @ExcelProperty("死亡日期") private String deathDate; /** * 火化时间 */ + @ColumnWidth(20) + @ExcelProperty("火化时间") private String cremationTime; /** * 民族 */ + @ExcelIgnore private String mz; /** * 登记单位名称 */ + @ColumnWidth(40) + @ExcelProperty("登记单位名称") private String organName; /** * 国籍 */ + @ExcelIgnore private String nation; /** * 第三方记录唯一标识 */ + @ExcelIgnore private String thirdRecordId; /** * 处理状态(更新至居民信息) 0:未处理;1:处理成功;2处理失败 */ + @ExcelIgnore private Integer dealStatus; /** * 处理结果 */ + @ExcelIgnore private String dealResult; /** * 删除标识:0.未删除 1.已删除 */ + @ExcelIgnore private Integer delFlag; /** * 乐观锁 */ + @ExcelIgnore private Integer revision; /** * 创建人 */ + @ExcelIgnore private String createdBy; /** * 创建时间 */ + @ExcelIgnore private Date createdTime; /** * 更新人 */ + @ExcelIgnore private String updatedBy; /** * 更新时间 */ + @ExcelIgnore private Date updatedTime; - private String gridName; - } From 5f68112c5e9d8294f3077638696f703592fa621b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 13 Oct 2022 15:56:39 +0800 Subject: [PATCH 126/249] =?UTF-8?q?=E5=88=97=E8=A1=A8=20=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/DataSyncRecordDisabilityDTO.java | 1 + .../DataSyncRecordDisabilityFormDTO.java | 24 ++++++ .../DataSyncRecordDisabilityController.java | 24 +++++- .../dao/DataSyncRecordDisabilityDao.java | 6 ++ .../excel/DataSyncRecordDisabilityExcel.java | 59 ++++++++++++++ .../DataSyncRecordDisabilityService.java | 7 ++ .../DataSyncRecordDisabilityServiceImpl.java | 80 ++++++++++++++++++- .../mapper/DataSyncRecordDisabilityDao.xml | 24 +++++- 8 files changed, 218 insertions(+), 7 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/DataSyncRecordDisabilityFormDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java index 8c99d8f95b..c24009c73a 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java @@ -101,6 +101,7 @@ public class DataSyncRecordDisabilityDTO implements Serializable { * 处理状态(更新至居民信息) 0:未处理;1:处理成功;2处理失败 */ private Integer dealStatus; + private String dealStatusName; /** * 残疾状态 0:非残疾;1:残疾 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/DataSyncRecordDisabilityFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/DataSyncRecordDisabilityFormDTO.java new file mode 100644 index 0000000000..0de7c52e15 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/DataSyncRecordDisabilityFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form.dataSync; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/13 14:47 + * @DESC + */ +@Data +public class DataSyncRecordDisabilityFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = -20061989190666183L; + + private String name; + private String idCard; + private String mobile; + private String customerId; + private String userId; + private String agencyId; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java index c8a3bed494..07ac090a24 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java @@ -1,7 +1,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; 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.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -9,10 +11,13 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.DataSyncRecordDisabilityDTO; +import com.epmet.dto.form.dataSync.DataSyncRecordDisabilityFormDTO; import com.epmet.service.DataSyncRecordDisabilityService; 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.Map; @@ -29,9 +34,11 @@ public class DataSyncRecordDisabilityController { @Autowired private DataSyncRecordDisabilityService dataSyncRecordDisabilityService; - @RequestMapping("page") - public Result> page(@RequestParam Map params){ - PageData page = dataSyncRecordDisabilityService.page(params); + @PostMapping("page") + public Result> page(@LoginUser TokenDto tokenDto,@RequestBody DataSyncRecordDisabilityFormDTO formDTO){ + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + PageData page = dataSyncRecordDisabilityService.list(formDTO); return new Result>().ok(page); } @@ -67,5 +74,16 @@ public class DataSyncRecordDisabilityController { return new Result(); } + @PostMapping("export") + public void export(@LoginUser TokenDto tokenDto, @RequestBody DataSyncRecordDisabilityFormDTO formDTO, HttpServletResponse response) throws IOException { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + dataSyncRecordDisabilityService.export(formDTO,response); + } + + @PostMapping("batchUpdate") + public Result batchUpdate(){ + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java index caad1854be..8f7d1f4713 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java @@ -1,9 +1,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.DataSyncRecordDisabilityDTO; +import com.epmet.dto.form.dataSync.DataSyncRecordDisabilityFormDTO; import com.epmet.entity.DataSyncRecordDisabilityEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 数据同步记录-居民残疾信息 * @@ -14,4 +18,6 @@ import org.apache.ibatis.annotations.Mapper; public interface DataSyncRecordDisabilityDao extends BaseDao { //int upsertBatch(List list); + + List list(DataSyncRecordDisabilityFormDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java new file mode 100644 index 0000000000..e7a52a2b40 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java @@ -0,0 +1,59 @@ +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/13 15:29 + * @DESC + */ +@Data +public class DataSyncRecordDisabilityExcel { + + @ExcelProperty(value = "姓名") + @ColumnWidth(20) + private String name; + + @ExcelProperty(value = "证件号") + @ColumnWidth(20) + private String idCard; + + @ExcelProperty(value = "手机") + @ColumnWidth(20) + private String mobile; + + @ExcelProperty(value = "性别") + @ColumnWidth(20) + private String gender; + + @ExcelProperty(value = "民族") + @ColumnWidth(20) + private String mz; + + @ExcelProperty(value = "家庭住址") + @ColumnWidth(20) + private String address; + + @ExcelProperty(value = "残疾类别") + @ColumnWidth(20) + private String cjlb; + + @ExcelProperty(value = "残疾等级") + @ColumnWidth(20) + private String cjzk; + + @ExcelProperty(value = "监护人") + @ColumnWidth(20) + private String guardian; + + @ExcelProperty(value = "状态") + @ColumnWidth(20) + private String dealStatusName; + + @ExcelProperty(value = "失败原因") + @ColumnWidth(20) + private String dealResult; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java index 73408be3f2..99ea18d578 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java @@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.DataSyncRecordDisabilityDTO; +import com.epmet.dto.form.dataSync.DataSyncRecordDisabilityFormDTO; import com.epmet.entity.DataSyncRecordDisabilityEntity; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -78,4 +81,8 @@ public interface DataSyncRecordDisabilityService extends BaseService queryWrapper); + + PageData list(DataSyncRecordDisabilityFormDTO formDTO); + + void export(DataSyncRecordDisabilityFormDTO formDTO, HttpServletResponse response) throws IOException; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java index f8e093e6f1..e28e34e301 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java @@ -1,23 +1,43 @@ 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.LambdaQueryWrapper; 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.CustomerStaffRedis; 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.DataSyncRecordDisabilityDao; import com.epmet.dto.DataSyncRecordDisabilityDTO; +import com.epmet.dto.form.dataSync.DataSyncRecordDisabilityFormDTO; import com.epmet.entity.DataSyncRecordDisabilityEntity; +import com.epmet.excel.DataSyncRecordDisabilityExcel; import com.epmet.service.DataSyncRecordDisabilityService; +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.*; /** * 数据同步记录-居民残疾信息 @@ -26,6 +46,7 @@ import java.util.Map; * @since v1.0.0 2022-10-11 */ @Service +@Slf4j public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl implements DataSyncRecordDisabilityService { @Override @@ -86,4 +107,57 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl list(DataSyncRecordDisabilityFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); + if (null == staffInfo){ + throw new EpmetException("查询工作人员失败:"+formDTO.getUserId()); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + PageData result = new PageData<>(new ArrayList<>(), NumConstant.ZERO_L); + if (formDTO.getIsPage()){ + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.list(formDTO)); + result.setList(pageInfo.getList()); + result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); + }else { + List list = baseDao.list(formDTO); + result.setList(list); + result.setTotal(list.size()); + } + return result; + } + + @Override + public void export(DataSyncRecordDisabilityFormDTO 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), DataSyncRecordDisabilityExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + List list = null; + do { + PageData data = list(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), DataSyncRecordDisabilityExcel.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(); + } + } + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml index a08fdfc710..0326e8b1f5 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml @@ -32,7 +32,29 @@ - + + + From 11eebc55c87a23c65517044e06765a4a20680272 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 13 Oct 2022 16:06:35 +0800 Subject: [PATCH 127/249] detail --- .../dto/DataSyncRecordDisabilityDTO.java | 3 + .../epmet/dto/form/dataSync/ResiInfoDTO.java | 81 +++++++++++++++++++ .../DataSyncRecordDisabilityController.java | 2 +- .../DataSyncRecordDisabilityServiceImpl.java | 13 ++- 4 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/ResiInfoDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java index c24009c73a..d1a35d8d77 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto; +import com.epmet.dto.form.dataSync.ResiInfoDTO; import lombok.Data; import java.io.Serializable; @@ -143,4 +144,6 @@ public class DataSyncRecordDisabilityDTO implements Serializable { */ private Date updatedTime; + private ResiInfoDTO resiInfo; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/ResiInfoDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/ResiInfoDTO.java new file mode 100644 index 0000000000..b42e47618d --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/ResiInfoDTO.java @@ -0,0 +1,81 @@ +package com.epmet.dto.form.dataSync; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/13 15:58 + * @DESC + */ +@Data +public class ResiInfoDTO implements Serializable { + + private static final long serialVersionUID = -3320460795150912451L; + + + /** + * 姓名 + */ + private String name; + + /** + * 身份证 + */ + private String idCard; + + /** + * 电话 + */ + private String mobile; + + + /** + * 残疾证号 + */ + private String cardNum; + + /** + * 残疾等级(状况) + */ + private String cjzk; + + /** + * 残疾类别 + */ + private String cjlb; + + /** + * 民族 + */ + private String mz; + + /** + * 家庭住址 + */ + private String address; + + /** + * 性别 + */ + private String gender; + + /** + * 监护人 + */ + private String guardian; + + public ResiInfoDTO() { + this.name = ""; + this.idCard = ""; + this.mobile = ""; + this.cardNum = ""; + this.cjzk = ""; + this.cjlb = ""; + this.mz = ""; + this.address = ""; + this.gender = ""; + this.guardian = ""; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java index 07ac090a24..4685545676 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java @@ -42,7 +42,7 @@ public class DataSyncRecordDisabilityController { return new Result>().ok(page); } - @RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) + @PostMapping("detail/{id}") public Result get(@PathVariable("id") String id){ DataSyncRecordDisabilityDTO data = dataSyncRecordDisabilityService.get(id); return new Result().ok(data); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java index e28e34e301..a08f6c9502 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java @@ -22,15 +22,19 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.dao.DataSyncRecordDisabilityDao; import com.epmet.dto.DataSyncRecordDisabilityDTO; +import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.dataSync.DataSyncRecordDisabilityFormDTO; +import com.epmet.dto.form.dataSync.ResiInfoDTO; import com.epmet.entity.DataSyncRecordDisabilityEntity; import com.epmet.excel.DataSyncRecordDisabilityExcel; import com.epmet.service.DataSyncRecordDisabilityService; +import com.epmet.service.IcResiUserService; 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.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -49,6 +53,9 @@ import java.util.*; @Slf4j public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl implements DataSyncRecordDisabilityService { + @Autowired + private IcResiUserService icResiUserService; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -77,7 +84,11 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl Date: Thu, 13 Oct 2022 16:47:02 +0800 Subject: [PATCH 128/249] =?UTF-8?q?=E3=80=90=E6=AD=BB=E4=BA=A1=E3=80=91?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ChangeDeathController.java | 6 +++ .../DataSyncRecordDeathController.java | 18 +++++++ .../service/DataSyncRecordDeathService.java | 8 +++ .../service/impl/ChangeDeathServiceImpl.java | 25 +++++++-- .../impl/DataSyncRecordDeathServiceImpl.java | 53 +++++++++++++++++++ .../impl/IcUserTransferRecordServiceImpl.java | 42 +++++++++------ 6 files changed, 132 insertions(+), 20 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/ChangeDeathController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/ChangeDeathController.java index c3a1e0ec6f..963d2369d0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/ChangeDeathController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/ChangeDeathController.java @@ -50,6 +50,12 @@ public class ChangeDeathController { return new Result().ok(data); } + /** + * 死亡管理-新增死亡人员 + * @param tokenDto + * @param dto + * @return + */ @NoRepeatSubmit @PostMapping("save") public Result save(@LoginUser TokenDto tokenDto, @RequestBody ChangeDeathDTO dto){ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDeathController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDeathController.java index 20ebd81810..d29cf564be 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDeathController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDeathController.java @@ -116,4 +116,22 @@ public class DataSyncRecordDeathController { } } } + + /** + * 批量更新 + * 新增死亡记录 + * + * @param tokenDto + * @param ids + * @return + */ + @NoRepeatSubmit + @PostMapping("batchupdate") + public Result batchUpdate(@LoginUser TokenDto tokenDto, @RequestBody List ids) { + if (CollectionUtils.isEmpty(ids)) { + return new Result(); + } + dataSyncRecordDeathService.batchUpdate(tokenDto.getUserId(), tokenDto.getCustomerId(), ids); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDeathService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDeathService.java index 43c330af9f..de5e8ef59f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDeathService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDeathService.java @@ -59,4 +59,12 @@ public interface DataSyncRecordDeathService extends BaseService ids); DataSyncRecordDeathDTO selectOne(LambdaQueryWrapper queryWrapper); + + /** + * + * @param userId 当前操作人 + * @param customerId 当前客户 + * @param ids 要操作的记录id + */ + void batchUpdate(String userId, String customerId, List ids); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeDeathServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeDeathServiceImpl.java index 96085b2a3b..04690ad68a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeDeathServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/ChangeDeathServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.service.ChangeDeathService; import com.epmet.service.ChangeWelfareService; import com.epmet.service.IcResiUserService; import com.epmet.service.IcUserTransferRecordService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -42,6 +43,7 @@ import java.util.*; * @author generator generator@elink-cn.com * @since v1.0.0 2022-05-05 */ +@Slf4j @Service public class ChangeDeathServiceImpl extends BaseServiceImpl implements ChangeDeathService { @@ -106,6 +108,12 @@ public class ChangeDeathServiceImpl extends BaseServiceImpl params = new HashMap<>(4); params.put("idCard", dto.getIdCard()); if (!list(params).isEmpty()) { - return new Result().error("该人员已经迁入死亡人口"); + // return new Result().error("该人员已经迁入死亡人口"); + log.warn(String.format("该人员已经迁入死亡人口,idCard:%s",result.getIdCard())); + return new Result(); } - + // 插入死亡名单表 dto.setJoinDate(DateUtils.format(new Date())); ChangeDeathEntity entity = ConvertUtils.sourceToTarget(dto, ChangeDeathEntity.class); entity.setCustomerId(loginUserUtil.getLoginUserCustomerId()); insert(entity); + // 如果勾选了享受福利 if (dto.getWelfareFlag() != null && dto.getWelfareFlag()) { ChangeWelfareDTO formDto = new ChangeWelfareDTO(); formDto.setUserId(dto.getUserId()); @@ -148,6 +163,8 @@ public class ChangeDeathServiceImpl extends BaseServiceImpl ids) { + // 要做的事:居民表修改状态为注销、子状态为死亡、加入死亡人员名单、记录变更主表、变更明细表(如果当前死亡的这个人属于十八类中的是,-1操作) + // 上面要做的事,其实就是新增死亡人员名单,调整下ChangeDeathServiceImpl.save,直接调用吧, + for (String id : ids) { + DataSyncRecordDeathEntity entity = baseDao.selectById(id); + if (NumConstant.ONE == entity.getDealStatus() || StringUtils.isBlank(entity.getIcResiUserId())) { + // 已处理的跳过 + continue; + } + try { + ChangeDeathDTO changeDeathDTO = new ChangeDeathDTO(); + changeDeathDTO.setStaffId(userId); + changeDeathDTO.setUserId(entity.getIcResiUserId()); + changeDeathDTO.setGridId(entity.getGridId()); + changeDeathDTO.setName(entity.getName()); + changeDeathDTO.setIdCard(entity.getIdCard()); + // 手机号没有值 + changeDeathDTO.setMobile(StrConstant.EPMETY_STR); + changeDeathDTO.setDeathDate(DateUtils.stringToDate(entity.getDeathDate(), "yyyy-MM-dd")); + changeDeathDTO.setJoinReason("来源于数据比对-死亡人员数据"); + SpringContextUtils.getBean(ChangeDeathServiceImpl.class).save(changeDeathDTO); + entity.setDealStatus(NumConstant.ONE); + } catch (EpmetException epmetException) { + + entity.setDealStatus(NumConstant.TWO); + entity.setDealResult("系统内部异常:" + epmetException.getMsg()); + + epmetException.printStackTrace(); + } catch (Exception e) { + + entity.setDealStatus(NumConstant.TWO); + entity.setDealResult("未知错误:" + e.getMessage()); + + e.printStackTrace(); + } finally { + baseDao.updateById(entity); + } + } + } + + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java index d07fe051eb..e2013336f0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserTransferRecordServiceImpl.java @@ -179,10 +179,19 @@ public class IcUserTransferRecordServiceImpl extends BaseServiceImpl result2 = getNewHouseInfo(formDTO); CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); From 26a23ceb314781b0037f6ab591e16b9ea14b2144 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 13 Oct 2022 16:51:52 +0800 Subject: [PATCH 129/249] =?UTF-8?q?=E6=94=B9=E5=AD=97=E6=AE=B5=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/utils/YtHsResUtils.java | 107 +++-- .../dto/DataSyncRecordDisabilityDTO.java | 24 +- .../DataSyncRecordDisabilityEntity.java | 24 +- .../impl/DataSyncConfigServiceImpl.java | 412 ++++++++++-------- .../resources/mapper/DataSyncConfigDao.xml | 2 + .../mapper/DataSyncRecordDisabilityDao.xml | 6 +- .../service/DataSyncConfigServiceTest.java | 22 + 7 files changed, 356 insertions(+), 241 deletions(-) create mode 100644 epmet-user/epmet-user-server/src/test/java/com/epmet/service/DataSyncConfigServiceTest.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java index b41afbd23b..6ed4887e13 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java @@ -26,6 +26,7 @@ public class YtHsResUtils { private static final String PAGE_SIZE = "PAGESIZE"; private static final String START = "ROWNUM"; private static final String LIMIT = "PAGESIZE"; + /** * desc:图片同步扫描 * @@ -35,24 +36,28 @@ public class YtHsResUtils { try { //String param = String.format("&card_no=%s&ROWNUM=%s&PAGESIZE=%s", cardNo, rowNum, pageSize); //String apiUrl = url.concat(param); - Map param = new HashMap<>(); - param.put(APP_KEY,APP_KEY_VALUE); - param.put(CARD_NO,cardNo); - param.put(ROW_NUM,rowNum); - param.put(PAGE_SIZE,pageSize); - log.info("hsjc api param:{}",param); - Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"hsjcxx", param); - log.info("hsjc api result:{}",JSON.toJSONString(result)); + Map param = new HashMap<>(); + param.put(APP_KEY, APP_KEY_VALUE); + param.put(CARD_NO, cardNo); + param.put(ROW_NUM, rowNum); + param.put(PAGE_SIZE, pageSize); + log.info("hsjc api param:{}", param); + //todo 核酸检测 mock数据 放开她 + //Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"hsjcxx", param); + String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":[{\"id\":\"6a31eb2d38c011eda054fa163ebc7ff4\",\"name\":\"数据同步测试用户\",\"card_no\":\"370283199912010302\",\"telephone\":\"13697890860\",\"address\":\"保利香榭里公馆18-1-302\",\"test_time\":\"2022-09-20 12:52:28\",\"depart_name\":\"天仁医学检验实验室有限公司\",\"county\":\"莱山区\",\"upload_time\":\"2022-09-20 21:23:10\",\"sample_result_pcr\":\"2\",\"sample_time\":\"2022-09-20 06:48:28\",\"sampling_org_pcr\":\"采样点327\"}],\"total\":1}"; + Result result = new Result().ok(mockData); + log.info("hsjc api result:{}", JSON.toJSONString(result)); if (result.success()) { return JSON.parseObject(result.getData(), YtHsjcResDTO.class); } } catch (Exception e) { - log.warn(String.format("烟台核酸检测结果查询异常cardNo:%s,异常信息:%s", cardNo, e.getMessage())); + log.error(String.format("烟台核酸检测结果查询异常cardNo:%s,异常信息:%s", cardNo, e.getMessage())); } YtHsjcResDTO resultResult = new YtHsjcResDTO(); resultResult.setData(new ArrayList<>()); return resultResult; } + /** * desc:死亡数据同步 * @@ -65,48 +70,55 @@ public class YtHsResUtils { // 3)idcard身份证号 必填 // 4)start开始默认0 // 5)limit每页记录数 - Map param = new HashMap<>(); - param.put(APP_KEY,APP_KEY_VALUE); - param.put("id_card",cardNo); - param.put("name",userName); - param.put("start",0); - param.put("limit",1); + Map param = new HashMap<>(); + param.put(APP_KEY, APP_KEY_VALUE); + param.put("id_card", cardNo); + param.put("name", userName); + param.put("start", 0); + param.put("limit", 1); - log.info("siWang api param:{}",param); + log.info("siWang api param:{}", param); //todo 放开他 //Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"mzt_hhrysj1", param); String mockData2 = "{\"code\":200,\"data\":\"{\\\"data\\\":[{\\\"AGE\\\":\\\"73\\\",\\\"CARD_TYPE\\\":\\\"9\\\",\\\"CREATE_ORGAN_NAME\\\":\\\"菏泽市巨野县殡仪馆\\\",\\\"CREMATION_TIME\\\":\\\"2014-04-17 14:46\\\",\\\"DEAD_ID\\\":\\\"SZ-371724-2012-1006560\\\",\\\"DEATH_DATE\\\":\\\"2014-04-17\\\",\\\"FAMILY_ADD\\\":\\\"菏泽市巨野县开发区马庄村\\\",\\\"FOLK\\\":\\\"01\\\",\\\"ID_CARD\\\":\\\"1\\\",\\\"NAME\\\":\\\"郭**\\\",\\\"NATION\\\":\\\"156\\\",\\\"POPULACE\\\":\\\"3381C3014B60439FE05319003C0A0897\\\",\\\"POPULACE_NAME\\\":\\\"菏泽市巨野县开发区马庄村\\\",\\\"RECORD_ID\\\":\\\"E-371724-2012-100000000000407849\\\",\\\"RN\\\":\\\"1\\\",\\\"SEX\\\":\\\"1\\\"}],\\\"fields\\\":[\\\"RN\\\",\\\"RECORD_ID\\\",\\\"DEAD_ID\\\",\\\"NAME\\\",\\\"SEX\\\",\\\"CARD_TYPE\\\",\\\"ID_CARD\\\",\\\"BIRTHDAY\\\",\\\"AGE\\\",\\\"NATION\\\",\\\"FOLK\\\",\\\"IF_LOCAL\\\",\\\"POPULACE\\\",\\\"FAMILY_ADD\\\",\\\"WORK_NAME\\\",\\\"DEATH_DATE\\\",\\\"CREMATION_TIME\\\",\\\"CREATE_ORGAN_NAME\\\",\\\"POPULACE_NAME\\\"],\\\"total\\\":\\\"4903\\\"}\",\"message\":\"\"}"; - String mockData = "{\"code\":200,\"data\":\"{\\\"data\\\":[],\\\"fields\\\":[\\\"RN\\\",\\\"RECORD_ID\\\",\\\"DEAD_ID\\\",\\\"NAME\\\",\\\"SEX\\\",\\\"CARD_TYPE\\\",\\\"ID_CARD\\\",\\\"BIRTHDAY\\\",\\\"AGE\\\",\\\"NATION\\\",\\\"FOLK\\\",\\\"IF_LOCAL\\\",\\\"POPULACE\\\",\\\"FAMILY_ADD\\\",\\\"WORK_NAME\\\",\\\"DEATH_DATE\\\",\\\"CREMATION_TIME\\\",\\\"CREATE_ORGAN_NAME\\\",\\\"POPULACE_NAME\\\"],\\\"total\\\":\\\"4903\\\"}\",\"message\":\"\"}"; + String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":\"{\\\"code\\\":200,\\\"data\\\":\\\"{\\\\\\\"data\\\\\\\":[{\\\\\\\"AGE\\\\\\\":\\\\\\\"82\\\\\\\",\\\\\\\"BIRTHDAY\\\\\\\":\\\\\\\"1933-02-23\\\\\\\",\\\\\\\"CARD_TYPE\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"CREATE_ORGAN_NAME\\\\\\\":\\\\\\\"莱州市殡仪馆\\\\\\\",\\\\\\\"CREMATION_TIME\\\\\\\":\\\\\\\"2016-01-03 13:01\\\\\\\",\\\\\\\"DEAD_ID\\\\\\\":\\\\\\\"8abc809851ffaf1501520600555c2849\\\\\\\",\\\\\\\"DEATH_DATE\\\\\\\":\\\\\\\"2016-01-02\\\\\\\",\\\\\\\"FAMILY_ADD\\\\\\\":\\\\\\\"山东省莱州市光州西路420号\\\\\\\",\\\\\\\"FOLK\\\\\\\":\\\\\\\"01\\\\\\\",\\\\\\\"ID_CARD\\\\\\\":\\\\\\\"370625193302231929\\\\\\\",\\\\\\\"NAME\\\\\\\":\\\\\\\"陈秀芬\\\\\\\",\\\\\\\"NATION\\\\\\\":\\\\\\\"156\\\\\\\",\\\\\\\"POPULACE\\\\\\\":\\\\\\\"3381C300B4B9439FE05319003C0A0897\\\\\\\",\\\\\\\"POPULACE_NAME\\\\\\\":\\\\\\\"烟台市莱州市文昌路街道\\\\\\\",\\\\\\\"RECORD_ID\\\\\\\":\\\\\\\"8abc809851ffaf1501520600694e2877\\\\\\\",\\\\\\\"RN\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"SEX\\\\\\\":\\\\\\\"2\\\\\\\"}],\\\\\\\"fields\\\\\\\":[\\\\\\\"RN\\\\\\\",\\\\\\\"RECORD_ID\\\\\\\",\\\\\\\"DEAD_ID\\\\\\\",\\\\\\\"NAME\\\\\\\",\\\\\\\"SEX\\\\\\\",\\\\\\\"CARD_TYPE\\\\\\\",\\\\\\\"ID_CARD\\\\\\\",\\\\\\\"BIRTHDAY\\\\\\\",\\\\\\\"AGE\\\\\\\",\\\\\\\"NATION\\\\\\\",\\\\\\\"FOLK\\\\\\\",\\\\\\\"IF_LOCAL\\\\\\\",\\\\\\\"POPULACE\\\\\\\",\\\\\\\"FAMILY_ADD\\\\\\\",\\\\\\\"WORK_NAME\\\\\\\",\\\\\\\"DEATH_DATE\\\\\\\",\\\\\\\"CREMATION_TIME\\\\\\\",\\\\\\\"CREATE_ORGAN_NAME\\\\\\\",\\\\\\\"POPULACE_NAME\\\\\\\"],\\\\\\\"total\\\\\\\":\\\\\\\"1\\\\\\\"}\\\",\\\"message\\\":\\\"\\\"}\",\"total\":0}"; Result result = new Result().ok(mockData); - log.info("siWang api result:{}",JSON.toJSONString(result)); + log.info("siWang api result:{}", JSON.toJSONString(result)); String data = result.getData(); JSONObject jsonObject = JSON.parseObject(data); //他们的结果是成功的 - if (jsonObject!= null && "200".equals(jsonObject.getString("code"))){ - //第一层data - JSONObject realObject = JSON.parseObject(jsonObject.getString("data")); - if (realObject!= null&& realObject.getJSONArray("data") != null) { - //第二层 data - Object thirdData = realObject.getJSONArray("data").get(0); - YtDataSyncResDTO ytDataSyncResDTO = new YtDataSyncResDTO(200,"",thirdData.toString()); - return ytDataSyncResDTO; - }else { - log.warn("canji 调用蓝图接口成功但是蓝图的结果中 省平台失败"); + if (jsonObject != null && "200".equals(jsonObject.getString("code"))) { + //第一层 + JSONObject firstData = JSON.parseObject(jsonObject.getString("data")); + + //第二层 data + if (firstData != null && "200".equals(firstData.getString("code"))) { + //第一层 + JSONObject secondData = JSON.parseObject(firstData.getString("data")); + Object thirdData = ""; + if (secondData != null && secondData.getJSONArray("data") != null) { + //第二层 data + thirdData = secondData.getJSONArray("data").get(0); + } + return new YtDataSyncResDTO(200, "", thirdData.toString()); + } else { + log.warn("siWang 调用蓝图接口成功但是蓝图的结果中 省平台失败"); } - }else { - log.warn("canji 调用蓝图接口败"); + } else { + log.warn("siWang 调用蓝图接口败"); } } catch (Exception e) { - log.warn(String.format("烟台siWang结果查询异常cardNo:%s,异常信息:%s", cardNo, e.getMessage())); + log.error(String.format("烟台siWang结果查询异常cardNo:%s,异常信息:%s", cardNo, e.getMessage())); } return new YtDataSyncResDTO(); } /** * desc:残疾数据同步 - * @remark:默认失败 因为一旦成功没有数据 会影响残疾人的数据 接口失败数据不做任何处理 + * * @return + * @remark:默认失败 因为一旦成功没有数据 会影响残疾人的数据 接口失败数据不做任何处理 */ public static YtDataSyncResDTO canji(String idCard, String userName) { @@ -117,19 +129,19 @@ public class YtHsResUtils { // 1)appkey // 2)name姓名 // 3)citizenId身份证号 - Map param = new HashMap<>(); - param.put(APP_KEY,APP_KEY_VALUE); - param.put("citizenId",idCard); - param.put("name",userName); + Map param = new HashMap<>(); + param.put(APP_KEY, APP_KEY_VALUE); + param.put("citizenId", idCard); + param.put("name", userName); - log.info("canji api param:{}",param); + log.info("canji api param:{}", param); //todo 上线放开她 //Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"sdcl_xxzx_czcjr1", param); - String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":\"{\\\"code\\\":200,\\\"data\\\":{\\\"result\\\":true,\\\"errorcode\\\":0,\\\"msg\\\":\\\"获取成功\\\",\\\"data\\\":{\\\"isNewRecord\\\":\\\"true\\\",\\\"delFlag\\\":\\\"0\\\",\\\"pageNo\\\":\\\"0\\\",\\\"pageSize\\\":\\\"0\\\",\\\"name\\\":\\\"姓名\\\",\\\"genderName\\\":\\\"性别\\\",\\\"citizenId\\\":\\\"身份证号\\\",\\\"cardNum\\\":\\\"残疾证号\\\",\\\"idtKindName\\\":\\\"残疾类别\\\",\\\"idtLevelName\\\":\\\"残疾等级\\\",\\\"eduLevelName\\\":\\\"教育程度\\\",\\\"marriagerName\\\":\\\"婚姻状况\\\",\\\"guardian\\\":\\\"监护人\\\",\\\"guardianPhone\\\":\\\"监护人联系方式\\\",\\\"residentAdd\\\":\\\"户籍地址\\\",\\\"nowAdd\\\":\\\"现居住地\\\",\\\"phoneNo\\\":\\\"联系电话\\\"}},\\\"message\\\":\\\"\\\"}\",\"total\":0}"; + String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":\"{\\\"code\\\":200,\\\"data\\\":\\\"{\\\\\\\"result\\\\\\\":true,\\\\\\\"errorcode\\\\\\\":0,\\\\\\\"msg\\\\\\\":\\\\\\\"获取成功\\\\\\\",\\\\\\\"data\\\\\\\":{\\\\\\\"isNewRecord\\\\\\\":true,\\\\\\\"delFlag\\\\\\\":\\\\\\\"0\\\\\\\",\\\\\\\"pageNo\\\\\\\":0,\\\\\\\"pageSize\\\\\\\":0,\\\\\\\"name\\\\\\\":\\\\\\\"数据同步测试用户\\\\\\\",\\\\\\\"genderName\\\\\\\":\\\\\\\"男\\\\\\\",\\\\\\\"citizenId\\\\\\\":\\\\\\\"370682198002072719\\\\\\\",\\\\\\\"cardNum\\\\\\\":\\\\\\\"370283199912010302\\\\\\\",\\\\\\\"idtKindName\\\\\\\":\\\\\\\"精神\\\\\\\",\\\\\\\"idtLevelName\\\\\\\":\\\\\\\"二级\\\\\\\",\\\\\\\"eduLevelName\\\\\\\":\\\\\\\"小学\\\\\\\",\\\\\\\"marriagerName\\\\\\\":\\\\\\\"未婚\\\\\\\",\\\\\\\"guardian\\\\\\\":\\\\\\\"盖希仁\\\\\\\",\\\\\\\"guardianPhone\\\\\\\":\\\\\\\"13854516627\\\\\\\",\\\\\\\"guardianRName\\\\\\\":\\\\\\\"兄/弟/姐/妹\\\\\\\",\\\\\\\"raceName\\\\\\\":\\\\\\\"汉族\\\\\\\",\\\\\\\"certDate\\\\\\\":1620779842000,\\\\\\\"residentAdd\\\\\\\":\\\\\\\"姜疃镇凤头村248号附1号\\\\\\\",\\\\\\\"nowAdd\\\\\\\":\\\\\\\"山东省烟台市莱阳市姜疃镇凤头村委会\\\\\\\",\\\\\\\"phoneNo\\\\\\\":\\\\\\\"13854516627\\\\\\\"}}\\\",\\\"message\\\":\\\"\\\"}\",\"total\":0}"; Result result = new Result().ok(mockData); - log.info("canji api result:{}",JSON.toJSONString(result)); + log.info("canji api result:{}", JSON.toJSONString(result)); if (result.success()) { /*返回示例 { @@ -153,25 +165,24 @@ public class YtHsResUtils { String data = result.getData(); JSONObject jsonObject = JSON.parseObject(data); //他们的结果是成功的 - if (jsonObject!= null && "200".equals(jsonObject.getString("code"))){ + if (jsonObject != null && "200".equals(jsonObject.getString("code"))) { //第一层data JSONObject realObject = JSON.parseObject(jsonObject.getString("data")); - if (realObject!= null && "200".equals(realObject.getString("code"))) { + if (realObject != null && "200".equals(realObject.getString("code"))) { //第二层 data String thirdData = realObject.getString("data"); - YtDataSyncResDTO ytDataSyncResDTO = JSON.parseObject(thirdData, YtDataSyncResDTO.class); - return ytDataSyncResDTO; - }else { + return JSON.parseObject(thirdData, YtDataSyncResDTO.class); + } else { log.warn("canji 调用蓝图接口成功但是蓝图的结果中 省平台失败"); } - }else { + } else { log.warn("canji 调用蓝图接口败"); } } } catch (Exception e) { - log.warn(String.format("烟台canji结果查询异常cardNo:%s,异常信息:%s", idCard, e.getMessage())); + log.error(String.format("烟台canji结果查询异常cardNo:%s,异常信息:%s", idCard, e.getMessage())); } return failResult; } @@ -179,11 +190,11 @@ public class YtHsResUtils { public static void main(String[] args) { YtDataSyncResDTO canji = canji("123", "123"); - System.out.println("残疾结果:"+JSON.toJSON(canji)); + System.out.println("残疾结果:" + JSON.toJSON(canji)); YtDataSyncResDTO siwang = siWang("1213", "!23"); - System.out.println("死亡结果:"+JSON.toJSON(siwang)); + System.out.println("死亡结果:" + JSON.toJSON(siwang)); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java index d1a35d8d77..748a039549 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java @@ -84,9 +84,29 @@ public class DataSyncRecordDisabilityDTO implements Serializable { private String eduLevel; /** - * 婚姻状况 + * 婚姻状况 中文 */ - private String maritalStatus; + private String maritalStatusName; + + /** + * 民族 中文 + */ + private String mzCn; + + /** + * 性别1男2女 + */ + private Integer gender; + + /** + * 户籍地址 + */ + private String residentAdd; + + /** + * 现居住地址 + */ + private String nowAdd; /** * 监护人 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java index 50dc64edbe..810b153665 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java @@ -79,9 +79,29 @@ public class DataSyncRecordDisabilityEntity extends BaseEpmetEntity { private String eduLevel; /** - * 婚姻状况 + * 婚姻状况 中文 */ - private String maritalStatus; + private String maritalStatusName; + + /** + * 民族 中文 + */ + private String mzCn; + + /** + * 性别1男2女 + */ + private Integer gender; + + /** + * 户籍地址 + */ + private String residentAdd; + + /** + * 现居住地址 + */ + private String nowAdd; /** * 监护人 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index d70289b0fb..8515089201 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -9,6 +9,7 @@ import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.result.YtDataSyncResDTO; import com.epmet.commons.tools.dto.result.YtHsjcResDTO; +import com.epmet.commons.tools.enums.GenderEnum; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; @@ -40,10 +41,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; /** @@ -182,7 +180,7 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl dbResiList = null; //设置查询数据范围 formDTO.setOrgList(config.getScopeList()); @@ -206,7 +206,7 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl dbResiList) { - List list = new ArrayList<>(); - for (NatUserInfoResultDTO dbResi : dbResiList) { - YtDataSyncResDTO thirdResult = YtHsResUtils.siWang(dbResi.getIdCard(), dbResi.getName()); - if (200 != thirdResult.getCode()) { - log.warn("canJi 调用蓝图接口失败了 继续处理下一个人"); - continue; - } + try { + List list = new ArrayList<>(); + for (NatUserInfoResultDTO dbResi : dbResiList) { + YtDataSyncResDTO thirdResult = YtHsResUtils.siWang(dbResi.getIdCard(), dbResi.getName()); + if (200 != thirdResult.getCode()) { + log.warn("canJi 调用蓝图接口失败了 继续处理下一个人"); + continue; + } - String thirdResultData = thirdResult.getData(); - JSONObject thirdResultObject = JSON.parseObject(thirdResultData); + String thirdResultData = thirdResult.getData(); + JSONObject thirdResultObject = JSON.parseObject(thirdResultData); - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(DataSyncRecordDeathEntity::getIdCard, dbResi.getIdCard()); - //获取数据库里的记录 - DataSyncRecordDeathDTO dbDeathEntity = dataSyncRecordDeathService.selectOne(queryWrapper); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(DataSyncRecordDeathEntity::getIdCard, dbResi.getIdCard()); + //获取数据库里的记录 + DataSyncRecordDeathDTO dbDeathEntity = dataSyncRecordDeathService.selectOne(queryWrapper); - JudgeDealStatus judgeDealStatus= new JudgeDealStatus(thirdResultObject,dbDeathEntity).invokeDeath(); - if (judgeDealStatus.isStop()) { - continue; - } + JudgeDealStatus judgeDealStatus = new JudgeDealStatus(thirdResultObject, dbDeathEntity).invokeDeath(); + if (judgeDealStatus.isStop()) { + continue; + } + + DataSyncRecordDeathEntity entity = new DataSyncRecordDeathEntity(); + if (dbDeathEntity != null && StringUtils.isNotBlank(dbDeathEntity.getId())) { + entity.setId(dbDeathEntity.getId()); + } + entity.setCustomerId(dbResi.getCustomerId()); + entity.setAgencyId(dbResi.getAgencyId()); + entity.setPids(dbResi.getPids()); + entity.setGridId(dbResi.getGridId()); + entity.setName(dbResi.getName()); + entity.setIdCard(dbResi.getIdCard()); + entity.setIcResiUserId(dbResi.getUserId()); + //死亡未获取到数据 + if (thirdResultObject != null) { + entity.setAge(thirdResultObject.getString("AGE")); + entity.setAddress(thirdResultObject.getString("FAMILY_ADD")); + entity.setDeathDate(thirdResultObject.getString("DEATH_DATE")); + entity.setCremationTime(thirdResultObject.getString("CREMATION_TIME")); + entity.setMz(thirdResultObject.getString("FAMILY_ADD")); + entity.setOrganName(thirdResultObject.getString("CREATE_ORGAN_NAME")); + entity.setNation(thirdResultObject.getString("NATION")); + entity.setThirdRecordId(thirdResultObject.getString("RECORD_ID")); + } - DataSyncRecordDeathEntity entity = new DataSyncRecordDeathEntity(); - entity.setId(dbDeathEntity.getId()); - entity.setCustomerId(dbResi.getCustomerId()); - entity.setAgencyId(dbResi.getAgencyId()); - entity.setPids(dbResi.getPids()); - entity.setGridId(dbResi.getGridId()); - entity.setName(dbResi.getName()); - entity.setIdCard(dbResi.getIdCard()); - entity.setIcResiUserId(dbResi.getUserId()); - - entity.setAge(thirdResultObject.getString("AGE")); - entity.setAddress(thirdResultObject.getString("FAMILY_ADD")); - entity.setDeathDate(thirdResultObject.getString("DEATH_DATE")); - entity.setCremationTime(thirdResultObject.getString("CREMATION_TIME")); - entity.setMz(thirdResultObject.getString("FAMILY_ADD")); - entity.setOrganName(thirdResultObject.getString("CREATE_ORGAN_NAME")); - entity.setNation(thirdResultObject.getString("NATION")); - entity.setThirdRecordId(thirdResultObject.getString("RECORD_ID")); - entity.setDealStatus(NumConstant.ZERO); - entity.setDealResult(StrConstant.EPMETY_STR); - if (judgeDealStatus.isNeedSetStatus) { - entity.setDealResult(judgeDealStatus.dealResult); - entity.setDealStatus(judgeDealStatus.dealStatus); + entity.setDealStatus(NumConstant.ZERO); + entity.setDealResult(StrConstant.EPMETY_STR); + if (judgeDealStatus.isNeedSetStatus) { + entity.setDealResult(judgeDealStatus.dealResult); + entity.setDealStatus(judgeDealStatus.dealStatus); + } + entity.setUpdatedTime(new Date()); + list.add(entity); } - list.add(entity); - } - if (list.size()==NumConstant.ZERO){ - return; + if (list.size() == NumConstant.ZERO) { + return; + } + dataSyncRecordDeathService.saveOrUpdateBatch(list, NumConstant.TWO_HUNDRED); + } catch (Exception e) { + log.error("siwang exception", e); } - dataSyncRecordDeathService.saveOrUpdateBatch(list,NumConstant.TWO_HUNDRED); } /** @@ -295,13 +305,13 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl getNatUserInfoFromDb(DataSyncTaskParam formDTO, DataSyncEnum anEnum, int pageNo, int pageSize) { + private List getNatUserInfoFromDb(DataSyncTaskParam formDTO, int pageNo, int pageSize) { //根据 组织 分页获取 居民数据 PageInfo pageInfo = PageHelper.startPage(pageNo, pageSize, false) .doSelectPageInfo(() -> baseDao.getIdCardsByScope(formDTO)); List dbResiList; dbResiList = pageInfo.getList(); - //如果传了身份证号 则按照身份证号查询 并同步记录, userId如果为空则是 手动录入的 此人没有录入居民库 但是也可以同步 + /* //如果传了身份证号 则按照身份证号查询 并同步记录, userId如果为空则是 手动录入的 此人没有录入居民库 但是也可以同步 if (CollectionUtils.isNotEmpty(formDTO.getIdCards()) && DataSyncEnum.HE_SUAN.getCode().equals(anEnum.getCode())) { List collect = formDTO.getIdCards().stream().map(id -> { NatUserInfoResultDTO e = new NatUserInfoResultDTO(); @@ -314,95 +324,112 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl u.getIdCard().equals(c.getIdCard())).forEach(u -> c.setUserId(u.getUserId())); } dbResiList = collect; - } + }*/ return dbResiList; } private void canJi(List resiList) { - List list = new ArrayList<>(); - for (NatUserInfoResultDTO dbResi : resiList) { - YtDataSyncResDTO thirdResult = YtHsResUtils.canji(dbResi.getIdCard(), dbResi.getName()); - if (200 != thirdResult.getCode()) { - log.warn("canJi 调用蓝图接口失败了 继续处理下一个人"); - continue; - } - String thirdResultData = thirdResult.getData(); - JSONObject thirdResultObject = JSON.parseObject(thirdResultData); - - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(DataSyncRecordDisabilityEntity::getIdCard, dbResi.getIdCard()); - //获取数据库里的记录 - DataSyncRecordDisabilityDTO dbDisablityEntity = dataSyncRecordDisabilityService.selectOne(queryWrapper); - + try { + List list = new ArrayList<>(); + for (NatUserInfoResultDTO dbResi : resiList) { + YtDataSyncResDTO thirdResult = YtHsResUtils.canji(dbResi.getIdCard(), dbResi.getName()); + if (200 != thirdResult.getCode()) { + log.warn("canJi 调用蓝图接口失败了 继续处理下一个人"); + continue; + } + String thirdResultData = thirdResult.getData(); + JSONObject thirdResultObject = JSON.parseObject(thirdResultData); - DataSyncRecordDisabilityEntity entity = new DataSyncRecordDisabilityEntity(); - entity.setId(dbDisablityEntity.getId()); - //居民库里 是否是残疾 - String categoryColumn = dbResi.getCategoryColumn(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(DataSyncRecordDisabilityEntity::getIdCard, dbResi.getIdCard()); + //获取数据库里的记录 + DataSyncRecordDisabilityDTO dbDisablityEntity = dataSyncRecordDisabilityService.selectOne(queryWrapper); - JudgeDealStatus judgeDealStatus = null; - int disabilityStatus = 0; - //居民是残疾 - if (NumConstant.ONE_STR.equals(categoryColumn)) { - // 第三方返回了该人的 残疾记录 说明和居民库的状态一致 只需要处理 同步记录中的数据即可 - if (thirdResultObject != null) { - //todo 联调时看一下 为什么db == null 总是true - judgeDealStatus = new JudgeDealStatus(dbDisablityEntity).invoke(); - if (judgeDealStatus.isStop()) { - continue; + DataSyncRecordDisabilityEntity entity = new DataSyncRecordDisabilityEntity(); + if (dbDisablityEntity != null && StringUtils.isNotBlank(dbDisablityEntity.getId())) { + entity.setId(dbDisablityEntity.getId()); + } + //居民库里 是否是残疾 + String categoryColumn = dbResi.getCategoryColumn(); + + + JudgeDealStatus judgeDealStatus = null; + int disabilityStatus = 0; + //居民是残疾 + if (NumConstant.ONE_STR.equals(categoryColumn)) { + // 第三方返回了该人的 残疾记录 说明和居民库的状态一致 只需要处理 同步记录中的数据即可 + if (thirdResultObject != null) { + //todo 联调时看一下 为什么db == null 总是true + judgeDealStatus = new JudgeDealStatus(dbDisablityEntity).invoke(); + if (judgeDealStatus.isStop()) { + continue; + } + disabilityStatus = 1; + } else { + //没有返回该人是残疾的数据 说明需要处理居民库的数据 + judgeDealStatus = new JudgeDealStatus(dbDisablityEntity).notSame(); + disabilityStatus = 0; } - disabilityStatus = 1; } else { - //没有返回该人是残疾的数据 说明需要处理居民库的数据 - judgeDealStatus = new JudgeDealStatus(dbDisablityEntity).notSame(); - disabilityStatus = 0; + //居民不是残疾 + + // 第三方没有返回了该人的 残疾记录 说明和居民库的状态一致 只需要处理 同步记录中的数据即可 + if (thirdResultObject == null) { + //todo 联调时看一下 为什么db == null 总是true + judgeDealStatus = new JudgeDealStatus(dbDisablityEntity).invoke(); + if (judgeDealStatus.isStop()) { + continue; + } + disabilityStatus = 0; + } else { + //蓝图返回该人是残疾的数据 说明需要处理居民库的数据 + judgeDealStatus = new JudgeDealStatus(dbDisablityEntity).notSame(); + disabilityStatus = 1; + } } - } else { - //居民不是残疾 - - // 第三方没有返回了该人的 残疾记录 说明和居民库的状态一致 只需要处理 同步记录中的数据即可 - if (thirdResultObject == null) { - //todo 联调时看一下 为什么db == null 总是true - judgeDealStatus = new JudgeDealStatus(dbDisablityEntity).invoke(); - if (judgeDealStatus.isStop()) { - continue; + + entity.setCustomerId(dbResi.getCustomerId()); + entity.setAgencyId(dbResi.getAgencyId()); + entity.setPids(dbResi.getPids()); + entity.setGridId(dbResi.getGridId()); + entity.setName(dbResi.getName()); + entity.setIdCard(dbResi.getIdCard()); + entity.setIcResiUserId(dbResi.getUserId()); + if (thirdResultObject != null){ + entity.setMobile(thirdResultObject.getString("phoneNo")); + entity.setCardNum(thirdResultObject.getString("cardNum")); + entity.setCjzk(thirdResultObject.getString("idtLevelName")); + entity.setCjlb(thirdResultObject.getString("idtKindName")); + entity.setEduLevel(thirdResultObject.getString("eduLevelName")); + entity.setMaritalStatusName(thirdResultObject.getString("marriagerName")); + entity.setGuardian(thirdResultObject.getString("guardian")); + entity.setGuardianPhone(thirdResultObject.getString("guardianPhone")); + entity.setMzCn(thirdResultObject.getString("raceName")); + String genderName = thirdResultObject.getString("genderName"); + if (GenderEnum.MAN.getName().equals(genderName)){ + entity.setGender(NumConstant.ONE); + }else { + entity.setGender(NumConstant.TWO); } - disabilityStatus = 0; - } else { - //蓝图返回该人是残疾的数据 说明需要处理居民库的数据 - judgeDealStatus = new JudgeDealStatus(dbDisablityEntity).notSame(); - disabilityStatus = 1; + entity.setResidentAdd(thirdResultObject.getString("residentAdd")); + entity.setNowAdd(thirdResultObject.getString("nowAdd")); } - } - entity.setCustomerId(dbResi.getCustomerId()); - entity.setAgencyId(dbResi.getAgencyId()); - entity.setPids(dbResi.getPids()); - entity.setGridId(dbResi.getGridId()); - entity.setName(dbResi.getName()); - entity.setIdCard(thirdResultObject.getString("citizenId")); - entity.setMobile(thirdResultObject.getString("phoneNo")); - entity.setIcResiUserId(dbResi.getUserId()); - entity.setCardNum(thirdResultObject.getString("cardNum")); - - entity.setCjzk(thirdResultObject.getString("idtLevelName")); - entity.setCjlb(thirdResultObject.getString("idtKindName")); - - entity.setEduLevel(thirdResultObject.getString("eduLevelName")); - entity.setMaritalStatus(thirdResultObject.getString("marriagerName")); - entity.setGuardian(thirdResultObject.getString("guardian")); - entity.setGuardianPhone(thirdResultObject.getString("guardianPhone")); - entity.setDealStatus(NumConstant.ZERO); - entity.setDisabilityStatus(disabilityStatus); - entity.setDealResult(StrConstant.EPMETY_STR); - if (judgeDealStatus.isNeedSetStatus) { - entity.setDealResult(judgeDealStatus.getDealResult()); - entity.setDealStatus(judgeDealStatus.getDealStatus()); + entity.setDealStatus(NumConstant.ZERO); + entity.setDisabilityStatus(disabilityStatus); + entity.setDealResult(StrConstant.EPMETY_STR); + if (judgeDealStatus.isNeedSetStatus) { + entity.setDealResult(judgeDealStatus.getDealResult()); + entity.setDealStatus(judgeDealStatus.getDealStatus()); + } + entity.setUpdatedTime(new Date()); + list.add(entity); } - list.add(entity); + dataSyncRecordDisabilityService.saveOrUpdateBatch(list, NumConstant.TWO_HUNDRED); + } catch (Exception e) { + log.error("canJi exception", e); } - dataSyncRecordDisabilityService.saveOrUpdateBatch(list, NumConstant.TWO_HUNDRED); } @@ -414,59 +441,68 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl idCards, String customerId) { - List entities = new ArrayList<>(); - idCards.forEach(idCard -> { - YtHsjcResDTO natInfoResult = YtHsResUtils.hsjc(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); - if (CollectionUtils.isNotEmpty(natInfoResult.getData())) { - natInfoResult.getData().forEach(natInfo -> { - IcNatEntity e = new IcNatEntity(); - e.setCustomerId(customerId); - e.setIsResiUser(StringUtils.isBlank(idCard.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR); - e.setUserId(idCard.getUserId()); - e.setUserType("sync"); - e.setName(StringUtils.isNotBlank(natInfo.getName()) ? natInfo.getName() : ""); - e.setMobile(StringUtils.isNotBlank(natInfo.getTelephone()) ? natInfo.getTelephone() : ""); - e.setIdCard(StringUtils.isNotBlank(natInfo.getCard_no()) ? natInfo.getCard_no() : ""); - e.setNatTime(DateUtils.parseDate(natInfo.getTest_time(), DateUtils.DATE_TIME_PATTERN)); - e.setNatResult(natInfo.getSample_result_pcr()); - e.setNatAddress(natInfo.getSampling_org_pcr()); - e.setAgencyId(idCard.getAgencyId()); - e.setPids(idCard.getPids()); - e.setAttachmentType(""); - e.setAttachmentUrl(""); - entities.add(e); - }); - } - }); - if (CollectionUtils.isNotEmpty(entities)) { - List existNatInfos = icNatDao.getExistNatInfo(entities); - entities.forEach(e -> existNatInfos.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> e.setExistStatus(true))); - Map> groupByStatus = entities.stream().collect(Collectors.groupingBy(IcNatEntity::getExistStatus)); - if (CollectionUtils.isNotEmpty(groupByStatus.get(false))) { - for (List icNatEntities : ListUtils.partition(groupByStatus.get(false), 500)) { - icNatService.insertBatch(icNatEntities); - } - } - //组织关系表 - List relationEntities = new ArrayList<>(); - entities.forEach(ne -> { - // 不是居民的先不加关系表吧 - if (ne.getIsResiUser().equals(NumConstant.ONE_STR)) { - IcNatRelationEntity e = new IcNatRelationEntity(); - e.setCustomerId(customerId); - e.setAgencyId(ne.getAgencyId()); - e.setPids(ne.getPids()); - e.setIcNatId(ne.getId()); - e.setUserType("sync"); - relationEntities.add(e); + @Transactional(rollbackFor = Exception.class) + public void hsjc(List idCards, String customerId) { + try { + List entities = new ArrayList<>(); + idCards.forEach(idCard -> { + YtHsjcResDTO natInfoResult = YtHsResUtils.hsjc(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); + if (CollectionUtils.isNotEmpty(natInfoResult.getData())) { + natInfoResult.getData().forEach(natInfo -> { + IcNatEntity e = new IcNatEntity(); + e.setCustomerId(customerId); + e.setIsResiUser(StringUtils.isBlank(idCard.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR); + e.setUserId(idCard.getUserId()); + e.setUserType("sync"); + e.setName(StringUtils.isNotBlank(natInfo.getName()) ? natInfo.getName() : ""); + e.setMobile(StringUtils.isNotBlank(natInfo.getTelephone()) ? natInfo.getTelephone() : ""); + e.setIdCard(StringUtils.isNotBlank(natInfo.getCard_no()) ? natInfo.getCard_no() : ""); + e.setNatTime(DateUtils.parseDate(natInfo.getTest_time(), DateUtils.DATE_TIME_PATTERN)); + String resultPcr = natInfo.getSample_result_pcr(); + //检测结果 转换 我们 0:阴性 1:阳性, 他们 :1:阳性,2:阴性 + e.setNatResult(NumConstant.ZERO_STR); + if (NumConstant.ONE_STR.equals(resultPcr)){ + e.setNatResult(NumConstant.ONE_STR); + } + e.setNatAddress(natInfo.getSampling_org_pcr()); + e.setAgencyId(idCard.getAgencyId()); + e.setPids(idCard.getPids()); + e.setAttachmentType(""); + e.setAttachmentUrl(""); + entities.add(e); + }); } }); - if (CollectionUtils.isNotEmpty(relationEntities)) { - for (List icNatRelationEntities : ListUtils.partition(relationEntities, 500)) { - icNatRelationService.insertBatch(icNatRelationEntities); + if (CollectionUtils.isNotEmpty(entities)) { + List existNatInfos = icNatDao.getExistNatInfo(entities); + entities.forEach(e -> existNatInfos.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> e.setExistStatus(true))); + Map> groupByStatus = entities.stream().collect(Collectors.groupingBy(IcNatEntity::getExistStatus)); + if (CollectionUtils.isNotEmpty(groupByStatus.get(false))) { + for (List icNatEntities : ListUtils.partition(groupByStatus.get(false), NumConstant.FIVE_HUNDRED)) { + icNatService.insertBatch(icNatEntities); + //组织关系表 + List relationEntities = new ArrayList<>(); + icNatEntities.forEach(ne -> { + // 不是居民的先不加关系表吧 + if (ne.getIsResiUser().equals(NumConstant.ONE_STR)) { + IcNatRelationEntity e = new IcNatRelationEntity(); + e.setCustomerId(customerId); + e.setAgencyId(ne.getAgencyId()); + e.setPids(ne.getPids()); + e.setIcNatId(ne.getId()); + e.setUserType("sync"); + relationEntities.add(e); + } + }); + if (CollectionUtils.isNotEmpty(relationEntities)) { + icNatRelationService.insertBatch(relationEntities); + } + } } + } + } catch (Exception e) { + log.error("hsjc exception", e); } } @@ -488,7 +524,7 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl ${categoryColumn} AS categoryColumn, diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml index 0326e8b1f5..8947f3a5e1 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml @@ -17,7 +17,11 @@ - + + + + + diff --git a/epmet-user/epmet-user-server/src/test/java/com/epmet/service/DataSyncConfigServiceTest.java b/epmet-user/epmet-user-server/src/test/java/com/epmet/service/DataSyncConfigServiceTest.java new file mode 100644 index 0000000000..a60c27d432 --- /dev/null +++ b/epmet-user/epmet-user-server/src/test/java/com/epmet/service/DataSyncConfigServiceTest.java @@ -0,0 +1,22 @@ +package com.epmet.service; + +import com.epmet.dto.form.DataSyncTaskParam; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@SpringBootTest +@RunWith(SpringRunner.class) +public class DataSyncConfigServiceTest { + @Autowired + private DataSyncConfigService dataSyncConfigService; + + @Test + public void dataSyncForYanTaiTask() { + DataSyncTaskParam param = new DataSyncTaskParam(); + dataSyncConfigService.dataSyncForYanTaiTask(param); + + } +} From 8796e5816d0072f795aaf39a1d8f3d168d68597e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 13 Oct 2022 16:54:41 +0800 Subject: [PATCH 130/249] =?UTF-8?q?=E3=80=90=E6=AD=BB=E4=BA=A1=E3=80=91?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java index 6feb825d30..d51b6b2fb6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java @@ -142,7 +142,7 @@ public class DataSyncRecordDeathServiceImpl extends BaseServiceImpl Date: Thu, 13 Oct 2022 16:56:40 +0800 Subject: [PATCH 131/249] =?UTF-8?q?=E6=94=B9=E5=AD=97=E6=AE=B5=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java | 4 ++-- .../java/com/epmet/entity/DataSyncRecordDisabilityEntity.java | 4 ++-- .../com/epmet/service/impl/DataSyncConfigServiceImpl.java | 4 ++-- .../src/main/resources/mapper/DataSyncRecordDisabilityDao.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java index 748a039549..66762c7617 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java @@ -71,12 +71,12 @@ public class DataSyncRecordDisabilityDTO implements Serializable { /** * 残疾等级(状况) */ - private String cjzk; + private String cjzkCn; /** * 残疾类别 */ - private String cjlb; + private String cjlbCn; /** * 文化程度 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java index 810b153665..3ea26e8050 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java @@ -66,12 +66,12 @@ public class DataSyncRecordDisabilityEntity extends BaseEpmetEntity { /** * 残疾等级(状况) */ - private String cjzk; + private String cjzkCn; /** * 残疾类别 */ - private String cjlb; + private String cjlbCn; /** * 文化程度 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index 8515089201..991884787a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -399,8 +399,8 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl - - + + From 4f8015ff473a0cbd406eab6399a6f29a47c11281 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 13 Oct 2022 16:58:46 +0800 Subject: [PATCH 132/249] /gov/issue/issue/unresolvedlist --- .../src/main/java/com/epmet/service/impl/IssueServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 8be5461c75..63efe318c7 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1724,7 +1724,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp } //重新查询一下所有议题的来源类型, 且来源于事件的议题,赋值icEventInfo List issueIds=resultList.stream().map(i -> i.getIssueId()).collect(Collectors.toList()); - List issueEntityList=baseDao.selectBatchIds(issueIds); + List issueEntityList = CollectionUtils.isEmpty(issueIds) ? new ArrayList<>() : baseDao.selectBatchIds(issueIds); if(CollectionUtils.isNotEmpty(issueEntityList)){ Map eventMap=new HashMap<>(); // 来源于事件的 From 904fdcb04796d4caed18be0ab40120b2a71ab51d Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 13 Oct 2022 17:32:04 +0800 Subject: [PATCH 133/249] =?UTF-8?q?=E6=A0=B8=E9=85=B8=E9=87=87=E6=A0=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/dto/result/YtHscyResDTO.java | 80 +++++++++++++++++++ .../commons/tools/utils/YtHsResUtils.java | 33 +++++++- 2 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHscyResDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHscyResDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHscyResDTO.java new file mode 100644 index 0000000000..dd74313196 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHscyResDTO.java @@ -0,0 +1,80 @@ +package com.epmet.commons.tools.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + + +/** + * @Description 核算采样结果 + * @Author yzm + * @Date 2022/9/26 17:04 + */ +@NoArgsConstructor +@Data +public class YtHscyResDTO { + private int code = 200; + private String msg = "请求成功"; + /** + * 响应数据 + */ + private List data; + private int total; + + @Data + class YtHscyResDetail { + private String id; + private String name; + private String card_type; + private String card_no; + private String create_by; + /** + * 采样时间 + */ + private String create_time; + private String sys_org_code; + private String sample_tube; + private String package_id; + private String city; + private String uuid; + private String county; + private String depart_ids; + private Object depart_name; + /** + * 采样点名称 + */ + private String realname; + private String upload_time; + private Object sd_id; + private Object sd_batch; + private Object sd_operation; + private Object sd_time; + private String inserttime; + } + + /*{ + "id":"1570924677539635484", + "name":"杨XX",//姓名 + "card_type":"1",//证件类型 + "card_no":"37************0813",//证件号码 + "create_by":"370613594",//采样点账号 + "create_time":"2022-09-17 07:15:22",//采样时间 + "sys_org_code":"370613",//部门代码 + "sample_tube":"GCJ-0825-0441",//采样管号 + "package_id":"bcj00208083952",//采样包号 + "city":"烟台市",//城市 + "uuid":"6225684525062602095",// + "county":"莱山区",//区县 + "depart_ids":"未填写",//街道 + "depart_name":null,//部门名称 + "realname":"采样点327",//采样点名称 + "upload_time":"2022-09-17 07:56:45",//自增时间戳 + "sd_id":null, + "sd_batch":null, + "sd_operation":null, + "sd_time":null, + "inserttime":"2022-09-17 09:36:20"//省大数据局返还烟台入库时间 + }*/ + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java index 6ed4887e13..cb28cf5419 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java @@ -3,6 +3,7 @@ package com.epmet.commons.tools.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.epmet.commons.tools.dto.result.YtDataSyncResDTO; +import com.epmet.commons.tools.dto.result.YtHscyResDTO; import com.epmet.commons.tools.dto.result.YtHsjcResDTO; import lombok.extern.slf4j.Slf4j; @@ -28,7 +29,36 @@ public class YtHsResUtils { private static final String LIMIT = "PAGESIZE"; /** - * desc:图片同步扫描 + * desc:核酸采样查询 + * + * @return + */ + public static YtHscyResDTO hscy(String cardNo, Integer rowNum, Integer pageSize) { + try { + Map param = new HashMap<>(); + param.put(APP_KEY, APP_KEY_VALUE); + param.put(CARD_NO, cardNo); + param.put(ROW_NUM, rowNum); + param.put(PAGE_SIZE, pageSize); + log.info("hscy api param:{}", param); + //todo 核酸检测 mock数据 放开她 + //Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"hscyxxcx", param); + String mockData = "{\"id\":\"1570924677539635484\",\"name\":\"杨XX\",\"card_type\":\"1\",\"card_no\":\"370283199912010302\",\"create_by\":\"370613594\",\"create_time\":\"2022-09-17 07:15:22\",\"sys_org_code\":\"370613\",\"sample_tube\":\"GCJ-0825-0441\",\"package_id\":\"bcj00208083952\",\"city\":\"烟台市\",\"uuid\":\"6225684525062602095\",\"county\":\"莱山区\",\"depart_ids\":\"未填写\",\"depart_name\":null,\"realname\":\"采样点327\",\"upload_time\":\"2022-09-17 07:56:45\",\"sd_id\":null,\"sd_batch\":null,\"sd_operation\":null,\"sd_time\":null,\"inserttime\":\"2022-09-17 09:36:20\"}"; + Result result = new Result().ok(mockData); + log.info("hscy api result:{}", JSON.toJSONString(result)); + if (result.success()) { + return JSON.parseObject(result.getData(), YtHscyResDTO.class); + } + } catch (Exception e) { + log.error(String.format("烟台核酸检测结果查询异常cardNo:%s,异常信息:%s", cardNo, e.getMessage())); + } + YtHscyResDTO resultResult = new YtHscyResDTO(); + resultResult.setData(new ArrayList<>()); + return resultResult; + } + + /** + * desc:核酸结果查询 * * @return */ @@ -81,7 +111,6 @@ public class YtHsResUtils { //todo 放开他 //Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"mzt_hhrysj1", param); - String mockData2 = "{\"code\":200,\"data\":\"{\\\"data\\\":[{\\\"AGE\\\":\\\"73\\\",\\\"CARD_TYPE\\\":\\\"9\\\",\\\"CREATE_ORGAN_NAME\\\":\\\"菏泽市巨野县殡仪馆\\\",\\\"CREMATION_TIME\\\":\\\"2014-04-17 14:46\\\",\\\"DEAD_ID\\\":\\\"SZ-371724-2012-1006560\\\",\\\"DEATH_DATE\\\":\\\"2014-04-17\\\",\\\"FAMILY_ADD\\\":\\\"菏泽市巨野县开发区马庄村\\\",\\\"FOLK\\\":\\\"01\\\",\\\"ID_CARD\\\":\\\"1\\\",\\\"NAME\\\":\\\"郭**\\\",\\\"NATION\\\":\\\"156\\\",\\\"POPULACE\\\":\\\"3381C3014B60439FE05319003C0A0897\\\",\\\"POPULACE_NAME\\\":\\\"菏泽市巨野县开发区马庄村\\\",\\\"RECORD_ID\\\":\\\"E-371724-2012-100000000000407849\\\",\\\"RN\\\":\\\"1\\\",\\\"SEX\\\":\\\"1\\\"}],\\\"fields\\\":[\\\"RN\\\",\\\"RECORD_ID\\\",\\\"DEAD_ID\\\",\\\"NAME\\\",\\\"SEX\\\",\\\"CARD_TYPE\\\",\\\"ID_CARD\\\",\\\"BIRTHDAY\\\",\\\"AGE\\\",\\\"NATION\\\",\\\"FOLK\\\",\\\"IF_LOCAL\\\",\\\"POPULACE\\\",\\\"FAMILY_ADD\\\",\\\"WORK_NAME\\\",\\\"DEATH_DATE\\\",\\\"CREMATION_TIME\\\",\\\"CREATE_ORGAN_NAME\\\",\\\"POPULACE_NAME\\\"],\\\"total\\\":\\\"4903\\\"}\",\"message\":\"\"}"; String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":\"{\\\"code\\\":200,\\\"data\\\":\\\"{\\\\\\\"data\\\\\\\":[{\\\\\\\"AGE\\\\\\\":\\\\\\\"82\\\\\\\",\\\\\\\"BIRTHDAY\\\\\\\":\\\\\\\"1933-02-23\\\\\\\",\\\\\\\"CARD_TYPE\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"CREATE_ORGAN_NAME\\\\\\\":\\\\\\\"莱州市殡仪馆\\\\\\\",\\\\\\\"CREMATION_TIME\\\\\\\":\\\\\\\"2016-01-03 13:01\\\\\\\",\\\\\\\"DEAD_ID\\\\\\\":\\\\\\\"8abc809851ffaf1501520600555c2849\\\\\\\",\\\\\\\"DEATH_DATE\\\\\\\":\\\\\\\"2016-01-02\\\\\\\",\\\\\\\"FAMILY_ADD\\\\\\\":\\\\\\\"山东省莱州市光州西路420号\\\\\\\",\\\\\\\"FOLK\\\\\\\":\\\\\\\"01\\\\\\\",\\\\\\\"ID_CARD\\\\\\\":\\\\\\\"370625193302231929\\\\\\\",\\\\\\\"NAME\\\\\\\":\\\\\\\"陈秀芬\\\\\\\",\\\\\\\"NATION\\\\\\\":\\\\\\\"156\\\\\\\",\\\\\\\"POPULACE\\\\\\\":\\\\\\\"3381C300B4B9439FE05319003C0A0897\\\\\\\",\\\\\\\"POPULACE_NAME\\\\\\\":\\\\\\\"烟台市莱州市文昌路街道\\\\\\\",\\\\\\\"RECORD_ID\\\\\\\":\\\\\\\"8abc809851ffaf1501520600694e2877\\\\\\\",\\\\\\\"RN\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"SEX\\\\\\\":\\\\\\\"2\\\\\\\"}],\\\\\\\"fields\\\\\\\":[\\\\\\\"RN\\\\\\\",\\\\\\\"RECORD_ID\\\\\\\",\\\\\\\"DEAD_ID\\\\\\\",\\\\\\\"NAME\\\\\\\",\\\\\\\"SEX\\\\\\\",\\\\\\\"CARD_TYPE\\\\\\\",\\\\\\\"ID_CARD\\\\\\\",\\\\\\\"BIRTHDAY\\\\\\\",\\\\\\\"AGE\\\\\\\",\\\\\\\"NATION\\\\\\\",\\\\\\\"FOLK\\\\\\\",\\\\\\\"IF_LOCAL\\\\\\\",\\\\\\\"POPULACE\\\\\\\",\\\\\\\"FAMILY_ADD\\\\\\\",\\\\\\\"WORK_NAME\\\\\\\",\\\\\\\"DEATH_DATE\\\\\\\",\\\\\\\"CREMATION_TIME\\\\\\\",\\\\\\\"CREATE_ORGAN_NAME\\\\\\\",\\\\\\\"POPULACE_NAME\\\\\\\"],\\\\\\\"total\\\\\\\":\\\\\\\"1\\\\\\\"}\\\",\\\"message\\\":\\\"\\\"}\",\"total\":0}"; Result result = new Result().ok(mockData); log.info("siWang api result:{}", JSON.toJSONString(result)); From cb315f9d289ee5ff8650f684c5a3ef9714bdfdb2 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 14 Oct 2022 08:52:33 +0800 Subject: [PATCH 134/249] =?UTF-8?q?=E6=9A=82=E6=8F=90=E4=B8=80=E6=B3=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/DataSyncRecordDisabilityDTO.java | 1 + .../DataSyncRecordDisabilityController.java | 18 +++++- .../dao/DataSyncRecordDisabilityDao.java | 2 + .../DataSyncRecordDisabilityEntity.java | 7 +++ .../excel/DataSyncRecordDisabilityExcel.java | 8 +-- .../DataSyncRecordDisabilityService.java | 21 +++++++ .../DataSyncRecordDisabilityServiceImpl.java | 58 +++++++++++++++++++ .../mapper/DataSyncRecordDisabilityDao.xml | 55 ++++++++++++++++++ 8 files changed, 164 insertions(+), 6 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java index 66762c7617..517a6bf26d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java @@ -107,6 +107,7 @@ public class DataSyncRecordDisabilityDTO implements Serializable { * 现居住地址 */ private String nowAdd; + private String address; /** * 监护人 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java index 4685545676..b9e8cd3c15 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java @@ -74,6 +74,14 @@ public class DataSyncRecordDisabilityController { return new Result(); } + /** + * Desc: 导出 + * @param tokenDto + * @param formDTO + * @param response + * @author zxc + * @date 2022/10/13 16:17 + */ @PostMapping("export") public void export(@LoginUser TokenDto tokenDto, @RequestBody DataSyncRecordDisabilityFormDTO formDTO, HttpServletResponse response) throws IOException { formDTO.setCustomerId(tokenDto.getCustomerId()); @@ -81,9 +89,15 @@ public class DataSyncRecordDisabilityController { dataSyncRecordDisabilityService.export(formDTO,response); } + /** + * Desc: 批量更新 + * @param ids + * @author zxc + * @date 2022/10/13 16:18 + */ @PostMapping("batchUpdate") - public Result batchUpdate(){ - + public Result batchUpdate(@RequestBody String[] ids,@LoginUser TokenDto tokenDto){ + dataSyncRecordDisabilityService.batchUpdate(ids,tokenDto.getCustomerId()); return new Result(); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java index 8f7d1f4713..c920bf67b1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java @@ -20,4 +20,6 @@ public interface DataSyncRecordDisabilityDao extends BaseDao list); List list(DataSyncRecordDisabilityFormDTO formDTO); + + void batchUpdateResiDisability(List entities); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java index 3ea26e8050..b09103c8d7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java @@ -1,5 +1,6 @@ package com.epmet.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; @@ -68,11 +69,17 @@ public class DataSyncRecordDisabilityEntity extends BaseEpmetEntity { */ private String cjzkCn; + @TableField(exist = false) + private String cjzk; + /** * 残疾类别 */ private String cjlbCn; + @TableField(exist = false) + private String cjlb; + /** * 文化程度 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java index e7a52a2b40..9b4d338451 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java @@ -26,11 +26,11 @@ public class DataSyncRecordDisabilityExcel { @ExcelProperty(value = "性别") @ColumnWidth(20) - private String gender; + private Integer gender; @ExcelProperty(value = "民族") @ColumnWidth(20) - private String mz; + private String mzCn; @ExcelProperty(value = "家庭住址") @ColumnWidth(20) @@ -38,11 +38,11 @@ public class DataSyncRecordDisabilityExcel { @ExcelProperty(value = "残疾类别") @ColumnWidth(20) - private String cjlb; + private String cjlbCn; @ExcelProperty(value = "残疾等级") @ColumnWidth(20) - private String cjzk; + private String cjzkCn; @ExcelProperty(value = "监护人") @ColumnWidth(20) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java index 99ea18d578..3c1d294b05 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java @@ -82,7 +82,28 @@ public interface DataSyncRecordDisabilityService extends BaseService queryWrapper); + /** + * Desc: 列表 + * @param formDTO + * @author zxc + * @date 2022/10/13 16:17 + */ PageData list(DataSyncRecordDisabilityFormDTO formDTO); + /** + * Desc: 导出 + * @param formDTO + * @param response + * @author zxc + * @date 2022/10/13 16:17 + */ void export(DataSyncRecordDisabilityFormDTO formDTO, HttpServletResponse response) throws IOException; + + /** + * Desc: 批量更新 + * @param ids + * @author zxc + * @date 2022/10/13 16:18 + */ + void batchUpdate(String[] ids,String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java index a08f6c9502..939c4d37b8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java @@ -23,10 +23,14 @@ import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.dao.DataSyncRecordDisabilityDao; import com.epmet.dto.DataSyncRecordDisabilityDTO; import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.form.IcFormOptionsQueryFormDTO; import com.epmet.dto.form.dataSync.DataSyncRecordDisabilityFormDTO; import com.epmet.dto.form.dataSync.ResiInfoDTO; +import com.epmet.dto.result.FormItemResult; import com.epmet.entity.DataSyncRecordDisabilityEntity; import com.epmet.excel.DataSyncRecordDisabilityExcel; +import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.DataSyncRecordDisabilityService; import com.epmet.service.IcResiUserService; import com.github.pagehelper.PageHelper; @@ -55,6 +59,8 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl page(Map params) { @@ -171,4 +177,56 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl all = Arrays.asList(ids); + List entities = baseDao.selectBatchIds(all); + IcFormOptionsQueryFormDTO formDTO = new IcFormOptionsQueryFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setFormCode("resi_base_info"); + formDTO.setColumnName("CJZK"); + Result> cjzkOptionsMap = operCustomizeOpenFeignClient.getOptionsMap(formDTO); + if (!cjzkOptionsMap.success()){ + throw new EpmetException("operCustomizeOpenFeignClient.getOptionsMap执行失败"); + } + formDTO.setColumnName("CJLB"); + Result> cjlbOptionsMap = operCustomizeOpenFeignClient.getOptionsMap(formDTO); + if (!cjlbOptionsMap.success()){ + throw new EpmetException("operCustomizeOpenFeignClient.getOptionsMap执行失败"); + } + Map cjlbMap = cjlbOptionsMap.getData(); + Map cjzkMap = cjzkOptionsMap.getData(); + entities.forEach(e -> { + cjlbMap.forEach((k,v) ->{ + if (e.getCjlbCn().equals(v)){ + e.setCjlb(k); + } + }); + cjzkMap.forEach((k,v) -> { + if (e.getCjzkCn().equals(v)){ + e.setCjzk(k); + } + }); + }); + // 变更记录 + + } + + @Transactional(rollbackFor = Exception.class) + public void disposeDisabilitybatchUpdate(List entities){ + baseDao.batchUpdateResiDisability(entities); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml index e545808db8..c9ecd32591 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml @@ -36,12 +36,67 @@ + + UPDATE ic_resi_user + + + + + when id = #{item.icResiUserId} then #{item.disabilityStatus} + + + + + + + + when id = #{item.icResiUserId} then #{item.cjzh} + + + when id = #{item.icResiUserId} then '' + + + + + + + + + when id = #{item.icResiUserId} then #{item.cjzk} + + + when id = #{item.icResiUserId} then '' + + + + + + + + + when id = #{item.icResiUserId} then #{item.cjlb} + + + when id = #{item.icResiUserId} then '' + + + + + UPDATED_TIME = NOW() + WHERE + + id = #{item.icResiUserId} + + + + From 9f48bc819724d073725a2451617a2030c24666ab Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 14 Oct 2022 14:24:22 +0800 Subject: [PATCH 141/249] =?UTF-8?q?/gov/project/icEvent/myreport-detail?= =?UTF-8?q?=E4=B8=8D=E9=99=90=E5=88=B6userId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/IcEventController.java | 2 +- .../java/com/epmet/service/impl/IcEventServiceImpl.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 a139371cb2..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 @@ -413,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)); } 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 3fba9bf715..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 @@ -1682,7 +1682,13 @@ 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) { From 3684e024e198a32926ea9056d70547010f79093d Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 14 Oct 2022 14:26:28 +0800 Subject: [PATCH 142/249] emm --- .../dto/DataSyncRecordDisabilityDTO.java | 1 + .../epmet/dto/form/dataSync/ResiInfoDTO.java | 2 ++ .../DataSyncRecordDisabilityEntity.java | 3 +++ .../DataSyncRecordDisabilityServiceImpl.java | 24 +++++++++++++++++++ 4 files changed, 30 insertions(+) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java index 517a6bf26d..d6768e09da 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java @@ -97,6 +97,7 @@ public class DataSyncRecordDisabilityDTO implements Serializable { * 性别1男2女 */ private Integer gender; + private String genderCn; /** * 户籍地址 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/ResiInfoDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/ResiInfoDTO.java index b42e47618d..f9a8295e53 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/ResiInfoDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/ResiInfoDTO.java @@ -40,6 +40,7 @@ public class ResiInfoDTO implements Serializable { * 残疾等级(状况) */ private String cjzk; + private String cjzkCn; /** * 残疾类别 @@ -60,6 +61,7 @@ public class ResiInfoDTO implements Serializable { * 性别 */ private String gender; + private String genderCn; /** * 监护人 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java index 5d2987cdb3..81f8fd7a06 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java @@ -100,6 +100,9 @@ public class DataSyncRecordDisabilityEntity extends BaseEpmetEntity { */ private Integer gender; + @TableField(exist = false) + private Integer genderCn; + /** * 户籍地址 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java index 4fed49f5de..400e00f000 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java @@ -97,12 +97,36 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl Date: Fri, 14 Oct 2022 14:43:06 +0800 Subject: [PATCH 143/249] emm --- .../src/main/resources/db/migration/V0.0.76__alter_ic_nat.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.76__alter_ic_nat.sql diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.76__alter_ic_nat.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.76__alter_ic_nat.sql new file mode 100644 index 0000000000..4c58646746 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.76__alter_ic_nat.sql @@ -0,0 +1,3 @@ +alter table ic_nat add COLUMN `SAMPLE_TIME` datetime COMMENT '采样时间'after ID_CARD; + +ALTER TABLE ic_nat MODIFY COLUMN NAT_TIME datetime COMMENT '检测时间,精确到分钟'; \ No newline at end of file From 858daf7b12bf1890ddf412c289c2bf34cb2565e9 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 14 Oct 2022 16:26:27 +0800 Subject: [PATCH 144/249] user --- .../tools/exception/EpmetErrorCode.java | 4 +++ .../src/main/java/com/epmet/dto/IcNatDTO.java | 6 +++++ .../com/epmet/dto/form/AddIcNatFormDTO.java | 7 ++++- .../com/epmet/dto/form/MyNatListFormDTO.java | 6 +++++ .../epmet/dto/result/NatListResultDTO.java | 5 ++++ .../DataSyncRecordDisabilityController.java | 2 ++ .../src/main/java/com/epmet/dao/IcNatDao.java | 4 ++- .../java/com/epmet/entity/IcNatEntity.java | 5 ++++ .../excel/data/IcNatImportExcelData.java | 7 +++-- .../handler/IcNatExcelImportListener.java | 14 +++++++++- .../epmet/service/impl/IcNatServiceImpl.java | 25 +++++++++++++++--- .../db/migration/V0.0.76__alter_ic_nat.sql | 6 ++++- .../src/main/resources/excel/ic_nat.xlsx | Bin 9220 -> 9203 bytes .../src/main/resources/mapper/IcNatDao.xml | 22 ++++++++++++++- 14 files changed, 103 insertions(+), 10 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 64688c8990..ec9ee8c209 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -263,6 +263,10 @@ public enum EpmetErrorCode { UNIT_EXIST_HOUSES_ERROR(8928,"单元下存在房屋,不可修改单元数"), IC_VACCINE(8929,"已存在相同记录,请去修改原有记录"), NOT_MATCH_IC_USER_ERROR(8930,"请联系社区工作人员"), + NAT_TIME_IS_NULL_ERROR(8931,"检测时间不能为空"), + NAT_RESULT_IS_NULL_ERROR(8932,"检测结果不能为空"), + SAMPLE_TIME_IS_NULL_ERROR(8933,"采样时间不能为空"), + SAMPLE_TIME_AND_RESULT_IS_NULL_ERROR(8934,"检测时间或结果不能为空"), MISMATCH(10086,"人员与房屋信息不匹配,请与工作人员联系。"), diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java index dbd32f4463..66c9828dfd 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatDTO.java @@ -67,6 +67,12 @@ public class IcNatDTO implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date natTime; + /** + * 采样时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date sampleTime; + /** * 检测结果(0:阴性 1:阳性) */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java index 258f28c66b..1d7ba24673 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AddIcNatFormDTO.java @@ -61,9 +61,14 @@ public class AddIcNatFormDTO implements Serializable { /** * 检测时间 */ - @NotNull(message = "检测时间不能为空", groups = Nat.class) +// @NotNull(message = "检测时间不能为空", groups = Nat.class) @JsonFormat(pattern="yyyy-MM-dd HH:mm") private Date natTime; + +// @NotNull(message = "采样时间不能为空", groups = Nat.class) + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private Date sampleTime; + /** * 检测结果 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java index 0272a30799..88f8359222 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/MyNatListFormDTO.java @@ -51,6 +51,12 @@ public class MyNatListFormDTO extends PageFormDTO { */ private String endTime; + /** + * 采样开始/结束时间yyyy-MM-dd HH:mm + */ + private String sampleStartTime; + private String sampleEndTime; + /** * 核酸记录Id */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java index cbeb66e482..43f9582b8c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java @@ -71,6 +71,11 @@ public class NatListResultDTO implements Serializable { @ExcelProperty(value = "检测时间",order = 4) private Date natTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + @ColumnWidth(25) + @ExcelProperty(value = "采样时间",order = 4) + private Date sampleTime; + /** * 检测结果 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java index 55a2fe580a..d890ff812c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java @@ -1,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -35,6 +36,7 @@ public class DataSyncRecordDisabilityController { private DataSyncRecordDisabilityService dataSyncRecordDisabilityService; @PostMapping("page") + @MaskResponse(fieldNames = { "mobile", "idCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) public Result> page(@LoginUser TokenDto tokenDto,@RequestBody DataSyncRecordDisabilityFormDTO formDTO){ formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java index 3507473187..b2419b09f5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java @@ -49,7 +49,9 @@ public interface IcNatDao extends BaseDao { * @Author sun * @Description 按条件查询业务数据 **/ - IcNatDTO getNatDTO(@Param("customerId") String customerId, @Param("icNatId") String icNatId, @Param("idCard") String idCard, @Param("natTime") String natTime, @Param("natResult") String natResult); + IcNatDTO getNatDTO(@Param("customerId") String customerId, @Param("icNatId") String icNatId, + @Param("idCard") String idCard, @Param("natTime") String natTime, + @Param("natResult") String natResult, @Param("sampleTime") String sampleTime); /** * desc:根据客户id 更新是否居民状态 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java index 50a9eed8e7..7cbe8cdd66 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatEntity.java @@ -64,6 +64,11 @@ public class IcNatEntity extends BaseEpmetEntity { */ private Date natTime; + /** + * 采样时间 + */ + private Date sampleTime; + /** * 检测结果(0:阴性 1:阳性) */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java index 052b0cb1eb..ae0cb210d7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java @@ -29,14 +29,17 @@ public class IcNatImportExcelData { @Length(max = 18, message = "身份证号长度不正确,应小于18位") private String idCard; - @NotNull(message = "检测时间为必填项") +// @NotNull(message = "检测时间为必填项") @ExcelProperty("检测时间") private Date natTime; + @ExcelProperty("采样时间") + private Date sampleTime; + @ExcelProperty("检测地点") private String natAddress; - @NotBlank(message = "检测结果为必填项") +// @NotBlank(message = "检测结果为必填项") @ExcelProperty("检测结果") private String natResultZh; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java index 1f09a5142f..59f5eaab7b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java @@ -2,6 +2,8 @@ package com.epmet.excel.handler; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.read.listener.ReadListener; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.utils.ConvertUtils; @@ -66,6 +68,16 @@ public class IcNatExcelImportListener implements ReadListener imp //@Autowired //private UserService userService; + public void disposeIsNull(AddIcNatFormDTO formDTO){ + /** + * 根据产品要求 不同情况提示不同错误 + * 1.采样时间为空,检测时间和结果有一个为空就报错 + * 2.采样时间不为空,检测时间和结果可以为空【如果不为空 检测时间和结果都不为空】 + */ + if ((null == formDTO.getSampleTime() && null == formDTO.getNatTime() || org.apache.commons.lang3.StringUtils.isBlank(formDTO.getNatResult()))){ + throw new EpmetException(EpmetErrorCode.SAMPLE_TIME_AND_RESULT_IS_NULL_ERROR.getCode()); + } + if(null != formDTO.getSampleTime() && org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getNatResult()) && null == formDTO.getNatTime()){ + throw new EpmetException(EpmetErrorCode.NAT_TIME_IS_NULL_ERROR.getCode()); + } + if (null != formDTO.getSampleTime() && org.apache.commons.lang3.StringUtils.isBlank(formDTO.getNatResult()) && null != formDTO.getNatTime()){ + throw new EpmetException(EpmetErrorCode.NAT_RESULT_IS_NULL_ERROR.getCode()); + } + } + /** * @Author sun * @Description 核酸检测-上报核酸记录 @@ -95,8 +112,9 @@ public class IcNatServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public void add(AddIcNatFormDTO formDTO) { + disposeIsNull(formDTO); //0.先根据身份证号和检查时间以及检测结果校验数据是否存在 - IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), null); + IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), null != formDTO.getNatTime() ? DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE) : null, null, null != formDTO.getSampleTime() ? DateUtils.format(formDTO.getSampleTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE) : null); //按身份证号核酸时间存在记录的 核酸结果相同的提示已存在相同记录核酸结果不同的提示已存在去修改【业务要求的】 if (null != icNatDTO && icNatDTO.getNatResult().equals(formDTO.getNatResult())) { throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg()); @@ -216,8 +234,9 @@ public class IcNatServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public void edit(AddIcNatFormDTO formDTO) { + disposeIsNull(formDTO); //0.先根据身份证号和检测时间以及检测结果校验除当前数据是否还存在相同数据 - IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), formDTO.getNatResult()); + IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), null != formDTO.getNatTime() ? DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE) : null, formDTO.getNatResult(), null != formDTO.getSampleTime() ? DateUtils.format(formDTO.getSampleTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE) : null); if (null != icNatDTO) { throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg()); } @@ -464,7 +483,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp errorRow.setName(e.getName()); errorRow.setMobile(e.getMobile()); errorRow.setIdCard(e.getIdCard()); - errorRow.setErrorInfo("未知系统错误"); + errorRow.setErrorInfo(exception.getMessage()); listener.getErrorRows().add(errorRow); } }); diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.76__alter_ic_nat.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.76__alter_ic_nat.sql index 4c58646746..136596160f 100644 --- a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.76__alter_ic_nat.sql +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.76__alter_ic_nat.sql @@ -1,3 +1,7 @@ alter table ic_nat add COLUMN `SAMPLE_TIME` datetime COMMENT '采样时间'after ID_CARD; -ALTER TABLE ic_nat MODIFY COLUMN NAT_TIME datetime COMMENT '检测时间,精确到分钟'; \ No newline at end of file +ALTER TABLE ic_nat MODIFY COLUMN NAT_TIME datetime COMMENT '检测时间,精确到分钟'; + +UPDATE ic_nat +SET SAMPLE_TIME = NAT_TIME, + UPDATED_TIME = NOW(); \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx index d9038bfdc4faa94007e45287efb4b4b9e34a099b..31cc19219bf74629dbeba6c13449990ad7f8208e 100644 GIT binary patch delta 5155 zcmZ8_bx;)E+x;%x9Sbb5)PgifNJ%%+-QCU7u}Zh#lF}{GER8fsw=@a}D7rKVO1^$R zzu!CG`M%H0z5kr&K6B^ZGiT)kHFd_#ChR399X$?b2Moyp+aj~KJ zu*YFGkL%(!1QfdL{DCy*NQ6oaa8zGpxnAF@MDEoedXXop(I)jC8iI}bY4|-JilJDn z$mM3Sf6%l!V#MKF=r*2bD4(jiJ=fOpVJzCFwAI_o41IZJyHsW&6&Fz!bscMSI1Ho+ zRP{c99Glg^JBW?UY=%a-8UR(%wM}TVY}erH{#6YHn39?R({!E()=LTyt#)zGkWk6* z4b%YVwbMZHRQ~%bc5+AY(E?-zXkEJ(#@@nd1181kuU54zY#J~lM3 zxYzl8U$m9;Gzgod=2zjnA&Y2HU2MZuC6TfxOjI>5b4PfPu93>Qt%H$qL+lui7L_FL zG-DSTtqLRCigFs*1+JVtqe8C!IDg4+r)0xb%;QM;%CT12jrLfA_DG?RX}Re6x~3PP zt)7ksLhxhA;xQXmq9V}&0AXB2D252!^JN>(jm1+k5AqU)nDWE&8iq2_1K|2o$}t}C za_*5g=KYpA3#ZeIdBnQ;lyPcn>MM9C72RNR!s&Xro9A>Jv%SWR%#1A_ywhG{SYC!a087BLqpSf%));w7Fy zQ$Fx%CLKmuiZ5vyK)TBFm8(nw?(co%?0cKwOY1@_UzdJi5x=LW@az+1VDb6VJ+_{3 zZ~I%dEj%BmgZhDaQ9SOHVBQ3wjRl&0K;KU}Z(1#y*y%~Qa(l**W4yROoX$IzgWr^S zU}xa;gmtP#+?VX!dgb#Y!~4s!>FF;$-qF~`%Es5JAeg>3`$Q(y_;V6-znDv7BjfA( zf=#OHj=bu`>ha z^3kWFATxQSvUwKHBF{&MWud9O*qTb4c_D6M0)~Sc1-VBssY@+WBv!S;*Vr+UQa$CV z^>|Nu0WX#i|6v2V`34p$4+U*y?u~fan0FO}$teLn$xF-4Y9o!l@b>*qcNQi8;o6k` zl+xMPGPFyHP@uze3+rnB)aw zU;sXHJ&CEMNlNcKgePaOo(!xJ%e)Id`<}o3qvqE9KvYZm@$UW%^=ol+` zX+aI1=mJJg$P9%tuMnVpg<<|V{R|`!H2FZ3NXH{sb7ANV8ocsF-vUz*Ay2LZ7;f&* zv5{VE(a(D^$%{|TjN@rUmau0p8UIlyyua!M_*b0(>BPiH4jdLNxE?pQf%{)zMGF8R z{EG&;^ZCJo-5vaRgFM`q%s+c=EK|Z68y{b3H%eh3*>pb{xr!y(lXJ`wV!i>Qw=t!$ zO+aPR85A)C;?P_cr##{aKnpx(I@T8We4)l4>gbk>-4@_b-My*@e2MF*YxypUT!m6+ z)Bx+q#l6IL2KblI>be?bbfazuZ28gax0vBb{Wy zN*WsKKfa8OciyH-(XBQG!@v!VJ^LwG%Mh@u1$-|CJ{>vE>#~=(66!tA?Hp~kaq@~& zwDsiCcQ39X{C4_@SVyhJ%|L~E#kB5^%B#0uH;TNt9}2zKAdmHyBN`DwdR!DN_X-XZ z$cZVHzS`;dZjGfE<6AlV4I%+06+ijdo>J3Q&vMG94C_zHg-}hltCV&3EL}@6*q34G zC>gc2!(+W%+QoUdXJuxNZ|WJHnfh@`YwfNBu|zuU!mje1w2pVXiNps;=9FgbsBOOduTqP=WIemWDXOmyaIrenrSF9uB%)v2g-jLSn z{E5IDK{;S28q2EzHNPFb!(CMt&NaTup$FnG|3L#qJjB20DPQzWw%!NW6C}VVe?dVOKprXu| zD}p|Dl~HsxSq9;qxY^o;D8R(cn~&(5yaXjreay3k%lRGCxi-w=3iw;lXCoVgL&A39 zze&U?iD~UIs+mhQK7>jifKgcWLqBk0dr_BZRJR^Y(vg+VVA`|h>%%;A4EO72Ay?^y z9)6Toym+ov1_CCw6+rlYNSUk9&k$TXWXK=Fy}hNR@iAKS7(?e58ISys){V6wA_f{3 zm3mA_tMFt)t$GB7+fd|eq8&lV+SctcU84oX3>NGKCwVWnOcpR?~9* zv8l;^rZvj+V+rT=FVn`hpXahnY_MWC0c6&TOe#*Jwp{to$wgE~s~my?wZUfaq+GPO z%gk0Bb8fOoZJ}k|mgv$yiC4R$ra@_6E}|H?`CVWh%F2rmd+S$OZrAcbZ}Ic*(J!Sh ziRY08jIj>@q7Y4|t!r^!FcnMUfplqf<`d&+SE@nu5Ah1$e8tP=swS}%VdVRTL43== znzSIUcQh`!L3{$xHL6CP{g`+-e3tR3QzR%AG%hZh^QYg>ahq|k#VG4(W9W=?|K3z~ z5V`+5$7$}RsYIO-Et+Zv<&P?7rIjrNm$DU-0FwkV4+*q|Gt* z<;5#^I1{M zp9>8ME3Dt*go$zT)M6wC2dcMCCuxInWSYj5#9{p^pIR-h#c2g2)}4mZ*IwENexlC0 zvcbnN_- zeooCt|xO*Mqg^loJ`edq?*JW^KCeq*7i|Xp;LJC`o z^H0I8kec5nZ4VR|n1wLkJ*{|8-=*m$iCgz*>~tGS$kVm4NnJTwqIr&TfZj7-`Oss8Fp_nE+wE5+;#+yIgiE9#9U_l zk~~HK&cksBAB>2}kN^qJNiC&fCbRaZHkQbLnHfl{3_cwKP7nS*+x;K1$ zxUKu~#IwAu&_^~Lx>BL>Wwc=FL7I5<^;W`ODOQo*_Wcpkmh#vZZ9Zsfd@^YFH~0O8 zv=n{cBWhgwd7^!(35jO3mGs++gc$tc>_JRQtC@;qQNJoj^y5l*`_){v>?e}_ztTvt zyI)hB!Cwnwm+MK{Zx1}AQ`-z}Csplq8d(j7V0Zi!{7JwT zFzeNKdw9kI)r&1CxeRe{zStf=eVPdZ6+O4Hb=VttfW`#cjtEAbv9JdU)-pX=)p+n1 z?7Z(&5ws-OW!>Z1H)%=jleD{@d>46S%Sl?a1uwk&0}DI3-t7*A7DY@uJ8%q0MnzIB zH6j{7;~J!TSv})b?B9#-b#^_|UZLMM>iaT8L`0nL>|M!o+#s|bW-umlsyY0VQ!vz@ ze@IE~&b%X`8Ksmz>G&#+E9sb+gu|mmWbCauEvV^$mDoAl&D9+AV%Q*|0w#jS z2{ImLgE7h$O_nrHeDrBGEb>WrFo?u3Q_l z_U6!2ke;Ja?Rjl!WLqgi+6A7Jis`ID_+M{hy6TDEa)(Q5dfSM8(!D*sUfYgs4Zl2$ zaN3I%UCo|GlYStL2*k8iI0;$o+>gsqME1Ylk~yJGKlfsc@gms4WcuBZf>vend&#qA zd3CKdIVGgpV2gh;z@bdX<;Y!sD!|QY)HNen_ts+!beR-rlnV1ZHafx56g`cLkls8T z1`> z+f%Q#&OCVr1ORBz5HvLOaMwW@ikRz|UiqA!nc+)i)`afovbO-)Dq0mN(^H-!O?+my zOKk4d1#Jpy-mXS`Ghyal4M!ob`3xC#?AhbO6EJUfjZuTSa_2CxRmv978vim)$x%+fBIgkK)2G~LXL3GeyTx6#qGr*+_dH3PmcZGCcb%+ zgWcTAPsEJ|RWFirQT=3c%5$ymXc=z5E` zvz!r`EDTDrZ|fvRsQy+BSUPX8FQ+ei)ZJIW&C~|EV7@TWuPbGkkd%O!r2a;6hW|Jn zd8^!%uToT1D*WJQb7gu#_up@tP;#7yfYCmIcOA>~*A)zBuVTJH3m{JDR+?1KEQj5N zZW`Kw#nxt1i?;lh^AN&^`0}5=Q1Tbp_s^*|v`A2#o;`&5;d4WGGWfsP0JlIkdX`po z5{#)uUl?gfJB(!tbdg^rCur;9$+wEjH20(aGWFT%Dh37Ta{M@Lq0`zMvl9Abf|^q} zBaxMX>DRLCI>l_IH!qb~-!Qs;R^V946zO237nm1n7<_Y#06HpYXsNO5V@~1R5b?!e zHqMD$*NJ@U$#W1pJzv@5B{}$fEF5sAd%}cj(d!MB4Sz>o;4Lf{WD*qR z2tg4GRG_YW)YYF5bG=YqegC81n*lKh9<#6x2QkciPs+bkJF%xjqyPF!95dN%mQn8k zkVcD~r<1_|K1Yy2WPp_jJ;+nw1R@TC`2VRHBa=AYzk$zR0~PU?pydDftiJ^WK>qGO z5HKbgY!Jr3<_h7?0!FMb5uu%f5#O1FfiwtuW*+c=m<<5@lOg?6|L^d35W01d1WDS(w28$zuQj X(0_F~U?AWaw1{IC60Bv$e~|wH2aby? delta 5168 zcmZ8l2T&7AyG>|;Kg%A{KGo6VL(x0AfJY z{S_5lyiMIT<_eD!scIA{N*n%%%c$bhQIjs#!q3F+3>2BN0enU7hR*swUQ(|j>z(BH z+3niWL>7bHPxFXGNw*6}2;;c$B8KODO>#)j{1tPB2ypdHZlD59Aj9%fMN7M*$Yfks zkN_(&co!Ua5H=*{e+7HEogePU*;@7S_mi5Z?iaS+BaBK&fxLUgD0k7EcQW938Mc;- z!GfzZ!*(wE@?5wbQY+MscehuZqFIY{ znQ4SgnDhBQ4sRXrX7!u*1=kioROm?jNLgNs>&^ali|7C)iKlVjkqr zjf>@z;@GP_<`GO*iz)KwN(w~R)D0%dxSkp0(~m@a(~EBTj-}zmbwFUk2kafvX$yblLHlir|4K-xP=>l>O ze_uZ}m9o_`EZRpk$oQruZn6-j_O_&HWO{7Id53=&ODqB1?XixetTe9 z-yn^9BZ&7bfPULAT1$A(@71;H@Ax}?3{}@UGp^;T^Bs^xF7I!addee^^H zS@m(5$FR=jo?pA%Ly`*K)Q8SfySKI!>%lDU=2y)2yuV305680Gmn$C6t5RGlD1@bOd3nazmq#~w ziaMw4@#m}Rq9XTxO_()PxQdV2Xd-nz-h7MU9gCs00+B0?o5R1v@hFn#+Huh+N<5h5 z7*+)5XO$`+NWUu9c=w2SOo$g=$C17d5<4cE@~h9!MKNU8=*j7-hAM@2kR4tJqdpIV^C z*-N$CH=lpgP6!*Yzwc8l=}o-h5RB6eva7jx>@G4UIQ8hEK(+WPE1AkKH9aUxr-Q7B z{3_u|u$RuaWzqH#IljP)J*XYSMfc!QPP;O)75U-@qED3>D1}&&^6T7kA?kQY#9R?= zEhhS9i~6KH03_<-Bvv2GA|zgRbl*8W^~4*3q~L!izqsqDczihlLJXP^hn`WfPQac$ zfgRvrBF_LXXAHY0p?@si%;=Cu6dB{Fkktcw z8&Z+W&w*AlpH!y`k-R2rMwg@tr|7f|y)@XW1uYwrSo2`P2j_##_StI`8Sky_4l`=r zJyV}zkpy1^mFCJt)=fPJ1;=;2@%-Ud`%;?hape874ahsKWaL4TR zb*cityC<1eXfp>HvbIi!nIQfpkEhE{mW;fYsfhEZ`r;{|nWsyo%cHh{b-k_B6ZyuQ zE#{l!`J6W`OTVQ~I6_x0>uc1+XwjEah)a0<&FMFi<_?FSZCxfCZB8;K0#9&vI*TgO z5IeD+I<0oib<;X-b+>YGfuJY*K8xN8j_r2221&sIJ_XwlB#e)R=a+aRwoxp^s(Jn| z;4RroUftADh!B7|BF*nFtoh;-qc|hv_0<;s#dz2t2i~QH`WWn#|MUzK8nAS}hDhp9 zPtv%ACttPBYjxJ`Zcpr*2)vcO7(Yin$EFHLvA};6+mt&wJ(Ra=#S5G(3BsDRSs3k7 zAELMgX&ShZ)S0D#@v&s%k*GQddj6qBhcOo;^;7E&c=*5xVuV*nozmc|_b)^2% zzq|7qf` zR%miz?FUWCR7tqUX?Dmp!Qhbf1r4*nIypN6et|?RiSd^?caL=o zuAhjzIgaz6cBU^&y3%L`KgAUWMtDG9tdx2?`EA7kBrkF32@sA5SR%eMc4=MNW9athi z;+sJa9vDlEiyv4b4623f3&7~lw+S*ocICoZB}@pQpF)Ps1UsU_Qw8~UjJx6j7|OYM zVKR#_VEZ|dE3WR;^uM1*w&XDKKLi!9MVX7c5FM zTUh)1o!9I0O3j}+<`Z|!%Bvsb5$+(-!+wLDNGD>GyiYJ$SFtzG)$j?sNQ7`v&-w&Q zePRm0hKLZMd)elYB71gJEQwI5{348PTnE+FK|mGjzNQX})A0B()vWp|jw7JQ%V`2i z#p*xu0w9a0dh)tI3E!I}w(%+%a&M>mr&ig<9^?WC@Xuva_L_CNZGv#H)giY+rsMZh zS!I{zyXutp%-z^nj}yXV|Js*tGc>wy%(FQ!B%h#_QyB%;s9!j2?Qj7d3xb#scB*W$e`34#bu9N!*+oh)}~qU#A0@U&coDAUAj5K^iz)Q9yT~hf-If zUJj&AG9?Fjs-frgypUU^B|OEOr)JJOZM-3`K7I~|;M_*(b*VZNAh`i8fIc4esM=(2 z@(_y*bK?P&v2IEvr)92baf$XJ4 z1nj2W*Hl9TD4P{+GVCykh~U#*P9rxmS+FIl%NGQIz6fUx=&a6F;3dzT@;Kr#canw6 z-q|tFCZn|J=iwknl9eh(G{GMTaF!1U)uYsoCA|lY)^_G_VN{8YHiJ#vBsr}HSv7+_ zu)b7>9@}NGbY_kEoHhwbbQS+3PrO8|U-b}ODKQ6qNxCXflbWY8$HC1x`Xiya7OUOiB{YOGtX?cPJaI9+|RYDYj26Q3>z=T||e zh9wA{Fjg%k@IMOwP9F;&_#B9eD&^{?r4G|N5ZG?qKi`{8BpHrCr)V>Z58s=}ARORc zB9|Y5=4?L|q>CDK;MsZWytXW{B_FQ-5%#X4y$Pa=Nh8 zBacHGWrM54kCujd2czkT)Z-iz4dH!8H!l<$j~0!^=ec602W(BV;oE0}rUxxUcczui zoaN82aBD_$8IC$#mRY2-2G3!+QsmSd#G5wZ7_QCUFkBCzLS#%H0eki zU;IW%S>eXZdxMJmx}Oh8g9pc@yp`{zRv|!g%s)!7hbuFPlWwE7gd9-9Od9diR+HHH zVoCj*!efcNsv))_b%(K*M2L0gcvXu3oBhSmn`5Q5A?zDva8DLM0qpMAEYhBy9p-cL z>$vCZzTvIU{!S;h|Ji*Fka$6g>Odm3kQ007B(|%)ikFll!j${l+j#?yTlm#11ss`> zE^%d&EG~_G4Fziv2`-vwZ@1roCFxQJw@7}z2M;>VkQ`dvmsvl4XzpLo_X*an%EVb( zffAm?SECSR3NSUtlhbCb&W&LFU@($i%5UCh4srcxK&E(y(2$eXi$&JGphI!e9LOZ6 z6Rlx2;Mw4=O6B&-#np;oyh8L)#{~Iygs!ZmuOwG!kI2C`0!X^u_=(~zsVC|7;IMQi zRLzB>W(my@^w?_rL?td^%p*Ri)9?UZKxuOu-Zl+XS}|%}UpT@0q4{U0UDsCHVQW#2 zY=O0lMeSF+^x?eL^85GYuA#wSr6*mB%70|S<=1P2UbqF9yGzyA)$a!N^E*l{qNAb8 zF9LoW*Z&MVso1XzeYWWr`CGcBd(E%eb2j64xjCqc{pOg>*V}J8@wa%gBb*>sFyfpT69uMC9NKRfTwT z1C%0^RCIc!6Ajc5wDYxU3?^3*U^B9O-w||dQ^^nBlr{szXbU>&<;pO&c|##;aGkmQ zsN)gN%b+zeU8M|~Yrlf3(EhDw_-PnAZrQFbhz3-fJ`sL#E(QuHL9wF z1nMU*`x)sX6en8Rr^^VEF6(W8xX?Pz7O}-yE_KVRU5b9bheyk&$n)t(8UA2yHe6J{ zWoYomI<9%eF|pEC^O>s(g6UV3Cv}MUTEJBG-3lU@?)h#S+2od0w$Rkr0)3q&msZZY zGw-Q%9N&J=x`V>q>b$`FPUdrDhsU=5wY`;2g&Zomx1(zsY!gYZea)t54WGFNi&v8O zVa1S-Q{RNPSsZY`rCIMb@a01ae_D7NivQnKt~D*b!8kGtAe%i`9Um*ih*Xhg66~;3 z2gIj}@CdNove!>AYTrM>u5O&Zo49b6yzHWUi{&xklM}7!(uJS$gtREz&Ev(!SoPOp zExKg1EFPsXl;P0bAACSs1k$O)g==Y+^qP^czQ!Cmmzp-)2f`RnERTVWaS#V_`MZZ# z@)FjTj7+J^NM+WFinkrwe2*igEM1KK6#wWAFzY+`%YcV!AMOCns@$1o2` z;3N_+E4qE200nDq+RQSW0`jY0) z`gZ^UoPXv`j3ZP9LQn9I05jGH;?V*yP-14x02GXe&xV AND b.nat_time #{endTime} + + AND b.sample_time = ]]> #{sampleStartTime} + + + AND b.sample_time #{sampleEndTime} + AND b.is_resi_user = #{isResiUser} @@ -83,6 +90,7 @@ mobile mobile, id_card idCard, nat_time natTime, + sample_time sampleTime, nat_result natResult, nat_address natAddress FROM @@ -105,6 +113,12 @@ AND nat_time #{endTime} + + AND sample_time = ]]> #{sampleStartTime} + + + AND sample_time #{sampleEndTime} + ORDER BY nat_time DESC, id ASC @@ -117,6 +131,7 @@ mobile, id_card, nat_time, + sample_time, nat_result, nat_address FROM @@ -125,7 +140,12 @@ del_flag = '0' AND customer_id = #{customerId} AND id_card = #{idCard} - AND DATE_FORMAT(nat_time, '%Y-%m-%d %h:%i') = DATE_FORMAT(#{natTime}, '%Y-%m-%d %h:%i') + + AND DATE_FORMAT(nat_time, '%Y-%m-%d %h:%i') = DATE_FORMAT(#{natTime}, '%Y-%m-%d %h:%i') + + + AND DATE_FORMAT(sample_time, '%Y-%m-%d %h:%i') = DATE_FORMAT(#{sampleTime}, '%Y-%m-%d %h:%i') + AND nat_result = #{natResult} From 211bd576fe09570807491c65b176cb0d2771ad6b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 14 Oct 2022 17:09:11 +0800 Subject: [PATCH 145/249] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=8C=BA?= =?UTF-8?q?=E7=BA=A7areaCode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/AreaCodeServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java index b0f519a3ac..418b3dc251 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java @@ -833,7 +833,7 @@ public class AreaCodeServiceImpl extends BaseServiceImpl Date: Fri, 14 Oct 2022 17:35:15 +0800 Subject: [PATCH 146/249] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=9A=82=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/DataSyncTaskParam.java | 12 +++ .../impl/DataSyncConfigServiceImpl.java | 102 ++++++++++-------- .../resources/mapper/DataSyncConfigDao.xml | 23 ++-- 3 files changed, 84 insertions(+), 53 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DataSyncTaskParam.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DataSyncTaskParam.java index 563bfc1500..00134f6c45 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DataSyncTaskParam.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DataSyncTaskParam.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dto.DataSyncScopeDTO; import lombok.Data; @@ -35,4 +36,15 @@ public class DataSyncTaskParam implements Serializable { * 类别字段 */ public String categoryColumn; + + /** + * 是否同步 1:是;0:否; + */ + private String isSync = NumConstant.ZERO_STR; + + /** + * 核酸检测信息列表 点击同步时使用此字段 不使用数据配置的范围 + */ + private String agencyId = null; + private String dataCode; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index 991884787a..fc872eb582 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -8,11 +8,13 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.result.YtDataSyncResDTO; +import com.epmet.commons.tools.dto.result.YtHscyResDTO; import com.epmet.commons.tools.dto.result.YtHsjcResDTO; import com.epmet.commons.tools.enums.GenderEnum; 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.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; @@ -178,58 +180,66 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl dbResiList = null; - //设置查询数据范围 - formDTO.setOrgList(config.getScopeList()); - DataSyncEnum anEnum = DataSyncEnum.getEnum(config.getDataCode()); - - do { - switch (anEnum) { - case HE_SUAN: - //查询正常状态的居民 - dbResiList = getNatUserInfoFromDb(formDTO, pageNo, pageSize); - if (CollectionUtils.isEmpty(dbResiList)) { - break; - } - hsjc(dbResiList, config.getCustomerId()); - break; - case CAN_JI: - //查询正常状态的居民 并回显 残疾状态 - formDTO.setCategoryColumn("IS_CJ"); - dbResiList = getNatUserInfoFromDb(formDTO, pageNo, pageSize); - canJi(dbResiList); - break; - case SI_WANG: - //查询正常状态的居民 - dbResiList = getNatUserInfoFromDb(formDTO, pageNo, pageSize); - siWang(dbResiList); - break; - default: - log.warn("没有要处理的数据"); + if (StringUtils.isNotBlank(formDTO.getDataCode())){ + allConfigList.forEach(c -> { + if (c.getDataCode().equals(formDTO.getDataCode())){ + disAllData(c,formDTO); + return; } - pageNo++; - } while (false);//todo fangkaita(dbResiList != null && dbResiList.size() == pageSize); + }); + }else { + for (DataSyncConfigDTO config : allConfigList) { + //没有配置 数据拉取范围 继续下次循环 + if (CollectionUtils.isEmpty(config.getScopeList())) { + continue; + } + disAllData(config,formDTO); + } } + } + private void disAllData(DataSyncConfigDTO config,DataSyncTaskParam formDTO){ + //没传具体参数 则 按照 + int pageNo = NumConstant.ONE; + int pageSize = 1;//todo fangkaita NumConstant.ONE_THOUSAND; + //ToDo 去掉 + formDTO.setIdCards(Collections.singletonList("370283199912010302")); + List dbResiList = null; + //设置查询数据范围 + formDTO.setOrgList(config.getScopeList()); + DataSyncEnum anEnum = DataSyncEnum.getEnum(config.getDataCode()); + + do { + switch (anEnum) { + case HE_SUAN: + //查询正常状态的居民 + dbResiList = getNatUserInfoFromDb(formDTO, pageNo, pageSize); + if (CollectionUtils.isEmpty(dbResiList)) { + break; + } + hsjc(dbResiList, config.getCustomerId()); + break; + case CAN_JI: + //查询正常状态的居民 并回显 残疾状态 + formDTO.setCategoryColumn("IS_CJ"); + dbResiList = getNatUserInfoFromDb(formDTO, pageNo, pageSize); + canJi(dbResiList); + break; + case SI_WANG: + //查询正常状态的居民 + dbResiList = getNatUserInfoFromDb(formDTO, pageNo, pageSize); + siWang(dbResiList); + break; + default: + log.warn("没有要处理的数据"); + } + pageNo++; + } while (false);//todo fangkaita(dbResiList != null && dbResiList.size() == pageSize); } private void siWang(List dbResiList) { @@ -446,8 +456,9 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl entities = new ArrayList<>(); idCards.forEach(idCard -> { + YtHscyResDTO sampleResult = YtHsResUtils.hscy(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); YtHsjcResDTO natInfoResult = YtHsResUtils.hsjc(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); - if (CollectionUtils.isNotEmpty(natInfoResult.getData())) { + if ((CollectionUtils.isEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData())) || (CollectionUtils.isNotEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData()))) { natInfoResult.getData().forEach(natInfo -> { IcNatEntity e = new IcNatEntity(); e.setCustomerId(customerId); @@ -458,6 +469,7 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl - AND ( - - - GRID_ID = #{l.orgId} - PIDS LIKE CONCAT(#{l.orgIdPath},'%') - - - ) + + + AND ( + + + GRID_ID = #{l.orgId} + PIDS LIKE CONCAT(#{l.orgIdPath},'%') + + + ) + + + AND PIDS LIKE CONCAT(#{agencyId},'%') + + ORDER BY CREATED_TIME From ca56697eeb54d0b39d80709138c7ff37d9df5fe7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 14 Oct 2022 17:48:46 +0800 Subject: [PATCH 147/249] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=9A=82=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/dto/result/YtHscyResDTO.java | 2 +- .../impl/DataSyncConfigServiceImpl.java | 34 ++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHscyResDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHscyResDTO.java index dd74313196..5e404f75d9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHscyResDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/YtHscyResDTO.java @@ -23,7 +23,7 @@ public class YtHscyResDTO { private int total; @Data - class YtHscyResDetail { + public static class YtHscyResDetail { private String id; private String name; private String card_type; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index fc872eb582..469465901e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -458,7 +458,13 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl { YtHscyResDTO sampleResult = YtHsResUtils.hscy(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); YtHsjcResDTO natInfoResult = YtHsResUtils.hsjc(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); - if ((CollectionUtils.isEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData())) || (CollectionUtils.isNotEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData()))) { + Boolean aBoolean = CollectionUtils.isEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData()); + Boolean bBoolean = CollectionUtils.isNotEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData()); + /** + * 1.采样结果 和 检测结果 都不为空,以检测结果为准 + * 2.采样结果为空,检测结果不为空 + */ + if (aBoolean || bBoolean) { natInfoResult.getData().forEach(natInfo -> { IcNatEntity e = new IcNatEntity(); e.setCustomerId(customerId); @@ -484,6 +490,32 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl { + IcNatEntity e = new IcNatEntity(); + e.setCustomerId(customerId); + e.setIsResiUser(StringUtils.isBlank(idCard.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR); + e.setUserId(idCard.getUserId()); + e.setUserType("sync"); + e.setName(StringUtils.isNotBlank(sampleInfo.getName()) ? sampleInfo.getName() : ""); + e.setMobile(StringUtils.isNotBlank(sampleInfo.getTelephone()) ? sampleInfo.getTelephone() : ""); + e.setIdCard(StringUtils.isNotBlank(sampleInfo.getCard_no()) ? sampleInfo.getCard_no() : ""); + e.setNatTime(DateUtils.parseDate(sampleInfo.getTest_time(), DateUtils.DATE_TIME_PATTERN)); + e.setSampleTime(DateUtils.parseDate(sampleInfo.getSample_time(), DateUtils.DATE_TIME_PATTERN)); + String resultPcr = sampleInfo.getSample_result_pcr(); + //检测结果 转换 我们 0:阴性 1:阳性, 他们 :1:阳性,2:阴性 + e.setNatResult(NumConstant.ZERO_STR); + if (NumConstant.ONE_STR.equals(resultPcr)){ + e.setNatResult(NumConstant.ONE_STR); + } + e.setNatAddress(sampleInfo.getSampling_org_pcr()); + e.setAgencyId(idCard.getAgencyId()); + e.setPids(idCard.getPids()); + e.setAttachmentType(""); + e.setAttachmentUrl(""); + entities.add(e); + });*/ + } }); if (CollectionUtils.isNotEmpty(entities)) { List existNatInfos = icNatDao.getExistNatInfo(entities); From f72c8c075e91187da9c61e9f7e2fc437f74cf45d Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Sun, 16 Oct 2022 20:38:07 +0800 Subject: [PATCH 148/249] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E4=BA=8C=E7=BB=B4?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90=E5=A4=B1=E8=B4=A5=E4=B8=8D=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/HouseServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index de8806a781..31aa88b033 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -175,7 +175,9 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { try { entity.setHouseQrcodeUrl(createHouseQrcodeUrl(icHouseDTO.getId(),null)); } catch (Exception e) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败","二维码生成失败"); + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("二维码生成失败:"+errorMsg); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"二维码生成失败:","二维码生成失败"); } icHouseDao.updateById(entity); } From a4f94291750124c65d4ea7c4b8b6d32a31a2c50f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 17 Oct 2022 09:47:17 +0800 Subject: [PATCH 149/249] =?UTF-8?q?test=20=E8=8F=9C=E5=8D=95=E6=95=B0?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/GovMenuServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java index a3b63e096b..b9ee352c28 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java @@ -234,7 +234,9 @@ public class GovMenuServiceImpl extends BaseServiceImpl Date: Mon, 17 Oct 2022 09:56:14 +0800 Subject: [PATCH 150/249] =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=9A=82=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DataSyncConfigServiceImpl.java | 79 ++++++++++--------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index 469465901e..d165bfaa51 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -222,7 +222,7 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl idCards, String customerId) { + public void hsjc(List idCards, String customerId, String isSync) { try { List entities = new ArrayList<>(); idCards.forEach(idCard -> { - YtHscyResDTO sampleResult = YtHsResUtils.hscy(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); +// YtHscyResDTO sampleResult = YtHsResUtils.hscy(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); YtHsjcResDTO natInfoResult = YtHsResUtils.hsjc(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); - Boolean aBoolean = CollectionUtils.isEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData()); - Boolean bBoolean = CollectionUtils.isNotEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData()); + /*Boolean aBoolean = CollectionUtils.isEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData()); + Boolean bBoolean = CollectionUtils.isNotEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData());*/ /** * 1.采样结果 和 检测结果 都不为空,以检测结果为准 * 2.采样结果为空,检测结果不为空 */ - if (aBoolean || bBoolean) { +// if (aBoolean || bBoolean) { + if (CollectionUtils.isNotEmpty(natInfoResult.getData())) { natInfoResult.getData().forEach(natInfo -> { IcNatEntity e = new IcNatEntity(); e.setCustomerId(customerId); e.setIsResiUser(StringUtils.isBlank(idCard.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR); e.setUserId(idCard.getUserId()); - e.setUserType("sync"); + e.setUserType(isSync.equals(NumConstant.ONE_STR) ? "manualSync" : "sync"); e.setName(StringUtils.isNotBlank(natInfo.getName()) ? natInfo.getName() : ""); e.setMobile(StringUtils.isNotBlank(natInfo.getTelephone()) ? natInfo.getTelephone() : ""); e.setIdCard(StringUtils.isNotBlank(natInfo.getCard_no()) ? natInfo.getCard_no() : ""); @@ -479,7 +481,7 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl { + /*if (CollectionUtils.isNotEmpty(sampleResult.getData()) && CollectionUtils.isEmpty(natInfoResult.getData())){ + sampleResult.getData().forEach(sampleInfo -> { IcNatEntity e = new IcNatEntity(); e.setCustomerId(customerId); e.setIsResiUser(StringUtils.isBlank(idCard.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR); e.setUserId(idCard.getUserId()); - e.setUserType("sync"); + e.setUserType(isSync.equals(NumConstant.ONE_STR) ? "manualSync" : "sync"); e.setName(StringUtils.isNotBlank(sampleInfo.getName()) ? sampleInfo.getName() : ""); - e.setMobile(StringUtils.isNotBlank(sampleInfo.getTelephone()) ? sampleInfo.getTelephone() : ""); + e.setMobile(StringUtils.isNotBlank(sampleInfo.get()) ? sampleInfo.getTelephone() : ""); e.setIdCard(StringUtils.isNotBlank(sampleInfo.getCard_no()) ? sampleInfo.getCard_no() : ""); e.setNatTime(DateUtils.parseDate(sampleInfo.getTest_time(), DateUtils.DATE_TIME_PATTERN)); e.setSampleTime(DateUtils.parseDate(sampleInfo.getSample_time(), DateUtils.DATE_TIME_PATTERN)); @@ -514,37 +516,38 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl existNatInfos = icNatDao.getExistNatInfo(entities); - entities.forEach(e -> existNatInfos.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> e.setExistStatus(true))); - Map> groupByStatus = entities.stream().collect(Collectors.groupingBy(IcNatEntity::getExistStatus)); - if (CollectionUtils.isNotEmpty(groupByStatus.get(false))) { - for (List icNatEntities : ListUtils.partition(groupByStatus.get(false), NumConstant.FIVE_HUNDRED)) { - icNatService.insertBatch(icNatEntities); - //组织关系表 - List relationEntities = new ArrayList<>(); - icNatEntities.forEach(ne -> { - // 不是居民的先不加关系表吧 - if (ne.getIsResiUser().equals(NumConstant.ONE_STR)) { - IcNatRelationEntity e = new IcNatRelationEntity(); - e.setCustomerId(customerId); - e.setAgencyId(ne.getAgencyId()); - e.setPids(ne.getPids()); - e.setIcNatId(ne.getId()); - e.setUserType("sync"); - relationEntities.add(e); + });*/ + if (CollectionUtils.isNotEmpty(entities)) { + List existNatInfos = icNatDao.getExistNatInfo(entities); + entities.forEach(e -> existNatInfos.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> e.setExistStatus(true))); + Map> groupByStatus = entities.stream().collect(Collectors.groupingBy(IcNatEntity::getExistStatus)); + if (CollectionUtils.isNotEmpty(groupByStatus.get(false))) { + for (List icNatEntities : ListUtils.partition(groupByStatus.get(false), NumConstant.FIVE_HUNDRED)) { + icNatService.insertBatch(icNatEntities); + //组织关系表 + List relationEntities = new ArrayList<>(); + icNatEntities.forEach(ne -> { + // 不是居民的先不加关系表吧 + if (ne.getIsResiUser().equals(NumConstant.ONE_STR)) { + IcNatRelationEntity e = new IcNatRelationEntity(); + e.setCustomerId(customerId); + e.setAgencyId(ne.getAgencyId()); + e.setPids(ne.getPids()); + e.setIcNatId(ne.getId()); + e.setUserType("sync"); + relationEntities.add(e); + } + }); + if (CollectionUtils.isNotEmpty(relationEntities)) { + icNatRelationService.insertBatch(relationEntities); } - }); - if (CollectionUtils.isNotEmpty(relationEntities)) { - icNatRelationService.insertBatch(relationEntities); } } - } - } + } + }); } catch (Exception e) { log.error("hsjc exception", e); } From d14dda0e4f5cf658dd3ad9622b6f4e78bd3e3729 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 17 Oct 2022 10:05:07 +0800 Subject: [PATCH 151/249] =?UTF-8?q?=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/GovMenuServiceImpl.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java index b9ee352c28..a413c9dfdc 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java @@ -234,8 +234,6 @@ public class GovMenuServiceImpl extends BaseServiceImpl Date: Mon, 17 Oct 2022 10:08:23 +0800 Subject: [PATCH 152/249] emm --- .../com/epmet/dto/form/dataSync/ResiInfoDTO.java | 1 + .../impl/DataSyncRecordDisabilityServiceImpl.java | 14 ++++++++++++++ .../com/epmet/service/impl/IcNatServiceImpl.java | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/ResiInfoDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/ResiInfoDTO.java index f9a8295e53..1f148219b5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/ResiInfoDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/dataSync/ResiInfoDTO.java @@ -46,6 +46,7 @@ public class ResiInfoDTO implements Serializable { * 残疾类别 */ private String cjlb; + private String cjlbCn; /** * 民族 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java index 400e00f000..3b564f19e7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java @@ -102,6 +102,7 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl> cjlbOptionsMap = operCustomizeOpenFeignClient.getOptionsMap(formDTO); + if (!cjlbOptionsMap.success()){ + throw new EpmetException("operCustomizeOpenFeignClient.getOptionsMap执行失败"); + } + Map data = cjlbOptionsMap.getData(); + return data.get(cjlb); + } + @Override @Transactional(rollbackFor = Exception.class) public void save(DataSyncRecordDisabilityDTO dto) { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index 08c6fa1079..3a9282b9bb 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -94,7 +94,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp * 1.采样时间为空,检测时间和结果有一个为空就报错 * 2.采样时间不为空,检测时间和结果可以为空【如果不为空 检测时间和结果都不为空】 */ - if ((null == formDTO.getSampleTime() && null == formDTO.getNatTime() || org.apache.commons.lang3.StringUtils.isBlank(formDTO.getNatResult()))){ + if ((null == formDTO.getSampleTime() && (null == formDTO.getNatTime() || org.apache.commons.lang3.StringUtils.isBlank(formDTO.getNatResult())))){ throw new EpmetException(EpmetErrorCode.SAMPLE_TIME_AND_RESULT_IS_NULL_ERROR.getCode()); } if(null != formDTO.getSampleTime() && org.apache.commons.lang3.StringUtils.isNotBlank(formDTO.getNatResult()) && null == formDTO.getNatTime()){ From 962aca62ea0a65c3ae15205b2b6a24ddf5b20163 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 17 Oct 2022 10:31:43 +0800 Subject: [PATCH 153/249] emm --- .../java/com/epmet/service/impl/DataSyncConfigServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index d165bfaa51..2517791025 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -218,11 +218,13 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl Date: Mon, 17 Oct 2022 11:05:15 +0800 Subject: [PATCH 154/249] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=AA=E6=88=BF=E4=B8=BB=E5=A7=93=E5=90=8D?= =?UTF-8?q?=EF=BC=8C=E7=94=B5=E8=AF=9D=EF=BC=8C=E8=BA=AB=E4=BB=BD=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V0.0.24__alter_log_operation.sql | 2 ++ .../tools/redis/common/bean/HouseInfoCache.java | 15 +++++++++++++++ .../java/com/epmet/dto/result/HouseInfoDTO.java | 16 ++++++++++++++++ .../src/main/resources/mapper/IcHouseDao.xml | 5 ++++- 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.24__alter_log_operation.sql diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.24__alter_log_operation.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.24__alter_log_operation.sql new file mode 100644 index 0000000000..cba42020bb --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.24__alter_log_operation.sql @@ -0,0 +1,2 @@ + +ALTER TABLE log_operation MODIFY COLUMN CATEGORY varchar(64) not null COMMENT '操作类型大类。例如login和logout都属于login大类。项目立项,项目流转,项目结案都属于项目大类;data_tm:数据脱敏;'; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java index 1fe656fef6..d3df049dab 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/HouseInfoCache.java @@ -107,4 +107,19 @@ public class HouseInfoCache implements Serializable { * 二维码地址 */ private String houseQrcodeUrl; + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 房主电话 + */ + private String ownerPhone; + + /** + * 房主身份证 + */ + private String ownerIdCard; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java index fffaae071c..f6be2d8f83 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java @@ -108,4 +108,20 @@ public class HouseInfoDTO implements Serializable { * 二维码地址 */ private String houseQrcodeUrl; + + + /** + * 房主姓名 + */ + private String ownerName; + + /** + * 房主电话 + */ + private String ownerPhone; + + /** + * 房主身份证 + */ + private String ownerIdCard; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index ed9bc5acd9..6e417b0aed 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -276,7 +276,10 @@ gr.GRID_NAME, ih.HOUSE_CODE, ih.CODING, - ih.HOUSE_QRCODE_URL + ih.HOUSE_QRCODE_URL, + ih.owner_name, + ih.owner_phone, + ih.owner_id_card FROM ic_house ih left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id AND n.DEL_FLAG = '0') left JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id AND ib.DEL_FLAG = '0') From 86be8ca3b20955e4dcecff6336e29ac510e9573c Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 17 Oct 2022 14:48:26 +0800 Subject: [PATCH 155/249] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=B9=E6=AF=94-?= =?UTF-8?q?=E6=AE=8B=E7=96=BE=E5=92=8C=E6=AD=BB=E4=BA=A1=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V0.0.77__data_compare_d_c.sql | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.77__data_compare_d_c.sql diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.77__data_compare_d_c.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.77__data_compare_d_c.sql new file mode 100644 index 0000000000..ed2d9a1de1 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.77__data_compare_d_c.sql @@ -0,0 +1,66 @@ +CREATE TABLE `data_sync_record_death` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `AGENCY_ID` varchar(64) DEFAULT '' COMMENT '组织Id', + `PIDS` varchar(255) DEFAULT '' COMMENT '组织的pids 含agencyId本身', + `GRID_ID` varchar(64) DEFAULT '' COMMENT '网格ID', + `NAME` varchar(16) NOT NULL COMMENT '姓名', + `ID_CARD` varchar(24) NOT NULL COMMENT '身份证', + `IC_RESI_USER_ID` varchar(64) DEFAULT NULL COMMENT '居民Id,ic_resi_user.id', + `AGE` varchar(8) DEFAULT NULL COMMENT '年龄(享年)', + `ADDRESS` varchar(128) DEFAULT NULL COMMENT '家庭住址', + `DEATH_DATE` varchar(32) DEFAULT '' COMMENT '死亡时间', + `CREMATION_TIME` varchar(32) DEFAULT '' COMMENT '火化时间', + `MZ` varchar(32) DEFAULT '' COMMENT '民族', + `ORGAN_NAME` varchar(16) DEFAULT '' COMMENT '登记单位名称', + `NATION` varchar(32) DEFAULT '' COMMENT '国籍', + `THIRD_RECORD_ID` varchar(64) DEFAULT '' COMMENT '第三方记录唯一标识', + `DEAL_STATUS` smallint(1) NOT NULL DEFAULT '0' COMMENT '处理状态(更新至居民信息) 0:未处理;1:处理成功;2处理失败', + `DEAL_RESULT` varchar(128) DEFAULT '' COMMENT '处理结果', + `DEL_FLAG` int(11) 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, + KEY `idx_u_id` (`IC_RESI_USER_ID`) USING BTREE COMMENT '居民Id' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='数据同步记录-居民死亡信息'; + +CREATE TABLE `data_sync_record_disability` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `AGENCY_ID` varchar(64) DEFAULT '' COMMENT '组织Id', + `PIDS` varchar(255) DEFAULT '' COMMENT '组织的pids 含agencyId本身', + `GRID_ID` varchar(64) DEFAULT '' COMMENT '网格ID', + `NAME` varchar(16) NOT NULL COMMENT '姓名', + `ID_CARD` varchar(24) NOT NULL COMMENT '身份证', + `MOBILE` varchar(24) DEFAULT NULL COMMENT '电话', + `IC_RESI_USER_ID` varchar(64) DEFAULT NULL COMMENT '居民Id,ic_resi_user.id', + `CARD_NUM` varchar(32) DEFAULT NULL COMMENT '残疾证号', + `CJZK_CN` varchar(32) DEFAULT NULL COMMENT '残疾等级(状况)', + `CJLB_CN` varchar(32) DEFAULT NULL COMMENT '残疾类别', + `EDU_LEVEL` varchar(32) DEFAULT '' COMMENT '文化程度', + `MARITAL_STATUS_NAME` varchar(32) DEFAULT '' COMMENT '婚姻状况', + `MZ_CN` varchar(32) DEFAULT '' COMMENT '民族中文', + `GENDER` char(2) DEFAULT NULL COMMENT '性别 1男2女', + `RESIDENT_ADD` varchar(128) DEFAULT NULL COMMENT '户籍地址', + `NOW_ADD` varchar(128) DEFAULT NULL COMMENT '现居住地址', + `GUARDIAN` varchar(32) DEFAULT '' COMMENT '监护人', + `GUARDIAN_PHONE` varchar(32) DEFAULT '' COMMENT '监护人联系方式', + `DEAL_STATUS` smallint(1) NOT NULL DEFAULT '0' COMMENT '处理状态(更新至居民信息) 0:未处理;1:处理成功;2处理失败', + `DISABILITY_STATUS` smallint(1) NOT NULL DEFAULT '0' COMMENT '需要处理的残疾状态 0:非残疾;1:残疾', + `DEAL_RESULT` varchar(128) DEFAULT '' COMMENT '处理结果', + `DEL_FLAG` int(11) 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, + KEY `idx_u_id` (`IC_RESI_USER_ID`) USING BTREE COMMENT '居民Id' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='数据同步记录-居民残疾信息'; + + +UPDATE `epmet_user`.`data_sync_config` SET `DATA_CODE` = 'siwang' ,`UPDATED_TIME` = now() WHERE `ID` = '7'; +UPDATE `epmet_user`.`data_sync_config` SET `DATA_CODE` = 'canji' ,`UPDATED_TIME` = now() WHERE `ID` = '9'; From fcdd2efc601d2d3180b69f7bfe94922ad4061704 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 17 Oct 2022 15:00:56 +0800 Subject: [PATCH 156/249] =?UTF-8?q?=E6=98=8E=E6=96=87=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mq/listener/RocketMQConsumerRegister.java | 2 + .../CheckAndExportOperationLogListener.java | 120 ++++++++++++++++++ .../constants/ConsomerGroupConstants.java | 5 + .../rocketmq/constants/TopicConstants.java | 5 + .../commons/rocketmq/messages/CheckMQMsg.java | 28 ++++ .../epmet/constant/NeighborhoodConstant.java | 2 + .../epmet/dto/form/DetailByTypeFormDTO.java | 25 ++++ .../dto/result/DetailByTypeResultDTO.java | 20 +++ .../epmet/controller/IcHouseController.java | 17 ++- .../com/epmet/service/IcHouseService.java | 15 ++- .../service/impl/IcHouseServiceImpl.java | 60 ++++++++- 11 files changed, 290 insertions(+), 9 deletions(-) create mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java create mode 100644 epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DetailByTypeFormDTO.java create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DetailByTypeResultDTO.java diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java index 93a2f8e5f0..7f15960037 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/RocketMQConsumerRegister.java @@ -5,6 +5,7 @@ import com.epmet.commons.rocketmq.constants.TopicConstants; import com.epmet.commons.rocketmq.register.MQAbstractRegister; import com.epmet.commons.rocketmq.register.MQConsumerProperties; import com.epmet.mq.listener.listener.AuthOperationLogListener; +import com.epmet.mq.listener.listener.CheckAndExportOperationLogListener; import com.epmet.mq.listener.listener.PointOperationLogListener; import com.epmet.mq.listener.listener.ProjectOperationLogListener; import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; @@ -19,6 +20,7 @@ public class RocketMQConsumerRegister extends MQAbstractRegister { register(consumerProperties, ConsomerGroupConstants.AUTH_OPERATION_LOG_GROUP, MessageModel.CLUSTERING, TopicConstants.AUTH, "*", new AuthOperationLogListener()); register(consumerProperties, ConsomerGroupConstants.PROJECT_OPERATION_LOG_GROUP, MessageModel.CLUSTERING, TopicConstants.PROJECT_CHANGED, "*", new ProjectOperationLogListener()); register(consumerProperties, ConsomerGroupConstants.POINT_OPERATION_LOG_GROUP, MessageModel.CLUSTERING, TopicConstants.POINT, "*", new PointOperationLogListener()); + register(consumerProperties, ConsomerGroupConstants.CHECK_OR_EXPORT_GROUP, MessageModel.CLUSTERING, TopicConstants.CHECK_OR_EXPORT, "*", new CheckAndExportOperationLogListener()); // ...其他监听器类似 } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java new file mode 100644 index 0000000000..1d86c65b8d --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java @@ -0,0 +1,120 @@ +package com.epmet.mq.listener.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.auth.constants.AuthOperationEnum; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.rocketmq.messages.CheckMQMsg; +import com.epmet.commons.rocketmq.messages.LoginMQMsg; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.entity.LogOperationEntity; +import com.epmet.mq.listener.bean.log.LogOperationHelper; +import com.epmet.mq.listener.bean.log.OperatorInfo; +import com.epmet.service.LogOperationService; +import org.apache.commons.lang3.StringUtils; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @author zxc + * @Description 查询明文或者导出操作日志监听器 + */ +public class CheckAndExportOperationLogListener implements MessageListenerConcurrently { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + private RedisUtils redisUtils; + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + logger.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + String tags = messageExt.getTags(); + String msg = new String(messageExt.getBody()); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); + logger.info("查询明文或者导出操作日志监听器-收到消息内容:{}", msg); + CheckMQMsg msgObj = JSON.parseObject(msg, CheckMQMsg.class); + + //获取操作人信息 + OperatorInfo operatorInfo = LogOperationHelper.getInstance().getOperatorInfo(msgObj.getUserId()); + LogOperationEntity logEntity = new LogOperationEntity(); + logEntity.setCategory(messageExt.getTopic()); + logEntity.setType(tags); + logEntity.setTypeDisplay(AuthOperationEnum.getDisplay(tags)); + logEntity.setIp(msgObj.getIp()); + logEntity.setFromApp(msgObj.getFromApp()); + logEntity.setFromClient(msgObj.getFromClient()); + logEntity.setTargetId(""); + logEntity.setCustomerId(operatorInfo.getCustomerId()); + logEntity.setOperatorId(msgObj.getUserId()); + logEntity.setOperatorName(operatorInfo.getName()); + logEntity.setOperatorMobile(operatorInfo.getMobile()); + logEntity.setOperatingTime(msgObj.getOperateTime()); + logEntity.setContent(msgObj.getContent()); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:auth_operation_log:%s:%s", logEntity.getType(), logEntity.getOperatorId()), + 30L, 30L, TimeUnit.SECONDS); + SpringContextUtils.getBean(LogOperationService.class).log(logEntity); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【RocketMQ】添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【RocketMQ】添加操作日志失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【查询明文或者导出操作日志监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【登录操作事件监听器】删除pendingMsgLabel成功:{}", pendingMsgLabel); + } +} diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java index 6bc618a01b..c4f43a03b2 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java @@ -108,4 +108,9 @@ public interface ConsomerGroupConstants { * 党建积分操作消费组 */ String PARTY_BUILDING_GROUP = "party_building_group"; + + /** + * 查看或者导出 日志记录 消费组 + */ + String CHECK_OR_EXPORT_GROUP = "check_or_export_group"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java index 23bfd628a4..2624971db2 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java @@ -91,4 +91,9 @@ public interface TopicConstants { String IC_MESSAGE = "ic_message"; String PARTY_BUILDING = "party_building"; + + /** + * 查看或者导出 日志记录 + */ + String CHECK_OR_EXPORT = "check_or_export"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java new file mode 100644 index 0000000000..0a9f02b692 --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java @@ -0,0 +1,28 @@ +package com.epmet.commons.rocketmq.messages; + +import lombok.Data; + +import java.util.Date; + +@Data +public class CheckMQMsg { + + /** + * 谁登录 + */ + private String userId; + + private String content; + + /** + * 操作时间 + */ + private Date operateTime; + + private String ip; + + private String fromApp; + + private String fromClient; + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java index 49a21f262e..fe92bcd3c2 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java @@ -12,4 +12,6 @@ public interface NeighborhoodConstant { String BUILDING = "building"; String HOUSE = "house"; + String IC_RESI_USER = "icResiUser"; + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DetailByTypeFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DetailByTypeFormDTO.java new file mode 100644 index 0000000000..45fc98f517 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DetailByTypeFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/17 13:42 + * @DESC + */ +@Data +public class DetailByTypeFormDTO implements Serializable { + + private static final long serialVersionUID = 8190270734257503603L; + + public interface DetailByTypeForm{} + + @NotBlank(message = "type不能为空",groups = DetailByTypeForm.class) + private String type; + + @NotBlank(message = "id不能为空",groups = DetailByTypeForm.class) + private String id; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DetailByTypeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DetailByTypeResultDTO.java new file mode 100644 index 0000000000..3992215890 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DetailByTypeResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/17 13:41 + * @DESC + */ +@Data +public class DetailByTypeResultDTO implements Serializable { + + private static final long serialVersionUID = -8067849365791132347L; + + private String idCard; + + private String mobile; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java index 6d828df25a..6e867c47de 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java @@ -26,12 +26,10 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.IcHouseDTO; import com.epmet.dto.IcVaccinePrarmeterDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO; +import com.epmet.dto.form.DetailByTypeFormDTO; import com.epmet.dto.form.HouseFormDTO; import com.epmet.dto.form.VaccinePrarmeterListFormDTO; -import com.epmet.dto.result.HouseAgencyInfoResultDTO; -import com.epmet.dto.result.HouseInfoDTO; -import com.epmet.dto.result.HouseListResultDTO; -import com.epmet.dto.result.HousesNameResultDTO; +import com.epmet.dto.result.*; import com.epmet.service.IcHouseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -154,6 +152,17 @@ public class IcHouseController { ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class); formDTO.setCustomerId(tokenDto.getCustomerId()); return icHouseService.checkHomeInfo(formDTO); + } + /** + * Desc: 数据明文查询 + * @param formDTO + * @author zxc + * @date 2022/10/17 13:45 + */ + @PostMapping("detailByType") + public Result detailByType(@RequestBody DetailByTypeFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, DetailByTypeFormDTO.DetailByTypeForm.class); + return new Result().ok(icHouseService.detailByType(formDTO,tokenDto)); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java index 77a5bdd4ad..0b2e40f86d 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java @@ -7,11 +7,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcHouseDTO; import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO; +import com.epmet.dto.form.DetailByTypeFormDTO; import com.epmet.dto.form.HouseFormDTO; -import com.epmet.dto.result.HouseAgencyInfoResultDTO; -import com.epmet.dto.result.HouseInfoDTO; -import com.epmet.dto.result.HouseListResultDTO; -import com.epmet.dto.result.HousesNameResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IcHouseEntity; import java.util.List; @@ -139,4 +137,13 @@ public interface IcHouseService extends BaseService { * @return */ Result checkHomeInfo(CheckHouseInfoFormDTO formDTO); + + /** + * Desc: 数据明文查询 + * @param formDTO + * @author zxc + * @date 2022/10/17 13:45 + */ + DetailByTypeResultDTO detailByType(DetailByTypeFormDTO formDTO, TokenDto tokenDto); + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 0f69fc8816..364b859376 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -3,6 +3,9 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.rocketmq.messages.CheckMQMsg; +import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; @@ -10,10 +13,14 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; +import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; +import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.IpUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.NeighborhoodConstant; import com.epmet.dao.IcBuildingDao; import com.epmet.dao.IcBuildingUnitDao; import com.epmet.dao.IcHouseDao; @@ -23,7 +30,9 @@ import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.ImportGeneralDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO; +import com.epmet.dto.form.DetailByTypeFormDTO; import com.epmet.dto.form.HouseFormDTO; +import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.IcBuildingEntity; import com.epmet.entity.IcBuildingUnitEntity; @@ -32,6 +41,7 @@ import com.epmet.entity.IcNeighborHoodEntity; import com.epmet.enums.HousePurposeEnums; import com.epmet.enums.HouseRentFlagEnums; import com.epmet.enums.HouseTypeEnums; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.redis.IcHouseRedis; @@ -39,10 +49,14 @@ import com.epmet.service.IcHouseService; import lombok.extern.slf4j.Slf4j; 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 org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; @@ -69,7 +83,8 @@ public class IcHouseServiceImpl extends BaseServiceImpl().ok(checkHomeInfoResultInfo); } + + /** + * Desc: 数据明文查询 + * @param formDTO + * @author zxc + * @date 2022/10/17 13:45 + */ + @Override + public DetailByTypeResultDTO detailByType(DetailByTypeFormDTO formDTO, TokenDto tokenDto) { + DetailByTypeResultDTO result = new DetailByTypeResultDTO(); + String customerId = tokenDto.getCustomerId(); + String userId = tokenDto.getUserId(); + CheckMQMsg msg = new CheckMQMsg(); + if (formDTO.getType().equals(NeighborhoodConstant.HOUSE)){ + HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(customerId, formDTO.getId()); + if (null == houseInfo){ + throw new EpmetException("查询房屋信息失败:"+formDTO.getId()); + } + result.setMobile(houseInfo.getOwnerPhone()); + result.setIdCard(houseInfo.getOwnerIdCard()); + msg.setContent("查看房屋信息明文"); + }else if (formDTO.getType().equals(NeighborhoodConstant.IC_RESI_USER)){ + ResiUserInfoCache userBaseInfo = CustomerResiUserRedis.getUserBaseInfo(formDTO.getId()); + if (null == userBaseInfo){ + throw new EpmetException("查询icResiUser失败:"+formDTO.getId()); + } + result.setIdCard(userBaseInfo.getIdNum()); + result.setMobile(userBaseInfo.getMobile()); + msg.setContent("查看居民信息明文"); + } + // 发送mq消息 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + msg.setOperateTime(new Date()); + msg.setUserId(userId); + msg.setFromApp(tokenDto.getApp()); + msg.setIp(IpUtils.getIpAddr(request)); + msg.setFromClient(tokenDto.getClient()); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(TopicConstants.CHECK_OR_EXPORT); + form.setContent(msg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + return result; + } } From 0caac7b142f70f2e523a4a56d526051eaa3bfce3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 17 Oct 2022 15:20:03 +0800 Subject: [PATCH 157/249] message --- .../src/main/java/com/epmet/constant/SystemMessageType.java | 6 ++++++ .../com/epmet/service/impl/SystemMessageServiceImpl.java | 3 +++ 2 files changed, 9 insertions(+) diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java index 9920eb019a..e0d8c80b35 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java @@ -175,6 +175,12 @@ public interface SystemMessageType { */ String PARTY_MEETING_MESSAGE = "party_meeting_message"; + + /** + * 查看或者导出 日志记录 + */ + String CHECK_OR_EXPORT = "check_or_export"; + String ZBWYH = "参加支部委员会"; String ZBDYDH = "参加支部党员大会"; String DXZH = "参加党小组会"; diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java index 3eea1f03d8..ad742b155b 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java @@ -248,6 +248,9 @@ public class SystemMessageServiceImpl implements SystemMessageService { case SystemMessageType.WMFWHD: topic=TopicConstants.PARTY_BUILDING; break; + case SystemMessageType.CHECK_OR_EXPORT: + topic = TopicConstants.CHECK_OR_EXPORT; + break; default: logger.error("getTopicByMsgType msgType:{} is not support for any topic", msgType); } From 78e81a9f56a2e2f7962be11343c533eaaf3f2201 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 17 Oct 2022 15:36:43 +0800 Subject: [PATCH 158/249] message --- .../listener/CheckAndExportOperationLogListener.java | 6 +++--- .../com/epmet/commons/rocketmq/messages/CheckMQMsg.java | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java index 1d86c65b8d..b11751f3eb 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java @@ -63,9 +63,9 @@ public class CheckAndExportOperationLogListener implements MessageListenerConcur //获取操作人信息 OperatorInfo operatorInfo = LogOperationHelper.getInstance().getOperatorInfo(msgObj.getUserId()); LogOperationEntity logEntity = new LogOperationEntity(); - logEntity.setCategory(messageExt.getTopic()); - logEntity.setType(tags); - logEntity.setTypeDisplay(AuthOperationEnum.getDisplay(tags)); + logEntity.setCategory("data_tm"); + logEntity.setType(msgObj.getType()); + logEntity.setTypeDisplay(msgObj.getTypeDisplay()); logEntity.setIp(msgObj.getIp()); logEntity.setFromApp(msgObj.getFromApp()); logEntity.setFromClient(msgObj.getFromClient()); diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java index 0a9f02b692..462133adfe 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java @@ -14,6 +14,9 @@ public class CheckMQMsg { private String content; + private String typeDisplay; + private String type; + /** * 操作时间 */ From 99e2f02be9244397e471437f16b30897822690b7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 17 Oct 2022 15:54:47 +0800 Subject: [PATCH 159/249] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=AAicresiuser?= =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/feign/CommonUserFeignClient.java | 4 + .../CommonUserFeignClientFallback.java | 6 + .../epmet/commons/tools/redis/RedisKeys.java | 4 + .../redis/common/CustomerResiUserRedis.java | 27 + .../common/bean/IcResiUserInfoCache.java | 539 ++++++++++++++++++ .../service/impl/IcHouseServiceImpl.java | 9 +- .../controller/IcResiUserController.java | 6 + .../com/epmet/service/IcResiUserService.java | 3 + .../service/impl/IcResiUserServiceImpl.java | 11 +- 9 files changed, 601 insertions(+), 8 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/IcResiUserInfoCache.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonUserFeignClient.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonUserFeignClient.java index 0f8f937a8a..8e67c1939b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonUserFeignClient.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonUserFeignClient.java @@ -2,6 +2,7 @@ package com.epmet.commons.tools.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.feign.fallback.CommonUserFeignClientFallBackFactory; +import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.utils.Result; import org.springframework.cloud.openfeign.FeignClient; @@ -17,4 +18,7 @@ import org.springframework.web.bind.annotation.PostMapping; public interface CommonUserFeignClient { @PostMapping("/epmetuser/userbaseinfo/getUserInfo/{userId}") Result getUserInfo(@PathVariable("userId") String userId); + + @PostMapping("/epmetuser/icresiuser/getIcResiUserInfo/{userId}") + Result getIcResiUserInfo(@PathVariable("userId") String userId); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallback.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallback.java index 8cd5660484..77f212943c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallback.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonUserFeignClientFallback.java @@ -2,6 +2,7 @@ package com.epmet.commons.tools.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.feign.CommonUserFeignClient; +import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; @@ -20,4 +21,9 @@ public class CommonUserFeignClientFallback implements CommonUserFeignClient { public Result getUserInfo(String userId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserInfo", userId); } + + @Override + public Result getIcResiUserInfo(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getIcResiUserInfo", userId); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index c09f13f2f4..49ab921e0f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -393,6 +393,10 @@ public class RedisKeys { return rootPrefix.concat("resi:user:").concat(userId); } + public static String getIcResiUserKey(String userId) { + return rootPrefix.concat("resi:icResiUser:").concat(userId); + } + /** * @param userId * @return epmet:badge:user:[customerId]:[userId] diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java index 5b34fcdee7..39e1995d9b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java @@ -1,10 +1,12 @@ package com.epmet.commons.tools.redis.common; import cn.hutool.core.bean.BeanUtil; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.CommonUserFeignClient; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; @@ -70,6 +72,31 @@ public class CustomerResiUserRedis { return resultData; } + public static IcResiUserInfoCache getIcResiUserInfo(String icResiUserId){ + if (StringUtils.isBlank(icResiUserId)){ + log.warn("getIcResiUserInfo param is blank,userId:{}",icResiUserId); + return null; + } + String key = RedisKeys.getIcResiUserKey(icResiUserId); + Map map = customerResiUserRedis.redisUtils.hGetAll(key); + if (!CollectionUtils.isEmpty(map)) { + return ConvertUtils.mapToEntity(map, IcResiUserInfoCache.class); + } + Result result = customerResiUserRedis.commonUserFeignClient.getIcResiUserInfo(icResiUserId); + if (result == null || !result.success()) { + throw new EpmetException("获取居民信息失败"); + } + IcResiUserInfoCache data = result.getData(); + if (null == data) { + log.warn("居民信息为空,userId:{}", icResiUserId); + return null; + } + + Map cacheMap = BeanUtil.beanToMap(data, false, true); + customerResiUserRedis.redisUtils.hMSet(key, cacheMap); + return data; + } + @Nullable private static ResiUserInfoCache reloadStaffCache(String userId, String key) { Result result = customerResiUserRedis.commonUserFeignClient.getUserInfo(userId); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/IcResiUserInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/IcResiUserInfoCache.java new file mode 100644 index 0000000000..6749272790 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/IcResiUserInfoCache.java @@ -0,0 +1,539 @@ +package com.epmet.commons.tools.redis.common.bean; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2022/10/17 15:40 + * @DESC + */ +@Data +public class IcResiUserInfoCache implements Serializable { + + private static final long serialVersionUID = -3644143706074015380L; + + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * + */ + private String agencyId; + + /** + * + */ + private String pids; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属小区ID + */ + private String villageId; + + /** + * 所属楼宇Id + */ + private String buildId; + + /** + * 单元id + */ + private String unitId; + + /** + * 所属家庭Id + */ + private String homeId; + + /** + * 是否本地户籍 + */ + private String isBdhj; + + /** + * 姓名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 备注 + */ + private String remarks; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系人电话 + */ + private String contactsMobile; + + /** + * 九小场所url + */ + private String ninePlace; + + /** + * 是否党员 + */ + private String isParty; + + /** + * 是否低保户 + */ + private String isDbh; + + /** + * 是否保障房 + */ + private String isEnsureHouse; + + /** + * 是否失业 + */ + private String isUnemployed; + + /** + * 是否育龄妇女 + */ + private String isYlfn; + + /** + * 是否退役军人 + */ + private String isVeterans; + + /** + * 是否统战人员 + */ + private String isUnitedFront; + + /** + * 是否信访人员 + */ + private String isXfry; + + /** + * 是否志愿者 + */ + private String isVolunteer; + + /** + * 是否老年人 + */ + private String isOldPeople; + + /** + * 是否空巢 + */ + private String isKc; + + /** + * 是否失独 + */ + private String isSd; + + /** + * 是否失能 + */ + private String isSn; + + /** + * 是否失智 + */ + private String isSz; + + /** + * 是否残疾 + */ + private String isCj; + + /** + * 是否大病 + */ + private String isDb; + + /** + * 是否慢病 + */ + private String isMb; + + /** + * 是否特殊人群 + */ + private String isSpecial; + + /** + * 是否租户【是:1 否:0】 + */ + private String isTenant; + + /** + * 是否是流动人口【是:1 否:0】 + */ + private String isFloating; + + /** + * 是否新阶层人士【是:1 否:0】 + */ + private String isXjc; + + /** + * 文化程度【字典表】 + */ + private String culture; + + /** + * 文化程度备注 + */ + private String cultureRemakes; + + /** + * 特长【字典表】 + */ + private String specialSkill; + + /** + * 兴趣爱好 + */ + private String hobby; + + /** + * 兴趣爱好备注 + */ + private String hobbyRemakes; + + /** + * 宗教信仰 + */ + private String faith; + + /** + * 宗教信仰备注 + */ + private String faithRemakes; + + /** + * 残疾类别【字典表】 + */ + private String cjlb; + + /** + * 残疾登记(状况)【字典表】 + */ + private String cjzk; + + /** + * 残疾证号 + */ + private String cjzh; + + /** + * 残疾说明 + */ + private String cjsm; + + /** + * 有无监护人【yes no】 + */ + private String ynJdr; + + /** + * 有无技能特长【yes no】 + */ + private String ynJntc; + + /** + * 有无劳动能力 + */ + private String ynLdnl; + + /** + * 有无非义务教育阶段助学【yes no】 + */ + private String ynFywjyjdzx; + + /** + * 所患大病 + */ + private String shdb; + + /** + * 患大病时间 + */ + private String dbsj; + + /** + * 所患慢性病 + */ + private String shmxb; + + /** + * 患慢性病时间 + */ + private String mxbsj; + + /** + * 是否参保 + */ + private String isCb; + + /** + * 自付金额 + */ + private String zfje; + + /** + * 救助金额 + */ + private String jzje; + + /** + * 救助时间[yyyy-MM-dd] + */ + private String jzsj; + + /** + * 享受救助明细序号 + */ + private String jzmxxh; + + /** + * 健康信息备注 + */ + private String healthRemakes; + + /** + * 工作单位 + */ + private String gzdw; + + /** + * 职业 + */ + private String zy; + + /** + * 离退休时间 + */ + private String ltxsj; + + /** + * 工作信息备注 + */ + private String workRemake; + + /** + * 退休金额 + */ + private String txje; + + /** + * 月收入 + */ + private String ysr; + + /** + * 是否经济低保 + */ + private String isJjdb; + + /** + * 籍贯 + */ + private String jg; + + /** + * 户籍所在地 + */ + private String hjszd; + + /** + * 现居住地 + */ + private String xjzd; + + /** + * 人户情况 + */ + private String rhzk; + + /** + * 居住信息备注 + */ + private String jzxxRemakes; + + /** + * 民族【字典表】 + */ + private String mz; + + /** + * 与户主关系【字典表】 + */ + private String yhzgx; + + /** + * 居住情况【字典表】 + */ + private String jzqk; + + /** + * 婚姻状况【字典表】 + */ + private String hyzk; + + /** + * 配偶情况【字典表】 + */ + private String poqk; + + /** + * 有无赡养人 + */ + private String ynSyr; + + /** + * 与赡养人关系【字典表】 + */ + private String ysyrgx; + + /** + * 赡养人电话 + */ + private String syrMobile; + + /** + * 家庭信息备注 + */ + private String jtxxRemakes; + + /** + * 用户状态【0:正常;1:迁出;2:注销】 + */ + private String status; + + /** + * 用户详细状态:01:新增、02:导入、03:迁入、04:新生、11:迁出、21死亡 + */ + private String subStatus; + + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 预留字段1 + */ + private String field1; + + /** + * 预留字段2 + */ + private String field2; + + /** + * 预留字段3 + */ + private String field3; + + /** + * 预留字段4 + */ + private String field4; + + /** + * 预留字段5 + */ + private String field5; + + /** + * 预留字段6 + */ + private String field6; + + /** + * 预留字段7 + */ + private String field7; + + /** + * 预留字段8 + */ + private String field8; + + /** + * 预留字段9 + */ + private String field9; + + /** + * 预留字段10 + */ + private String field10; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 364b859376..7ad72ca217 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -15,6 +15,7 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; +import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; @@ -437,12 +438,12 @@ public class IcHouseServiceImpl extends BaseServiceImpl getIcResiUserInfo(@PathVariable("userId") String userId){ + return new Result().ok(icResiUserService.getIcResiUserInfo(userId)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 87dcd4cba3..e3e0f75e1f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcResiUserDTO; @@ -518,4 +519,6 @@ public interface IcResiUserService extends BaseService { * @Date 2022/9/8 15:45 */ void updateYlfn(); + + IcResiUserInfoCache getIcResiUserInfo(String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index ec9bf3043c..e602218bee 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -44,10 +44,7 @@ import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; -import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; -import com.epmet.commons.tools.redis.common.bean.GridInfoCache; -import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; -import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; +import com.epmet.commons.tools.redis.common.bean.*; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.*; import com.epmet.constant.IcPlatformConstant; @@ -3540,4 +3537,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl Date: Mon, 17 Oct 2022 15:58:29 +0800 Subject: [PATCH 160/249] emm --- .../main/java/com/epmet/service/impl/IcHouseServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 7ad72ca217..83d12ff7ab 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -437,6 +437,8 @@ public class IcHouseServiceImpl extends BaseServiceImpl Date: Mon, 17 Oct 2022 16:05:26 +0800 Subject: [PATCH 161/249] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/IcHouseDTO.java | 9 +++++++++ .../java/com/epmet/controller/IcHouseController.java | 4 ++-- .../java/com/epmet/service/impl/IcHouseServiceImpl.java | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java index e026d7cbdc..cdbf65c799 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcHouseDTO.java @@ -161,4 +161,13 @@ public class IcHouseDTO implements Serializable { * 房屋可编辑编码 */ private String coding; + + /** + * 加密后的联系方式 + */ + private String showOwnerPhone; + /** + * 加密后的房主身份证 + */ + private String showOwnerIdCard; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java index 6e867c47de..00a9076821 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java @@ -18,17 +18,16 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO; 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.dto.IcHouseDTO; -import com.epmet.dto.IcVaccinePrarmeterDTO; import com.epmet.dto.form.CheckHouseInfoFormDTO; import com.epmet.dto.form.DetailByTypeFormDTO; import com.epmet.dto.form.HouseFormDTO; -import com.epmet.dto.form.VaccinePrarmeterListFormDTO; import com.epmet.dto.result.*; import com.epmet.service.IcHouseService; import org.springframework.beans.factory.annotation.Autowired; @@ -51,6 +50,7 @@ public class IcHouseController { @Autowired private IcHouseService icHouseService; + @MaskResponse(fieldNames = { "showOwnerPhone", "showOwnerIdCard" }, fieldsMaskType = { MaskResponse.MASK_TYPE_MOBILE, MaskResponse.MASK_TYPE_ID_CARD }) @GetMapping("{id}") public Result get(@PathVariable("id") String id) { IcHouseDTO data = icHouseService.get(id); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 7ad72ca217..6a222b9500 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.rocketmq.constants.TopicConstants; import com.epmet.commons.rocketmq.messages.CheckMQMsg; -import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; @@ -16,7 +15,6 @@ import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; -import com.epmet.commons.tools.redis.common.bean.ResiUserInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.IpUtils; @@ -94,6 +92,8 @@ public class IcHouseServiceImpl extends BaseServiceImpl Date: Mon, 17 Oct 2022 16:33:44 +0800 Subject: [PATCH 162/249] =?UTF-8?q?=E6=93=8D=E4=BD=9C=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/LogOperationListFormDTO.java | 20 +++++++++++ .../dto/region/LogOperationResultDTO.java | 5 +++ .../controller/LogOperationController.java | 17 +++++++++ .../java/com/epmet/dao/LogOperationDao.java | 12 ++++++- .../epmet/service/LogOperationService.java | 17 +++++++++ .../service/impl/LogOperationServiceImpl.java | 24 +++++++++++++ .../main/resources/mapper/LogOperationDao.xml | 35 ++++++++++++++++++- 7 files changed, 128 insertions(+), 2 deletions(-) diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java index 3fe203b482..a4fc503431 100644 --- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/form/LogOperationListFormDTO.java @@ -10,4 +10,24 @@ public class LogOperationListFormDTO { private Integer pageNo = 1; private Integer pageSize = 10; + /** + * 姓名 + */ + private String operatorName; + /** + * 手机号 + */ + private String operatorMobile; + /** + * yyyyMMdd + */ + private String startTime; + /** + * yyyyMMdd + */ + private String endTime; + /** + * 默认传data_tm + */ + private String category; } diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java index b08c9fc295..b794dcbd26 100644 --- a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/region/LogOperationResultDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.region; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; +import java.util.Date; + /** * */ @@ -45,4 +48,6 @@ public class LogOperationResultDTO { */ private Long operatingTime; + @JsonFormat(pattern="yyyy-MM-dd HH:mm") + private Date operateTime; } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java index 089ad29639..2da04fe5d6 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java @@ -2,6 +2,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.enums.RequirePermissionEnum; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -45,4 +46,20 @@ public class LogOperationController { return new Result>().ok(resultList); } + /** + * 数字社区-操作记录 + * @param formDTO + * @return + */ + @PostMapping("page") + public Result> page(@RequestBody LogOperationListFormDTO formDTO){ + return new Result>().ok(logOperationService.page(loginUserUtil.getLoginUserCustomerId(), + formDTO.getStartTime(), + formDTO.getEndTime(), + formDTO.getOperatorName(), + formDTO.getOperatorMobile(), + formDTO.getPageNo(), + formDTO.getPageSize(), + formDTO.getCategory())); + } } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java index a63a5aa8e4..59650e60ae 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.region.LogOperationResultDTO; import com.epmet.entity.LogOperationEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 操作日指标 @@ -29,5 +33,11 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface LogOperationDao extends BaseDao { - + + List pageList(@Param("customerId") String customerId, + @Param("startTime")String startTime, + @Param("endTime")String endTime, + @Param("operatorName")String operatorName, + @Param("operatorMobile")String operatorMobile, + @Param("category")String category); } \ No newline at end of file diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java index 67b3736395..ad7bc8acb6 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java @@ -1,5 +1,6 @@ package com.epmet.service; +import com.epmet.commons.tools.page.PageData; import com.epmet.dto.region.LogOperationResultDTO; import com.epmet.entity.LogOperationEntity; @@ -25,4 +26,20 @@ public interface LogOperationService { * @date 2021.06.07 21:56 */ List listOperationLogs(String condition, String customerId, Integer pageNo, Integer pageSize); + + /** + * 数字社区-操作记录 + * @param loginUserCustomerId + * @param startTime + * @param endTime + * @param operatorName + * @param operatorMobile + * @return + */ + PageData page(String loginUserCustomerId, + String startTime, + String endTime, + String operatorName, + String operatorMobile, + Integer pageNo, Integer pageSize,String category); } diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java index 1cbf7e32d2..f9837728e7 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.feign.ResultDataResolver; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.LogOperationDao; import com.epmet.dto.CustomerStaffDTO; @@ -15,6 +16,8 @@ import com.epmet.dto.region.LogOperationResultDTO; import com.epmet.entity.LogOperationEntity; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.LogOperationService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -174,7 +177,28 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR ldto.setCustomerId(l.getCustomerId()); ldto.setOperatorMobile(staffMap.get(l.getOperatorId()).getMobile()); ldto.setOperatorName(staffMap.get(l.getOperatorId()).getRealName()); + ldto.setOperateTime(l.getOperatingTime()); return ldto; }).collect(Collectors.toList()); } + + /** + * 数字社区-操作记录 + * + * @param customerId + * @param startTime + * @param endTime + * @param operatorName + * @param operatorMobile + * @return + */ + @Override + public PageData page(String customerId, String startTime, String endTime, String operatorName, String operatorMobile, + Integer pageNo, Integer pageSize,String category) { + // 列表/导出查询 + PageHelper.startPage(pageNo, pageSize); + List list = logOperationDao.pageList(customerId, startTime, endTime, operatorName, operatorMobile,category); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } } diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml index 5f34d339ad..b65219788c 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml +++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml @@ -26,5 +26,38 @@ - + \ No newline at end of file From dc37e827abae339040c5df812d7c47f9c5424c22 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 17 Oct 2022 16:41:36 +0800 Subject: [PATCH 163/249] message --- .../com/epmet/controller/HouseController.java | 52 +++++++++++++++---- .../service/impl/IcHouseServiceImpl.java | 8 +-- .../impl/IcResiUserExportServiceImpl.java | 32 +++++++++--- 3 files changed, 70 insertions(+), 22 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 35b3bc0e6f..0e2f57f7d9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -25,6 +25,8 @@ import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.rocketmq.messages.CheckMQMsg; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; import com.epmet.commons.tools.annotation.ReportRequest; @@ -40,10 +42,7 @@ import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.ExcelUtils; -import com.epmet.commons.tools.utils.HouseQRcodeUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.poi.excel.handler.ExcelFillRowMergeStrategy; import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -54,6 +53,7 @@ import com.epmet.dto.result.*; import com.epmet.entity.CustomerOrgParameterEntity; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.HouseService; import com.epmet.util.ExcelPoiUtils; @@ -66,18 +66,18 @@ import org.apache.poi.ss.usermodel.VerticalAlignment; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.multipart.MultipartFile; import javax.imageio.ImageIO; import javax.imageio.stream.ImageOutputStream; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.awt.image.BufferedImage; import java.io.*; import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Set; +import java.util.*; import java.util.concurrent.TimeUnit; @@ -105,6 +105,8 @@ public class HouseController implements ResultDataResolver { @Autowired private IcHouseDao icHouseDao; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; @ReportRequest @PostMapping("houselist") @@ -265,7 +267,7 @@ public class HouseController implements ResultDataResolver { * @throws Exception */ @RequestMapping("exporthouseinfo") - public void exporthouseinfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response) throws Exception { + public void exporthouseinfo(@RequestBody IcHouseListFormDTO formDTO, HttpServletResponse response,@LoginUser TokenDto tokenDto) throws Exception { ValidatorUtils.validateEntity(formDTO); if (StringUtils.isNotBlank(formDTO.getId())){ formDTO.setSelectType("id"); @@ -274,7 +276,21 @@ public class HouseController implements ResultDataResolver { } formDTO.setIsPage(false); houseService.exportBuildinginfo(formDTO, response); - + // 新增操作日志 + CheckMQMsg msg = new CheckMQMsg(); + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + msg.setOperateTime(new Date()); + msg.setContent("导出房屋数据"); + msg.setType("exportHouse"); + msg.setTypeDisplay("导出房屋数据"); + msg.setUserId(tokenDto.getUserId()); + msg.setFromApp(tokenDto.getApp()); + msg.setIp(IpUtils.getIpAddr(request)); + msg.setFromClient(tokenDto.getClient()); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(TopicConstants.CHECK_OR_EXPORT); + form.setContent(msg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); } @PostMapping("queryListHouseInfo") @@ -452,6 +468,22 @@ public class HouseController implements ResultDataResolver { //获取导出配置 haveSearchCache.invalidateAll(); + + // 发送操作日志 + CheckMQMsg msg = new CheckMQMsg(); + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + msg.setOperateTime(new Date()); + msg.setContent("导出一户一档数据"); + msg.setType("exportYHYD"); + msg.setTypeDisplay("导出一户一档数据"); + msg.setUserId(tokenDto.getUserId()); + msg.setFromApp(tokenDto.getApp()); + msg.setIp(IpUtils.getIpAddr(request)); + msg.setFromClient(tokenDto.getClient()); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(TopicConstants.CHECK_OR_EXPORT); + form.setContent(msg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); } catch (EpmetException e) { response.reset(); response.setCharacterEncoding("UTF-8"); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 15d9d849f6..81693e4230 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -436,9 +436,9 @@ public class IcHouseServiceImpl extends BaseServiceImpl Date: Mon, 17 Oct 2022 17:18:56 +0800 Subject: [PATCH 164/249] showOwnerIdCard --- .../main/java/com/epmet/service/impl/IcHouseServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 81693e4230..a44882b549 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -92,7 +92,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl Date: Tue, 18 Oct 2022 09:03:31 +0800 Subject: [PATCH 165/249] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=92=8C=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E4=BA=BA=E5=91=98=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yantai/DataSyncUserAndOrgController.java | 42 ++++ .../yantai/DataSyncUserAndOrgService.java | 10 + .../yantai/DataSyncUserAndOrgServiceImpl.java | 30 +++ .../controller/yantai/SM4UtilsForYanTai.java | 199 ++++++++++++++++++ .../main/java/com/epmet/utils/YantaiApi.java | 96 +++++++++ 5 files changed, 377 insertions(+) create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/SM4UtilsForYanTai.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/YantaiApi.java diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java new file mode 100644 index 0000000000..9df9a6d5c5 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java @@ -0,0 +1,42 @@ +package com.epmet.controller.yantai; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * desc: 从各个平台-同步用户和组织数据到本地 用于生成本系统账号 + * + * @author LiuJanJun + * @date 2022/10/17 3:41 下午 + */ +@RestController +@RequestMapping("dataSync") +public class DataSyncUserAndOrgController { + + @Autowired + private DataSyncUserAndOrgService dataSyncUserAndOrgService; + + /** + * desc:从统一认证中心 拉取用户信息 + * @return + */ + @PostMapping("yantai/sync/user") + public Result templateList(String orgId) { + Boolean flag = dataSyncUserAndOrgService.yanTaiSyncUser(orgId); + return new Result().ok(flag); + } + + /** + * desc:从统一认证中心 拉取组织信息 + * @return + */ + @PostMapping("yantai/sync/org") + public Result getExtJson(String orgId) { + Boolean extJson = dataSyncUserAndOrgService.yanTaiSyncOrg(orgId); + return new Result().ok(extJson); + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java new file mode 100644 index 0000000000..2a7e1bbabc --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java @@ -0,0 +1,10 @@ +package com.epmet.controller.yantai; + +/** + * @author liujianjun + */ +public interface DataSyncUserAndOrgService { + Boolean yanTaiSyncUser(String organizationId); + + Boolean yanTaiSyncOrg(String organizationId); +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java new file mode 100644 index 0000000000..bfc87e0ff4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -0,0 +1,30 @@ +package com.epmet.controller.yantai; + +import com.epmet.utils.OrgData; +import com.epmet.utils.UserData; +import com.epmet.utils.YantaiApi; + +import java.util.List; + +/** + * desc:烟台 从认证中心同步组织和用户信息 到本地 + * + * @author: LiuJanJun + * @date: 2022/10/17 3:42 下午 + * @version: 1.0 + */ +public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService { + @Override + public Boolean yanTaiSyncUser(String organizationId) { + List data = YantaiApi.getChildOuInfoByGuid(organizationId); + //todo 更新或插入数据 + return false; + } + + @Override + public Boolean yanTaiSyncOrg(String organizationId) { + List data = YantaiApi.getUserByOuGuid(organizationId); + + return false; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/SM4UtilsForYanTai.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/SM4UtilsForYanTai.java new file mode 100644 index 0000000000..35d90d20ca --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/SM4UtilsForYanTai.java @@ -0,0 +1,199 @@ +package com.epmet.controller.yantai; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.commons.codec.binary.Base64; +import org.bouncycastle.jce.provider.BouncyCastleProvider; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.security.InvalidKeyException; +import java.security.Security; + +/** + * 烟台的认证中心-国密sm4加解密 + */ +public class SM4UtilsForYanTai { + private static String SM4_KEY = "yaweisoftware@xy"; + //编码格式 + private static final Charset encryptCharset = StandardCharsets.UTF_8; + + public enum Algorithm { + SM4("SM4","SM4","国密四,key长16byte"); + private String keyAlgorithm; + private String transformation; + private String description;//描述 + Algorithm(String keyAlgorithm, String transformation, String description) { + this.keyAlgorithm = keyAlgorithm; + this.transformation = transformation; + this.description = description; + } + public String getKeyAlgorithm() { + return this.keyAlgorithm; + } + public String getTransformation() { + return this.transformation; + } + public String getDescription() { + return this.description; + } + } + + private static final String PROVIDER_NAME = "BC"; + static { + Security.addProvider(new BouncyCastleProvider()); + } + + /** + * 自定字符串产生密钥 + * @param algorithm 加解密算法 + * @param keyStr 密钥字符串 + * @param charset 编码字符集 + * @return 密钥 + */ + public static SecretKey genKeyByStr(Algorithm algorithm, String keyStr, Charset charset) { + return readKeyFromBytes(algorithm, keyStr.getBytes(charset)); + } + + /** + * 根据指定字节数组产生密钥 + * @param algorithm 加解密算法 + * @param keyBytes 密钥字节数组 + * @return 密钥 + */ + public static SecretKey readKeyFromBytes(Algorithm algorithm, byte[] keyBytes) { + return new SecretKeySpec(keyBytes, algorithm.getKeyAlgorithm()); + } + + /****************************加密*********************************/ + /** + * 加密字符串,并进行base64编码 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 明文 + * @param charset 编码字符集 + * @return 密文 + * @throws InvalidKeyException 密钥错误 + */ + public static String encryptBase64(Algorithm algorithm, SecretKey key, String data, Charset charset) throws InvalidKeyException { + return Base64.encodeBase64String(encrypt(algorithm, key, data.getBytes(charset))); + } + + /** + * 加密字节数组 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 明文 + * @return 密文 + * @throws InvalidKeyException 密钥错误 + */ + public static byte[] encrypt(Algorithm algorithm, SecretKey key, byte[] data) throws InvalidKeyException { + try { + return cipherDoFinal(algorithm, Cipher.ENCRYPT_MODE, key, data); + } catch (BadPaddingException e) { + throw new RuntimeException(e);//明文没有具体格式要求,不会出错。所以这个异常不需要外部捕获。 + } + } + + /** + * 加解密字节数组 + * @param algorithm 加解密算法 + * @param opmode 操作:1加密,2解密 + * @param key 密钥 + * @param data 数据 + * @throws InvalidKeyException 密钥错误 + * @throws BadPaddingException 解密密文错误(加密模式没有) + */ + private static byte[] cipherDoFinal(Algorithm algorithm, int opmode, SecretKey key, byte[] data) throws InvalidKeyException, BadPaddingException { + Cipher cipher; + try { + cipher = Cipher.getInstance(algorithm.getTransformation(), PROVIDER_NAME); + } catch (Exception e) { + //NoSuchAlgorithmException:加密算法名是本工具类提供的,如果错了业务没有办法处理。所以这个异常不需要外部捕获。 + //NoSuchProviderException:Provider是本工具类提供的,如果错了业务没有办法处理。所以这个异常不需要外部捕获。 + //NoSuchPaddingException:没有特定的填充机制,与环境有关,业务没有办法处理。所以这个异常不需要外部捕获。 + throw new RuntimeException(e); + } + cipher.init(opmode, key); + try { + return cipher.doFinal(data); + } catch (IllegalBlockSizeException e) { + throw new RuntimeException(e);//业务不需要将数据分块(好像由底层处理了),如果错了业务没有办法处理。所以这个异常不需要外部捕获。 + } + } + + /****************************解密*********************************/ + /** + * 对字符串先进行base64解码,再解密 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 密文 + * @param charset 编码字符集 + * @return 明文 + * @throws InvalidKeyException 密钥错误 + * @throws BadPaddingException 密文错误 + */ + public static String decryptBase64(Algorithm algorithm, SecretKey key, String data, Charset charset) + throws InvalidKeyException, BadPaddingException { + return new String(decrypt(algorithm, key, Base64.decodeBase64(data)), charset); + } + + /** + * 解密字节数组 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 密文 + * @return 明文 + * @throws InvalidKeyException 密钥错误 + * @throws BadPaddingException 密文错误 + */ + public static byte[] decrypt(Algorithm algorithm, SecretKey key, byte[] data) throws InvalidKeyException, BadPaddingException { + return cipherDoFinal(algorithm, Cipher.DECRYPT_MODE, key, data); + } + + public static String Encrypt(String data) throws InvalidKeyException { + SecretKey key = genKeyByStr(Algorithm.SM4, SM4_KEY, encryptCharset); + return encryptBase64(Algorithm.SM4, key, data, encryptCharset); + } + public static String Decrypt(String data) throws BadPaddingException, InvalidKeyException { + SecretKey key = genKeyByStr(Algorithm.SM4, SM4_KEY, encryptCharset); + return decryptBase64(Algorithm.SM4, key, data, encryptCharset); + } + //加密 + public static String dealEncryptData(Object data) throws JsonProcessingException, InvalidKeyException { + ObjectMapper objectMapper = new ObjectMapper(); + String dataString = ""; + try { + if(data instanceof String){ + dataString = (String) data; + }else { + dataString = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(data); + } + String dataEncrypt = Encrypt(dataString); + return dataEncrypt; + }catch (Exception e){ + return dataString; + } + } + //解密 + public static String dealDecryptData(Object data) throws JsonProcessingException, BadPaddingException, InvalidKeyException { + String dataString = ""; + try { + ObjectMapper objectMapper = new ObjectMapper(); + if (data instanceof String) { + dataString = (String) data; + } else { + dataString = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(data); + } + String dataDecrypt = Decrypt(dataString); + return dataDecrypt; + }catch (Exception e){ + return dataString; + } + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/YantaiApi.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/YantaiApi.java new file mode 100644 index 0000000000..e788f605c1 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/YantaiApi.java @@ -0,0 +1,96 @@ +package com.epmet.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.controller.yantai.SM4UtilsForYanTai; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * desc: + * + * @author: LiuJanJun + * @date: 2022/10/17 3:57 下午 + * @version: 1.0 + */ +@Slf4j +public class YantaiApi { + private static final String SSO_SERVER = "http://localhost:8080/"; + + /** + * desc:根据组织id获取下级组织 + * + * @param organizationId + * @return + */ + public static List getChildOuInfoByGuid(String organizationId) { + try { + if (StringUtils.isBlank(organizationId)){ + throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + //加密 + String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(organizationId); + //pwd = URLEncoder.encode(pwd, "UTF-8"); + System.out.println("加密组织Id = " + organizationIdEn); + String url = "ouinfo/getChildOuInfoByGuid?organizationId=" + organizationIdEn; + + Map headerMap = new HashMap<>(); + Map paramMap = new HashMap<>(); + log.info("getChildOuInfoByGuid request param: url:{},header:{}", url, headerMap); + Result result = HttpClientManager.getInstance().sendGet(url, paramMap, headerMap); + log.info("getChildOuInfoByGuid request result:{}", result); + JSONObject jsonObject = JSONObject.parseObject(result.getData()); + //解密 + String data = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); + List orgData = JSON.parseArray(data, OrgData.class); + log.info("getChildOuInfoByGuid request real result:{}", JSON.toJSONString(orgData)); + return orgData; + } catch (Exception e) { + log.error("getChildOuInfoByGuid exception", e); + } + return new ArrayList<>(); + } + + /** + * desc:根据组织id获取下级组织 + * + * @param organizationId + * @return + */ + public static List getUserByOuGuid(String organizationId) { + try { + if (StringUtils.isBlank(organizationId)){ + throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + //加密 + String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(organizationId); + //pwd = URLEncoder.encode(pwd, "UTF-8"); + System.out.println("加密组织Id = " + organizationIdEn); + String url = "ouinfo/getUserByOuGuid?organizationId=" + organizationIdEn; + + Map headerMap = new HashMap<>(); + Map paramMap = new HashMap<>(); + log.info("getUserByOuGuid request param: url:{},header:{}", url, headerMap); + Result result = HttpClientManager.getInstance().sendGet(url, paramMap, headerMap); + log.info("getUserByOuGuid request result:{}", result); + JSONObject jsonObject = JSONObject.parseObject(result.getData()); + //解密 + String data = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); + List userData = JSON.parseArray(data, UserData.class); + log.info("getUserByOuGuid request real result:{}", JSON.toJSONString(userData)); + return userData; + } catch (Exception e) { + log.error("getUserByOuGuid exception", e); + } + return new ArrayList<>(); + } +} From 24b8116bfdfb074de21e09ab46da0aaa16681891 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Oct 2022 10:19:04 +0800 Subject: [PATCH 166/249] =?UTF-8?q?=E5=97=AF=20=E6=A0=B8=E9=85=B8=E6=A3=80?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/utils/YtHsResUtils.java | 30 +++- .../src/main/java/com/epmet/dao/IcNatDao.java | 2 + .../java/com/epmet/service/IcNatService.java | 2 + .../impl/DataSyncConfigServiceImpl.java | 142 ++++++++++-------- .../epmet/service/impl/IcNatServiceImpl.java | 8 + .../src/main/resources/mapper/IcNatDao.xml | 34 ++++- 6 files changed, 152 insertions(+), 66 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java index cb28cf5419..3f72228656 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java @@ -43,7 +43,33 @@ public class YtHsResUtils { log.info("hscy api param:{}", param); //todo 核酸检测 mock数据 放开她 //Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"hscyxxcx", param); - String mockData = "{\"id\":\"1570924677539635484\",\"name\":\"杨XX\",\"card_type\":\"1\",\"card_no\":\"370283199912010302\",\"create_by\":\"370613594\",\"create_time\":\"2022-09-17 07:15:22\",\"sys_org_code\":\"370613\",\"sample_tube\":\"GCJ-0825-0441\",\"package_id\":\"bcj00208083952\",\"city\":\"烟台市\",\"uuid\":\"6225684525062602095\",\"county\":\"莱山区\",\"depart_ids\":\"未填写\",\"depart_name\":null,\"realname\":\"采样点327\",\"upload_time\":\"2022-09-17 07:56:45\",\"sd_id\":null,\"sd_batch\":null,\"sd_operation\":null,\"sd_time\":null,\"inserttime\":\"2022-09-17 09:36:20\"}"; + String mockData = "{\n" + + " \"code\":0,\n" + + " \"msg\":\"success\",\n" + + " \"data\":[{\n" + + " \"id\": \"1570924677539635484\",\n" + + " \"name\": \"杨XX\",\n" + + " \"card_type\": \"1\",\n" + + " \"card_no\": \"370283199912010302\",\n" + + " \"create_by\": \"370613594\",\n" + + " \"create_time\": \"2022-09-17 07:15:22\",\n" + + " \"sys_org_code\": \"370613\",\n" + + " \"sample_tube\": \"GCJ-0825-0441\",\n" + + " \"package_id\": \"bcj00208083952\",\n" + + " \"city\": \"烟台市\",\n" + + " \"uuid\": \"6225684525062602095\",\n" + + " \"county\": \"莱山区\",\n" + + " \"depart_ids\": \"未填写\",\n" + + " \"depart_name\": null,\n" + + " \"realname\": \"采样点327\",\n" + + " \"upload_time\": \"2022-09-17 07:56:45\",\n" + + " \"sd_id\": null,\n" + + " \"sd_batch\": null,\n" + + " \"sd_operation\": null,\n" + + " \"sd_time\": null,\n" + + " \"inserttime\": \"2022-09-17 09:36:20\"\n" + + "}]\n" + + "}"; Result result = new Result().ok(mockData); log.info("hscy api result:{}", JSON.toJSONString(result)); if (result.success()) { @@ -74,7 +100,7 @@ public class YtHsResUtils { log.info("hsjc api param:{}", param); //todo 核酸检测 mock数据 放开她 //Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"hsjcxx", param); - String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":[{\"id\":\"6a31eb2d38c011eda054fa163ebc7ff4\",\"name\":\"数据同步测试用户\",\"card_no\":\"370283199912010302\",\"telephone\":\"13697890860\",\"address\":\"保利香榭里公馆18-1-302\",\"test_time\":\"2022-09-20 12:52:28\",\"depart_name\":\"天仁医学检验实验室有限公司\",\"county\":\"莱山区\",\"upload_time\":\"2022-09-20 21:23:10\",\"sample_result_pcr\":\"2\",\"sample_time\":\"2022-09-20 06:48:28\",\"sampling_org_pcr\":\"采样点327\"}],\"total\":1}"; + String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":[{\"id\":\"6a31eb2d38c011eda054fa163ebc7ff4\",\"name\":\"数据同步测试用户\",\"card_no\":\"370283199912010302\",\"telephone\":\"13697890860\",\"address\":\"保利香榭里公馆18-1-302\",\"test_time\":\"2022-09-20 12:52:28\",\"depart_name\":\"天仁医学检验实验室有限公司\",\"county\":\"莱山区\",\"upload_time\":\"2022-09-20 21:23:10\",\"sample_result_pcr\":\"2\",\"sample_time\":\"2022-09-17 07:15:22\",\"sampling_org_pcr\":\"采样点327\"}],\"total\":1}"; Result result = new Result().ok(mockData); log.info("hsjc api result:{}", JSON.toJSONString(result)); if (result.success()) { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java index b2419b09f5..f21ec91eb3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcNatDao.java @@ -64,4 +64,6 @@ public interface IcNatDao extends BaseDao { List getExistNatInfo(@Param("list") List entities); + void updateBatchNat(@Param("list")List entities); + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java index ea75c911e4..430a66424a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcNatService.java @@ -92,4 +92,6 @@ public interface IcNatService extends BaseService { * @return */ Integer updateIsResiFlag(String customerId, String icResiUserId); + + void updateBatchNat(List entities); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index 2517791025..90ddad6372 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -454,100 +454,64 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl idCards, String customerId, String isSync) { try { - List entities = new ArrayList<>(); idCards.forEach(idCard -> { -// YtHscyResDTO sampleResult = YtHsResUtils.hscy(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); - YtHsjcResDTO natInfoResult = YtHsResUtils.hsjc(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); - /*Boolean aBoolean = CollectionUtils.isEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData()); - Boolean bBoolean = CollectionUtils.isNotEmpty(sampleResult.getData()) && CollectionUtils.isNotEmpty(natInfoResult.getData());*/ - /** - * 1.采样结果 和 检测结果 都不为空,以检测结果为准 - * 2.采样结果为空,检测结果不为空 - */ -// if (aBoolean || bBoolean) { - if (CollectionUtils.isNotEmpty(natInfoResult.getData())) { - natInfoResult.getData().forEach(natInfo -> { + YtHscyResDTO sampleResult = YtHsResUtils.hscy(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); + if (CollectionUtils.isNotEmpty(sampleResult.getData())){ + List entities = new ArrayList<>(); + sampleResult.getData().forEach(sampleInfo -> { IcNatEntity e = new IcNatEntity(); e.setCustomerId(customerId); e.setIsResiUser(StringUtils.isBlank(idCard.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR); e.setUserId(idCard.getUserId()); + e.setMobile(""); e.setUserType(isSync.equals(NumConstant.ONE_STR) ? "manualSync" : "sync"); - e.setName(StringUtils.isNotBlank(natInfo.getName()) ? natInfo.getName() : ""); - e.setMobile(StringUtils.isNotBlank(natInfo.getTelephone()) ? natInfo.getTelephone() : ""); - e.setIdCard(StringUtils.isNotBlank(natInfo.getCard_no()) ? natInfo.getCard_no() : ""); - e.setNatTime(DateUtils.parseDate(natInfo.getTest_time(), DateUtils.DATE_TIME_PATTERN)); - e.setSampleTime(DateUtils.parseDate(natInfo.getSample_time(), DateUtils.DATE_TIME_PATTERN)); - String resultPcr = natInfo.getSample_result_pcr(); - //检测结果 转换 我们 0:阴性 1:阳性, 他们 :1:阳性,2:阴性 - e.setNatResult(NumConstant.ZERO_STR); - if (NumConstant.ONE_STR.equals(resultPcr)) { - e.setNatResult(NumConstant.ONE_STR); - } - e.setNatAddress(natInfo.getSampling_org_pcr()); + e.setName(StringUtils.isNotBlank(sampleInfo.getName()) ? sampleInfo.getName() : ""); + e.setIdCard(StringUtils.isNotBlank(sampleInfo.getCard_no()) ? sampleInfo.getCard_no() : ""); + e.setSampleTime(DateUtils.parseDate(sampleInfo.getCreate_time(), DateUtils.DATE_TIME_PATTERN)); e.setAgencyId(idCard.getAgencyId()); e.setPids(idCard.getPids()); e.setAttachmentType(""); e.setAttachmentUrl(""); entities.add(e); }); + if (CollectionUtils.isNotEmpty(entities)){ + List existSampleInfo = icNatDao.getExistNatInfo(entities); + sampleAndNat(existSampleInfo,entities,NumConstant.ONE_STR,customerId,isSync); + } } - /*if (CollectionUtils.isNotEmpty(sampleResult.getData()) && CollectionUtils.isEmpty(natInfoResult.getData())){ - sampleResult.getData().forEach(sampleInfo -> { + YtHsjcResDTO natInfoResult = YtHsResUtils.hsjc(idCard.getIdCard(), NumConstant.ONE, NumConstant.ONE); + if (CollectionUtils.isNotEmpty(natInfoResult.getData())) { + List entities = new ArrayList<>(); + natInfoResult.getData().forEach(natInfo -> { IcNatEntity e = new IcNatEntity(); e.setCustomerId(customerId); e.setIsResiUser(StringUtils.isBlank(idCard.getUserId()) ? NumConstant.ZERO_STR : NumConstant.ONE_STR); e.setUserId(idCard.getUserId()); e.setUserType(isSync.equals(NumConstant.ONE_STR) ? "manualSync" : "sync"); - e.setName(StringUtils.isNotBlank(sampleInfo.getName()) ? sampleInfo.getName() : ""); - e.setMobile(StringUtils.isNotBlank(sampleInfo.get()) ? sampleInfo.getTelephone() : ""); - e.setIdCard(StringUtils.isNotBlank(sampleInfo.getCard_no()) ? sampleInfo.getCard_no() : ""); - e.setNatTime(DateUtils.parseDate(sampleInfo.getTest_time(), DateUtils.DATE_TIME_PATTERN)); - e.setSampleTime(DateUtils.parseDate(sampleInfo.getSample_time(), DateUtils.DATE_TIME_PATTERN)); - String resultPcr = sampleInfo.getSample_result_pcr(); + e.setName(StringUtils.isNotBlank(natInfo.getName()) ? natInfo.getName() : ""); + e.setMobile(StringUtils.isNotBlank(natInfo.getTelephone()) ? natInfo.getTelephone() : ""); + e.setIdCard(StringUtils.isNotBlank(natInfo.getCard_no()) ? natInfo.getCard_no() : ""); + e.setNatTime(DateUtils.parseDate(natInfo.getTest_time(), DateUtils.DATE_TIME_PATTERN)); + e.setSampleTime(DateUtils.parseDate(natInfo.getSample_time(), DateUtils.DATE_TIME_PATTERN)); + String resultPcr = natInfo.getSample_result_pcr(); //检测结果 转换 我们 0:阴性 1:阳性, 他们 :1:阳性,2:阴性 e.setNatResult(NumConstant.ZERO_STR); - if (NumConstant.ONE_STR.equals(resultPcr)){ + if (NumConstant.ONE_STR.equals(resultPcr)) { e.setNatResult(NumConstant.ONE_STR); } - e.setNatAddress(sampleInfo.getSampling_org_pcr()); + e.setNatAddress(natInfo.getSampling_org_pcr()); e.setAgencyId(idCard.getAgencyId()); e.setPids(idCard.getPids()); e.setAttachmentType(""); e.setAttachmentUrl(""); entities.add(e); }); - } - });*/ - if (CollectionUtils.isNotEmpty(entities)) { - List existNatInfos = icNatDao.getExistNatInfo(entities); - entities.forEach(e -> existNatInfos.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> e.setExistStatus(true))); - Map> groupByStatus = entities.stream().collect(Collectors.groupingBy(IcNatEntity::getExistStatus)); - if (CollectionUtils.isNotEmpty(groupByStatus.get(false))) { - for (List icNatEntities : ListUtils.partition(groupByStatus.get(false), NumConstant.FIVE_HUNDRED)) { - icNatService.insertBatch(icNatEntities); - //组织关系表 - List relationEntities = new ArrayList<>(); - icNatEntities.forEach(ne -> { - // 不是居民的先不加关系表吧 - if (ne.getIsResiUser().equals(NumConstant.ONE_STR)) { - IcNatRelationEntity e = new IcNatRelationEntity(); - e.setCustomerId(customerId); - e.setAgencyId(ne.getAgencyId()); - e.setPids(ne.getPids()); - e.setIcNatId(ne.getId()); - e.setUserType("sync"); - relationEntities.add(e); - } - }); - if (CollectionUtils.isNotEmpty(relationEntities)) { - icNatRelationService.insertBatch(relationEntities); - } - } + if (CollectionUtils.isNotEmpty(entities)) { + List existNatInfos = icNatDao.getExistNatInfo(entities); + sampleAndNat(existNatInfos,entities,NumConstant.TWO_STR,customerId,isSync); } - } }); } catch (Exception e) { @@ -556,6 +520,58 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl existInfo, List entities, String type, String customerId, String isSync){ + /** + * 采样结果不为空 + * 数据库采样时间+idCard+userId 存在的 不做操作 + * 数据库采样时间+idCard+userId 不存在的 新增 + * + * 检测结果不为空 + * 数据库采样时间+idCard+userId 存在的 做更新 + * 数据库采样时间+idCard+userId 不存在的 新增 + */ + entities.forEach(e -> existInfo.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> e.setExistStatus(true))); + Map> groupByStatus = entities.stream().collect(Collectors.groupingBy(IcNatEntity::getExistStatus)); + if (CollectionUtils.isNotEmpty(groupByStatus.get(false))) { + for (List icNatEntities : ListUtils.partition(groupByStatus.get(false), NumConstant.FIVE_HUNDRED)) { + // 主表新增 + icNatService.insertBatch(icNatEntities); + // 组织关系表 + List relationEntities = new ArrayList<>(); + icNatEntities.forEach(ne -> { + if (ne.getIsResiUser().equals(NumConstant.ONE_STR)) { + IcNatRelationEntity e = new IcNatRelationEntity(); + e.setCustomerId(customerId); + e.setAgencyId(ne.getAgencyId()); + e.setPids(ne.getPids()); + e.setIcNatId(ne.getId()); + e.setUserType(isSync.equals(NumConstant.ONE_STR) ? "manualSync" : "sync"); + relationEntities.add(e); + } + }); + if (CollectionUtils.isNotEmpty(relationEntities)) { + icNatRelationService.insertBatch(relationEntities); + } + } + } + if (NumConstant.TWO_STR.equals(type)){ + if (CollectionUtils.isNotEmpty(groupByStatus.get(true))){ + for (List icNatEntities : ListUtils.partition(groupByStatus.get(true), NumConstant.ONE_HUNDRED)) { + icNatService.updateBatchNat(icNatEntities); + } + } + } + } + private class JudgeDealStatus { private boolean isNext; private DataSyncRecordDisabilityDTO dbDisablityEntity; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index 3a9282b9bb..fcc03adf39 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -464,6 +464,14 @@ public class IcNatServiceImpl extends BaseServiceImpl imp return baseDao.updateIsResiFlag(customerId,icResiUserId); } + @Override + @Transactional(rollbackFor = Exception.class) + public void updateBatchNat(List entities) { + if (CollectionUtils.isNotEmpty(entities)){ + baseDao.updateBatchNat(entities); + } + } + /** * 批量持久化 * @param entities diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index 0295d92f3f..ea4f9a8bc6 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -164,7 +164,7 @@ WHERE del_flag = '0' AND USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} - AND UNIX_TIMESTAMP(NAT_TIME) = UNIX_TIMESTAMP(#{l.natTime}) + AND UNIX_TIMESTAMP(SAMPLE_TIME) = UNIX_TIMESTAMP(#{l.sampleTime}) @@ -189,4 +189,36 @@ m.ID_CARD = t.ID_CARD AND m.DEL_FLAG = '0' + + UPDATE ic_nat + + + + when USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} then #{l.natTime} + + + + + when USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} then #{l.natAddress} + + + + + when USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} then #{l.natResult} + + + + + when USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} then #{l.mobile} + + + UPDATED_TIME = NOW() + + WHERE DEL_FLAG = '0' + + AND USER_ID = #{l.userId} + AND ID_CARD = #{l.idCard} + + + From b55b324fc480d1e9eae4f3920e0918e4e584ce50 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Oct 2022 10:49:10 +0800 Subject: [PATCH 167/249] =?UTF-8?q?=E5=85=88=E6=8A=8A=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=8B=BF=E5=88=B0controller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/IcResiUserController.java | 18 ++++++++++++++++++ .../impl/IcResiUserExportServiceImpl.java | 14 -------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 5b78b84775..701968bcf0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -22,6 +22,8 @@ import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.fill.FillWrapper; import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.rocketmq.messages.CheckMQMsg; import com.epmet.commons.rocketmq.messages.IcResiUserAddMQMsg; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; @@ -85,6 +87,8 @@ import org.jetbrains.annotations.NotNull; import org.redisson.api.RLock; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.multipart.MultipartFile; import javax.servlet.ServletOutputStream; @@ -558,6 +562,20 @@ public class IcResiUserController implements ResultDataResolver { } else { icResiUserExportService.exportIcResiUser(tokenDto, pageFormDTO, response,false); } + CheckMQMsg msg = new CheckMQMsg(); + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + msg.setOperateTime(new Date()); + msg.setContent("导出居民数据"); + msg.setType("exportIcResiUser"); + msg.setTypeDisplay("导出居民数据"); + msg.setUserId(tokenDto.getUserId()); + msg.setFromApp(tokenDto.getApp()); + msg.setIp(IpUtils.getIpAddr(request)); + msg.setFromClient(tokenDto.getClient()); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(TopicConstants.CHECK_OR_EXPORT); + form.setContent(msg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); } catch (EpmetException e) { response.reset(); response.setCharacterEncoding("UTF-8"); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java index e5d691a8c0..ec754bb2b8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserExportServiceImpl.java @@ -204,20 +204,6 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { excelWriter.write(resultData, writeSheet); } } while (!searchForm.getIsPage() && mapListPage.getResult().size() == searchForm.getPageSize()); - CheckMQMsg msg = new CheckMQMsg(); - HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - msg.setOperateTime(new Date()); - msg.setContent("导出居民数据"); - msg.setType("exportIcResiUser"); - msg.setTypeDisplay("导出居民数据"); - msg.setUserId(tokenDto.getUserId()); - msg.setFromApp(tokenDto.getApp()); - msg.setIp(IpUtils.getIpAddr(request)); - msg.setFromClient(tokenDto.getClient()); - SystemMsgFormDTO form = new SystemMsgFormDTO(); - form.setMessageType(TopicConstants.CHECK_OR_EXPORT); - form.setContent(msg); - epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); } catch (IOException e) { log.error("exportIcResiUser exception", e); throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMessage(), "导出失败"); From 7661f838bc9307ec989187e92b4f20eba0f9319a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 12:38:58 +0800 Subject: [PATCH 168/249] =?UTF-8?q?/third/dataSync/page-user=20=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E8=AE=A4=E8=AF=81=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/yantai/YtUserPageFormDTO.java | 36 ++++++ .../dto/result/yantai/YtUserPageResDTO.java | 54 +++++++++ .../yantai/DataSyncUserAndOrgController.java | 16 +++ .../yantai/DataSyncUserAndOrgService.java | 12 ++ .../yantai/DataSyncUserAndOrgServiceImpl.java | 27 +++++ .../epmet/dao/yantai/DataSyncOrgDataDao.java | 16 +++ .../epmet/dao/yantai/DataSyncUserDataDao.java | 25 +++++ .../entity/yantai/DataSyncOrgDataEntity.java | 106 ++++++++++++++++++ .../entity/yantai/DataSyncUserDataEntity.java | 91 +++++++++++++++ .../mapper/yantai/DataSyncOrgDataDao.xml | 34 ++++++ .../mapper/yantai/DataSyncUserDataDao.xml | 76 +++++++++++++ 11 files changed, 493 insertions(+) create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtUserPageFormDTO.java create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/YtUserPageResDTO.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncOrgDataEntity.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncUserDataEntity.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtUserPageFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtUserPageFormDTO.java new file mode 100644 index 0000000000..6a3ddda553 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtUserPageFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.form.yantai; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; + +/** + * @Description 运营端,统一认证 列表查询入参 + * @Author yzm + * @Date 2022/10/18 11:12 + */ +@Data +public class YtUserPageFormDTO extends PageFormDTO { + /** + * 0本机 + * 1本级及下级 + */ + private String type; + /** + * 组织id + * data_sync_org_data.ORGANIZATION_ID + */ + private String orgId; + /** + * 姓名 + */ + private String name; + /** + * 手机号 + */ + private String mobile; + /** + * 0未创建、已创建 + */ + private String status; +} + diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/YtUserPageResDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/YtUserPageResDTO.java new file mode 100644 index 0000000000..1600fa6052 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/YtUserPageResDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.result.yantai; + +import lombok.Data; + +/** + * @Description 运营端,统一认证 列表返参 + * @Author yzm + * @Date 2022/10/18 11:53 + */ +@Data +public class YtUserPageResDTO { + /** + * 统一用户编码 + */ + private String userGuid; + /** + * data_sync_org_data.组织机构ID; + */ + private String organizationId; + /** + * XXX-XXX + */ + private String orgName; + /** + * 用户姓名 + */ + private String userName; + + /** + * 电话号码 + */ + private String telephoneNumber; + + /** + * 性别:0未知1男2女 + */ + private String gender; + + /** + * 0未创建、已创建 + */ + private String status; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 备注;目前为空 + */ + private String remark; +} + diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java index 9df9a6d5c5..9ebbbfa8d3 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java @@ -1,8 +1,12 @@ package com.epmet.controller.yantai; +import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.yantai.YtUserPageFormDTO; +import com.epmet.dto.result.yantai.YtUserPageResDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -39,4 +43,16 @@ public class DataSyncUserAndOrgController { return new Result().ok(extJson); } + + /** + * 运营端,统一认证 列表查询 + * + * @param formDTO + * @return + */ + @PostMapping("page-user") + public Result> pageUser(@RequestBody YtUserPageFormDTO formDTO) { + return new Result>().ok(dataSyncUserAndOrgService.pageUser(formDTO)); + } + } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java index 2a7e1bbabc..42b002eb07 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java @@ -1,5 +1,9 @@ package com.epmet.controller.yantai; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.yantai.YtUserPageFormDTO; +import com.epmet.dto.result.yantai.YtUserPageResDTO; + /** * @author liujianjun */ @@ -7,4 +11,12 @@ public interface DataSyncUserAndOrgService { Boolean yanTaiSyncUser(String organizationId); Boolean yanTaiSyncOrg(String organizationId); + + /** + * 运营端-统一认证 + * 用户列表 + * @param formDTO + * @return + */ + PageData pageUser(YtUserPageFormDTO formDTO); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index bfc87e0ff4..60eb24a678 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -1,8 +1,15 @@ package com.epmet.controller.yantai; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dao.yantai.DataSyncUserDataDao; +import com.epmet.dto.form.yantai.YtUserPageFormDTO; +import com.epmet.dto.result.yantai.YtUserPageResDTO; import com.epmet.utils.OrgData; import com.epmet.utils.UserData; import com.epmet.utils.YantaiApi; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.springframework.beans.factory.annotation.Autowired; import java.util.List; @@ -14,6 +21,10 @@ import java.util.List; * @version: 1.0 */ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService { + @Autowired + private DataSyncUserDataDao dataSyncUserDataDao; + + @Override public Boolean yanTaiSyncUser(String organizationId) { List data = YantaiApi.getChildOuInfoByGuid(organizationId); @@ -27,4 +38,20 @@ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService return false; } + + + /** + * 运营端-统一认证 + * 用户列表 + * + * @param formDTO + * @return + */ + @Override + public PageData pageUser(YtUserPageFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); + List list = dataSyncUserDataDao.pageUser(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java new file mode 100644 index 0000000000..9e5ad6b28b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java @@ -0,0 +1,16 @@ +package com.epmet.dao.yantai; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.yantai.DataSyncOrgDataEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +@Mapper +public interface DataSyncOrgDataDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java new file mode 100644 index 0000000000..aa3caaf4d9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java @@ -0,0 +1,25 @@ +package com.epmet.dao.yantai; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.yantai.YtUserPageFormDTO; +import com.epmet.dto.result.yantai.YtUserPageResDTO; +import com.epmet.entity.yantai.DataSyncUserDataEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +@Mapper +public interface DataSyncUserDataDao extends BaseDao { + /** + * 运营端,统一认证 列表查询 + * @param formDTO + * @return + */ + List pageUser(YtUserPageFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncOrgDataEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncOrgDataEntity.java new file mode 100644 index 0000000000..95a12a46c4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncOrgDataEntity.java @@ -0,0 +1,106 @@ +package com.epmet.entity.yantai; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("data_sync_org_data") +public class DataSyncOrgDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 联系人姓名 + */ + private String contact; + + /** + * 联系电话号码 + */ + private String contacttelephoneNumber; + + /** + * 详细地址 + */ + private String detailAddress; + + /** + * 组织机构第一名称 + */ + private String firstnameofOrganization; + + /** + * 组织机构全称 + */ + private String nameofOrganization; + + /** + * 排序号码 + */ + private String orderNumber; + + /** + * 组织机构简称 + */ + private String organizatioNabbreviation; + + /** + * 组织机构ID + */ + private String organizationId; + + /** + * 组织机构级别 + */ + private String organizationLevel; + + /** + * 组织机构路径 + */ + private String organizationPath; + + /** + * 组织机构类型 + */ + private String organizationType; + + /** + * 注册类型 + */ + private String registrationType; + + /** + * 统一社会信用代码 + */ + private String unifiedsocialcreditId; + + /** + * 客户id;烟台id + */ + private String customerId; + + /** + * 上级组织机构id:ORGANIZATION_ID + */ + private String pid; + + /** + * 上级组织机构名称:ORGANIZATIO_NABBREVIATION + */ + private String parentOrgName; + + /** + * 所有上级组织。不包含本身! + */ + private String pids; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncUserDataEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncUserDataEntity.java new file mode 100644 index 0000000000..e0fa956f32 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncUserDataEntity.java @@ -0,0 +1,91 @@ +package com.epmet.entity.yantai; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("data_sync_user_data") +public class DataSyncUserDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 性别:0未知1男2女 + */ + private String gender; + + /** + * 手机号码 + */ + private String mobileTelephoneNumber; + + /** + * 排序号码 + */ + private String orderNumber; + + /** + * 职务 + */ + private String position; + + /** + * 职级 + */ + private String positionLevel; + + /** + * 电话号码 + */ + private String telephoneNumber; + + /** + * 统一用户编码 + */ + private String userGuid; + + /** + * 用户姓名 + */ + private String userName; + + /** + * 人员路径 + */ + private String userPath; + + /** + * data_sync_org_data.组织机构ID; + */ + private String organizationId; + + /** + * 客户id + */ + private String customerId; + + /** + * 0未创建、已创建 + */ + private String status; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 备注;目前为空 + */ + private String remark; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml new file mode 100644 index 0000000000..0c6f3288ef --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml new file mode 100644 index 0000000000..204f27314c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 85c7dc882e2178f1e596c851af8c205942832c9d Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 18 Oct 2022 12:41:18 +0800 Subject: [PATCH 169/249] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=92=8C=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E4=BA=BA=E5=91=98=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/utils/OrgData.java | 79 +++++++++++++++++++ .../main/java/com/epmet/utils/UserData.java | 50 ++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/OrgData.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/UserData.java diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/OrgData.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/OrgData.java new file mode 100644 index 0000000000..f82b6fdef5 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/OrgData.java @@ -0,0 +1,79 @@ + +package com.epmet.utils; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:组织机构数据 实体类 + * @author liujianjun + */ +@Data +public class OrgData implements Serializable { + + /** + * 联系人姓名 + */ + private String contact; + /** + * 联系电话号码 + */ + private String contactTelephoneNumber; + + /** + * 详细地址 + */ + private String detailAddress; + + /** + * 组织机构第一名称 + */ + private String firstNameOfOrganization; + + /** + * 组织机构全称 + */ + private String nameOfOrganization; + + /** + * 排序号码 + */ + private String orderNumber; + + /** + * 组织机构简称 + */ + private String organizatioNabbreviation; + + /** + * 组织机构ID + */ + private String organizationId; + + /** + * 组织机构级别 + */ + private String organizationLevel; + + /** + * 组织机构路径 + */ + private String organizationPath; + + /** + * 组织机构类型 + */ + private String organizationType; + /** + * 注册类型 + */ + private String registrationType; + /** + * 统一社会信用代码 + */ + private String unifiedSocialCreditId; + + + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/UserData.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/UserData.java new file mode 100644 index 0000000000..99d78d63d7 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/UserData.java @@ -0,0 +1,50 @@ + +package com.epmet.utils; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:认证中心-用户信息 + * @author liujianjun + */ +@Data +public class UserData implements Serializable { + + /** + * 性别:todo 不知道是什么值 + */ + private String gender; + /** + * 手机号码 + */ + private String mobileTelephoneNumber; + private String orderNumber; + /** + * 职务 + */ + private String position; + /** + * 职级 + */ + private String positionLevel; + /** + * 电话号码 + */ + private String telephoneNumber; + /** + * 用户编码/id + */ + private String userGuid; + /** + * 用户姓名 + */ + private String userName; + /** + * 人员路径 + */ + private String userPath; + + +} From eb891e052e66a0c537012ed007f26e1c7aef42b3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 12:53:57 +0800 Subject: [PATCH 170/249] =?UTF-8?q?/org/staffdetailv2=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E4=BF=AE=E6=94=B9=E8=BF=94=E5=9B=9E=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E7=A4=BE=E5=8C=BA=E8=A7=92=E8=89=B2=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/govorg/form/StaffDetailV2FormDTO.java | 4 ++++ .../epmetuser/impl/EpmetUserServiceImpl.java | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java index 4a63e5c8ee..2a320915e8 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java @@ -42,5 +42,9 @@ public class StaffDetailV2FormDTO implements Serializable { private String orgType = ""; //职责名称列表 private List roles; + /** + * 数字社区里的角色名称 + */ + private List szsqRoles; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index f93c66675b..6820ef9f8c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.BadgeConstant; import com.epmet.constant.OrgInfoConstant; import com.epmet.dataaggre.constant.DataSourceConstant; @@ -42,7 +43,10 @@ import com.epmet.dataaggre.service.govproject.GovProjectService; import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.UserBaseInfoDTO; +import com.epmet.dto.form.GetStaffExistRoleFormDTO; +import com.epmet.dto.result.NewUserRoleResultDTO; import com.epmet.dto.result.StaffRoleResultDTO; +import com.epmet.feign.GovAccessFeignClient; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -98,6 +102,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { private IcPointVaccinesInoculationDao pointVaccinesInoculationDao; @Resource private IcPointNucleicMonitoringDao pointNucleicMonitoringDao; + @Autowired + private GovAccessFeignClient govAccessFeignClient; /** * @Description 根据UserIds查询 @@ -724,7 +730,15 @@ public class EpmetUserServiceImpl implements EpmetUserService { result.setName(dto.getRealName()); result.setGender(dto.getGender().toString()); result.setRoles(list); - + // 获取数字社区里的新角色 + GetStaffExistRoleFormDTO getStaffExistRoleFormDTO = new GetStaffExistRoleFormDTO(); + getStaffExistRoleFormDTO.setStaffId(staffId); + getStaffExistRoleFormDTO.setCustomerId(dto.getCustomerId()); + Result> staffExistRole = govAccessFeignClient.getStaffExistRole(getStaffExistRoleFormDTO); + if (staffExistRole.success()&&CollectionUtils.isNotEmpty(staffExistRole.getData())){ + List szsqRoles=staffExistRole.getData().stream().map(m -> m.getRoleName()).distinct().collect(Collectors.toList()); + result.setSzsqRoles(szsqRoles); + } return result; } From 24ba608e289a73d18a25225f595a1d1b7fa3f3cb Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 13:18:46 +0800 Subject: [PATCH 171/249] =?UTF-8?q?/gov/org/staff/addstaffv2=E8=BF=94?= =?UTF-8?q?=E5=9B=9EstaffId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/StaffController.java | 3 ++- .../src/main/java/com/epmet/service/StaffService.java | 3 ++- .../java/com/epmet/service/impl/StaffServiceImpl.java | 9 +++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index 939f740fc1..4f2c228243 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -196,11 +196,12 @@ public class StaffController { /** * 【通讯录】人员添加v2 + * 返回staffId * @author sun */ @PostMapping("addstaffv2") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_CREATE) - public Result addStaffV2(@LoginUser TokenDto tokenDto, @RequestBody AddStaffV2FromDTO fromDTO){ + public Result addStaffV2(@LoginUser TokenDto tokenDto, @RequestBody AddStaffV2FromDTO fromDTO){ ValidatorUtils.validateEntity(fromDTO, AddStaffV2FromDTO.AddStaff.class); fromDTO.setCustomerId(tokenDto.getCustomerId()); fromDTO.setApp(tokenDto.getApp()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java index fc2f954b02..9d9929a9ae 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java @@ -134,9 +134,10 @@ public interface StaffService { /** * 【通讯录】人员添加v2 + * 返回staffId * @author sun */ - Result addStaffV2(AddStaffV2FromDTO fromDTO); + Result addStaffV2(AddStaffV2FromDTO fromDTO); /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 6950cbcc3c..9dc4670192 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -537,7 +537,7 @@ public class StaffServiceImpl implements StaffService { */ @Override @Transactional(rollbackFor = Exception.class) - public Result addStaffV2(AddStaffV2FromDTO fromDTO) { + public Result addStaffV2(AddStaffV2FromDTO fromDTO) { //1.根据新增人员类型判断查询机关信息 OrgResultDTO orgDTO = customerAgencyDao.selectAgencyDetail(fromDTO.getOrgId(), fromDTO.getOrgType()); if (null == orgDTO) { @@ -612,8 +612,13 @@ public class StaffServiceImpl implements StaffService { throw new EpmetException("save data to gov-role-user failure"); } } + //如果是烟台的需要更新 根据手机号+姓名 更新data_sync_user_data置为已创建、记录staffId + // todo - return new Result(); + //2022.10.18加个返参,借用下StaffDetailResultDTO不再新建dto了 + StaffDetailResultDTO resultDTO=new StaffDetailResultDTO(); + resultDTO.setStaffId(result.getData().getUserId()); + return new Result().ok(resultDTO); } From ae2008d288d3a08a230b1179808d02d48391ce63 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Oct 2022 13:36:47 +0800 Subject: [PATCH 172/249] vote --- .../com/epmet/dto/form/IssueIdFormDTO.java | 2 +- .../com/epmet/dto/result/VoteResultDTO.java | 2 +- .../epmet/service/impl/IssueServiceImpl.java | 36 ++++++++++--------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueIdFormDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueIdFormDTO.java index ce1b760bb3..58d12671de 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueIdFormDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/form/IssueIdFormDTO.java @@ -19,7 +19,7 @@ public class IssueIdFormDTO implements Serializable { /** * 当 sourceType = issue 时,是直接创建议题,无需加入小组即可表决 */ - private String sourceType; + private String sourceType = "resi_topic"; } diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VoteResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VoteResultDTO.java index 7f81035bf1..dfa73fe47e 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VoteResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VoteResultDTO.java @@ -31,7 +31,7 @@ public class VoteResultDTO implements Serializable { /** * 是否加入小组 已加入:true,未加入:false */ - private Boolean voteAuthorization; + private Boolean voteAuthorization = false; /** * 支持:support 反对:oppose diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 6c61788c10..2eddf62d6a 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -22,6 +22,7 @@ import com.epmet.resi.group.dto.topic.form.TopicDetailBatchFormDTO; import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.service.IssueService; +import com.epmet.util.ModuleConstant; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -217,25 +218,26 @@ public class IssueServiceImpl implements IssueService { GridIdFormDTO gridIdFormDTO = new GridIdFormDTO(); gridIdFormDTO.setGridId(gridId.getGridId()); gridIdFormDTO.setUserId(tokenDto.getUserId()); - Result checkJoinTeam = resiGroupFeignClient.checkjointeam(gridIdFormDTO); - if (!checkJoinTeam.success()){ - throw new RenException("查询校验用户是否加入小组失败"); - } - CheckJoinTeamResultDTO check = checkJoinTeam.getData(); - //未加入小组 - if (check.getVoteAuthorization()==false){ - voteResultDTOResult.setVoteFlag(false); - voteResultDTOResult.setVoteAuthorization(check.getVoteAuthorization()); - voteResultDTOResult.setOppositionCount(NumConstant.ZERO); - voteResultDTOResult.setSupportCount(NumConstant.ZERO); - }else { - Result voteResult = govIssueFeignClient.voteCount(issueId); - if (!voteResult.success()){ - throw new RenException("查询表决中议题详情——支持、反对数失败"); + if (issueId.getSourceType().equals("resi_topic")){ + Result checkJoinTeam = resiGroupFeignClient.checkjointeam(gridIdFormDTO); + if (!checkJoinTeam.success()){ + throw new RenException("查询校验用户是否加入小组失败"); + } + CheckJoinTeamResultDTO check = checkJoinTeam.getData(); + //未加入小组 + if (check.getVoteAuthorization()==false){ + voteResultDTOResult.setVoteFlag(false); + voteResultDTOResult.setVoteAuthorization(check.getVoteAuthorization()); + voteResultDTOResult.setOppositionCount(NumConstant.ZERO); + voteResultDTOResult.setSupportCount(NumConstant.ZERO); } - voteResultDTOResult = voteResult.getData(); - voteResultDTOResult.setVoteAuthorization(check.getVoteAuthorization()); + return voteResultDTOResult; + } + Result voteResult = govIssueFeignClient.voteCount(issueId); + if (!voteResult.success()){ + throw new RenException("查询表决中议题详情——支持、反对数失败"); } + voteResultDTOResult = voteResult.getData(); return voteResultDTOResult; } From 8c70b4c74685b7a1121626e550d1a9666bdb0743 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 13:51:17 +0800 Subject: [PATCH 173/249] =?UTF-8?q?/gov/org/customeragency/agencylist?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E8=BF=90=E8=90=A5=E7=AB=AF=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/GetAgencyListFormDTO.java | 8 ++++++++ .../com/epmet/controller/CustomerAgencyController.java | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java index 95c371ad83..64dd258641 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetAgencyListFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -14,6 +16,12 @@ public class GetAgencyListFormDTO implements Serializable { private static final long serialVersionUID = -5846836779036328298L; + /** + * 这个接口在运营端统一认证,新增用户事也调用了 + */ + public interface OperAddUserShowGroup extends CustomerClientShowGroup { + } + @NotBlank(message = "运营端调用此接口必须传客户id",groups =OperAddUserShowGroup.class ) private String customerId; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index c1aba9bb3c..6a8c433250 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -18,6 +18,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; @@ -348,8 +349,12 @@ public class CustomerAgencyController { */ @PostMapping("agencylist") public Result getAgencyList(@LoginUser TokenDto tokenDTO,@RequestBody GetAgencyListFormDTO formDTO) { - if (StringUtils.isBlank(formDTO.getCustomerId())){ - formDTO.setCustomerId(tokenDTO.getCustomerId()); + if(AppClientConstant.APP_OPER.equals(tokenDTO.getApp())){ + ValidatorUtils.validateEntity(formDTO.getCustomerId(),GetAgencyListFormDTO.OperAddUserShowGroup.class); + }else{ + if (StringUtils.isBlank(formDTO.getCustomerId())){ + formDTO.setCustomerId(tokenDTO.getCustomerId()); + } } return new Result().ok(customerAgencyService.getAgencyList(formDTO)); } From d8a05f9f1253e04de68782b7df51e5c2397a8945 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 14:14:10 +0800 Subject: [PATCH 174/249] =?UTF-8?q?/gov/org/staff/addstaffv2=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=B7=A5=E4=BD=9C=E4=BA=BA=E5=91=98=EF=BC=8C=E8=B0=83?= =?UTF-8?q?=E7=94=A8/third/dataSync/update-staff=E6=9B=B4=E6=96=B0staffId?= =?UTF-8?q?=EF=BC=8Cstatus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/EpmetThirdOpenFeignClient.java | 4 ++++ .../EpmetThirdOpenFeignClientFallback.java | 5 +++++ .../yantai/DataSyncUserAndOrgController.java | 15 ++++++++++++++ .../yantai/DataSyncUserAndOrgService.java | 9 +++++++++ .../yantai/DataSyncUserAndOrgServiceImpl.java | 13 ++++++++++++ .../epmet/dao/yantai/DataSyncUserDataDao.java | 7 +++++++ .../mapper/yantai/DataSyncUserDataDao.xml | 13 ++++++++++++ .../com/epmet/dto/form/AddStaffV2FromDTO.java | 2 ++ .../com/epmet/controller/StaffController.java | 1 + .../epmet/service/impl/StaffServiceImpl.java | 20 +++++++++++++------ 10 files changed, 83 insertions(+), 6 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdOpenFeignClient.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdOpenFeignClient.java index f0fef19e58..0638d340be 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdOpenFeignClient.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdOpenFeignClient.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.BlockChainCreateProjectFormDTO; import com.epmet.dto.form.BlockChainProcessProjectFormDTO; import com.epmet.dto.form.ProjectApplyAssistFormDTO; +import com.epmet.dto.form.yantai.YtSyncStaffIdFormDTO; import com.epmet.dto.result.ProjectAssistResult; import com.epmet.dto.result.UploadFileResultDTO; import com.epmet.feign.fallback.EpmetThirdOpenFeignClientFallbackFactory; @@ -75,6 +76,9 @@ public interface EpmetThirdOpenFeignClient { @PostMapping("/third/blockchain/project/process") Result blockChainProcessProject(@RequestBody BlockChainProcessProjectFormDTO input); + @PostMapping("/third/dataSync/update-staff") + Result dataSyncUpdateStaff(@RequestBody YtSyncStaffIdFormDTO ytSyncStaffIdFormDTO); + class MultipartSupportConfig { @Autowired diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdOpenFeignClientFallback.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdOpenFeignClientFallback.java index ebf63b3e49..ec7901a7a1 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdOpenFeignClientFallback.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdOpenFeignClientFallback.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.BlockChainCreateProjectFormDTO; import com.epmet.dto.form.BlockChainProcessProjectFormDTO; import com.epmet.dto.form.ProjectApplyAssistFormDTO; +import com.epmet.dto.form.yantai.YtSyncStaffIdFormDTO; import com.epmet.dto.result.ProjectAssistResult; import com.epmet.dto.result.UploadFileResultDTO; import com.epmet.feign.EpmetThirdOpenFeignClient; @@ -57,4 +58,8 @@ public class EpmetThirdOpenFeignClientFallback implements EpmetThirdOpenFeignCli return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "processProject", input); } + @Override + public Result dataSyncUpdateStaff(YtSyncStaffIdFormDTO ytSyncStaffIdFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "updateStaff", ytSyncStaffIdFormDTO); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java index 9ebbbfa8d3..e0122911d1 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java @@ -2,6 +2,9 @@ package com.epmet.controller.yantai; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.dto.form.yantai.YtSyncStaffIdFormDTO; import com.epmet.dto.form.yantai.YtUserPageFormDTO; import com.epmet.dto.result.yantai.YtUserPageResDTO; import org.springframework.beans.factory.annotation.Autowired; @@ -55,4 +58,16 @@ public class DataSyncUserAndOrgController { return new Result>().ok(dataSyncUserAndOrgService.pageUser(formDTO)); } + /** + * 工作端新增完用户后,需要调用此接口,更新data_sync_user_data + * + * @param formDTO + * @return + */ + @PostMapping("update-staff") + public Result updateStaff(@RequestBody YtSyncStaffIdFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + dataSyncUserAndOrgService.updateStaff(formDTO.getCustomerId(),formDTO.getOperUserId(),formDTO.getStaffId(),formDTO.getName(),formDTO.getMobile()); + return new Result(); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java index 42b002eb07..320bc29919 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java @@ -19,4 +19,13 @@ public interface DataSyncUserAndOrgService { * @return */ PageData pageUser(YtUserPageFormDTO formDTO); + + /** + * 工作端新增完用户后,需要调用此接口,更新data_sync_user_data + * @param customerId + * @param staffId + * @param name + * @param mobile + */ + int updateStaff(String customerId,String operUserId, String staffId, String name, String mobile); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index 60eb24a678..9de208d165 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -54,4 +54,17 @@ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal()); } + + /** + * 工作端新增完用户后,需要调用此接口,更新data_sync_user_data + * + * @param customerId + * @param staffId + * @param name + * @param mobile + */ + @Override + public int updateStaff(String customerId, String operUserId,String staffId, String name, String mobile) { + return dataSyncUserDataDao.updateStaff(customerId,operUserId,staffId,name,mobile); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java index aa3caaf4d9..170bbb82c1 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java @@ -5,6 +5,7 @@ import com.epmet.dto.form.yantai.YtUserPageFormDTO; import com.epmet.dto.result.yantai.YtUserPageResDTO; import com.epmet.entity.yantai.DataSyncUserDataEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -22,4 +23,10 @@ public interface DataSyncUserDataDao extends BaseDao { * @return */ List pageUser(YtUserPageFormDTO formDTO); + + int updateStaff(@Param("customerId") String customerId, + @Param("operUserId")String operUserId, + @Param("staffId")String staffId, + @Param("name")String name, + @Param("mobile")String mobile); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml index 204f27314c..dbb8b3c455 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml @@ -73,4 +73,17 @@ order by o.ORDER_NUMBER asc,u.ORDER_NUMBER asc + + + UPDATE data_sync_user_data + SET UPDATED_BY = #{operUserId}, + UPDATED_TIME = NOW(), + `STATUS` = '1', + STAFF_ID = #{staffId}, + CUSTOMER_ID = #{customerId} + WHERE + MOBILE_TELEPHONE_NUMBER = #{mobile} + AND USER_NAME = #{name} + AND del_flag = '0' + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java index 705ddfaadb..ecdfba89f9 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java @@ -73,4 +73,6 @@ public class AddStaffV2FromDTO implements Serializable { private String client; private List newRoles; + + private String currentStaffId; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index 4f2c228243..892f92087b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -206,6 +206,7 @@ public class StaffController { fromDTO.setCustomerId(tokenDto.getCustomerId()); fromDTO.setApp(tokenDto.getApp()); fromDTO.setClient(tokenDto.getClient()); + fromDTO.setCurrentStaffId(tokenDto.getUserId()); return staffService.addStaffV2(fromDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 9dc4670192..9269f249ad 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -17,6 +17,7 @@ import com.epmet.dao.CustomerStaffAgencyDao; import com.epmet.dao.StaffOrgRelationDao; import com.epmet.dto.*; import com.epmet.dto.form.*; +import com.epmet.dto.form.yantai.YtSyncStaffIdFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.*; import com.epmet.feign.*; @@ -46,8 +47,6 @@ public class StaffServiceImpl implements StaffService { @Autowired private EpmetUserFeignClient epmetUserFeignClient; @Autowired - private OperCrmFeignClient operCrmFeignClient; - @Autowired private CustomerAgencyService customerAgencyService; @Autowired private CustomerStaffAgencyService customerStaffAgencyService; @@ -76,11 +75,11 @@ public class StaffServiceImpl implements StaffService { @Autowired private StaffOrgRelationService staffOrgRelationService; @Resource - private CustomerStaffRedis customerStaffRedis; - @Resource private StaffOrgRelationDao staffOrgRelationDao; @Autowired private GovAccessFeignClient govAccessFeignClient; + @Autowired + private EpmetThirdOpenFeignClient epmetThirdOpenFeignClient; @Override public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { @@ -613,8 +612,17 @@ public class StaffServiceImpl implements StaffService { } } //如果是烟台的需要更新 根据手机号+姓名 更新data_sync_user_data置为已创建、记录staffId - // todo - + // 开发环境默认:45687aa479955f9d06204d415238f7cc + // 测试环境:0c41b272ee9ee95ac6f184ad548a30eb + // 烟台: 1535072605621841922 + if ("1535072605621841922".equals(fromDTO.getCustomerId()) + || "45687aa479955f9d06204d415238f7cc".equals(fromDTO.getCustomerId()) + || "0c41b272ee9ee95ac6f184ad548a30eb".equals(fromDTO.getCustomerId())) { + YtSyncStaffIdFormDTO ytSyncStaffIdFormDTO = ConvertUtils.sourceToTarget(fromDTO,YtSyncStaffIdFormDTO.class); + ytSyncStaffIdFormDTO.setStaffId(result.getData().getUserId()); + ytSyncStaffIdFormDTO.setOperUserId(fromDTO.getCurrentStaffId()); + epmetThirdOpenFeignClient.dataSyncUpdateStaff(ytSyncStaffIdFormDTO); + } //2022.10.18加个返参,借用下StaffDetailResultDTO不再新建dto了 StaffDetailResultDTO resultDTO=new StaffDetailResultDTO(); resultDTO.setStaffId(result.getData().getUserId()); From 7a30d453b406728c8e72f2b5c75965c4f6518120 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 14:15:14 +0800 Subject: [PATCH 175/249] =?UTF-8?q?/gov/org/staff/addstaffv2=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=B7=A5=E4=BD=9C=E4=BA=BA=E5=91=98=EF=BC=8C=E8=B0=83?= =?UTF-8?q?=E7=94=A8/third/dataSync/update-staff=E6=9B=B4=E6=96=B0staffId?= =?UTF-8?q?=EF=BC=8Cstatus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/yantai/YtSyncStaffIdFormDTO.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtSyncStaffIdFormDTO.java diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtSyncStaffIdFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtSyncStaffIdFormDTO.java new file mode 100644 index 0000000000..522f2926ee --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/yantai/YtSyncStaffIdFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.form.yantai; + +import com.epmet.commons.tools.validator.group.AddGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description 工作端新增完用户后,需要调用此接口,更新data_sync_user_data + * @Author yzm + * @Date 2022/10/18 13:54 + */ +@Data +public class YtSyncStaffIdFormDTO { + /** + * 客户ID + */ + @NotBlank(message = "customerId不能为空",groups = AddGroup.class) + private String customerId; + /** + * 人员ID + */ + @NotBlank(message = "staffId不能为空",groups = AddGroup.class) + private String staffId; + + @NotBlank(message = "name不能为空",groups = AddGroup.class) + private String name; + + @NotBlank(message = "mobile不能为空",groups = AddGroup.class) + private String mobile; + + @NotBlank(message = "当前操作人id不能为空",groups = AddGroup.class) + private String operUserId; + +} + From cc82f45c88b415756cd0ff4f3012009587ee9c50 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 14:16:14 +0800 Subject: [PATCH 176/249] =?UTF-8?q?updateStaff=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dao/yantai/DataSyncUserDataDao.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java index 170bbb82c1..f1bc42e2e8 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncUserDataDao.java @@ -24,6 +24,15 @@ public interface DataSyncUserDataDao extends BaseDao { */ List pageUser(YtUserPageFormDTO formDTO); + /** + * 更新data_sync_user_data 为已创建、记录staffId + * @param customerId + * @param operUserId + * @param staffId + * @param name + * @param mobile + * @return + */ int updateStaff(@Param("customerId") String customerId, @Param("operUserId")String operUserId, @Param("staffId")String staffId, From dfcf11438097181415801c44ba10eee7cba6cc71 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Oct 2022 14:19:18 +0800 Subject: [PATCH 177/249] vote --- .../src/main/java/com/epmet/service/impl/IssueServiceImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 2eddf62d6a..f13aff5a82 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -231,7 +231,6 @@ public class IssueServiceImpl implements IssueService { voteResultDTOResult.setOppositionCount(NumConstant.ZERO); voteResultDTOResult.setSupportCount(NumConstant.ZERO); } - return voteResultDTOResult; } Result voteResult = govIssueFeignClient.voteCount(issueId); if (!voteResult.success()){ From 09160e9a8a5519c0ff79ea4b701c4c4a52949d00 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Oct 2022 14:25:04 +0800 Subject: [PATCH 178/249] vote --- .../src/main/java/com/epmet/dto/result/VoteResultDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VoteResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VoteResultDTO.java index dfa73fe47e..33207f51f8 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VoteResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/VoteResultDTO.java @@ -31,7 +31,7 @@ public class VoteResultDTO implements Serializable { /** * 是否加入小组 已加入:true,未加入:false */ - private Boolean voteAuthorization = false; + private Boolean voteAuthorization = true; /** * 支持:support 反对:oppose From 481c9dcdd66e52c1e238ba57c56ea33d1dd2b4c6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 14:42:40 +0800 Subject: [PATCH 179/249] =?UTF-8?q?/third/dataSync/ytorglist=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/yantai/DataSyncOrgDataDTO.java | 23 +++++++++++++++++++ .../yantai/DataSyncUserAndOrgController.java | 14 +++++++++++ .../yantai/DataSyncUserAndOrgService.java | 10 ++++++++ .../yantai/DataSyncUserAndOrgServiceImpl.java | 17 +++++++++++++- .../epmet/dao/yantai/DataSyncOrgDataDao.java | 11 ++++++++- .../entity/yantai/DataSyncOrgDataEntity.java | 2 +- .../mapper/yantai/DataSyncOrgDataDao.xml | 17 +++++++++++++- 7 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/DataSyncOrgDataDTO.java diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/DataSyncOrgDataDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/DataSyncOrgDataDTO.java new file mode 100644 index 0000000000..1a3b19a855 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/DataSyncOrgDataDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result.yantai; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2022/10/18 14:21 + */ +@Data +public class DataSyncOrgDataDTO implements Serializable { + private static final long serialVersionUID = -3011177998045994250L; + private String orgId; + private String orgName; + private String pid; + /** + * true代表有下级 + */ + private Boolean haveChild; +} + diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java index e0122911d1..888e18ea3c 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.dto.form.yantai.YtSyncStaffIdFormDTO; import com.epmet.dto.form.yantai.YtUserPageFormDTO; +import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; import com.epmet.dto.result.yantai.YtUserPageResDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * desc: 从各个平台-同步用户和组织数据到本地 用于生成本系统账号 * @@ -70,4 +73,15 @@ public class DataSyncUserAndOrgController { dataSyncUserAndOrgService.updateStaff(formDTO.getCustomerId(),formDTO.getOperUserId(),formDTO.getStaffId(),formDTO.getName(),formDTO.getMobile()); return new Result(); } + + /** + * 运营端,统一认证 列表查询条件 那颗树 调用此接口 + * @param formDTO + * @return + */ + @PostMapping("ytorglist") + public Result> ytOrgList(@RequestBody YtUserPageFormDTO formDTO){ + List list=dataSyncUserAndOrgService.ytOrgList(formDTO.getOrgId()); + return new Result>().ok(list); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java index 320bc29919..eedd580077 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgService.java @@ -2,8 +2,11 @@ package com.epmet.controller.yantai; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.form.yantai.YtUserPageFormDTO; +import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; import com.epmet.dto.result.yantai.YtUserPageResDTO; +import java.util.List; + /** * @author liujianjun */ @@ -28,4 +31,11 @@ public interface DataSyncUserAndOrgService { * @param mobile */ int updateStaff(String customerId,String operUserId, String staffId, String name, String mobile); + + /** + * 根据组织id查询下级组织 + * @param pid + * @return + */ + List ytOrgList(String pid); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index 9de208d165..51e99171ea 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -1,8 +1,10 @@ package com.epmet.controller.yantai; import com.epmet.commons.tools.page.PageData; +import com.epmet.dao.yantai.DataSyncOrgDataDao; import com.epmet.dao.yantai.DataSyncUserDataDao; import com.epmet.dto.form.yantai.YtUserPageFormDTO; +import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; import com.epmet.dto.result.yantai.YtUserPageResDTO; import com.epmet.utils.OrgData; import com.epmet.utils.UserData; @@ -23,7 +25,8 @@ import java.util.List; public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService { @Autowired private DataSyncUserDataDao dataSyncUserDataDao; - + @Autowired + private DataSyncOrgDataDao dataSyncOrgDataDao; @Override public Boolean yanTaiSyncUser(String organizationId) { @@ -67,4 +70,16 @@ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService public int updateStaff(String customerId, String operUserId,String staffId, String name, String mobile) { return dataSyncUserDataDao.updateStaff(customerId,operUserId,staffId,name,mobile); } + + /** + * 根据组织id查询下级组织 + * + * @param pid + * @return + */ + @Override + public List ytOrgList(String pid) { + List list=dataSyncOrgDataDao.queryList(pid); + return list; + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java index 9e5ad6b28b..edad699db9 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java @@ -1,8 +1,12 @@ package com.epmet.dao.yantai; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; import com.epmet.entity.yantai.DataSyncOrgDataEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * @@ -12,5 +16,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface DataSyncOrgDataDao extends BaseDao { - + /** + * 根据pid查询下一级组织列表 + * @param pid + * @return + */ + List queryList(@Param("pid") String pid); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncOrgDataEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncOrgDataEntity.java index 95a12a46c4..5c46e0b939 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncOrgDataEntity.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/yantai/DataSyncOrgDataEntity.java @@ -89,7 +89,7 @@ public class DataSyncOrgDataEntity extends BaseEpmetEntity { private String customerId; /** - * 上级组织机构id:ORGANIZATION_ID + * 上级组织机构id:ORGANIZATION_ID; 根级组织赋值0 */ private String pid; diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml index 0c6f3288ef..6f81c501f3 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml @@ -30,5 +30,20 @@ - + \ No newline at end of file From 543e0ecf974fc0c474f0b15a9b61ca966c5c9dda Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 14:49:56 +0800 Subject: [PATCH 180/249] =?UTF-8?q?/third/dataSync/page-user=E8=BF=94?= =?UTF-8?q?=E5=9B=9EcustomerId,/gov/org/staff/editstaffinit=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E8=BF=90=E8=90=A5=E7=AB=AF=E8=B0=83=E7=94=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/result/yantai/YtUserPageResDTO.java | 2 ++ .../main/resources/mapper/yantai/DataSyncUserDataDao.xml | 3 ++- .../main/java/com/epmet/service/impl/StaffServiceImpl.java | 7 +++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/YtUserPageResDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/YtUserPageResDTO.java index 1600fa6052..38da48f7a9 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/YtUserPageResDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/yantai/YtUserPageResDTO.java @@ -50,5 +50,7 @@ public class YtUserPageResDTO { * 备注;目前为空 */ private String remark; + + private String customerId; } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml index dbb8b3c455..fdcedc74d9 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml @@ -41,7 +41,8 @@ u.GENDER AS gender, u.`STATUS` AS status, IFNULL(u.STAFF_ID,'') AS staffId, - IFNULL(u.REMARK, '' ) AS remark + IFNULL(u.REMARK, '' ) AS remark, + u.CUSTOMER_ID as customerId FROM data_sync_user_data u LEFT JOIN data_sync_org_data o ON ( u.ORGANIZATION_ID = o.ORGANIZATION_ID ) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 9269f249ad..417cce8a29 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -135,8 +135,11 @@ public class StaffServiceImpl implements StaffService { @Override public Result editStaffInit(StaffInfoFromDTO fromDTO) { - CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); - fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + //运营端-统一认证调用此接口时,客户id传值了。 + if(StringUtils.isBlank(fromDTO.getCustomerId())){ + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + } return epmetUserFeignClient.editStaffInit(fromDTO); } From d835e21367c97e0c8814fa353a3c0963967d97e8 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Oct 2022 15:22:58 +0800 Subject: [PATCH 181/249] =?UTF-8?q?=E6=8D=A2=E6=8D=A2=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/yantai/DataSyncUserAndOrgServiceImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index 51e99171ea..5866b1efdb 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.utils.UserData; import com.epmet.utils.YantaiApi; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import java.util.List; @@ -30,15 +31,17 @@ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService @Override public Boolean yanTaiSyncUser(String organizationId) { - List data = YantaiApi.getChildOuInfoByGuid(organizationId); + List data = YantaiApi.getUserByOuGuid(organizationId); //todo 更新或插入数据 return false; } @Override public Boolean yanTaiSyncOrg(String organizationId) { - List data = YantaiApi.getUserByOuGuid(organizationId); + List data = YantaiApi.getChildOuInfoByGuid(organizationId); + if (CollectionUtils.isNotEmpty(data)){ + } return false; } From 342f93077bb16a495076fe09133a4f6942102635 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 15:51:21 +0800 Subject: [PATCH 182/249] =?UTF-8?q?/gov/org/staff/rolelist=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E8=BF=90=E8=90=A5=E7=AB=AF=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/StaffServiceImpl.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 417cce8a29..8eed306d5b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -126,10 +126,20 @@ public class StaffServiceImpl implements StaffService { return epmetUserFeignClient.getStaffList(fromDTO); } + /** + * 人员添加页面初始化 + * 备注:2022.10.18运营端-统一认证也会调用此接口,入参会给customerId + * @param fromDTO 参数 + * @return + */ @Override public Result> addStaffInit(StaffInfoFromDTO fromDTO) { - CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); - fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + if(StringUtils.isBlank(fromDTO.getCustomerId())){ + if(StringUtils.isNotBlank(fromDTO.getAgencyId())){ + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + } + } return epmetUserFeignClient.addStaffInit(fromDTO); } From 5f64a715d9aa245945297cd8e964bd527e67aa2b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Oct 2022 15:54:11 +0800 Subject: [PATCH 183/249] =?UTF-8?q?=E7=94=9F=E6=88=90=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/DataSyncOrgDataDTO.java | 139 ++++++++++++++++++ .../com/epmet/dto/DataSyncUserDataDTO.java | 124 ++++++++++++++++ .../yantai/DataSyncUserAndOrgServiceImpl.java | 27 ++++ .../epmet/service/DataSyncOrgDataService.java | 78 ++++++++++ .../service/DataSyncUserDataService.java | 78 ++++++++++ .../impl/DataSyncOrgDataServiceImpl.java | 83 +++++++++++ .../impl/DataSyncUserDataServiceImpl.java | 83 +++++++++++ 7 files changed, 612 insertions(+) create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncOrgDataDTO.java create mode 100644 epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncUserDataDTO.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncOrgDataService.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncUserDataService.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncOrgDataServiceImpl.java create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncUserDataServiceImpl.java diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncOrgDataDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncOrgDataDTO.java new file mode 100644 index 0000000000..fd5f9121c7 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncOrgDataDTO.java @@ -0,0 +1,139 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +@Data +public class DataSyncOrgDataDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 联系人姓名 + */ + private String contact; + + /** + * 联系电话号码 + */ + private String contacttelephoneNumber; + + /** + * 详细地址 + */ + private String detailAddress; + + /** + * 组织机构第一名称 + */ + private String firstnameofOrganization; + + /** + * 组织机构全称 + */ + private String nameofOrganization; + + /** + * 排序号码 + */ + private String orderNumber; + + /** + * 组织机构简称 + */ + private String organizatioNabbreviation; + + /** + * 组织机构ID + */ + private String organizationId; + + /** + * 组织机构级别 + */ + private String organizationLevel; + + /** + * 组织机构路径 + */ + private String organizationPath; + + /** + * 组织机构类型 + */ + private String organizationType; + + /** + * 注册类型 + */ + private String registrationType; + + /** + * 统一社会信用代码 + */ + private String unifiedsocialcreditId; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户id;烟台id + */ + private String customerId; + + /** + * 上级组织机构id:ORGANIZATION_ID; 根级组织赋值0 + */ + private String pid; + + /** + * 上级组织机构名称:ORGANIZATIO_NABBREVIATION + */ + private String parentOrgName; + + /** + * 所有上级组织。不包含本身! + */ + private String pids; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncUserDataDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncUserDataDTO.java new file mode 100644 index 0000000000..291d40d7de --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/DataSyncUserDataDTO.java @@ -0,0 +1,124 @@ +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +@Data +public class DataSyncUserDataDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 性别:0未知1男2女 + */ + private String gender; + + /** + * 手机号码 + */ + private String mobileTelephoneNumber; + + /** + * 排序号码 + */ + private String orderNumber; + + /** + * 职务 + */ + private String position; + + /** + * 职级 + */ + private String positionLevel; + + /** + * 电话号码 + */ + private String telephoneNumber; + + /** + * 统一用户编码 + */ + private String userGuid; + + /** + * 用户姓名 + */ + private String userName; + + /** + * 人员路径 + */ + private String userPath; + + /** + * data_sync_org_data.组织机构ID; + */ + private String organizationId; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 客户id + */ + private String customerId; + + /** + * 0未创建、1已创建 + */ + private String status; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 备注;目前为空 + */ + private String remark; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index 5866b1efdb..ada434a02e 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -6,15 +6,21 @@ import com.epmet.dao.yantai.DataSyncUserDataDao; import com.epmet.dto.form.yantai.YtUserPageFormDTO; import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; import com.epmet.dto.result.yantai.YtUserPageResDTO; +import com.epmet.service.DataSyncOrgDataService; +import com.epmet.service.DataSyncUserDataService; import com.epmet.utils.OrgData; import com.epmet.utils.UserData; import com.epmet.utils.YantaiApi; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; +import java.util.Map; /** * desc:烟台 从认证中心同步组织和用户信息 到本地 @@ -23,11 +29,17 @@ import java.util.List; * @date: 2022/10/17 3:42 下午 * @version: 1.0 */ +@Service +@Slf4j public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService { @Autowired private DataSyncUserDataDao dataSyncUserDataDao; @Autowired private DataSyncOrgDataDao dataSyncOrgDataDao; + @Autowired + private DataSyncOrgDataService dataSyncOrgDataService; + @Autowired + private DataSyncUserDataService dataSyncUserDataService; @Override public Boolean yanTaiSyncUser(String organizationId) { @@ -40,11 +52,26 @@ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService public Boolean yanTaiSyncOrg(String organizationId) { List data = YantaiApi.getChildOuInfoByGuid(organizationId); if (CollectionUtils.isNotEmpty(data)){ + List needInsert = new ArrayList<>(); + data.forEach(d -> { + needInsert.add(d); + disposeYanTaiSyncOrg(d.getOrganizationId(),needInsert); + }); } return false; } + public void disposeYanTaiSyncOrg(String organizationId, List needInsert){ + List data = YantaiApi.getChildOuInfoByGuid(organizationId); + if (CollectionUtils.isNotEmpty(data)){ + needInsert.addAll(data); + data.forEach(d -> { + disposeYanTaiSyncOrg(d.getOrganizationId(),needInsert); + }); + } + } + /** * 运营端-统一认证 diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncOrgDataService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncOrgDataService.java new file mode 100644 index 0000000000..3a3d40fe2d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncOrgDataService.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.DataSyncOrgDataDTO; +import com.epmet.entity.yantai.DataSyncOrgDataEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +public interface DataSyncOrgDataService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-10-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-10-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DataSyncOrgDataDTO + * @author generator + * @date 2022-10-18 + */ + DataSyncOrgDataDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-18 + */ + void save(DataSyncOrgDataDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-18 + */ + void update(DataSyncOrgDataDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-10-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncUserDataService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncUserDataService.java new file mode 100644 index 0000000000..0b5e41df00 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/DataSyncUserDataService.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.DataSyncUserDataDTO; +import com.epmet.entity.yantai.DataSyncUserDataEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +public interface DataSyncUserDataService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2022-10-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2022-10-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DataSyncUserDataDTO + * @author generator + * @date 2022-10-18 + */ + DataSyncUserDataDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-18 + */ + void save(DataSyncUserDataDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2022-10-18 + */ + void update(DataSyncUserDataDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2022-10-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncOrgDataServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncOrgDataServiceImpl.java new file mode 100644 index 0000000000..2191a77c85 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncOrgDataServiceImpl.java @@ -0,0 +1,83 @@ +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.yantai.DataSyncOrgDataDao; +import com.epmet.dto.DataSyncOrgDataDTO; +import com.epmet.entity.yantai.DataSyncOrgDataEntity; +import com.epmet.service.DataSyncOrgDataService; +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.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +@Service +public class DataSyncOrgDataServiceImpl extends BaseServiceImpl implements DataSyncOrgDataService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DataSyncOrgDataDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DataSyncOrgDataDTO.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 DataSyncOrgDataDTO get(String id) { + DataSyncOrgDataEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DataSyncOrgDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DataSyncOrgDataDTO dto) { + DataSyncOrgDataEntity entity = ConvertUtils.sourceToTarget(dto, DataSyncOrgDataEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DataSyncOrgDataDTO dto) { + DataSyncOrgDataEntity entity = ConvertUtils.sourceToTarget(dto, DataSyncOrgDataEntity.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/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncUserDataServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncUserDataServiceImpl.java new file mode 100644 index 0000000000..87ffb7a479 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/DataSyncUserDataServiceImpl.java @@ -0,0 +1,83 @@ +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.yantai.DataSyncUserDataDao; +import com.epmet.dto.DataSyncUserDataDTO; +import com.epmet.entity.yantai.DataSyncUserDataEntity; +import com.epmet.service.DataSyncUserDataService; +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.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2022-10-18 + */ +@Service +public class DataSyncUserDataServiceImpl extends BaseServiceImpl implements DataSyncUserDataService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DataSyncUserDataDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DataSyncUserDataDTO.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 DataSyncUserDataDTO get(String id) { + DataSyncUserDataEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DataSyncUserDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DataSyncUserDataDTO dto) { + DataSyncUserDataEntity entity = ConvertUtils.sourceToTarget(dto, DataSyncUserDataEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DataSyncUserDataDTO dto) { + DataSyncUserDataEntity entity = ConvertUtils.sourceToTarget(dto, DataSyncUserDataEntity.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 From df8e0d32f71c52304b9801f76a07c61192c819a0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 16:25:01 +0800 Subject: [PATCH 184/249] =?UTF-8?q?/gov/org/staff/editstaff=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E4=B8=8B=E8=BF=90=E8=90=A5=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/StaffController.java | 2 +- .../java/com/epmet/service/StaffService.java | 2 +- .../epmet/service/impl/StaffServiceImpl.java | 31 ++++++++++++------- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index 892f92087b..0463372db2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -98,7 +98,7 @@ public class StaffController { @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_UPDATE) public Result editStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitFromDTO fromDTO){ ValidatorUtils.validateEntity(fromDTO); - return staffService.editStaff(tokenDto, fromDTO); + return staffService.editStaff(fromDTO); } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java index 9d9929a9ae..5a4a989166 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java @@ -62,7 +62,7 @@ public interface StaffService { * @param fromDTO 参数 * @return Result */ - Result editStaff(TokenDto tokenDto,StaffSubmitFromDTO fromDTO); + Result editStaff(StaffSubmitFromDTO fromDTO); /** * 人员编辑 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 8eed306d5b..954eb170df 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -191,13 +191,20 @@ public class StaffServiceImpl implements StaffService { return new Result(); } + /** + * + * @param tokenDto TokenDto tokenDto, + * @param fromDTO + * @return + */ @Override - public Result editStaff(TokenDto tokenDto, StaffSubmitFromDTO fromDTO) { - CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); - fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); - - fromDTO.setApp(tokenDto.getApp()); - fromDTO.setClient(tokenDto.getClient()); + public Result editStaff(StaffSubmitFromDTO fromDTO) { + if(StringUtils.isBlank(fromDTO.getCustomerId())){ + CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); + fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); + } + // fromDTO.setApp(tokenDto.getApp()); + // fromDTO.setClient(tokenDto.getClient()); Result result = epmetUserFeignClient.editStaff(fromDTO); if (!result.success()) { if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) { @@ -205,12 +212,14 @@ public class StaffServiceImpl implements StaffService { } return new Result().error(EpmetErrorCode.STAFF_EDIT_FAILED.getCode(), EpmetErrorCode.STAFF_EDIT_FAILED.getMsg()); } - if (tokenDto.getClient().equals("web")){ - Result roleUserAccess = govAccessFeignClient.roleUser(new RoleUserFormDTO(fromDTO.getNewRoles(), fromDTO.getStaffId(),fromDTO.getCustomerId())); - if (!roleUserAccess.success()){ - throw new EpmetException("save data to gov-role-user failure"); + // if (tokenDto.getClient().equals("web")){ + if(CollectionUtils.isNotEmpty(fromDTO.getNewRoles())){ + Result roleUserAccess = govAccessFeignClient.roleUser(new RoleUserFormDTO(fromDTO.getNewRoles(), fromDTO.getStaffId(),fromDTO.getCustomerId())); + if (!roleUserAccess.success()){ + throw new EpmetException("save data to gov-role-user failure"); + } } - } + // } //2021.8.24 sun 人员信息编辑时删除工作人员的缓存信息 CustomerStaffRedis.delStaffInfoFormCache(fromDTO.getCustomerId(), fromDTO.getStaffId()); return result; From 7bcddfad6982405bed6637907f0c2d07a4ff49f6 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Oct 2022 16:45:56 +0800 Subject: [PATCH 185/249] =?UTF-8?q?=E6=8B=89=E5=8F=96org?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/constant/YanTaiConstant.java | 12 ++++++++++++ .../yantai/DataSyncUserAndOrgServiceImpl.java | 16 +++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/YanTaiConstant.java diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/YanTaiConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/YanTaiConstant.java new file mode 100644 index 0000000000..74e1d13560 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/YanTaiConstant.java @@ -0,0 +1,12 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2022/10/18 16:43 + * @DESC + */ +public interface YanTaiConstant { + + String YT_CUSTOMER_ID = "1535072605621841922"; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index ada434a02e..df431a925e 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -1,11 +1,14 @@ package com.epmet.controller.yantai; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.yantai.DataSyncOrgDataDao; import com.epmet.dao.yantai.DataSyncUserDataDao; import com.epmet.dto.form.yantai.YtUserPageFormDTO; import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; import com.epmet.dto.result.yantai.YtUserPageResDTO; +import com.epmet.entity.yantai.DataSyncOrgDataEntity; import com.epmet.service.DataSyncOrgDataService; import com.epmet.service.DataSyncUserDataService; import com.epmet.utils.OrgData; @@ -21,6 +24,9 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; + +import static com.epmet.constant.YanTaiConstant.YT_CUSTOMER_ID; /** * desc:烟台 从认证中心同步组织和用户信息 到本地 @@ -57,7 +63,15 @@ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService needInsert.add(d); disposeYanTaiSyncOrg(d.getOrganizationId(),needInsert); }); - + List entities = needInsert.stream().map(m -> { + DataSyncOrgDataEntity entity = ConvertUtils.sourceToTarget(m, DataSyncOrgDataEntity.class); + entity.setCustomerId(YT_CUSTOMER_ID); + entity.setPid(""); + entity.setParentOrgName(""); + entity.setPids(""); + return entity; + }).collect(Collectors.toList()); + dataSyncOrgDataService.insertBatch(entities, NumConstant.ONE_HUNDRED); } return false; } From 4967e63e57b2ebbf71e9b9c863948041362ceb6d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 16:51:29 +0800 Subject: [PATCH 186/249] =?UTF-8?q?/gov/org/staff/editstaffinit=20?= =?UTF-8?q?=E8=BF=94=E5=8F=82=E5=A2=9E=E5=8A=A0agencyId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/StaffInfoFromDTO.java | 4 +++- .../java/com/epmet/dto/result/StaffInitResultDTO.java | 4 ++++ .../java/com/epmet/controller/StaffController.java | 1 + .../java/com/epmet/service/impl/StaffServiceImpl.java | 10 +++++++++- .../epmet/service/impl/CustomerStaffServiceImpl.java | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java index 133f0df8a4..7c2a885f06 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java @@ -14,6 +14,7 @@ import java.io.Serializable; @Data public class StaffInfoFromDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface EditStaffInitGroup {} /** * 客户ID */ @@ -26,5 +27,6 @@ public class StaffInfoFromDTO implements Serializable { /** * 用户ID */ - String staffId; + @NotBlank(message = "staffId不能为空",groups = EditStaffInitGroup.class) + private String staffId; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java index 36cc283268..62c63698eb 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java @@ -46,4 +46,8 @@ public class StaffInitResultDTO implements Serializable { */ private List roleList; private List newRoleList; + /** + * customer_staff_agency.agency_id + */ + private String agencyId; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index 0463372db2..d3f9b9dd28 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -70,6 +70,7 @@ public class StaffController { @PostMapping("editstaffinit") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_DETAIL) public Result editStaffInit(@RequestBody StaffInfoFromDTO fromDTO){ + ValidatorUtils.validateEntity(fromDTO,StaffInfoFromDTO.EditStaffInitGroup.class); return staffService.editStaffInit(fromDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 954eb170df..a8c94bf3a4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -150,7 +150,15 @@ public class StaffServiceImpl implements StaffService { CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); } - return epmetUserFeignClient.editStaffInit(fromDTO); + CustomerStaffAgencyDTO customerStaffAgencyDTO=customerStaffAgencyService.getInfoByUserId(fromDTO.getStaffId()); + if (null == customerStaffAgencyDTO) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "customer_staff_agency is null user_id :" + fromDTO.getStaffId(), "查询用户所属组织为空"); + } + Result res=epmetUserFeignClient.editStaffInit(fromDTO); + if (res.success() && null != res.getData()) { + res.getData().setAgencyId(customerStaffAgencyDTO.getAgencyId()); + } + return new Result().ok(res.getData()); } @Override diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 2a4585eb8a..54a44f35a5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -288,7 +288,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl Date: Tue, 18 Oct 2022 16:51:32 +0800 Subject: [PATCH 187/249] feign --- .../com/epmet/feign/ThirdOpenFeignClient.java | 20 +++++++++++++++++++ .../ThirdOpenFeignClientFallback.java | 10 ++++++++++ .../yantai/DataSyncUserAndOrgController.java | 13 +++++------- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java index 7b19e3efde..1f0f16c314 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/ThirdOpenFeignClient.java @@ -8,6 +8,7 @@ import com.epmet.feign.fallback.ThirdOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @@ -69,4 +70,23 @@ public interface ThirdOpenFeignClient { */ @PostMapping("/third/blockchain/project/process") Result blockChainProcessProject(@RequestBody BlockChainProcessProjectFormDTO input); + + /** + * Desc: 从统一认证中心 拉取组织信息 + * @param orgId + * @author zxc + * @date 2022/10/18 16:50 + */ + @PostMapping("/third/dataSync/yanTai/sync/org") + Result getYanTaiOrgInfo(@RequestParam("orgId") String orgId); + + /** + * Desc: 从统一认证中心 拉取用户信息 + * @param orgId + * @author zxc + * @date 2022/10/18 16:50 + */ + @PostMapping("/third/dataSync/yanTai/sync/user") + Result getYanTaiUserInfo(@RequestParam("orgId") String orgId); + } diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java index 973342dc57..006122b075 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/ThirdOpenFeignClientFallback.java @@ -40,4 +40,14 @@ public class ThirdOpenFeignClientFallback implements ThirdOpenFeignClient { public Result blockChainProcessProject(BlockChainProcessProjectFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "blockChainProcessProject", input); } + + @Override + public Result getYanTaiOrgInfo(String orgId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "getYanTaiOrgInfo", orgId); + } + + @Override + public Result getYanTaiUserInfo(String orgId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "getYanTaiUserInfo", orgId); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java index 888e18ea3c..80f3a2f056 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgController.java @@ -9,10 +9,7 @@ import com.epmet.dto.form.yantai.YtUserPageFormDTO; import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; import com.epmet.dto.result.yantai.YtUserPageResDTO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -33,8 +30,8 @@ public class DataSyncUserAndOrgController { * desc:从统一认证中心 拉取用户信息 * @return */ - @PostMapping("yantai/sync/user") - public Result templateList(String orgId) { + @PostMapping("yanTai/sync/user") + public Result getYanTaiUserInfo(@RequestParam("orgId")String orgId) { Boolean flag = dataSyncUserAndOrgService.yanTaiSyncUser(orgId); return new Result().ok(flag); } @@ -43,8 +40,8 @@ public class DataSyncUserAndOrgController { * desc:从统一认证中心 拉取组织信息 * @return */ - @PostMapping("yantai/sync/org") - public Result getExtJson(String orgId) { + @PostMapping("yanTai/sync/org") + public Result getYanTaiOrgInfo(@RequestParam("orgId")String orgId) { Boolean extJson = dataSyncUserAndOrgService.yanTaiSyncOrg(orgId); return new Result().ok(extJson); } From 4c77e949f7b26b725e5c6c463f15f7558e7f2aa7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Oct 2022 17:03:35 +0800 Subject: [PATCH 188/249] job --- .../com/epmet/task/YTUserAndOrgPullTask.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java new file mode 100644 index 0000000000..627efb5836 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java @@ -0,0 +1,42 @@ +package com.epmet.task; + + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.NatInfoScanTaskFormDTO; +import com.epmet.feign.EpmetThirdOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.ThirdOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author zxc + * @dscription 拉取yt用户信息和组织信息 + */ +@Slf4j +@Component("YTUserAndOrgPullTask") +public class YTUserAndOrgPullTask implements ITask { + + @Autowired + private ThirdOpenFeignClient thirdOpenFeignClient; + + @Override + public void run(String params) { + Result yanTaiOrgInfo = thirdOpenFeignClient.getYanTaiOrgInfo(""); + if (yanTaiOrgInfo.success()) { + log.info("yt拉取组织信息定时任务执行成功"); + } else { + log.error("yt拉取组织信息定时任务执行失败:" + yanTaiOrgInfo.getMsg()); + } + + Result yanTaiUserInfo = thirdOpenFeignClient.getYanTaiUserInfo(""); + if (yanTaiUserInfo.success()) { + log.info("yt拉取用户信息定时任务执行成功"); + } else { + log.error("yt拉取用户信息定时任务执行失败:" + yanTaiUserInfo.getMsg()); + } + } +} From bbbc092da80722af260441f094df0d7d68c2f039 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Oct 2022 17:04:12 +0800 Subject: [PATCH 189/249] job --- .../src/main/java/com/epmet/task/YTUserAndOrgPullTask.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java index 627efb5836..801a1d62e8 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java @@ -1,14 +1,8 @@ package com.epmet.task; - -import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.NatInfoScanTaskFormDTO; -import com.epmet.feign.EpmetThirdOpenFeignClient; -import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.ThirdOpenFeignClient; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; From cd8310c0fd464b07dd985e246effba4bcec063e5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 Oct 2022 17:23:42 +0800 Subject: [PATCH 190/249] =?UTF-8?q?/gov/org/staff/editstaffinit=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=BB=84=E7=BB=87=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/StaffInitResultDTO.java | 4 ++++ .../main/java/com/epmet/service/impl/StaffServiceImpl.java | 1 + 2 files changed, 5 insertions(+) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java index 62c63698eb..69f9e86294 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java @@ -50,4 +50,8 @@ public class StaffInitResultDTO implements Serializable { * customer_staff_agency.agency_id */ private String agencyId; + /** + * xxx-xxx + */ + private String agencyName; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index a8c94bf3a4..c642caddd2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -157,6 +157,7 @@ public class StaffServiceImpl implements StaffService { Result res=epmetUserFeignClient.editStaffInit(fromDTO); if (res.success() && null != res.getData()) { res.getData().setAgencyId(customerStaffAgencyDTO.getAgencyId()); + res.getData().setAgencyName(customerAgencyService.getAgencyName(customerStaffAgencyDTO.getAgencyId())); } return new Result().ok(res.getData()); } From a3b78a873b2564fe63b3102cdedf4e93e4edd57f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 18 Oct 2022 17:42:49 +0800 Subject: [PATCH 191/249] ai --- .../java/com/epmet/excel/handler/IcNatExcelImportListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java index 59f5eaab7b..c600349029 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java @@ -68,7 +68,7 @@ public class IcNatExcelImportListener implements ReadListener Date: Wed, 19 Oct 2022 09:41:50 +0800 Subject: [PATCH 192/249] =?UTF-8?q?/data/aggregator/org/staffdetailv2?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/service/govorg/impl/GovOrgServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index d2ee934888..7265e9bcae 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -504,8 +504,9 @@ public class GovOrgServiceImpl implements GovOrgService { public StaffDetailV2FormDTO staffDetailV2(StaffDetailV2ResultDTO formDTO) { //1.查询工作人员基本信息、角色信息 StaffDetailV2FormDTO result = epmetUserService.selectByStaffId(formDTO.getStaffId()); - if (null == result) { - return new StaffDetailV2FormDTO(); + if (null == result||StringUtils.isBlank(result.getStaffId())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"customer_staff is null staffId:"+formDTO.getStaffId(),"未查询到工作人员基本信息"); + // return new StaffDetailV2FormDTO(); } //2.查询工作人员注册组织关系信息 @@ -513,7 +514,7 @@ public class GovOrgServiceImpl implements GovOrgService { staffIdList.add(formDTO.getStaffId()); List list = customerAgencyDao.selelctStaffOrg(staffIdList); if (null == list || list.size() < NumConstant.ONE) { - throw new RenException("未查询到工作人员注册组织信息"); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"未查询到工作人员注册组织信息","未查询到工作人员所属组织信息"); } //3.封装数据并返回 From 5b0624ebe2f70df5d7232cc26bb1ed4b0accc604 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Oct 2022 10:08:46 +0800 Subject: [PATCH 193/249] =?UTF-8?q?gov-issue=E5=86=85=E5=AE=B9=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E8=B5=B0=E7=94=9F=E4=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-issue/gov-issue-server/pom.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 From 50a3ca1dae488726ef2e1493df48309adbe7b1c7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Oct 2022 10:25:37 +0800 Subject: [PATCH 194/249] =?UTF-8?q?/gov/issue/issuesuggestion/save=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8B=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IssueSuggestionServiceImpl.java | 10 +++++----- .../java/com/epmet/service/impl/IssueServiceImpl.java | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) 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/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index f13aff5a82..573da12cb7 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -393,10 +393,10 @@ public class IssueServiceImpl implements IssueService { issueSuggestionDTO.setPublicFlag(formDTO.getPublicFlag() == true ? NumConstant.ONE : NumConstant.ZERO); issueSuggestionDTO.setCreatedBy(loginUserUtil.getLoginUserId()); Result result = govIssueOpenFeignClient.saveIssueSuggestion(issueSuggestionDTO); - if (result.success() && null != result.getData()) { - return new PublishSuggestionResultDTO(result.getData().getIssueId(), result.getData().getSuggestionId()); + if(result.success()||null==result.getData()||StringUtils.isBlank(result.getData().getSuggestionId())){ + throw new EpmetException(result.getCode(),result.getInternalMsg(),result.getMsg()); } - throw new RenException(result.getCode()); + return new PublishSuggestionResultDTO(result.getData().getIssueId(), result.getData().getSuggestionId()); } /** From 45612749f820bc0141bb04326b4c229ae862c679 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 19 Oct 2022 11:02:07 +0800 Subject: [PATCH 195/249] =?UTF-8?q?=E6=A0=B9=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/task/YTUserAndOrgPullTask.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java index 801a1d62e8..e47d52bcd3 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/YTUserAndOrgPullTask.java @@ -19,14 +19,14 @@ public class YTUserAndOrgPullTask implements ITask { @Override public void run(String params) { - Result yanTaiOrgInfo = thirdOpenFeignClient.getYanTaiOrgInfo(""); + Result yanTaiOrgInfo = thirdOpenFeignClient.getYanTaiOrgInfo("44e05de9-34fa-48f6-b89f-02838d792cf9"); if (yanTaiOrgInfo.success()) { log.info("yt拉取组织信息定时任务执行成功"); } else { log.error("yt拉取组织信息定时任务执行失败:" + yanTaiOrgInfo.getMsg()); } - Result yanTaiUserInfo = thirdOpenFeignClient.getYanTaiUserInfo(""); + Result yanTaiUserInfo = thirdOpenFeignClient.getYanTaiUserInfo("44e05de9-34fa-48f6-b89f-02838d792cf9"); if (yanTaiUserInfo.success()) { log.info("yt拉取用户信息定时任务执行成功"); } else { From 8e1cd9dd6e378a6eb24b1bcadea9e05124f0b473 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Oct 2022 11:30:52 +0800 Subject: [PATCH 196/249] =?UTF-8?q?gov-project=E5=86=85=E5=AE=B9=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E8=B5=B0=E7=94=9F=E4=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/gov-project/gov-project-server/pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 From ed11d566e2ea5a98b5396c57fbf70db57210262a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Oct 2022 14:14:26 +0800 Subject: [PATCH 197/249] /dataSync/page-user --- .../epmet-third-server/src/main/resources/logback-spring.xml | 5 ++--- .../src/main/resources/mapper/yantai/DataSyncUserDataDao.xml | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml index c95ac8b0f3..f8e2164fb7 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml @@ -140,10 +140,9 @@ - + - @@ -158,7 +157,7 @@ - + diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml index fdcedc74d9..e021884602 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml @@ -49,13 +49,13 @@ WHERE u.DEL_FLAG = '0' AND o.DEL_FLAG = '0' - + AND u.ORGANIZATION_ID = #{orgId} - + AND (o.ORGANIZATION_ID = #{orgId} OR o.pids LIKE concat( '%', #{orgId}, '%' ) ) From 995653e28642511ae9bf027d187e72f058b41120 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Oct 2022 14:17:14 +0800 Subject: [PATCH 198/249] =?UTF-8?q?=E6=89=80=E5=B1=9E=E7=BB=84=E7=BB=87-?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/yantai/DataSyncUserDataDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml index e021884602..8e7241fcd4 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncUserDataDao.xml @@ -33,7 +33,7 @@ u.USER_GUID AS userGuid, u.ORGANIZATION_ID AS organizationId, (case when o.PARENT_ORG_NAME is not null and LENGTH(o.PARENT_ORG_NAME)>0 - then concat(o.PARENT_ORG_NAME,o.ORGANIZATIO_NABBREVIATION) + then concat(o.PARENT_ORG_NAME,'-',o.ORGANIZATIO_NABBREVIATION) else o.ORGANIZATIO_NABBREVIATION end)as orgName, u.USER_NAME AS userName, From 38249c5586e6723352181846cd04a3633e875d76 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 19 Oct 2022 14:31:49 +0800 Subject: [PATCH 199/249] =?UTF-8?q?=E6=A0=B9=E7=BB=84=E7=BB=87=E7=BC=93?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 8 ++ .../redis/common/CustomerStaffRedis.java | 29 ++++ .../bean/CustomerStaffInfoDTOCache.java | 133 ++++++++++++++++++ .../yantai/DataSyncUserAndOrgServiceImpl.java | 14 +- .../epmet/feign/EpmetUserOpenFeignClient.java | 9 ++ .../EpmetUserOpenFeignClientFallback.java | 5 + .../controller/CustomerStaffController.java | 11 ++ .../java/com/epmet/dao/CustomerStaffDao.java | 2 + .../epmet/service/CustomerStaffService.java | 2 + .../impl/CustomerStaffServiceImpl.java | 19 +++ .../resources/mapper/CustomerStaffDao.xml | 6 + 11 files changed, 237 insertions(+), 1 deletion(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoDTOCache.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index c09f13f2f4..6d55e66238 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -533,6 +533,14 @@ public class RedisKeys { return rootPrefix.concat("gov:staff:").concat(customerId).concat(StrConstant.COLON).concat(staffId); } + public static String getCustomerAllStaffInfoKey(String customerId) { + return rootPrefix.concat("gov:allCustomerStaff:").concat(customerId).concat(StrConstant.COLON).concat("*"); + } + + public static String getCustomerStaffInfoKeyByMobile(String customerId,String mobile) { + return rootPrefix.concat("gov:allCustomerStaff:").concat(customerId).concat(StrConstant.COLON).concat(mobile); + } + /** * @description 网格信息 * diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java index 37904be02b..66abe790f3 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java @@ -9,6 +9,7 @@ import com.epmet.commons.tools.feign.CommonAggFeignClient; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache; +import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoDTOCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import lombok.extern.slf4j.Slf4j; @@ -138,4 +139,32 @@ public class CustomerStaffRedis { return customerStaffRedis.redisUtils.delete(key); } + /** + * Desc: 拉取烟台用户时使用。 + * 根据客户ID 手机号获取工作人员信息,没有返回null + * @param customerId + * @param mobile + * @author zxc + * @date 2022/10/19 14:18 + */ + public static CustomerStaffInfoDTOCache getStaffInfoByMobile(String customerId, String mobile){ + String key = RedisKeys.getCustomerStaffInfoKeyByMobile(customerId, mobile); + Map roleMap = customerStaffRedis.redisUtils.hGetAll(key); + if (!CollectionUtils.isEmpty(roleMap)) { + return ConvertUtils.mapToEntity(roleMap, CustomerStaffInfoDTOCache.class); + } + return null; + } + + /** + * Desc: 【烟台用】删除所有工作人员信息 + * @param customerId + * @author zxc + * @date 2022/10/19 14:28 + */ + public static void delAllCustomerStaff(String customerId){ + String key = RedisKeys.getCustomerAllStaffInfoKey(customerId); + customerStaffRedis.redisUtils.deleteByPattern(key); + } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoDTOCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoDTOCache.java new file mode 100644 index 0000000000..70d5da942a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoDTOCache.java @@ -0,0 +1,133 @@ +package com.epmet.commons.tools.redis.common.bean; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2022/10/19 14:26 + * @DESC + */ +@Data +public class CustomerStaffInfoDTOCache implements Serializable { + + private static final long serialVersionUID = 6967736754443092229L; + + + /** + * ID + */ + private String id; + + /** + * 关联User表的主键Id + */ + private String userId; + + /** + * 账户 + */ + private String userAccount; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 性别0.未知,1男,2.女 + */ + private Integer gender; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号-唯一键 + */ + private String mobile; + + /** + * 地址 + */ + private String address; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * fulltime专职parttime兼职 + */ + private String workType; + + /** + * 头像 + */ + private String headPhoto; + + /** + * inactive未激活,active已激活 + */ + private String activeFlag; + + /** + * 激活时间 + */ + private Date activeTime; + + /** + * 未禁用enable,已禁用diabled + */ + private String enableFlag; + + /** + * 客户id + */ + private String customerId; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 登录密码 + */ + private String password; + + /** + * 身份证号 + */ + private String idCard; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index df431a925e..0eca37a078 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -1,7 +1,9 @@ package com.epmet.controller.yantai; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.yantai.DataSyncOrgDataDao; import com.epmet.dao.yantai.DataSyncUserDataDao; @@ -9,6 +11,7 @@ import com.epmet.dto.form.yantai.YtUserPageFormDTO; import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; import com.epmet.dto.result.yantai.YtUserPageResDTO; import com.epmet.entity.yantai.DataSyncOrgDataEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.DataSyncOrgDataService; import com.epmet.service.DataSyncUserDataService; import com.epmet.utils.OrgData; @@ -46,10 +49,19 @@ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService private DataSyncOrgDataService dataSyncOrgDataService; @Autowired private DataSyncUserDataService dataSyncUserDataService; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + /** + * Desc: 从org表查询组织,在根据组织去查询用户 + * @param organizationId + * @author zxc + * @date 2022/10/19 13:27 + */ @Override public Boolean yanTaiSyncUser(String organizationId) { - List data = YantaiApi.getUserByOuGuid(organizationId); + epmetUserOpenFeignClient +// List data = YantaiApi.getUserByOuGuid(organizationId); //todo 更新或插入数据 return false; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index a2398b2d92..0137e8eb7c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -924,4 +924,13 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/dataSyncConfig/natInfoScanTask") Result natInfoScanTask(@RequestBody NatInfoScanTaskFormDTO formDTO); + + /** + * Desc: 客户下所有工作人员放缓存 + * @param customerId + * @author zxc + * @date 2022/10/19 14:07 + */ + @PostMapping("/epmetuser/customerstaff/allCustomerStaffInCache") + Result allCustomerStaffInCache(@RequestParam("customerId")String customerId); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 4601ca1ef3..212252ab99 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -716,4 +716,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result natInfoScanTask(NatInfoScanTaskFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "natInfoScanTask", formDTO); } + + @Override + public Result allCustomerStaffInCache(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "allCustomerStaffInCache", customerId); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index 6c9d46dbb5..8bea2e4fbf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java @@ -618,5 +618,16 @@ public class CustomerStaffController { return new Result>().ok(customerStaffService.customerStaff(formDTO)); } + /** + * Desc: 客户下所有工作人员放缓存 + * @param customerId + * @author zxc + * @date 2022/10/19 14:07 + */ + @PostMapping("allCustomerStaffInCache") + public Result allCustomerStaffInCache(@RequestParam("customerId")String customerId){ + customerStaffService.allCustomerStaffInCache(customerId); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index 1c127d7aa5..682c279996 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -251,5 +251,7 @@ public interface CustomerStaffDao extends BaseDao { List getStaffByCustomerId(@Param("customerId") String customerId); + List getAllStaffByCustomerId(@Param("customerId") String customerId); + void edit(CustomerStaffDTO formDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index b2a3442172..8c88c7680d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -398,4 +398,6 @@ public interface CustomerStaffService extends BaseService { void editToStaff(CustomerStaffDTO formDTO); List customerStaff(GridStaffUploadtFormDTO formDTO); + + void allCustomerStaffInCache(String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 54a44f35a5..657e590d64 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import cn.hutool.core.bean.BeanUtil; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -1153,4 +1154,22 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerStaffs = baseDao.getAllStaffByCustomerId(customerId); + size = customerStaffs.size(); + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(customerStaffs)){ + customerStaffs.forEach(c -> { + String key = RedisKeys.getCustomerStaffInfoKeyByMobile(customerId, c.getMobile()); + Map map = BeanUtil.beanToMap(c, false, true); + redisUtils.hMSet(key,map); + }); + } + no++; + }while (size == NumConstant.ONE_HUNDRED); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml index 60b32c4d32..88eca3f734 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml @@ -514,5 +514,11 @@ AND enable_flag = 'enable' AND customer_id = #{customerId} + From c1fdaaf54b1c8a009cbb4d5d5d2d9c9353897864 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Oct 2022 14:38:25 +0800 Subject: [PATCH 200/249] =?UTF-8?q?/gov/org/staff/editstaffinit=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E8=BF=90=E8=90=A5=E7=AB=AF=E5=8E=BB=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java | 1 + .../main/java/com/epmet/service/impl/StaffServiceImpl.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java index 7c2a885f06..1592c4fea3 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java @@ -18,6 +18,7 @@ public class StaffInfoFromDTO implements Serializable { /** * 客户ID */ + @NotBlank(message = "customerId不能为空",groups = EditStaffInitGroup.class) private String customerId; /** * 机关ID diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index c642caddd2..9f337196ca 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -154,6 +154,10 @@ public class StaffServiceImpl implements StaffService { if (null == customerStaffAgencyDTO) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "customer_staff_agency is null user_id :" + fromDTO.getStaffId(), "查询用户所属组织为空"); } + //运营端-统一认证那调用的时候, agencyId为空,这里重新赋值下 + if(StringUtils.isBlank(fromDTO.getAgencyId())){ + fromDTO.setAgencyId(customerStaffAgencyDTO.getAgencyId()); + } Result res=epmetUserFeignClient.editStaffInit(fromDTO); if (res.success() && null != res.getData()) { res.getData().setAgencyId(customerStaffAgencyDTO.getAgencyId()); From 31134daaf903e017b16c55668c1b5838fccb13b6 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 19 Oct 2022 14:43:36 +0800 Subject: [PATCH 201/249] =?UTF-8?q?=E6=9A=82=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index 0eca37a078..0af3a39984 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -60,7 +60,7 @@ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService */ @Override public Boolean yanTaiSyncUser(String organizationId) { - epmetUserOpenFeignClient + // List data = YantaiApi.getUserByOuGuid(organizationId); //todo 更新或插入数据 return false; From febc7ffbad2e8e6123156de21d1df5b2fa8608a4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Oct 2022 14:54:56 +0800 Subject: [PATCH 202/249] =?UTF-8?q?/gov/org/staff/editstaffinit=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E4=BC=A0=E5=8F=82=EF=BC=9AagencyId+staffId?= =?UTF-8?q?=EF=BC=9B=E8=BF=90=E8=90=A5=E7=AB=AF=E4=BC=A0=E5=8F=82=EF=BC=9A?= =?UTF-8?q?customerId+staffId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java | 1 - 1 file changed, 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java index 1592c4fea3..7c2a885f06 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java @@ -18,7 +18,6 @@ public class StaffInfoFromDTO implements Serializable { /** * 客户ID */ - @NotBlank(message = "customerId不能为空",groups = EditStaffInitGroup.class) private String customerId; /** * 机关ID From 3bd02ea44cbc3a9ad2697af7459f39ff433985a6 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 19 Oct 2022 15:06:58 +0800 Subject: [PATCH 203/249] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=9A=B4=E9=9C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ThirdLoginController.java | 17 +- .../com/epmet/service/ThirdLoginService.java | 7 + .../service/impl/ThirdLoginServiceImpl.java | 23 +- .../commons/tools/utils/api/yt}/OrgData.java | 2 +- .../tools/utils/api/yt/SM4UtilsForYanTai.java | 199 ++++++++++++++++++ .../commons/tools/utils/api/yt}/UserData.java | 2 +- .../tools/utils/api/yt}/YantaiApi.java | 54 ++++- .../yantai/DataSyncUserAndOrgServiceImpl.java | 8 +- 8 files changed, 293 insertions(+), 19 deletions(-) rename {epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils => epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt}/OrgData.java (96%) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/SM4UtilsForYanTai.java rename {epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils => epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt}/UserData.java (94%) rename {epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils => epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt}/YantaiApi.java (60%) diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index 44ca89df30..f5c8da7ad4 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -9,10 +9,7 @@ import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.ThirdLoginService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -219,4 +216,16 @@ public class ThirdLoginController { ValidatorUtils.validateEntity(formDTO); return new Result().ok(thirdLoginService.govLoginInternalDing(formDTO)); } + + /** + * 根据免登授权码, 获取登录用户身份 + * + * @param authCode 烟台认证中心 授权码 + * @return + */ + @PostMapping("sso-govlogin-yantai/{authCode}") + public Result yantaiSSOLogin(@RequestParam(value = "authCode") String authCode) { + return new Result().ok(thirdLoginService.yanTaiSSOLogin(authCode)); + } + } diff --git a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java index dff5e129e5..f939656023 100644 --- a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java @@ -117,4 +117,11 @@ public interface ThirdLoginService { * @return */ UserTokenResultDTO govLoginInternalDing(DingAppLoginMdFormDTO formDTO); + + /** + * desc:烟台sso根据authCode 获取本系统token + * @param authCode + * @return + */ + UserTokenResultDTO yanTaiSSOLogin(String authCode); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index c7c79bb575..5e71f69be0 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -25,6 +25,8 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.utils.api.yt.YantaiApi; +import com.epmet.commons.tools.utils.api.yt.YantaiSSOUser; import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.constant.AuthHttpUrlConstant; import com.epmet.constant.SmsTemplateConstant; @@ -33,10 +35,7 @@ import com.epmet.dto.dingres.DingUserDetailDTO; import com.epmet.dto.dingres.V2UserGetuserinfoResDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.feign.EpmetMessageOpenFeignClient; -import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.*; import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.redis.CaptchaRedis; @@ -96,6 +95,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol private EpmetUserFeignClient epmetUserFeignClient; @Autowired private GovWebService govWebService; + @Autowired + private ThirdOpenFeignClient thirdOpenFeignClient; /** * @param formDTO @@ -1077,6 +1078,20 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol return govWebService.loginByThirdPlatform(loginGovParam); } + @Override + public UserTokenResultDTO yanTaiSSOLogin(String authCode) { + YantaiSSOUser ssoUserInfo = YantaiApi.getLoginToken(authCode); + if (ssoUserInfo== null){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"登录失败-sso获取用户失败","登录失败-sso获取用户失败"); + } + + GovWebLoginFormDTO loginGovParam = new GovWebLoginFormDTO(); + loginGovParam.setCustomerId("1535072605621841922"); + loginGovParam.setPhone(ssoUserInfo.getClientId()); + + return govWebService.loginByThirdPlatform(loginGovParam); + } + /** * 最原始的企业内部应用开发,不授权给产品服务商 * @param miniAppId diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/OrgData.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/OrgData.java similarity index 96% rename from epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/OrgData.java rename to epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/OrgData.java index f82b6fdef5..6c7ea48907 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/OrgData.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/OrgData.java @@ -1,5 +1,5 @@ -package com.epmet.utils; +package com.epmet.commons.tools.utils.api.yt; import lombok.Data; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/SM4UtilsForYanTai.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/SM4UtilsForYanTai.java new file mode 100644 index 0000000000..6c2ca8c60a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/SM4UtilsForYanTai.java @@ -0,0 +1,199 @@ +package com.epmet.commons.tools.utils.api.yt; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.commons.codec.binary.Base64; +import org.bouncycastle.jce.provider.BouncyCastleProvider; + +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.security.InvalidKeyException; +import java.security.Security; + +/** + * 烟台的认证中心-国密sm4加解密 + */ +public class SM4UtilsForYanTai { + private static String SM4_KEY = "yaweisoftware@xy"; + //编码格式 + private static final Charset encryptCharset = StandardCharsets.UTF_8; + + public enum Algorithm { + SM4("SM4","SM4","国密四,key长16byte"); + private String keyAlgorithm; + private String transformation; + private String description;//描述 + Algorithm(String keyAlgorithm, String transformation, String description) { + this.keyAlgorithm = keyAlgorithm; + this.transformation = transformation; + this.description = description; + } + public String getKeyAlgorithm() { + return this.keyAlgorithm; + } + public String getTransformation() { + return this.transformation; + } + public String getDescription() { + return this.description; + } + } + + private static final String PROVIDER_NAME = "BC"; + static { + Security.addProvider(new BouncyCastleProvider()); + } + + /** + * 自定字符串产生密钥 + * @param algorithm 加解密算法 + * @param keyStr 密钥字符串 + * @param charset 编码字符集 + * @return 密钥 + */ + public static SecretKey genKeyByStr(Algorithm algorithm, String keyStr, Charset charset) { + return readKeyFromBytes(algorithm, keyStr.getBytes(charset)); + } + + /** + * 根据指定字节数组产生密钥 + * @param algorithm 加解密算法 + * @param keyBytes 密钥字节数组 + * @return 密钥 + */ + public static SecretKey readKeyFromBytes(Algorithm algorithm, byte[] keyBytes) { + return new SecretKeySpec(keyBytes, algorithm.getKeyAlgorithm()); + } + + /****************************加密*********************************/ + /** + * 加密字符串,并进行base64编码 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 明文 + * @param charset 编码字符集 + * @return 密文 + * @throws InvalidKeyException 密钥错误 + */ + public static String encryptBase64(Algorithm algorithm, SecretKey key, String data, Charset charset) throws InvalidKeyException { + return Base64.encodeBase64String(encrypt(algorithm, key, data.getBytes(charset))); + } + + /** + * 加密字节数组 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 明文 + * @return 密文 + * @throws InvalidKeyException 密钥错误 + */ + public static byte[] encrypt(Algorithm algorithm, SecretKey key, byte[] data) throws InvalidKeyException { + try { + return cipherDoFinal(algorithm, Cipher.ENCRYPT_MODE, key, data); + } catch (BadPaddingException e) { + throw new RuntimeException(e);//明文没有具体格式要求,不会出错。所以这个异常不需要外部捕获。 + } + } + + /** + * 加解密字节数组 + * @param algorithm 加解密算法 + * @param opmode 操作:1加密,2解密 + * @param key 密钥 + * @param data 数据 + * @throws InvalidKeyException 密钥错误 + * @throws BadPaddingException 解密密文错误(加密模式没有) + */ + private static byte[] cipherDoFinal(Algorithm algorithm, int opmode, SecretKey key, byte[] data) throws InvalidKeyException, BadPaddingException { + Cipher cipher; + try { + cipher = Cipher.getInstance(algorithm.getTransformation(), PROVIDER_NAME); + } catch (Exception e) { + //NoSuchAlgorithmException:加密算法名是本工具类提供的,如果错了业务没有办法处理。所以这个异常不需要外部捕获。 + //NoSuchProviderException:Provider是本工具类提供的,如果错了业务没有办法处理。所以这个异常不需要外部捕获。 + //NoSuchPaddingException:没有特定的填充机制,与环境有关,业务没有办法处理。所以这个异常不需要外部捕获。 + throw new RuntimeException(e); + } + cipher.init(opmode, key); + try { + return cipher.doFinal(data); + } catch (IllegalBlockSizeException e) { + throw new RuntimeException(e);//业务不需要将数据分块(好像由底层处理了),如果错了业务没有办法处理。所以这个异常不需要外部捕获。 + } + } + + /****************************解密*********************************/ + /** + * 对字符串先进行base64解码,再解密 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 密文 + * @param charset 编码字符集 + * @return 明文 + * @throws InvalidKeyException 密钥错误 + * @throws BadPaddingException 密文错误 + */ + public static String decryptBase64(Algorithm algorithm, SecretKey key, String data, Charset charset) + throws InvalidKeyException, BadPaddingException { + return new String(decrypt(algorithm, key, Base64.decodeBase64(data)), charset); + } + + /** + * 解密字节数组 + * @param algorithm 加解密算法 + * @param key 密钥 + * @param data 密文 + * @return 明文 + * @throws InvalidKeyException 密钥错误 + * @throws BadPaddingException 密文错误 + */ + public static byte[] decrypt(Algorithm algorithm, SecretKey key, byte[] data) throws InvalidKeyException, BadPaddingException { + return cipherDoFinal(algorithm, Cipher.DECRYPT_MODE, key, data); + } + + public static String Encrypt(String data) throws InvalidKeyException { + SecretKey key = genKeyByStr(Algorithm.SM4, SM4_KEY, encryptCharset); + return encryptBase64(Algorithm.SM4, key, data, encryptCharset); + } + public static String Decrypt(String data) throws BadPaddingException, InvalidKeyException { + SecretKey key = genKeyByStr(Algorithm.SM4, SM4_KEY, encryptCharset); + return decryptBase64(Algorithm.SM4, key, data, encryptCharset); + } + //加密 + public static String dealEncryptData(Object data) throws JsonProcessingException, InvalidKeyException { + ObjectMapper objectMapper = new ObjectMapper(); + String dataString = ""; + try { + if(data instanceof String){ + dataString = (String) data; + }else { + dataString = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(data); + } + String dataEncrypt = Encrypt(dataString); + return dataEncrypt; + }catch (Exception e){ + return dataString; + } + } + //解密 + public static String dealDecryptData(Object data) throws JsonProcessingException, BadPaddingException, InvalidKeyException { + String dataString = ""; + try { + ObjectMapper objectMapper = new ObjectMapper(); + if (data instanceof String) { + dataString = (String) data; + } else { + dataString = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(data); + } + String dataDecrypt = Decrypt(dataString); + return dataDecrypt; + }catch (Exception e){ + return dataString; + } + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/UserData.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/UserData.java similarity index 94% rename from epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/UserData.java rename to epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/UserData.java index 99d78d63d7..b7d3abca4e 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/UserData.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/UserData.java @@ -1,5 +1,5 @@ -package com.epmet.utils; +package com.epmet.commons.tools.utils.api.yt; import lombok.Data; diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/YantaiApi.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java similarity index 60% rename from epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/YantaiApi.java rename to epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java index e788f605c1..cbab66f5b8 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/utils/YantaiApi.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java @@ -1,12 +1,12 @@ -package com.epmet.utils; +package com.epmet.commons.tools.utils.api.yt; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; -import com.epmet.controller.yantai.SM4UtilsForYanTai; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -25,6 +25,7 @@ import java.util.Map; @Slf4j public class YantaiApi { private static final String SSO_SERVER = "http://localhost:8080/"; + private static final String CLIENT_ID = "1000006"; /** * desc:根据组织id获取下级组织 @@ -75,7 +76,7 @@ public class YantaiApi { String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(organizationId); //pwd = URLEncoder.encode(pwd, "UTF-8"); System.out.println("加密组织Id = " + organizationIdEn); - String url = "ouinfo/getUserByOuGuid?organizationId=" + organizationIdEn; + String url = SSO_SERVER+"ouinfo/getUserByOuGuid?organizationId=" + organizationIdEn; Map headerMap = new HashMap<>(); Map paramMap = new HashMap<>(); @@ -93,4 +94,51 @@ public class YantaiApi { } return new ArrayList<>(); } + + /** + * desc:根据组织id获取下级组织 + * + * @param code + * @return + */ + public static YantaiSSOUser getLoginToken(String code) { + try { + if (StringUtils.isBlank(code)){ + throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + //加密 + String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(code); + //pwd = URLEncoder.encode(pwd, "UTF-8"); + System.out.println("加密组织Id = " + organizationIdEn); + String url = "logintoken?client_id="+CLIENT_ID+"&client_code=" + code; + + Map headerMap = new HashMap<>(); + Map paramMap = new HashMap<>(); + log.info("getUserByOuGuid request param: url:{},header:{}", url, headerMap); + Result result = HttpClientManager.getInstance().sendGet(url, paramMap, headerMap); + log.info("getUserByOuGuid request result:{}", result); + JSONObject jsonObject = JSONObject.parseObject(result.getData()); + //解密 + String errcode = jsonObject.getString("errcode"); + if (!NumConstant.ZERO_STR.equals(errcode)){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取token失败","获取token失败"); + } + String data = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); + YantaiSSOUser userData = JSON.parseObject(data, YantaiSSOUser.class); + log.info("getUserByOuGuid request real result:{}", JSON.toJSONString(userData)); + return userData; + } catch (Exception e) { + log.error("getUserByOuGuid exception", e); + } + return null; + } + + public static void main(String[] args) { + String serverUrl = "http://172.20.46.155:8080/sso/login"; + Map param = new HashMap<>(); + param.put("client_id","1000006"); + param.put("redirect_url","https://epmet-open.elinkservice.cn/epmet-oper-gov/"); + Result stringResult = HttpClientManager.getInstance().sendGet(serverUrl, param); + System.out.println(JSON.toJSONString(stringResult)); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index 0af3a39984..4261969097 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -1,10 +1,10 @@ package com.epmet.controller.yantai; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.api.yt.OrgData; +import com.epmet.commons.tools.utils.api.yt.YantaiApi; import com.epmet.dao.yantai.DataSyncOrgDataDao; import com.epmet.dao.yantai.DataSyncUserDataDao; import com.epmet.dto.form.yantai.YtUserPageFormDTO; @@ -14,9 +14,6 @@ import com.epmet.entity.yantai.DataSyncOrgDataEntity; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.DataSyncOrgDataService; import com.epmet.service.DataSyncUserDataService; -import com.epmet.utils.OrgData; -import com.epmet.utils.UserData; -import com.epmet.utils.YantaiApi; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -26,7 +23,6 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.stream.Collectors; import static com.epmet.constant.YanTaiConstant.YT_CUSTOMER_ID; From 2e2894d6825856f996da89b2d990f299ea5cf364 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Oct 2022 15:13:41 +0800 Subject: [PATCH 204/249] =?UTF-8?q?/data/aggregator/org/staffdetailv2?= =?UTF-8?q?=E7=9A=84szsqRoles=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 6820ef9f8c..e89800fa69 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -736,7 +736,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { getStaffExistRoleFormDTO.setCustomerId(dto.getCustomerId()); Result> staffExistRole = govAccessFeignClient.getStaffExistRole(getStaffExistRoleFormDTO); if (staffExistRole.success()&&CollectionUtils.isNotEmpty(staffExistRole.getData())){ - List szsqRoles=staffExistRole.getData().stream().map(m -> m.getRoleName()).distinct().collect(Collectors.toList()); + // 过滤selected=true的 + List szsqRoles=staffExistRole.getData().stream().filter(t->t.getSelected()).map(m -> m.getRoleName()).distinct().collect(Collectors.toList()); result.setSzsqRoles(szsqRoles); } return result; From 883d11ef94f82ba884ff85a0c563d623de28b332 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 19 Oct 2022 15:21:31 +0800 Subject: [PATCH 205/249] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=9A=B4=E9=9C=B2=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/utils/api/yt/YantaiSSOUser.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiSSOUser.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiSSOUser.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiSSOUser.java new file mode 100644 index 0000000000..99d31cc439 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiSSOUser.java @@ -0,0 +1,30 @@ + +package com.epmet.commons.tools.utils.api.yt; + +import lombok.Data; + +import java.io.Serializable; + +/** + * sso:认证中心 用户信息 + * @author liujianjun + */ +@Data +public class YantaiSSOUser implements Serializable { + + private static final long serialVersionUID = -2794280342919451106L; + + /** + * 他说这个是手机号 + */ + private String clientId; + private String departmentCode; + private String expirationTime; + private String ip; + private String issueTime; + private String registerGuid; + private String registerName; + private String userGuid; + private String userName; + +} From 1294fe08be91b59b2e8aacd42c06f8c1a15824e3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 19 Oct 2022 15:22:11 +0800 Subject: [PATCH 206/249] =?UTF-8?q?=E6=9A=82=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yantai/DataSyncUserAndOrgServiceImpl.java | 49 +++++++++++++++++-- .../epmet/dao/yantai/DataSyncOrgDataDao.java | 2 + .../mapper/yantai/DataSyncOrgDataDao.xml | 6 +++ .../impl/CustomerStaffServiceImpl.java | 10 ++-- 4 files changed, 60 insertions(+), 7 deletions(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index 4261969097..6b81da281f 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -1,16 +1,22 @@ package com.epmet.controller.yantai; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoDTOCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.api.yt.OrgData; +import com.epmet.commons.tools.utils.api.yt.UserData; import com.epmet.commons.tools.utils.api.yt.YantaiApi; import com.epmet.dao.yantai.DataSyncOrgDataDao; import com.epmet.dao.yantai.DataSyncUserDataDao; +import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.yantai.YtUserPageFormDTO; import com.epmet.dto.result.yantai.DataSyncOrgDataDTO; import com.epmet.dto.result.yantai.YtUserPageResDTO; import com.epmet.entity.yantai.DataSyncOrgDataEntity; +import com.epmet.entity.yantai.DataSyncUserDataEntity; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.DataSyncOrgDataService; import com.epmet.service.DataSyncUserDataService; @@ -56,9 +62,46 @@ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService */ @Override public Boolean yanTaiSyncUser(String organizationId) { - -// List data = YantaiApi.getUserByOuGuid(organizationId); - //todo 更新或插入数据 + String customerId = "45687aa479955f9d06204d415238f7cc"; + // 缓存初始化staffs + epmetUserOpenFeignClient.allCustomerStaffInCache(customerId); + Integer no = NumConstant.ONE; + Integer size; + do { + // 分批获取org + PageInfo pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> dataSyncOrgDataDao.getAllList(customerId)); + size = pageInfo.getList().size(); + if (CollectionUtils.isNotEmpty(pageInfo.getList())){ + List needInsert = new ArrayList<>(); + pageInfo.getList().forEach(org -> { + // 根据org查用户 + List data = YantaiApi.getUserByOuGuid(org.getOrganizationId()); + if (CollectionUtils.isNotEmpty(data)){ + for (UserData u : data) { + CustomerStaffInfoDTOCache staffInfo = CustomerStaffRedis.getStaffInfoByMobile(customerId, u.getMobileTelephoneNumber()); + DataSyncUserDataEntity entity = ConvertUtils.sourceToTarget(u, DataSyncUserDataEntity.class); + entity.setCustomerId(customerId); + entity.setRemark(""); + if (null == staffInfo){ + entity.setStatus(NumConstant.ZERO_STR); + entity.setOrganizationId(""); + entity.setStaffId(""); + }else { + CustomerStaffInfoCacheResult staffInfo1 = CustomerStaffRedis.getStaffInfo(customerId, staffInfo.getUserId()); + entity.setStatus(NumConstant.ONE_STR); + entity.setOrganizationId(null == staffInfo1 ? "" : staffInfo1.getAgencyId()); + entity.setStaffId(staffInfo.getUserId()); + } + needInsert.add(entity); + } + } + }); + dataSyncUserDataService.insertBatch(needInsert,NumConstant.FIVE_HUNDRED); + } + no++; + }while (size == NumConstant.ONE_HUNDRED); + // 删除staffs缓存 + CustomerStaffRedis.delAllCustomerStaff(customerId); return false; } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java index edad699db9..b0b0529b62 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/yantai/DataSyncOrgDataDao.java @@ -22,4 +22,6 @@ public interface DataSyncOrgDataDao extends BaseDao { * @return */ List queryList(@Param("pid") String pid); + + List getAllList(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml index 6f81c501f3..14931417d7 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/yantai/DataSyncOrgDataDao.xml @@ -46,4 +46,10 @@ order by d.ORDER_NUMBER asc + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 657e590d64..1d229ba369 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -61,6 +61,8 @@ import com.epmet.service.GovStaffRoleService; import com.epmet.service.StaffRoleService; import com.epmet.service.UserService; import com.epmet.util.ModuleConstant; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -1159,10 +1161,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl customerStaffs = baseDao.getAllStaffByCustomerId(customerId); - size = customerStaffs.size(); - if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(customerStaffs)){ - customerStaffs.forEach(c -> { + PageInfo pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> baseDao.getAllStaffByCustomerId(customerId)); + size = pageInfo.getList().size(); + if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(pageInfo.getList())){ + pageInfo.getList().forEach(c -> { String key = RedisKeys.getCustomerStaffInfoKeyByMobile(customerId, c.getMobile()); Map map = BeanUtil.beanToMap(c, false, true); redisUtils.hMSet(key,map); From 204444a511c098dd2fbf5ab3a6ea38b3571f8754 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Oct 2022 16:36:22 +0800 Subject: [PATCH 207/249] =?UTF-8?q?/gov/org/staff/addstaffv2=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E8=BF=90=E8=90=A5=E7=AB=AF=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/AddStaffV2FromDTO.java | 5 ++++- .../com/epmet/controller/StaffController.java | 22 +++++++++++++++---- .../epmet/service/impl/StaffServiceImpl.java | 6 ++--- .../impl/CustomerStaffServiceImpl.java | 3 ++- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java index ecdfba89f9..7bc3b93076 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddStaffV2FromDTO.java @@ -74,5 +74,8 @@ public class AddStaffV2FromDTO implements Serializable { private List newRoles; - private String currentStaffId; + /** + * 烟台用:当前登录用户 + */ + private String currentUserId; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index d3f9b9dd28..4b925df93e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -4,13 +4,17 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.enums.RequirePermissionEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; 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.dto.form.*; import com.epmet.dto.result.*; import com.epmet.service.StaffService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -204,10 +208,20 @@ public class StaffController { @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_CREATE) public Result addStaffV2(@LoginUser TokenDto tokenDto, @RequestBody AddStaffV2FromDTO fromDTO){ ValidatorUtils.validateEntity(fromDTO, AddStaffV2FromDTO.AddStaff.class); - fromDTO.setCustomerId(tokenDto.getCustomerId()); - fromDTO.setApp(tokenDto.getApp()); - fromDTO.setClient(tokenDto.getClient()); - fromDTO.setCurrentStaffId(tokenDto.getUserId()); + if(AppClientConstant.APP_OPER.equals(tokenDto.getApp())){ + if(StringUtils.isBlank(fromDTO.getCustomerId())){ + // 该接口烟台运营端-统一认证也在用,所以客户id,运营端必传。 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"运营端操作,customerId不能为空","运营端操作,customerId不能为空"); + } + }else{ + //小程序端或者数字社区从token里面取 + fromDTO.setCustomerId(tokenDto.getCustomerId()); + } + //因为添加的是工作人员,这里写死吧! + fromDTO.setApp("gov"); + fromDTO.setClient("wxmp"); + //当前登录用户 + fromDTO.setCurrentUserId(tokenDto.getUserId()); return staffService.addStaffV2(fromDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 9f337196ca..d364fabda6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -575,8 +575,8 @@ public class StaffServiceImpl implements StaffService { //1.根据新增人员类型判断查询机关信息 OrgResultDTO orgDTO = customerAgencyDao.selectAgencyDetail(fromDTO.getOrgId(), fromDTO.getOrgType()); if (null == orgDTO) { - logger.error(String.format("工作人员新增,根据新增人员组织类型未查询到相关组织信息,orgId->%s,orgType->%s", fromDTO.getOrgId(), fromDTO.getOrgType())); - throw new RenException("根据新增人员组织类型未查询到相关组织信息"); + logger.warn(String.format("工作人员新增,根据新增人员组织类型未查询到相关组织信息,orgId->%s,orgType->%s", fromDTO.getOrgId(), fromDTO.getOrgType())); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"根据新增人员组织类型未查询到相关组织信息","组织不存在"); } //2.调用user服务,新增用户信息 @@ -655,7 +655,7 @@ public class StaffServiceImpl implements StaffService { || "0c41b272ee9ee95ac6f184ad548a30eb".equals(fromDTO.getCustomerId())) { YtSyncStaffIdFormDTO ytSyncStaffIdFormDTO = ConvertUtils.sourceToTarget(fromDTO,YtSyncStaffIdFormDTO.class); ytSyncStaffIdFormDTO.setStaffId(result.getData().getUserId()); - ytSyncStaffIdFormDTO.setOperUserId(fromDTO.getCurrentStaffId()); + ytSyncStaffIdFormDTO.setOperUserId(fromDTO.getCurrentUserId()); epmetThirdOpenFeignClient.dataSyncUpdateStaff(ytSyncStaffIdFormDTO); } //2022.10.18加个返参,借用下StaffDetailResultDTO不再新建dto了 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 1d229ba369..d931b46a2c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -349,7 +349,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + // return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"手机号已存在","手机号已存在"); } //USER表插入数据 UserEntity userEntity = new UserEntity(); From 9513601af001f5190a8066061dc01fb6518e384a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Oct 2022 16:47:38 +0800 Subject: [PATCH 208/249] =?UTF-8?q?/gov/org/staff/addstaffv2=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E8=BF=90=E8=90=A5=E7=AB=AF=E8=B0=83=E7=94=A8;staff/ed?= =?UTF-8?q?itstaff=E8=B0=83=E6=95=B4=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/StaffController.java | 2 +- .../java/com/epmet/service/impl/StaffServiceImpl.java | 11 +++-------- .../epmet/service/impl/CustomerStaffServiceImpl.java | 3 ++- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index 4b925df93e..bcc8e2f55e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -101,7 +101,7 @@ public class StaffController { */ @PostMapping("editstaff") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_STAFF_UPDATE) - public Result editStaff(@LoginUser TokenDto tokenDto, @RequestBody StaffSubmitFromDTO fromDTO){ + public Result editStaff(@RequestBody StaffSubmitFromDTO fromDTO){ ValidatorUtils.validateEntity(fromDTO); return staffService.editStaff(fromDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index d364fabda6..a81f868ac5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -216,14 +216,12 @@ public class StaffServiceImpl implements StaffService { CustomerAgencyEntity customerAgencyEntity = customerAgencyService.selectById(fromDTO.getAgencyId()); fromDTO.setCustomerId(customerAgencyEntity.getCustomerId()); } + // epmetUserFeignClient.editStaff没有用到这俩参数,就注释了。 // fromDTO.setApp(tokenDto.getApp()); // fromDTO.setClient(tokenDto.getClient()); Result result = epmetUserFeignClient.editStaff(fromDTO); if (!result.success()) { - if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) { - return new Result().error(result.getCode(), result.getMsg()); - } - return new Result().error(EpmetErrorCode.STAFF_EDIT_FAILED.getCode(), EpmetErrorCode.STAFF_EDIT_FAILED.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),result.getInternalMsg(),result.getMsg()); } // if (tokenDto.getClient().equals("web")){ if(CollectionUtils.isNotEmpty(fromDTO.getNewRoles())){ @@ -584,10 +582,7 @@ public class StaffServiceImpl implements StaffService { submitDTO.setAgencyId(orgDTO.getAgencyId()); Result result = epmetUserFeignClient.addStaff(submitDTO); if (!result.success()) { - if (result.getCode() != EpmetErrorCode.SERVER_ERROR.getCode()) { - return new Result().error(result.getCode(), result.getMsg()); - } - return new Result().error(EpmetErrorCode.STAFF_ADD_FAILED.getCode(), EpmetErrorCode.STAFF_ADD_FAILED.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),result.getInternalMsg(),result.getMsg()); } //3.人员机关表总人数加一、关系表新增关系数据 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index d931b46a2c..24d9eb6729 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -470,7 +470,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + // return new Result().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"手机号已存在","手机号已存在"); } CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); From 271a9ad65855facb14085ce5bb441e39135b2313 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Oct 2022 18:16:03 +0800 Subject: [PATCH 209/249] =?UTF-8?q?/gov/org/staff/editstaffinit=E8=BF=94?= =?UTF-8?q?=E5=9B=9EcustomerId=EF=BC=8Cstaff=5Forg=5Frelation=E6=94=B9?= =?UTF-8?q?=E4=BA=86=E4=B8=8B=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/StaffOrgRelationDTO.java | 2 +- .../src/main/java/com/epmet/dto/result/StaffInitResultDTO.java | 1 + .../src/main/java/com/epmet/entity/StaffOrgRelationEntity.java | 2 +- .../java/com/epmet/service/impl/CustomerStaffServiceImpl.java | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffOrgRelationDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffOrgRelationDTO.java index 47e3105b3d..e1b2602373 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffOrgRelationDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffOrgRelationDTO.java @@ -60,7 +60,7 @@ public class StaffOrgRelationDTO implements Serializable { private String orgId; /** - * 工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + * 工作人员的添加入口类型(组织:agency;部门:dept;网格:grid) */ private String orgType; diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java index 69f9e86294..87b641b564 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInitResultDTO.java @@ -13,6 +13,7 @@ import java.util.List; @Data public class StaffInitResultDTO implements Serializable { private static final long serialVersionUID = 1L; + private String customerId; /** * 人员ID */ diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffOrgRelationEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffOrgRelationEntity.java index 99c242b25d..04ef0c00d2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffOrgRelationEntity.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffOrgRelationEntity.java @@ -56,7 +56,7 @@ public class StaffOrgRelationEntity extends BaseEpmetEntity { private String orgId; /** - * 工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + * 工作人员的添加入口类型(组织:agency;部门:dept;网格:grid) */ private String orgType; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 24d9eb6729..62af329caf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -303,6 +303,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl Date: Wed, 19 Oct 2022 18:25:59 +0800 Subject: [PATCH 210/249] =?UTF-8?q?/gov/org/staff/editstaff,staff=5Frole.c?= =?UTF-8?q?ustomerId=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/CustomerStaffServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 62af329caf..a5d32a11b0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -496,6 +496,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl Date: Wed, 19 Oct 2022 18:38:57 +0800 Subject: [PATCH 211/249] =?UTF-8?q?/data/aggregator/org/staffdetailv2?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=8A=A5=E9=94=99=E3=80=82=E8=BF=94=E5=9B=9E?= =?UTF-8?q?customerId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java | 1 + .../service/epmetuser/impl/EpmetUserServiceImpl.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java index 2a320915e8..ea1763af18 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java @@ -46,5 +46,6 @@ public class StaffDetailV2FormDTO implements Serializable { * 数字社区里的角色名称 */ private List szsqRoles; + private String customerId; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index e89800fa69..7f2fa0e263 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -7,6 +7,8 @@ import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.IdAndNameDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.OrgTypeEnum; +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.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; @@ -720,7 +722,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { //基本信息 CustomerStaffDTO dto = customerStaffDao.selectByStaffId(staffId); if (null == dto) { - return result; + // return result; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"customer_staff is null staffId:"+staffId,"未查询到工作人员基础信息"); } //角色信息 List list = staffRoleDao.selectByStaffId(staffId); From 1014523743a0602f87e19a0d79feaaa253f2d26c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 20 Oct 2022 08:56:21 +0800 Subject: [PATCH 212/249] =?UTF-8?q?=E8=AF=81=E4=BB=B6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/NatListResultDTO.java | 2 +- .../excel/data/IcNatImportExcelData.java | 6 +++--- .../src/main/resources/excel/ic_nat.xlsx | Bin 9203 -> 9198 bytes 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java index 43f9582b8c..ee3f03e5e9 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/NatListResultDTO.java @@ -60,7 +60,7 @@ public class NatListResultDTO implements Serializable { * 身份证号 */ @ColumnWidth(25) - @ExcelProperty(value = "身份证号",order = 3) + @ExcelProperty(value = "证件号",order = 3) private String idCard; /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java index ae0cb210d7..b54c571f8f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java @@ -24,9 +24,9 @@ public class IcNatImportExcelData { @Length(max = 15, message = "手机号长度不正确,应小于15位") private String mobile; - @NotBlank(message = "身份证号为必填项") - @ExcelProperty("身份证号") - @Length(max = 18, message = "身份证号长度不正确,应小于18位") + @NotBlank(message = "证件号为必填项") + @ExcelProperty("证件号") + @Length(max = 18, message = "证件号长度不正确,应小于18位") private String idCard; // @NotNull(message = "检测时间为必填项") diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx index 31cc19219bf74629dbeba6c13449990ad7f8208e..524d327bd7032cf01b51e60fcf15ec903428035d 100644 GIT binary patch delta 4508 zcmV;N5o7N2NA5?klK};y%iTXTlb8V>e?d=#Fc5|BCjJM~JG8)RHVv=`&7L$dagD}X z)6PO8Elpcx*I#deUBqbOt?hgB&6`fKIjA=J0PAF@OOz%AMWA^nq^?W!wA;pO6gkhd zU~Q+NL`QIFQ(ayZ+)&m|4-khG)Rl&JCEP>daKKrxpDhYsStvx@m}f3-C> zjK8rOa7M^AR^XXnp5Xx)o0*7CNWo{MdAIEd5FA4b3bc1PO;Y^r^Da|a)0+Yjv7ln{1pdO6@pW4f%(o>J=66;GX2?v zLxC4caE+lRD~Kqxp;M@{@|@q?IPSKn%1D;QB#(2lBRNf1l#thf^`m}hJ3Xkd!oB>T zn36aP#5KLjX|`Gr&w#4HzgAs+0Z>Z=1d~1?8nXujYykxo9nI)~lXwIrf6I>3FcjS* z@eh#~tRRW|NFOvsOgk+|fJO|DwI^{~Yn(XPPCLVj&)^UE0Qe>({(@`gF-=lLyQq`v zb5G8F_$IR#cL{g)R4OLY5MkFx4oxEwvveDxj~`ag#>i2cq%q+lr6Ibf3cZ*=el$A> zd8>AmY6lon6{4Ni+0^q?f3%|sQLe~n3OgGi6Qbc(ZatMrN@DAjaIfe4ftL`LqJm*6 z&*2c84U6bfM0r9}U64r1i3a^@$1+v1-Nk3|#gZH#)=JNj#AUHl^Wi~9U&10Ol-OuD z5{Xwx>qa^8CXG0gs6%ujSqYK1dG-v5GYIa6ai;HWxM)7JDZG;2e|#1*NQ0@JBk3kY zFY$EUM_{*zPmCVa(Y2$=%{ApT(lmxzBj>9S$#q0H)D`!j^7Z{YQ#D>%O{H&yxHWXI z!O=GgERA_Ci8R~O1?2!=^q^V3SS4@?GQ3*H@pYwXWqadFIx*dloa=?)pINMTA)2^& z&>Ig&)jz5r@5SL2e`VX925loZK#s^YXDNL{_msnCh(N-z4LCy-7%h?D@L>3N5@uQ* zISIM5>)~GyRr=oMrgSeH;Q`hW*3uD!jvDGjxzZvj1Hlc~e(4Hp>Dn8(K`;rbU?*o1 z4N4+dE26&J$Gzd1{(!SFfbc4Yp*tF2|0v^UMKmgjV6BMye{L{pl4haDGm-Cd#J6-h#5+FI)ZMEjPa$h+Wvs%QDEKA{h7BnG$rDq zLYQtbE{nEd**09Z4Xd_cePr-JUoFy{m99u*4G}a*EfTjxb`iZM!k)q=N56?!b~y%3 z#AO#TY$8@&e?-tkthViYrG(b=pXn0HH zmO((AZXh4NJAy$bi`PMMqeW(Q-Utmt*k117n}fn(_T3@IV}DrvVD@c<(5JUx0u+8L z3o*l{1^(cf{{@g9vpWbQ27hpH@TYDH007rd000dD004MwFLQKxY-MvUcx`OeTy1aL z))oFfVE=(ouzd(-i=?Qx)N&TfCQzUo3M2ytY(pSRludvlJ(3FS4h6EMnYRuZFr-_y zqQJTqUiM+}wr*I1u1Wt)q{yH87k2IoFYlEuUmRN$V|}nh@!WIHbAO(5?ji4`Hm)Cz z9OaJX2e#*SD%!eQQ7pIb4QzL>Q~ALybFEcTg0SZfdXDE>oyw6FRIYD+^BWsMc;r|& z_bn?_UMRH~7EyfL+TW9GD9Rp!)PrRL@wU!Nae z?rf^3@-GE9)1B1jji63qDdr*llsImcMt5^#=(%x_brqtFj(==!1n($!dJgbUM_~6o z$McmCXarH#F#NrdMb4O<{^rHAhxn}ho*w}Fh+xe?$1wNknIqfvd~~o%bj)eO;}T8& z-fpL2n&yq>wyNe*htJAZwu?-PT;mi{*J` zXoM?*NMpSXf3;S-p|@L_ik(@aewsEn>ga`#UZO5K<+oStt7-0RwY$amiu-~kLdv=u z)9e=HQhy^3Uk#Yrtk+w0t*skcyBJ98vHoIHWs$y3@V})sTCG;wsA&b2isp*_=kPDq zf5!E0v%9lou2Egx#*VpkU6fbcq_YxUbG#}xuGIg6W*-jbmAJ{x^u_9r(nmMpwdC}n zA>}BwlBt4=^-A>POM@lO{w#A?^SBZ>mp$=E%zuRzr@d@l6jH9qDK<+N^{-?yD6E$$ z`if&E3BuL<3+l(0wQwQ5>-hs%U{dJXj)rdglVh73jx`JcR^Q&+NB=|b0D{-s-RaK6x5H#{lLNrXEXFTWL=wkLnY=hhz6#u=VcXKt3-vWJPctMI{mc-M zc$p!Q*T)RbCUJ?Rb3VGJ!N>(aE72+NoPR_<7&(EQFme)kVNCNeUM$H=6;2|bkDNeG zA32GpB*>q&Iq1YV`xut#B0)f_w z(Ut@B7H;O!w`A%eA2v67j=krOEEiUwEkCsTX#KhmA1$)zd^k)V7CN?Q*czjbs}AKk(eY5e&{WI=rBZQl#6euy`7pn3KJMxqT4)OQUoj>>5y zk0fkXD5sGKz6eTPfD)Rmlz0~wUmb39mlHaUggSs#A|uIeq^vSQ!fQe~iF4G1tcpKv z6`IsszUa`@l?YFuV0P6lGn{a*xqn1(a+4Sr^BUw+>5bINmFRLL_16JOy|m2*iZPoK zg^7EWQzD-!5cYCr3e=ehIk2~!HuBSUX@S%@B+>iQLkX+aB{dRR7LihjHylrCaK%n& zx$Q1&EoLUd@^?vr1j8a61smZ*3XV%gjw_40P^;luW_4Dfz3H-RbFenWsDC0Umy{Hc zA-OHwD)jPztJ_*>8yqf?g<4ZGSPf)n=6xi>gz{V<@(d_f_h=x~UOPNtwM$;6O2$@X zCIy#k&EaU?u1GAbt1DaQFu7PGxtoCJuyK{Ja`S#^J5R)0+64%=4WOS-n`4C=a?5R> z_=+lYPhfhAiN%tW3$<{Ax_?YIazK{$Y7JdkM0_lBmK&&he*Gp>jsgO@<>~o33*l|v z$+OsGPimmS;FN+S&P2{!iD8TkyI~FjLfIHlV4skmNW14~<2kcZPPoK^nzsI4vJGLEohK+CswwufgG}Lb? zYs%!yFJ}L|H~qu$8E$6e?FN!`2FPmz3InaGFg#Iu&yqVMK$dB3nnsG#H3|! z`tkAECx2987)0Vg$0pPB_|voF_osIsL(!jp^mnFE zcC#G8+n!<}^5p8g&dd-#0%+Y>f`$S7%&5~P@f$Rk+LmDrl-GK&!e zMX+2t%}ndf48f;-L<&lA}R`bbT$ ziRGy-9e+krSy_F9Hb5|43SD9Zm>u9UKTKT;{R0S-^0(YK#b^F zZ`*gg5D(F*#P8oi&l-{PZyknj1@M3n{8z@l-KqR+XRF!X-ZAyHmb%qiGip|StzF;R zUaK43t?g~It?Fv`UC0>pi+9%!HDlpd??!gt_X2MiuJ_>)CT}>j`_|&`-nFak=$G$c zkT+|A184cvS!(>v_*kdHeIVvzxWH@xEpnn7uwUfc{6A1j0|XQR000O8hfd-^{W0a% zGywnr7L)!M9)C*1Koo`dg6|M!-_9iQr<5e!`2_j^p&8piGAWr+bk_={Nbv_MR53_P z7hTpx?Jv@o$xO{#I1*4CdUp4G=Ww}Pt8x_v+9i&u9}yeqMFccVs*&fDnhnlQPYNZV zQRWiQ4I+YVaE&RbIQx4RrA(7uLTylItWk!LR_i!)X@4LOzu4ZjzxXPVvZOrvi3rZn&P9IZib>Yu^@9S_(SsqANTm< zo$89)u1Hq=VXlI&Nh@8?c7S|`=+CnLR4rwlju^~$v%JTX_wCJ6?d5E{?uoZVW!w91 zx_VMwy)*PH6`9BAzjQTWAOjVUSuk}?H_Q5=%H;v+dc0Zo&ZB02#YlhGnJ0zn9qUe@{=uAP~jxCVq#8dkb{`#3gO_pxKiqCe~=Y z5t!{Z7D@o^uAg4ouC+!JZ@_!=n>S3hJ*p;p2kYuq=ZGc*MW971YhC5&vE0R1C~}@_ z$(vR~j!xjvwz#~=gkhq!aBo`!*4N;oK+=v0lcR(8hGFc)0Tg#haOfcJTdTMae^*;! z!^JDF0H=hku>#K}_Z;`Y*i1xpMoKXu&6{lofD{-SP@uiTG@%l7bXThM%oT~OG z6J|QcowKDF#mRki^I z;gI2(5?n*5(F!sOZP*ylfVK$wT{9AG6QM+fr0k@t9-}wt0opSa$SpdgEX9&sz+RZr@Xgbk4@a7u zKP24QQmL3oLxf!)IW&z#%+hs;zI6-b#Cfq(@!?)eU&10Olvrsu5{XwxYezZq zMzuJTs6})nSqYJMd3FZG83cFBIMa_dTr{276y8X0e>#a7q`}nAk#rTJ3p`$S5!fx_ zE2BGgaP4Sv`-yTIX&OVVk@H=MO!;JTP1J_GQ3L1;dQBLVSD37Ix$_5oa>q3-&m|SAsV^3*BSN)y2Utf~_l_8JR8S|%l@`f95L|PG^jKF|_pY6u8w8`E40d!PQEyKKYf02~ zySURo(I0SD2na7@=(~d+_75_CQbdD25v(Oqf7cBLwbGqL1Y@QsN6;NUN7e3wip+FZ zQBvDubE3&~BE`;uV-K}e88Jf%j|b4LkuhEvtL+bH9tGCz)Sq};L$gO*mI%`=#%0zt z%$tU*reV=EEDsDG=&M9R{~Qr%tRaF1sYK$2$Tp%=N6gxYZXGdiBYJhjRU6T-BNlB$ ze^5s(+lWDhsHMV;jds0^)z-2~#jtX><+*GlMs>ujjlhkf&yPSFDYs*-t^_wAiz6(J zvcO<&#)F^hQskqUmqjlpRIcq@RZb-G)J!~R+RFMo@a>H8stp)&F&u`kgfm#pYw^&( zzUAo042C~vN+XAGE_Rokq<1z}wGq4Pe>BVWd#V&!n|A~R0LCjRg{&Eik-zMWm)P&Y z*$+UddGY6*;OVRTT2AeX~^1Y_IG09B;o__{j}_YolJ! zhGEC+bzI-Gn}uV0Sh%|V-S2D-!(-RJeqh_71}wZ`vv3fGhgXWlVfVlubcUP$q3yvp zeLomD{`oX13rOi_5ruLfR+n;YN{+@8zApfpj#Y}#9 zQ!5lB{X}KTv&zg!zpTxOyG+$h$={geuQqm}rRpywGZ!1F&niKU#8k{edKSyKNTa*G z)%QIfWTOO8Mpw4ChHq)NIxgVPK+f*^t{-S2zzCwOWA}FkHo0Sb_M2yaPwwNp4m!aQ z&_@W%Cc1{PNADaso*$r#MIvKH66Q-J1^au=f@N9PYCEM;DslL(mlO6vX1%(crP{NH zTpWc;a3Hm*oXU6lGD2mQ;4hW9lr9{_m`1UI#97ud1v-lb)-3c{rocT>UsET@p|@=4Q+E3UoHx2r&TdoVx<9p<$9xPH0pW@8?$=(4dmq2i^<3uT!mI>O_cvI zAhp}scn%&JBS@|VAhk8iudGXc6l=qR&x&Im$+C7^jaB1{%DPrTpRDX^*V?-)mPK0} z0WUSEr**wruh$!YW?5f#L1!^+w;LH%RUtRaU~8>XsaN!dVd@#l7ks@I`9f{XHr5nt z4PKkFl~1wOuI^e{<&|LTTE?L&_w`z^w(9ahAtiL6YcaEyO_dfZSGJi$-He|WSJ)^r zF|2u8iv{#lh zuzSvEz~sz-mv|F(sAkP9)y#@f#ZMWjWk<$H@uH@*4D>;zJTYqX6bZ4LCrFCmJjIIr zOCX*ugp1tBC)U%tQJ_fYMu8xu8wHBAZj5YH<6dB>Nby9Pc{>wH6qY8^q_tH}{m61D zNmw2toFwZa-JVtrrC^!}d^svDtOSaAcT2X-i%=MUm_V_}MmluBNYu4m_c|Ife%fcl zk=cM^chnb__F)SIS}R6d4$vV?=F&ql^pKP7t&Z#Ldjs2p6=*vMoi19x?!u`}7M+j! z@odrF0m`-v$0A>?b9m?;|9CXmvjYonoxob)t1Uc`^7Ctv2K>^Sfgjr45O3x{6JlX$U8&HEgZxc}vf2ixXFCa^_YOzru0Ro)Cq9 zX`g%z+$O5uiSu$KvGVi4jk=$xbY74efD-?LsVsmN^~ZeBTwD^et*sZ&twP6SNWDm& z+zPrxXqBFKVU$=j$VyXktL>fybizAtIYp-sYiWu)PoWka3CH!6{32rR0Z(!#}RYo<_+a{H_N{DB7nk8*Y875P>c8xAJgobtseh3GmACYlSYVG43*q3S8N_U{SfUIWGT>$$ z$Y{uj&V}@p^*rzc=PfAw!hVI6I~X$1J=Kl{j3mI0u%ScV&cTqTdGNyl&BFM9@#E>k z_XMx*jT{$VQ6kuZEj64OSJQvqnf&2o{OG~?XP-HYED(?}vJrkn!WQH4Y^ zPHzxL^oG$^;8Mo#Zlt!JaY225CfB7*-p8HQ{yz`LkKc*pq6VK+;Qj5hVioRU0?~NP z$;)`-_$>YNKRq44|Le&=K8j?bSrATyUq70qiG>Tqm%;@VU(ThBH*=?E1Ma45WZ0QX zmnl5J^^g$I@}z&u_o`?C~QeQ-+@Vldl-bOc7Immc7ZRC+DC2QR8lqfdl)nRB|4Eetz=d=Qm z7&M(B46w=)Eh1Ha$Q86sBakW!1I+G=yWq{* zthWbX^z43TnX5K<^rn@^2r7Zw%oDA^5M2 z0;gH{)o!cS*x9v=je4n7-!RK|WusAP?QB%cc57$HYLtvp`)$Y=^ow^_j&yVGSMLT+ zH}HpkKiurXD@=aB?{w|?-@R)T8__S{0h2337w!tEu~hl%{93ahoDlV~yFhJlT4Y3V z$bOM;`~OfDO9KQH000080EbTEK-sm<(EZEXe6c;YKunSu?BEC#!G;h(AKuZVD?w;=)E|;rU zuUtpD!~wNEVgR*>fPzWQtJ|bufV0z+LK!HOS)^_`9>E5<#uQY|{XLyhres}04bWuF zuRus^P3(VKwCMSmWaQinT#IF6(16qruvMo`jG61e5<*ANwQK^Ens-51w)X&-I<-xm znPMneTe@Wq-(v7AVsr=m6fb7A&c^Bc2F8m|QbK9l?(Kmn$cJs>jy z%9C**lLgJ7JdZV#2_aMg>62a|Kmiz&pCK>-@{`aZHUb$PlQ10|lO!S#8`-taDL4TD z02u-R02BZK000000096X0002zlTRWi8&fO?Rcs0X0M}0d01W^D000000096X0000` zlaV4i0UeXfA~pd;lLI3_0a24gBRl~)lYt{493obx>w*IS05u5!02lxO000000096X X0001G1e1US8k5)~5C+yC00000gV1hy From 1b3a4a4262e28c915b436607cfc68a57da65366e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 20 Oct 2022 09:08:04 +0800 Subject: [PATCH 213/249] LOUTI --- .../java/com/epmet/service/impl/CustomerStaffServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index a5d32a11b0..0bcb0b5eee 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -478,6 +478,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl Date: Thu, 20 Oct 2022 09:24:41 +0800 Subject: [PATCH 214/249] /staff/editstaffinit --- .../src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java index 7c2a885f06..9bcd6dcb8c 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffInfoFromDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -14,7 +15,7 @@ import java.io.Serializable; @Data public class StaffInfoFromDTO implements Serializable { private static final long serialVersionUID = 1L; - public interface EditStaffInitGroup {} + public interface EditStaffInitGroup extends CustomerClientShowGroup {} /** * 客户ID */ From 9c1d6913065a9b8dc5d4aee26cbe2861007fe9a7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 20 Oct 2022 09:58:39 +0800 Subject: [PATCH 215/249] =?UTF-8?q?=E6=98=8E=E6=96=87=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-aggregator-server/pom.xml | 12 ++++ .../controller/EpmetUserController.java | 14 +++++ .../service/epmetuser/EpmetUserService.java | 13 ++++ .../epmetuser/impl/EpmetUserServiceImpl.java | 60 +++++++++++++++++++ 4 files changed, 99 insertions(+) diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index 27873367ec..30999f1c99 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -126,6 +126,18 @@ 2.0.0 compile + + com.epmet + epmet-commons-rocketmq + 2.0.0 + compile + + + com.epmet + epmet-message-client + 2.0.0 + compile + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java index 9b9c7a0ef1..24d9c5a738 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java @@ -14,6 +14,8 @@ import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; import com.epmet.dataaggre.excel.StaffPatrollExcel; import com.epmet.dataaggre.service.datastats.DataStatsService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import com.epmet.dto.form.DetailByTypeFormDTO; +import com.epmet.dto.result.DetailByTypeResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -285,4 +287,16 @@ public class EpmetUserController { return new Result>().ok(epmetUserService.gridMemberPatrolList(formDTO)); } + /** + * Desc: 数据明文查询 + * @param formDTO + * @author zxc + * @date 2022/10/17 13:45 + */ + @PostMapping("detailByType") + public Result detailByType(@RequestBody DetailByTypeFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, DetailByTypeFormDTO.DetailByTypeForm.class); + return new Result().ok(epmetUserService.detailByType(formDTO,tokenDto)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index 901087a7ba..6ff3e02f90 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -1,6 +1,7 @@ package com.epmet.dataaggre.service.epmetuser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dataaggre.dto.datastats.form.NowStatsDataFormDTO; import com.epmet.dataaggre.dto.datastats.result.NowStatsDataResultDTO; import com.epmet.dataaggre.dto.epmetuser.form.*; @@ -20,6 +21,8 @@ import com.epmet.dataaggre.entity.epmetuser.IcPointVaccinesInoculationEntity; import com.epmet.dataaggre.entity.epmetuser.IcResiUserEntity; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.UserBaseInfoDTO; +import com.epmet.dto.form.DetailByTypeFormDTO; +import com.epmet.dto.result.DetailByTypeResultDTO; import java.util.List; import java.util.Map; @@ -250,4 +253,14 @@ public interface EpmetUserService { List listVaccinePoints(String customerId, String agencyId, String staffOrgIds, String search); List listNucleicPoints(String customerId, String agencyId,String staffOrgIds, String search); + + + /** + * Desc: 数据明文查询 + * @param formDTO + * @author zxc + * @date 2022/10/17 13:45 + */ + DetailByTypeResultDTO detailByType(DetailByTypeFormDTO formDTO, TokenDto tokenDto); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index f93c66675b..7b672ab2bd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -2,16 +2,26 @@ package com.epmet.dataaggre.service.epmetuser.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.rocketmq.messages.CheckMQMsg; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.IdAndNameDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.OrgTypeEnum; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; +import com.epmet.commons.tools.redis.common.CustomerResiUserRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; +import com.epmet.commons.tools.redis.common.bean.IcResiUserInfoCache; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.IpUtils; import com.epmet.constant.BadgeConstant; +import com.epmet.constant.NeighborhoodConstant; import com.epmet.constant.OrgInfoConstant; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.epmetuser.*; @@ -42,7 +52,11 @@ import com.epmet.dataaggre.service.govproject.GovProjectService; import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.UserBaseInfoDTO; +import com.epmet.dto.form.DetailByTypeFormDTO; +import com.epmet.dto.form.SystemMsgFormDTO; +import com.epmet.dto.result.DetailByTypeResultDTO; import com.epmet.dto.result.StaffRoleResultDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -51,8 +65,11 @@ import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.text.NumberFormat; import java.util.*; import java.util.stream.Collectors; @@ -98,6 +115,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { private IcPointVaccinesInoculationDao pointVaccinesInoculationDao; @Resource private IcPointNucleicMonitoringDao pointNucleicMonitoringDao; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; /** * @Description 根据UserIds查询 @@ -971,4 +990,45 @@ public class EpmetUserServiceImpl implements EpmetUserService { query.like(StringUtils.isNotBlank(search), IcPointNucleicMonitoringEntity::getName, search); return pointNucleicMonitoringDao.selectList(query); } + + @Override + public DetailByTypeResultDTO detailByType(DetailByTypeFormDTO formDTO, TokenDto tokenDto) { + DetailByTypeResultDTO result = new DetailByTypeResultDTO(); + String customerId = tokenDto.getCustomerId(); + String userId = tokenDto.getUserId(); + CheckMQMsg msg = new CheckMQMsg(); + if (formDTO.getType().equals(NeighborhoodConstant.HOUSE)){ + HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(customerId, formDTO.getId()); + if (null == houseInfo){ + throw new EpmetException("查询房屋信息失败:"+formDTO.getId()); + } + result.setMobile(houseInfo.getOwnerPhone()); + result.setIdCard(houseInfo.getOwnerIdCard()); + msg.setContent("查看"+houseInfo.getAllName()+"房屋的敏感信息"); + msg.setType("checkHouse"); + msg.setTypeDisplay("查看"+houseInfo.getAllName()+"房屋的敏感信息"); + }else if (formDTO.getType().equals(NeighborhoodConstant.IC_RESI_USER)){ + IcResiUserInfoCache icResiUserInfo = CustomerResiUserRedis.getIcResiUserInfo(formDTO.getId()); + if (null == icResiUserInfo){ + throw new EpmetException("查询icResiUser失败:"+formDTO.getId()); + } + result.setIdCard(icResiUserInfo.getIdCard()); + result.setMobile(icResiUserInfo.getMobile()); + msg.setContent("查看"+icResiUserInfo.getName()+"的敏感信息"); + msg.setType("checkIcResiUser"); + msg.setTypeDisplay("查看"+icResiUserInfo.getName()+"的敏感信息"); + } + // 发送mq消息 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + msg.setOperateTime(new Date()); + msg.setUserId(userId); + msg.setFromApp(tokenDto.getApp()); + msg.setIp(IpUtils.getIpAddr(request)); + msg.setFromClient(tokenDto.getClient()); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(TopicConstants.CHECK_OR_EXPORT); + form.setContent(msg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + return result; + } } From 8992ac40a1d8207171d65b5579f8128a2079465d Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 20 Oct 2022 11:15:57 +0800 Subject: [PATCH 216/249] =?UTF-8?q?=E6=98=8E=E6=96=87=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/epmetuser/IcResiUserDao.java | 11 +++ .../epmetuser/impl/EpmetUserServiceImpl.java | 74 +++++++++++++++++-- .../mapper/epmetuser/IcResiUserDao.xml | 38 ++++++++++ .../epmet/constant/NeighborhoodConstant.java | 47 ++++++++++++ .../com/epmet/dto/IcNatCompareRecordDTO.java | 3 + .../mapper/IcNatCompareRecordDao.xml | 1 + 6 files changed, 166 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java index 3b3a66dd50..e666aab317 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java @@ -30,6 +30,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 用户基础信息 @@ -138,4 +139,14 @@ public interface IcResiUserDao extends BaseDao { @Param("agencyId")String agencyId, @Param("staffOrgIds")String staffOrgIds, @Param("search")String search); + + Map getTripReportRecordInfo(@Param("id")String id); + + Map getVaccineRecordInfo(@Param("id")String id); + + Map getSpecialAttentionInfo(@Param("id")String id); + + Map getNoNatCompareInfo(@Param("id")String id); + + Map getNatInfo(@Param("id")String id); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index 7b672ab2bd..5e731980d8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -997,6 +997,10 @@ public class EpmetUserServiceImpl implements EpmetUserService { String customerId = tokenDto.getCustomerId(); String userId = tokenDto.getUserId(); CheckMQMsg msg = new CheckMQMsg(); + IcResiUserInfoCache icResiUserInfo = CustomerResiUserRedis.getIcResiUserInfo(formDTO.getId()); + if (null == icResiUserInfo){ + throw new EpmetException("查询icResiUser失败:"+formDTO.getId()); + } if (formDTO.getType().equals(NeighborhoodConstant.HOUSE)){ HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(customerId, formDTO.getId()); if (null == houseInfo){ @@ -1005,22 +1009,76 @@ public class EpmetUserServiceImpl implements EpmetUserService { result.setMobile(houseInfo.getOwnerPhone()); result.setIdCard(houseInfo.getOwnerIdCard()); msg.setContent("查看"+houseInfo.getAllName()+"房屋的敏感信息"); - msg.setType("checkHouse"); - msg.setTypeDisplay("查看"+houseInfo.getAllName()+"房屋的敏感信息"); }else if (formDTO.getType().equals(NeighborhoodConstant.IC_RESI_USER)){ - IcResiUserInfoCache icResiUserInfo = CustomerResiUserRedis.getIcResiUserInfo(formDTO.getId()); - if (null == icResiUserInfo){ - throw new EpmetException("查询icResiUser失败:"+formDTO.getId()); - } result.setIdCard(icResiUserInfo.getIdCard()); result.setMobile(icResiUserInfo.getMobile()); msg.setContent("查看"+icResiUserInfo.getName()+"的敏感信息"); - msg.setType("checkIcResiUser"); - msg.setTypeDisplay("查看"+icResiUserInfo.getName()+"的敏感信息"); + }else if (formDTO.getType().equals(NeighborhoodConstant.JMFYXX)){ + result.setIdCard(icResiUserInfo.getIdCard()); + result.setMobile(icResiUserInfo.getMobile()); + msg.setContent("查看"+icResiUserInfo.getName()+"的敏感信息(居民防疫信息)"); + }else if (formDTO.getType().equals(NeighborhoodConstant.ROUTE_FOLLOW)){ + Map info = icResiUserDao.getTripReportRecordInfo(formDTO.getId()); + if (null == info){ + throw new EpmetException("未查询到行程随访信息:"+formDTO.getId()); + } + result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); + result.setMobile(info.get(NeighborhoodConstant.MOBILE)); + msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(行程随访)"); + }else if (formDTO.getType().equals(NeighborhoodConstant.VACCINATION_RECORD)){ + Map info = icResiUserDao.getVaccineRecordInfo(formDTO.getId()); + if (null == info){ + throw new EpmetException("未查询到疫苗接种信息:"+formDTO.getId()); + } + result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); + result.setMobile(info.get(NeighborhoodConstant.MOBILE)); + msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(疫苗接种记录)"); + }else if (formDTO.getType().equals(NeighborhoodConstant.VACCINE_SPECIAL_ATTENTION) + || formDTO.getType().equals(NeighborhoodConstant.FOCUS_GROUP_SPECIAL_ATTENTION_QUARANTINE) + || formDTO.getType().equals(NeighborhoodConstant.FOCUS_GROUP_SPECIAL_ATTENTION_HISTORY)){ + Map info = icResiUserDao.getSpecialAttentionInfo(formDTO.getId()); + if (null == info){ + throw new EpmetException("未查询到特别关注名单信息:"+formDTO.getId()); + } + result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); + result.setMobile(info.get(NeighborhoodConstant.MOBILE)); + String cMsg = ""; + switch (formDTO.getType()){ + case NeighborhoodConstant.VACCINE_SPECIAL_ATTENTION: + cMsg = "疫苗接种关注名单"; + break; + case NeighborhoodConstant.FOCUS_GROUP_SPECIAL_ATTENTION_QUARANTINE: + cMsg = "重点人群关注名单(防疫隔离)"; + break; + case NeighborhoodConstant.FOCUS_GROUP_SPECIAL_ATTENTION_HISTORY: + cMsg = "重点人群关注名单(历史记录)"; + break; + default: + } + msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息("+cMsg+")"); + + }else if (formDTO.getType().equals(NeighborhoodConstant.NO_NAT_COMPARE)){ + Map info = icResiUserDao.getNoNatCompareInfo(formDTO.getId()); + if (null == info){ + throw new EpmetException("未查询到未做核酸比对信息:"+formDTO.getId()); + } + result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); + result.setMobile(info.get(NeighborhoodConstant.MOBILE)); + msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(未做核酸比对)"); + }else if (formDTO.getType().equals(NeighborhoodConstant.NAT_RECORD)){ + Map info = icResiUserDao.getNatInfo(formDTO.getId()); + if (null == info){ + throw new EpmetException("未查询到核酸检测信息:"+formDTO.getId()); + } + result.setIdCard(info.get(NeighborhoodConstant.ID_CARD)); + result.setMobile(info.get(NeighborhoodConstant.MOBILE)); + msg.setContent("查看"+info.get(NeighborhoodConstant.NAME)+"的敏感信息(核酸检测信息)"); } // 发送mq消息 HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); msg.setOperateTime(new Date()); + msg.setType(formDTO.getType()); + msg.setTypeDisplay(msg.getContent()); msg.setUserId(userId); msg.setFromApp(tokenDto.getApp()); msg.setIp(IpUtils.getIpAddr(request)); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml index d89996a58a..c8e2bd94f9 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -283,4 +283,42 @@ having volunteerCategory is null or volunteerCategory = '' + + + + + + + + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java index fe92bcd3c2..c71c0de90c 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java @@ -6,12 +6,59 @@ package com.epmet.constant; */ public interface NeighborhoodConstant { + String MOBILE = "MOBILE"; + String ID_CARD = "ID_CARD"; + String NAME = "NAME"; + String GRID = "grid"; String NEIGHBOR_HOOD= "neighbourHood"; String BUILDING = "building"; String HOUSE = "house"; + /** + * ic居民 + */ String IC_RESI_USER = "icResiUser"; + /** + * 居民防疫信息 + */ + String JMFYXX = "JMFYXX"; + + /** + * 行程随访 + */ + String ROUTE_FOLLOW = "routeFollow"; + + /** + * 疫苗接种记录 + */ + String VACCINATION_RECORD = "vaccinationRecord"; + + /** + * 疫苗接种关注名单 + */ + String VACCINE_SPECIAL_ATTENTION = "vaccineSpecialAttention"; + + /** + * 未做核酸比对 + */ + String NO_NAT_COMPARE = "noNatCompare"; + + /** + * 核酸检测记录 + */ + String NAT_RECORD = "natRecord"; + + /** + * 重点人群关注名单【防疫隔离】 + */ + String FOCUS_GROUP_SPECIAL_ATTENTION_QUARANTINE = "focusGroupSpecialAttentionQuarantine"; + + /** + * 重点人群关注名单【历史记录】 + */ + String FOCUS_GROUP_SPECIAL_ATTENTION_HISTORY = "focusGroupSpecialAttentionHistory"; + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatCompareRecordDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatCompareRecordDTO.java index 9bde2314d1..b422af6b61 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatCompareRecordDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcNatCompareRecordDTO.java @@ -30,6 +30,9 @@ public class IcNatCompareRecordDTO implements Serializable { @ExcelIgnore private String relationId; + @ExcelIgnore + private String recordId; + /** * 姓名 */ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatCompareRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatCompareRecordDao.xml index 2a33a5680b..0e3fcaa606 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatCompareRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatCompareRecordDao.xml @@ -7,6 +7,7 @@ + \ No newline at end of file From e338601bbce0a861d97cc66f98924d0daad44105 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 20 Oct 2022 14:11:44 +0800 Subject: [PATCH 219/249] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=9A=B4=E9=9C=B2=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ThirdLoginController.java | 2 +- .../commons/tools/utils/api/yt/TestMs4.java | 184 ++++++++++++++++++ .../commons/tools/utils/api/yt/YantaiApi.java | 123 ++++++++++-- .../tools/utils/api/yt/YantaiSSOUser.java | 5 + .../impl/IcFollowUpRecordServiceImpl.java | 3 +- 5 files changed, 294 insertions(+), 23 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/TestMs4.java diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index f5c8da7ad4..3f23ee88c8 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -224,7 +224,7 @@ public class ThirdLoginController { * @return */ @PostMapping("sso-govlogin-yantai/{authCode}") - public Result yantaiSSOLogin(@RequestParam(value = "authCode") String authCode) { + public Result yantaiSSOLogin(@PathVariable(value = "authCode") String authCode) { return new Result().ok(thirdLoginService.yanTaiSSOLogin(authCode)); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/TestMs4.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/TestMs4.java new file mode 100644 index 0000000000..1a9853705d --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/TestMs4.java @@ -0,0 +1,184 @@ +package com.epmet.commons.tools.utils.api.yt; + + +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.bouncycastle.pqc.math.linearalgebra.ByteUtils; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.spec.SecretKeySpec; +import java.security.*; +import java.util.Arrays; + +/** + * sm4加密算法工具类 + * + * @explain sm4加密、解密与加密结果验证 可逆算法 + * @Autor:jingyao + */ +public class TestMs4 { + static { + Security.addProvider(new BouncyCastleProvider()); + } + + private static final String ENCODING = "UTF-8"; + public static final String ALGORITHM_NAME = "SM4"; + // 加密算法/分组加密模式/分组填充方式 + // PKCS5Padding-以8个字节为一组进行分组加密 + // 定义分组加密模式使用:PKCS5Padding + public static final String ALGORITHM_NAME_ECB_PADDING = "SM4/ECB/PKCS5Padding"; + // 128-32位16进制;256-64位16进制 + public static final int DEFAULT_KEY_SIZE = 128; + + /** + * 生成ECB暗号 + * + * @param algorithmName 算法名称 + * @param mode 模式 + * @param key + * @return + * @throws Exception + * @explain ECB模式(电子密码本模式:Electronic codebook) + */ + private static Cipher generateEcbCipher(String algorithmName, int mode, byte[] key) throws Exception { + Cipher cipher = Cipher.getInstance(algorithmName, BouncyCastleProvider.PROVIDER_NAME); + Key sm4Key = new SecretKeySpec(key, ALGORITHM_NAME); + cipher.init(mode, sm4Key); + return cipher; + } + + /** + * 自动生成密钥 + * + * @return + * @throws NoSuchAlgorithmException + * @throws NoSuchProviderException + * @explain + */ + public static byte[] generateKey() throws Exception { + return generateKey(DEFAULT_KEY_SIZE); + } + + + //加密****************************************** + + /** + * @param keySize + * @return + * @throws Exception + * @explain 系统产生秘钥 + */ + public static byte[] generateKey(int keySize) throws Exception { + KeyGenerator kg = KeyGenerator.getInstance(ALGORITHM_NAME, BouncyCastleProvider.PROVIDER_NAME); + kg.init(keySize, new SecureRandom()); + return kg.generateKey().getEncoded(); + } + + /** + * sm4加密 + * + * @param hexKey 16进制密钥(忽略大小写) + * @param paramStr 待加密字符串 + * @return 返回16进制的加密字符串 + * @throws Exception + * @explain 加密模式:ECB 密文长度不固定,会随着被加密字符串长度的变化而变化 + */ + public static String encryptEcb(String hexKey, String paramStr) throws Exception { + String cipherText = ""; + // 16进制字符串-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // String-->byte[] + byte[] srcData = paramStr.getBytes(ENCODING); + // 加密后的数组 + byte[] cipherArray = encrypt_Ecb_Padding(keyData, srcData); + // byte[]-->hexString + cipherText = ByteUtils.toHexString(cipherArray); + return cipherText; + } + + /** + * 加密模式之Ecb + * + * @param key + * @param data + * @return + * @throws Exception + */ + public static byte[] encrypt_Ecb_Padding(byte[] key, byte[] data) throws Exception { + Cipher cipher = generateEcbCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.ENCRYPT_MODE, key);//声称Ecb暗号,通过第二个参数判断加密还是解密 + return cipher.doFinal(data); + } + + //解密**************************************** + + /** + * sm4解密 + * + * @param hexKey 16进制密钥 + * @param cipherText 16进制的加密字符串(忽略大小写) + * @return 解密后的字符串 + * @throws Exception + * @explain 解密模式:采用ECB + */ + public static String decryptEcb(String hexKey, String cipherText) throws Exception { + // 用于接收解密后的字符串 + String decryptStr = ""; + // hexString-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // hexString-->byte[] + byte[] cipherData = ByteUtils.fromHexString(cipherText); + // 解密 + byte[] srcData = decrypt_Ecb_Padding(keyData, cipherData); + // byte[]-->String + decryptStr = new String(srcData, ENCODING); + return decryptStr; + } + + /** + * 解密 + * + * @param key + * @param cipherText + * @return + * @throws Exception + * @explain + */ + public static byte[] decrypt_Ecb_Padding(byte[] key, byte[] cipherText) throws Exception { + Cipher cipher = generateEcbCipher(ALGORITHM_NAME_ECB_PADDING, Cipher.DECRYPT_MODE, key);//生成Ecb暗号,通过第二个参数判断加密还是解密 + return cipher.doFinal(cipherText); + } + + /** + * 校验加密前后的字符串是否为同一数据 + * + * @param hexKey 16进制密钥(忽略大小写) + * @param cipherText 16进制加密后的字符串 + * @param paramStr 加密前的字符串 + * @return 是否为同一数据 + * @throws Exception + * @explain + */ + public static boolean verifyEcb(String hexKey, String cipherText, String paramStr) throws Exception { + // 用于接收校验结果 + boolean flag = false; + // hexString-->byte[] + byte[] keyData = ByteUtils.fromHexString(hexKey); + // 将16进制字符串转换成数组 + byte[] cipherData = ByteUtils.fromHexString(cipherText); + // 解密 + byte[] decryptData = decrypt_Ecb_Padding(keyData, cipherData); + // 将原字符串转换成byte[] + byte[] srcData = paramStr.getBytes(ENCODING); + // 判断2个数组是否一致 + flag = Arrays.equals(decryptData, srcData); + return flag; + } + + public static void main(String[] args) throws Exception { + String text = "5d22ea44c7599a48f0d4446b1b7fbb4bb8353922df437d39c3a38549c0f2549cbd021ada00a8be83027ae06203c3daea2eedc5bd0875c7e509c7049045c5349577f2c21bcec328a5ea0bf341191e5bdba978566dddd16f1cf1928ff5cbd826dd33289fb45a8a04585f1f24ab04f59426371a5a0a0f2ee3e7b00d2bdfba7810524ce4c33130eda077546fa4c4191d0117f7a44e1cadac6c69a7d437653be1f958a459e0f025d471e09ab4636c38013032948ffb0827040ed6f3436be090f545186928a7b0b2bfc65782452606607ce8555ba130caacad73998da704428a07276a2699889c9872eebba5de8b72cdbe88705483293b00ab3ecb3aa57d283a4ecab40b71bc0a10e9ec626f07b2293255349fb2270d37e81c5c3d0de0b0f0706ed1872f60f039ce2e51effc39aef9747d67457e072cf3170a9c19589c1bab1a7d9d80"; + String s = TestMs4.decryptEcb("dbcff4c9f4774e6cb56080f279149d59", text); + System.out.println(s); + } + +} + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java index cbab66f5b8..84195d6711 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java @@ -7,9 +7,12 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; +import com.fasterxml.jackson.core.JsonProcessingException; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import javax.crypto.BadPaddingException; +import java.security.InvalidKeyException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -24,8 +27,10 @@ import java.util.Map; */ @Slf4j public class YantaiApi { - private static final String SSO_SERVER = "http://localhost:8080/"; - private static final String CLIENT_ID = "1000006"; + private static final String SSO_SERVER = "http://172.20.46.155:8080/sso/"; + private static final String CLIENT_ID = "1000009"; + private static final String CLIENT_SECRET = "a1f9879119bc4080ab5575f832b7d98b"; + private static final String SSO_CLIENT_TOKEN = "PRm5Db96atozjPQsJOuwlA=="; /** * desc:根据组织id获取下级组织 @@ -35,8 +40,8 @@ public class YantaiApi { */ public static List getChildOuInfoByGuid(String organizationId) { try { - if (StringUtils.isBlank(organizationId)){ - throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + if (StringUtils.isBlank(organizationId)) { + throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } //加密 String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(organizationId); @@ -69,14 +74,14 @@ public class YantaiApi { */ public static List getUserByOuGuid(String organizationId) { try { - if (StringUtils.isBlank(organizationId)){ - throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + if (StringUtils.isBlank(organizationId)) { + throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } //加密 String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(organizationId); //pwd = URLEncoder.encode(pwd, "UTF-8"); System.out.println("加密组织Id = " + organizationIdEn); - String url = SSO_SERVER+"ouinfo/getUserByOuGuid?organizationId=" + organizationIdEn; + String url = SSO_SERVER + "ouinfo/getUserByOuGuid?organizationId=" + organizationIdEn; Map headerMap = new HashMap<>(); Map paramMap = new HashMap<>(); @@ -103,29 +108,41 @@ public class YantaiApi { */ public static YantaiSSOUser getLoginToken(String code) { try { - if (StringUtils.isBlank(code)){ - throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + if (StringUtils.isBlank(code)) { + throw new EpmetException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } //加密 String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(code); //pwd = URLEncoder.encode(pwd, "UTF-8"); - System.out.println("加密组织Id = " + organizationIdEn); - String url = "logintoken?client_id="+CLIENT_ID+"&client_code=" + code; + log.info("getLoginToken加密组织Id = " + organizationIdEn); + String url = SSO_SERVER + "logintoken?client_id=" + CLIENT_ID + "&client_code=" + code; Map headerMap = new HashMap<>(); Map paramMap = new HashMap<>(); log.info("getUserByOuGuid request param: url:{},header:{}", url, headerMap); Result result = HttpClientManager.getInstance().sendGet(url, paramMap, headerMap); + if (!result.success() || StringUtils.isBlank(result.getData())) { + log.info("getUserByOuGuid fail result:{}", JSON.toJSONString(result)); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取token为空", "获取token为空"); + } log.info("getUserByOuGuid request result:{}", result); JSONObject jsonObject = JSONObject.parseObject(result.getData()); //解密 String errcode = jsonObject.getString("errcode"); - if (!NumConstant.ZERO_STR.equals(errcode)){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"获取token失败","获取token失败"); + if (!NumConstant.ZERO_STR.equals(errcode)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取token失败", "获取token失败"); } - String data = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); + String sencondData = jsonObject.getString("data"); + log.info("getLoginToken jiami data:{}", sencondData); + //String data = SM4UtilsForYanTai.dealDecryptData(sencondData); + + + String data = TestMs4.decryptEcb(CLIENT_SECRET, sencondData); + log.info("getLoginToken jiemi data:{}", sencondData); YantaiSSOUser userData = JSON.parseObject(data, YantaiSSOUser.class); log.info("getUserByOuGuid request real result:{}", JSON.toJSONString(userData)); + String userInfoMobile = getUserInfoMobile(userData.getUserGuid()); + userData.setMobile(userInfoMobile); return userData; } catch (Exception e) { log.error("getUserByOuGuid exception", e); @@ -133,12 +150,76 @@ public class YantaiApi { return null; } - public static void main(String[] args) { - String serverUrl = "http://172.20.46.155:8080/sso/login"; - Map param = new HashMap<>(); - param.put("client_id","1000006"); - param.put("redirect_url","https://epmet-open.elinkservice.cn/epmet-oper-gov/"); - Result stringResult = HttpClientManager.getInstance().sendGet(serverUrl, param); - System.out.println(JSON.toJSONString(stringResult)); + public static String getUserInfoMobile(String userId) { + try { + JSONObject token = new JSONObject(); + token.put("token", "iJCDUgCBV/Zk5FkkaxLypA=="); + // token.put("token","iJCDUgCBV/Zk5FkkaxLypA=="); + token.put("expiration", System.currentTimeMillis()); + + String tokanStr = SM4UtilsForYanTai.dealEncryptData(token.toString()); + String userIdEn = SM4UtilsForYanTai.dealEncryptData(userId); + System.out.println(tokanStr + "__" + userIdEn); + String serverUrl = "http://172.20.46.155:8082/person/userInfo/getUserByUserGuid"; + //String serverUrl = "http://120.220.248.247:8081/person/userInfo/getUserByUserGuid"; + Map param = new HashMap<>(); + param.put("userGuid", userIdEn); + Map headerMap = new HashMap<>(); + headerMap.put("Authorization", "Bearer " + tokanStr); + Result result = HttpClientManager.getInstance().sendGet(serverUrl, param, headerMap); + System.out.println(JSON.toJSONString(result)); + if (!result.success() || StringUtils.isBlank(result.getData())) { + log.info("getUserInfoMobile fail result:{}", JSON.toJSONString(result)); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取用户信息失败", "获取用户信息失败"); + } + String data = result.getData(); + log.info("getUserInfoMobile jiami data:{}", JSON.parseObject(data)); + JSONObject jsonObject = JSON.parseObject(data); + String secondCode = jsonObject.getString("code"); + String secondMessage = jsonObject.getString("message"); + if (!"200".equals(secondCode)) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取人员信息接口返回失败" + secondMessage, "获取人员信息接口返回失败" + secondMessage); + } + String data1 = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); + String telephoneNumber = JSON.parseObject(data1).getString("mobileTelephoneNumber"); + log.info("getUserInfoMobile jiemi data:{}", telephoneNumber); + return telephoneNumber; + } catch (Exception e) { + log.error("getUserInfoMobile exception", e); + } + return null; + } + + public static void main(String[] args) throws BadPaddingException, InvalidKeyException, JsonProcessingException { +// JSONObject token = new JSONObject(); +// token.put("token", SSO_CLIENT_TOKEN); +// token.put("expiration", System.currentTimeMillis()); +// +// String tokanStr = SM4UtilsForYanTai.dealEncryptData(token.toString()); +// String testUserId = "0ffd76e2-27b5-4b33-be9a-186f9f878bf1"; +// String userId = SM4UtilsForYanTai.dealEncryptData(testUserId); +// System.out.println(tokanStr + "__" + userId); +// String serverUrl = "http://172.20.46.155:8082/person/userInfo/getUserByUserGuid"; +// //String serverUrl = "http://120.220.248.247:8081/person/userInfo/getUserByUserGuid"; +// Map param = new HashMap<>(); +// param.put("userGuid", userId); +// Map headerMap = new HashMap<>(); +// headerMap.put("Authorization", "Bearer " + tokanStr); +// Result stringResult = HttpClientManager.getInstance().sendGet(serverUrl, param, headerMap); +// System.out.println(JSON.toJSONString(stringResult)); +// +// String data = stringResult.getData(); +// JSONObject jsonObject = JSON.parseObject(data); +// String secondCode = jsonObject.getString("code"); +// String secondMessage = jsonObject.getString("message"); +// System.out.println(secondCode); +// System.out.println(secondMessage); +// String data1 = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); +// System.out.println("======" + data1); + String s = SM4UtilsForYanTai.dealDecryptData("R5TbfdZPJ7QA9uo02EGT/uDWyUWapZTmTQZwwLYnX5ZChQhV8bYa17yJ+d+KC5vUm9P/O9J25pkpKSzUSaXEmJz3oniLQdj3OyhmZFghKAKVbK/By+3oyVQG3ApRUMwir64RkvnjpP7MjgUaXXongNRheMrsarV2fjr8ZYDzIH0bhsTDgo0/qNSSmFc+0sWmcvraDyeeI5nRNyjaBzybuBQzOCkqf3LtQAwnqWj8lCVPi5dH7KiTzM0pwZWzhfr21xzaw80fQkUMznBfkiJJM8nI2vqgZfa6TgtTH3h7JYLq8LDcu5UMJpMuVjbWwW41N41I+c9magDCUOJ9LkbmrUTvg2Y0asccP7U3jt9NNgwmRT5L/vxNmuapDaADjFR83P3ospRaclr3vo9OWMORSw=="); + System.out.println("sssssss:"+s); + + + getLoginToken("0d554bccfbac4be3846d643252daf92b"); } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiSSOUser.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiSSOUser.java index 99d31cc439..d2285ce0f3 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiSSOUser.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiSSOUser.java @@ -27,4 +27,9 @@ public class YantaiSSOUser implements Serializable { private String userGuid; private String userName; + /** + * 二次请求结果 + */ + private String mobile; + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java index 1e3c46f9f1..0999660b0e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcFollowUpRecordServiceImpl.java @@ -83,6 +83,7 @@ public class IcFollowUpRecordServiceImpl extends BaseServiceImpl Date: Thu, 20 Oct 2022 14:49:13 +0800 Subject: [PATCH 220/249] mingwen buquan --- .../epmet/dto/ComplementLogOperationDTO.java | 21 +++++++++++++ .../java/com/epmet/dao/LogOperationDao.java | 6 +++- .../service/impl/LogOperationServiceImpl.java | 30 +++++++++++++++++-- .../main/resources/mapper/LogOperationDao.xml | 26 ++++++++++++++-- .../mapper/epmetuser/IcResiUserDao.xml | 17 +++++++---- 5 files changed, 89 insertions(+), 11 deletions(-) create mode 100644 epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/ComplementLogOperationDTO.java diff --git a/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/ComplementLogOperationDTO.java b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/ComplementLogOperationDTO.java new file mode 100644 index 0000000000..ff363c2ad6 --- /dev/null +++ b/epmet-admin/epmet-admin-client/src/main/java/com/epmet/dto/ComplementLogOperationDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/10/20 14:21 + * @DESC + */ +@Data +public class ComplementLogOperationDTO implements Serializable { + + private static final long serialVersionUID = 7563210356670229204L; + + private String staffId; + + private String orgId; + private String orgIdPath; +} diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java index 9b68f81ed7..bb2a615faf 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java @@ -18,12 +18,14 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ComplementLogOperationDTO; import com.epmet.dto.region.LogOperationResultDTO; import com.epmet.entity.LogOperationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 操作日指标 @@ -41,6 +43,8 @@ public interface LogOperationDao extends BaseDao { @Param("operatorMobile")String operatorMobile, @Param("category")String category); - List getStaffId(); + Map getStaffId(); + + void updateBatchLog(@Param("list") List list); } \ No newline at end of file diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java index 189f83cf7e..314b5577fb 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java @@ -6,11 +6,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.LogOperationDao; +import com.epmet.dto.ComplementLogOperationDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.dto.region.LogOperationResultDTO; @@ -22,6 +25,7 @@ import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.*; @@ -214,10 +218,32 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR Integer no = NumConstant.ONE; Integer size; do { - PageInfo pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> logOperationDao.getStaffId()); + PageInfo> pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> logOperationDao.getStaffId()); size = pageInfo.getList().size(); - + if (!CollectionUtils.isEmpty(pageInfo.getList())){ + List needUpdate = new ArrayList<>(); + for (Map m : pageInfo.getList()) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(m.get("CUSTOMER_ID"), m.get("OPERATOR_ID")); + if (null == staffInfo){ + logger.warn("未查询到工作人员信息"+m.get("OPERATOR_ID")); + continue; + } + ComplementLogOperationDTO dto = new ComplementLogOperationDTO(); + dto.setStaffId(staffInfo.getStaffId()); + dto.setOrgId(staffInfo.getAgencyId()); + dto.setOrgIdPath(StringUtils.isBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds().concat(":").concat(staffInfo.getAgencyId())); + needUpdate.add(dto); + } + if (!CollectionUtils.isEmpty(needUpdate)){ + updateLog(needUpdate); + } + } no++; }while (size == NumConstant.ONE_HUNDRED); } + + @Transactional(rollbackFor = Exception.class) + public void updateLog(List list){ + logOperationDao.updateBatchLog(list); + } } diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml index 2a962daf18..92a3f0fa5c 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml +++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml @@ -26,6 +26,27 @@ + + update log_operation + + + + when OPERATOR_ID = #{item.staffId} then #{item.orgId} + + + + + when OPERATOR_ID = #{item.staffId} then #{item.orgIdPath} + + + UPDATED_TIME = NOW() + + where 1=1 + + OPERATOR_ID = #{item.staffId} + + + - SELECT - OPERATOR_ID + OPERATOR_ID, + CUSTOMER_ID FROM log_operation GROUP BY OPERATOR_ID diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml index c8e2bd94f9..d80dceb72d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml @@ -287,22 +287,25 @@ - select MOBILE, - ID_CARD + ID_CARD, + NAME from ic_epidemic_special_attention where id = #{id} @@ -310,14 +313,16 @@ From ef1dc23316c6e1352a5f513b7b91e1a8f06ec525 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 20 Oct 2022 15:02:10 +0800 Subject: [PATCH 221/249] =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/LogOperationController.java | 6 ++++-- .../src/main/java/com/epmet/dao/LogOperationDao.java | 5 +++-- .../java/com/epmet/service/LogOperationService.java | 3 ++- .../epmet/service/impl/LogOperationServiceImpl.java | 10 ++++++++-- .../src/main/resources/mapper/LogOperationDao.xml | 1 + 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java index 52d96b8697..419ff38b21 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/LogOperationController.java @@ -1,8 +1,10 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; 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.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -52,7 +54,7 @@ public class LogOperationController { * @return */ @PostMapping("page") - public Result> page(@RequestBody LogOperationListFormDTO formDTO){ + public Result> page(@RequestBody LogOperationListFormDTO formDTO, @LoginUser TokenDto tokenDto){ return new Result>().ok(logOperationService.page(loginUserUtil.getLoginUserCustomerId(), formDTO.getStartTime(), formDTO.getEndTime(), @@ -60,7 +62,7 @@ public class LogOperationController { formDTO.getOperatorMobile(), formDTO.getPageNo(), formDTO.getPageSize(), - formDTO.getCategory())); + formDTO.getCategory(),tokenDto)); } @PostMapping("complementLogOperation") diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java index bb2a615faf..be1858c9e2 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java @@ -41,9 +41,10 @@ public interface LogOperationDao extends BaseDao { @Param("endTime")String endTime, @Param("operatorName")String operatorName, @Param("operatorMobile")String operatorMobile, - @Param("category")String category); + @Param("category")String category, + @Param("agencyId")String agencyId); - Map getStaffId(); + List> getStaffId(); void updateBatchLog(@Param("list") List list); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java index a60ba94ff7..ce56a25a6e 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/LogOperationService.java @@ -1,6 +1,7 @@ package com.epmet.service; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.region.LogOperationResultDTO; import com.epmet.entity.LogOperationEntity; @@ -41,7 +42,7 @@ public interface LogOperationService { String endTime, String operatorName, String operatorMobile, - Integer pageNo, Integer pageSize,String category); + Integer pageNo, Integer pageSize, String category, TokenDto tokenDto); void complementLogOperation(); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java index 314b5577fb..fae8de2b7c 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java @@ -8,9 +8,11 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; 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.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.LogOperationDao; import com.epmet.dto.ComplementLogOperationDTO; @@ -199,10 +201,14 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR */ @Override public PageData page(String customerId, String startTime, String endTime, String operatorName, String operatorMobile, - Integer pageNo, Integer pageSize,String category) { + Integer pageNo, Integer pageSize, String category, TokenDto tokenDto) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询工作人员信息:"+tokenDto.getUserId()); + } // 列表/导出查询 PageHelper.startPage(pageNo, pageSize); - List list = logOperationDao.pageList(customerId, startTime, endTime, operatorName, operatorMobile,category); + List list = logOperationDao.pageList(customerId, startTime, endTime, operatorName, operatorMobile,category,staffInfo.getAgencyId()); PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal()); } diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml index 92a3f0fa5c..749e9b4288 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml +++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml @@ -64,6 +64,7 @@ WHERE lo.del_flag = '0' AND lo.CUSTOMER_ID = #{customerId} + AND lo.ORG_ID_PATH LIKE concat('%',#{agencyId},'%') AND lo.CATEGORY = #{category} From 67b47a5b29342cec93a7b2c1c1859300f8cfe39a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 20 Oct 2022 15:36:02 +0800 Subject: [PATCH 222/249] =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=B9=8B=E5=89=8D?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=8A=A0=20=E6=96=B0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/entity/LogOperationEntity.java | 2 ++ .../listener/AuthOperationLogListener.java | 2 ++ .../CheckAndExportOperationLogListener.java | 2 ++ .../epmet/service/impl/IcLoginServiceImpl.java | 16 ++++++++++++---- .../commons/rocketmq/messages/CheckMQMsg.java | 2 ++ .../commons/rocketmq/messages/LoginMQMsg.java | 2 ++ .../epmetuser/impl/EpmetUserServiceImpl.java | 10 ++++++++-- .../com/epmet/constant/NeighborhoodConstant.java | 2 ++ 8 files changed, 32 insertions(+), 6 deletions(-) diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java index 537d1fc9b2..e576d3823a 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/entity/LogOperationEntity.java @@ -79,6 +79,8 @@ public class LogOperationEntity extends BaseEpmetEntity { * 操作人手机号 */ private String operatorMobile; + private String orgId; + private String orgIdPath; /** * 操作时间,该时间不是插入数据的时间,而是操作发生的真实时间 diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java index 6f8afd1418..fb1feb3ac8 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java @@ -78,6 +78,8 @@ public class AuthOperationLogListener implements MessageListenerConcurrently { logEntity.setOperatorMobile(operatorInfo.getMobile()); logEntity.setOperatingTime(msgObj.getLoginTime()); logEntity.setContent("成功登录系统"); + logEntity.setOrgIdPath(msgObj.getOrgIdPath()); + logEntity.setOrgId(msgObj.getOrgId()); DistributedLock distributedLock = null; RLock lock = null; diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java index b11751f3eb..977117ac84 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/CheckAndExportOperationLogListener.java @@ -76,6 +76,8 @@ public class CheckAndExportOperationLogListener implements MessageListenerConcur logEntity.setOperatorMobile(operatorInfo.getMobile()); logEntity.setOperatingTime(msgObj.getOperateTime()); logEntity.setContent(msgObj.getContent()); + logEntity.setOrgId(msgObj.getOrgId()); + logEntity.setOrgIdPath(msgObj.getOrgIdPath()); DistributedLock distributedLock = null; RLock lock = null; diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java index ea0ae6d5fb..4740033245 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java @@ -5,11 +5,14 @@ import com.epmet.auth.constants.AuthOperationConstants; import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.ServiceConstant; +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.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.IcTokenDto; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.IpUtils; @@ -23,6 +26,7 @@ import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.service.IcLoginService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.context.request.RequestContextHolder; @@ -78,7 +82,7 @@ public class IcLoginServiceImpl implements IcLoginService, ResultDataResolver { //7.发送登录事件 try { - sendLoginEvent(staffId, app, client); + sendLoginEvent(staffId, app, client,agencyInfo.getCustomerId()); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { @@ -113,16 +117,20 @@ public class IcLoginServiceImpl implements IcLoginService, ResultDataResolver { * @author wxz * @date 2021.10.26 13:45:59 */ - private void sendLoginEvent(String userId, String fromApp, String fromClient) { + private void sendLoginEvent(String userId, String fromApp, String fromClient, String customerId) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); + if (null == staffInfo){ + throw new EpmetException("未查询到工作人员信息:"+userId); + } LoginMQMsg loginMQMsg = new LoginMQMsg(); loginMQMsg.setUserId(userId); loginMQMsg.setLoginTime(new Date()); loginMQMsg.setIp(IpUtils.getIpAddr(request)); loginMQMsg.setFromApp(fromApp); loginMQMsg.setFromClient(fromClient); - + loginMQMsg.setOrgId(staffInfo.getAgencyId()); + loginMQMsg.setOrgIdPath(StringUtils.isBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds().concat(":").concat(staffInfo.getAgencyId())); SystemMsgFormDTO form = new SystemMsgFormDTO(); form.setMessageType(AuthOperationConstants.LOGIN); form.setContent(loginMQMsg); diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java index 462133adfe..30b1595e20 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CheckMQMsg.java @@ -27,5 +27,7 @@ public class CheckMQMsg { private String fromApp; private String fromClient; + private String orgId; + private String orgIdPath; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java index 646db43501..46f400d6d1 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java @@ -22,5 +22,7 @@ public class LoginMQMsg { private String fromApp; private String fromClient; + private String orgId; + private String orgIdPath; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index cff0f63234..79f949b525 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -997,7 +997,7 @@ public class EpmetUserServiceImpl implements EpmetUserService { String customerId = tokenDto.getCustomerId(); String userId = tokenDto.getUserId(); CheckMQMsg msg = new CheckMQMsg(); - if (formDTO.getType().equals(NeighborhoodConstant.HOUSE)){ + if (formDTO.getType().equals(NeighborhoodConstant.CHECK_HOUSE)){ HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(customerId, formDTO.getId()); if (null == houseInfo){ throw new EpmetException("查询房屋信息失败:"+formDTO.getId()); @@ -1005,7 +1005,7 @@ public class EpmetUserServiceImpl implements EpmetUserService { result.setMobile(houseInfo.getOwnerPhone()); result.setIdCard(houseInfo.getOwnerIdCard()); msg.setContent("查看"+houseInfo.getAllName()+"房屋的敏感信息"); - }else if (formDTO.getType().equals(NeighborhoodConstant.IC_RESI_USER)){ + }else if (formDTO.getType().equals(NeighborhoodConstant.CHECK_IC_RESI_USER)){ IcResiUserInfoCache icResiUserInfo = CustomerResiUserRedis.getIcResiUserInfo(formDTO.getId()); if (null == icResiUserInfo){ throw new EpmetException("查询icResiUser失败:"+formDTO.getId()); @@ -1084,6 +1084,12 @@ public class EpmetUserServiceImpl implements EpmetUserService { msg.setType(formDTO.getType()); msg.setTypeDisplay(msg.getContent()); msg.setUserId(userId); + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); + if(null == staffInfo){ + throw new EpmetException("未查询到工作人员信息:"+userId); + } + msg.setOrgId(staffInfo.getAgencyId()); + msg.setOrgIdPath(StringUtils.isBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds().concat(":").concat(staffInfo.getAgencyId())); msg.setFromApp(tokenDto.getApp()); msg.setIp(IpUtils.getIpAddr(request)); msg.setFromClient(tokenDto.getClient()); diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java index c71c0de90c..261b951496 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/constant/NeighborhoodConstant.java @@ -15,11 +15,13 @@ public interface NeighborhoodConstant { String NEIGHBOR_HOOD= "neighbourHood"; String BUILDING = "building"; String HOUSE = "house"; + String CHECK_HOUSE = "checkHouse"; /** * ic居民 */ String IC_RESI_USER = "icResiUser"; + String CHECK_IC_RESI_USER = "checkIcResiUser"; /** * 居民防疫信息 From 48f61754876b3c63e29f182ec3ee604e19348c5f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 20 Oct 2022 15:44:11 +0800 Subject: [PATCH 223/249] =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ThirdLoginServiceImpl.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index e1ab790e0f..d27d7ad672 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -12,6 +12,7 @@ import com.epmet.commons.rocketmq.messages.LoginMQMsg; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; @@ -19,6 +20,7 @@ import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.redis.common.CustomerDingDingRedis; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; @@ -208,7 +210,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //7.发送登录事件 try { - sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); + sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP,userWechatDTO.getCustomerId()); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { @@ -439,7 +441,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //6.发送登录事件 try { - sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); + sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, formDTO.getCustomerId()); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { @@ -501,7 +503,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //6.发送登录事件 try { - sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); + sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, formDTO.getCustomerId()); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { @@ -820,7 +822,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol * @author wxz * @date 2021.06.08 15:27 */ - private void sendLoginEvent(String userId, String appId, String fromApp, String fromClient) { + private void sendLoginEvent(String userId, String appId, String fromApp, String fromClient,String customerId) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); LoginMQMsg loginMQMsg = new LoginMQMsg(); @@ -830,7 +832,12 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol loginMQMsg.setIp(IpUtils.getIpAddr(request)); loginMQMsg.setFromApp(fromApp); loginMQMsg.setFromClient(fromClient); - + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); + if (null == staffInfo){ + throw new EpmetException("未查询到工作人员信息:"+userId); + } + loginMQMsg.setOrgId(staffInfo.getAgencyId()); + loginMQMsg.setOrgIdPath(StringUtils.isBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds().concat(":").concat(staffInfo.getAgencyId())); SystemMsgFormDTO form = new SystemMsgFormDTO(); form.setMessageType(AuthOperationConstants.LOGIN); form.setContent(loginMQMsg); From 5d4b981c4752af7c5a86afbe22c39c1353222c75 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 20 Oct 2022 15:48:05 +0800 Subject: [PATCH 224/249] =?UTF-8?q?=E7=A7=AF=E5=88=86=E8=A7=84=E5=88=99?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mq/listener/listener/PointOperationLogListener.java | 2 ++ .../commons/rocketmq/messages/PointRuleChangedMQMsg.java | 2 ++ .../commons/rocketmq/messages/ProjectChangedMQMsg.java | 3 +++ .../com/epmet/service/impl/PointRuleServiceImpl.java | 9 +++++++++ 4 files changed, 16 insertions(+) diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/PointOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/PointOperationLogListener.java index aa4f50a768..e20f4eecb1 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/PointOperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/PointOperationLogListener.java @@ -80,6 +80,8 @@ public class PointOperationLogListener implements MessageListenerConcurrently { logEntity.setOperatorName(operatorInfo.getName()); logEntity.setOperatingTime(msgObj.getOperatingTime()); logEntity.setContent(content); + logEntity.setOrgId(msgObj.getOrgId()); + logEntity.setOrgIdPath(msgObj.getOrgIdPath()); DistributedLock distributedLock = null; RLock lock = null; diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/PointRuleChangedMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/PointRuleChangedMQMsg.java index 073d18821c..f3d2516276 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/PointRuleChangedMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/PointRuleChangedMQMsg.java @@ -28,6 +28,8 @@ public class PointRuleChangedMQMsg { private String fromApp; private String fromClient; + private String orgId; + private String orgIdPath; private Date operatingTime; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java index 5f33faae98..8e5f60f31c 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java @@ -36,5 +36,8 @@ public class ProjectChangedMQMsg implements Serializable { private String fromApp; private String fromClient; + private String orgId; + private String orgIdPath; + } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java index 251046a50f..358dfd5e92 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java @@ -26,11 +26,14 @@ import com.epmet.commons.rocketmq.messages.PointRuleChangedMQMsg; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.enums.CommonOperateTypeEnum; import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; @@ -206,6 +209,12 @@ public class PointRuleServiceImpl extends BaseServiceImpl Date: Thu, 20 Oct 2022 15:59:03 +0800 Subject: [PATCH 225/249] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=97=B6=20=E5=88=A0=E9=99=A4=E5=B1=85=E6=B0=91=E7=BC=93?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/redis/common/CustomerResiUserRedis.java | 11 +++++++++++ .../main/java/com/epmet/dto/form/TransferFormDTO.java | 3 +++ .../com/epmet/service/impl/IcResiUserServiceImpl.java | 1 + 3 files changed, 15 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java index 39e1995d9b..2efa0bdbf1 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerResiUserRedis.java @@ -114,4 +114,15 @@ public class CustomerResiUserRedis { return resultData; } + /** + * Desc: 删除Ic居民缓存 + * @param icResiUserId + * @author zxc + * @date 2022/10/20 15:57 + */ + public static Boolean delIcResiUserInfo(String icResiUserId){ + String key = RedisKeys.getIcResiUserKey(icResiUserId); + return customerResiUserRedis.redisUtils.delete(key); + } + } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java index 5eb7013261..8bce2e24ad 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java @@ -51,5 +51,8 @@ public class TransferFormDTO implements Serializable { * 协办单位类型,1社区自组织,2联建单位 */ private String assistanceUnitType; + + private String operateStaffId; + private String customerId; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index e602218bee..bae8e89c0b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -694,6 +694,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl Date: Thu, 20 Oct 2022 16:35:24 +0800 Subject: [PATCH 226/249] =?UTF-8?q?=E4=B8=8D=E7=94=A8=E5=8A=A0=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E7=9A=84=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../listener/AuthOperationLogListener.java | 2 -- .../listener/PointOperationLogListener.java | 2 -- .../com/epmet/service/impl/IcLoginServiceImpl.java | 10 ++-------- .../epmet/service/impl/ThirdLoginServiceImpl.java | 14 ++++---------- .../commons/rocketmq/messages/LoginMQMsg.java | 2 -- .../rocketmq/messages/PointRuleChangedMQMsg.java | 2 -- .../rocketmq/messages/ProjectChangedMQMsg.java | 3 --- .../epmet/service/impl/PointRuleServiceImpl.java | 6 ------ .../java/com/epmet/dto/form/TransferFormDTO.java | 2 -- 9 files changed, 6 insertions(+), 37 deletions(-) diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java index fb1feb3ac8..6f8afd1418 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/AuthOperationLogListener.java @@ -78,8 +78,6 @@ public class AuthOperationLogListener implements MessageListenerConcurrently { logEntity.setOperatorMobile(operatorInfo.getMobile()); logEntity.setOperatingTime(msgObj.getLoginTime()); logEntity.setContent("成功登录系统"); - logEntity.setOrgIdPath(msgObj.getOrgIdPath()); - logEntity.setOrgId(msgObj.getOrgId()); DistributedLock distributedLock = null; RLock lock = null; diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/PointOperationLogListener.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/PointOperationLogListener.java index e20f4eecb1..aa4f50a768 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/PointOperationLogListener.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/mq/listener/listener/PointOperationLogListener.java @@ -80,8 +80,6 @@ public class PointOperationLogListener implements MessageListenerConcurrently { logEntity.setOperatorName(operatorInfo.getName()); logEntity.setOperatingTime(msgObj.getOperatingTime()); logEntity.setContent(content); - logEntity.setOrgId(msgObj.getOrgId()); - logEntity.setOrgIdPath(msgObj.getOrgIdPath()); DistributedLock distributedLock = null; RLock lock = null; diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java index 4740033245..16d7e2ba5e 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/IcLoginServiceImpl.java @@ -82,7 +82,7 @@ public class IcLoginServiceImpl implements IcLoginService, ResultDataResolver { //7.发送登录事件 try { - sendLoginEvent(staffId, app, client,agencyInfo.getCustomerId()); + sendLoginEvent(staffId, app, client); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { @@ -117,20 +117,14 @@ public class IcLoginServiceImpl implements IcLoginService, ResultDataResolver { * @author wxz * @date 2021.10.26 13:45:59 */ - private void sendLoginEvent(String userId, String fromApp, String fromClient, String customerId) { + private void sendLoginEvent(String userId, String fromApp, String fromClient) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); - if (null == staffInfo){ - throw new EpmetException("未查询到工作人员信息:"+userId); - } LoginMQMsg loginMQMsg = new LoginMQMsg(); loginMQMsg.setUserId(userId); loginMQMsg.setLoginTime(new Date()); loginMQMsg.setIp(IpUtils.getIpAddr(request)); loginMQMsg.setFromApp(fromApp); loginMQMsg.setFromClient(fromClient); - loginMQMsg.setOrgId(staffInfo.getAgencyId()); - loginMQMsg.setOrgIdPath(StringUtils.isBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds().concat(":").concat(staffInfo.getAgencyId())); SystemMsgFormDTO form = new SystemMsgFormDTO(); form.setMessageType(AuthOperationConstants.LOGIN); form.setContent(loginMQMsg); diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index d27d7ad672..9850feb4b3 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -210,7 +210,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //7.发送登录事件 try { - sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP,userWechatDTO.getCustomerId()); + sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { @@ -441,7 +441,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //6.发送登录事件 try { - sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, formDTO.getCustomerId()); + sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { @@ -503,7 +503,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //6.发送登录事件 try { - sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, formDTO.getCustomerId()); + sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { @@ -822,7 +822,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol * @author wxz * @date 2021.06.08 15:27 */ - private void sendLoginEvent(String userId, String appId, String fromApp, String fromClient,String customerId) { + private void sendLoginEvent(String userId, String appId, String fromApp, String fromClient) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); LoginMQMsg loginMQMsg = new LoginMQMsg(); @@ -832,12 +832,6 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol loginMQMsg.setIp(IpUtils.getIpAddr(request)); loginMQMsg.setFromApp(fromApp); loginMQMsg.setFromClient(fromClient); - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); - if (null == staffInfo){ - throw new EpmetException("未查询到工作人员信息:"+userId); - } - loginMQMsg.setOrgId(staffInfo.getAgencyId()); - loginMQMsg.setOrgIdPath(StringUtils.isBlank(staffInfo.getAgencyPIds()) ? staffInfo.getAgencyId() : staffInfo.getAgencyPIds().concat(":").concat(staffInfo.getAgencyId())); SystemMsgFormDTO form = new SystemMsgFormDTO(); form.setMessageType(AuthOperationConstants.LOGIN); form.setContent(loginMQMsg); diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java index 46f400d6d1..646db43501 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/LoginMQMsg.java @@ -22,7 +22,5 @@ public class LoginMQMsg { private String fromApp; private String fromClient; - private String orgId; - private String orgIdPath; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/PointRuleChangedMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/PointRuleChangedMQMsg.java index f3d2516276..073d18821c 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/PointRuleChangedMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/PointRuleChangedMQMsg.java @@ -28,8 +28,6 @@ public class PointRuleChangedMQMsg { private String fromApp; private String fromClient; - private String orgId; - private String orgIdPath; private Date operatingTime; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java index 8e5f60f31c..5f33faae98 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/ProjectChangedMQMsg.java @@ -36,8 +36,5 @@ public class ProjectChangedMQMsg implements Serializable { private String fromApp; private String fromClient; - private String orgId; - private String orgIdPath; - } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java index 358dfd5e92..f8210046bd 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java @@ -209,12 +209,6 @@ public class PointRuleServiceImpl extends BaseServiceImpl Date: Thu, 20 Oct 2022 16:52:23 +0800 Subject: [PATCH 227/249] =?UTF-8?q?=E5=88=A0=E9=99=A4org=E7=9A=84=E6=98=8E?= =?UTF-8?q?=E6=96=87=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/IcHouseController.java | 11 ----- .../com/epmet/service/IcHouseService.java | 7 --- .../service/impl/IcHouseServiceImpl.java | 47 ------------------- 3 files changed, 65 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java index 00a9076821..e7b5ac7e56 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcHouseController.java @@ -154,15 +154,4 @@ public class IcHouseController { return icHouseService.checkHomeInfo(formDTO); } - /** - * Desc: 数据明文查询 - * @param formDTO - * @author zxc - * @date 2022/10/17 13:45 - */ - @PostMapping("detailByType") - public Result detailByType(@RequestBody DetailByTypeFormDTO formDTO,@LoginUser TokenDto tokenDto){ - ValidatorUtils.validateEntity(formDTO, DetailByTypeFormDTO.DetailByTypeForm.class); - return new Result().ok(icHouseService.detailByType(formDTO,tokenDto)); - } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java index 0b2e40f86d..0855d78104 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcHouseService.java @@ -138,12 +138,5 @@ public interface IcHouseService extends BaseService { */ Result checkHomeInfo(CheckHouseInfoFormDTO formDTO); - /** - * Desc: 数据明文查询 - * @param formDTO - * @author zxc - * @date 2022/10/17 13:45 - */ - DetailByTypeResultDTO detailByType(DetailByTypeFormDTO formDTO, TokenDto tokenDto); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index a44882b549..943d6f9eee 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -416,51 +416,4 @@ public class IcHouseServiceImpl extends BaseServiceImpl().ok(checkHomeInfoResultInfo); } - - /** - * Desc: 数据明文查询 - * @param formDTO - * @author zxc - * @date 2022/10/17 13:45 - */ - @Override - public DetailByTypeResultDTO detailByType(DetailByTypeFormDTO formDTO, TokenDto tokenDto) { - DetailByTypeResultDTO result = new DetailByTypeResultDTO(); - String customerId = tokenDto.getCustomerId(); - String userId = tokenDto.getUserId(); - CheckMQMsg msg = new CheckMQMsg(); - if (formDTO.getType().equals(NeighborhoodConstant.HOUSE)){ - HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(customerId, formDTO.getId()); - if (null == houseInfo){ - throw new EpmetException("查询房屋信息失败:"+formDTO.getId()); - } - result.setMobile(houseInfo.getOwnerPhone()); - result.setIdCard(houseInfo.getOwnerIdCard()); - msg.setContent("查看"+houseInfo.getAllName()+"房屋的敏感信息"); - msg.setType("checkHouse"); - msg.setTypeDisplay("查看"+houseInfo.getAllName()+"房屋的敏感信息"); - }else if (formDTO.getType().equals(NeighborhoodConstant.IC_RESI_USER)){ - IcResiUserInfoCache icResiUserInfo = CustomerResiUserRedis.getIcResiUserInfo(formDTO.getId()); - if (null == icResiUserInfo){ - throw new EpmetException("查询icResiUser失败:"+formDTO.getId()); - } - result.setIdCard(icResiUserInfo.getIdCard()); - result.setMobile(icResiUserInfo.getMobile()); - msg.setContent("查看"+icResiUserInfo.getName()+"的敏感信息"); - msg.setType("checkIcResiUser"); - msg.setTypeDisplay("查看"+icResiUserInfo.getName()+"的敏感信息"); - } - // 发送mq消息 - HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); - msg.setOperateTime(new Date()); - msg.setUserId(userId); - msg.setFromApp(tokenDto.getApp()); - msg.setIp(IpUtils.getIpAddr(request)); - msg.setFromClient(tokenDto.getClient()); - SystemMsgFormDTO form = new SystemMsgFormDTO(); - form.setMessageType(TopicConstants.CHECK_OR_EXPORT); - form.setContent(msg); - epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); - return result; - } } From bb3e626ef4e3969c023119e729ab1b3ff749384d Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 20 Oct 2022 21:50:58 +0800 Subject: [PATCH 228/249] 1111 --- .../main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 5e71f69be0..57cd0be2d3 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -1087,7 +1087,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol GovWebLoginFormDTO loginGovParam = new GovWebLoginFormDTO(); loginGovParam.setCustomerId("1535072605621841922"); - loginGovParam.setPhone(ssoUserInfo.getClientId()); + loginGovParam.setPhone(ssoUserInfo.getMobile()); return govWebService.loginByThirdPlatform(loginGovParam); } From 5706a4457fd8f769860b06e30ececfdc5a60ae3c Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 20 Oct 2022 23:07:49 +0800 Subject: [PATCH 229/249] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=AE=A2=E6=88=B7Id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/GovWebServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index 92e1de27a5..91828cb561 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -95,6 +95,7 @@ public class GovWebServiceImpl implements GovWebService, ResultDataResolver { //5.生成token存到redis并返回 UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setCustomerId(formDTO.getCustomerId()); userTokenResultDTO.setToken(this.packagingUserToken(formDTO, resultDTO.getUserId())); return userTokenResultDTO; From ca28a3b9fbf06621569b6de771668e08ab769103 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 20 Oct 2022 23:49:03 +0800 Subject: [PATCH 230/249] =?UTF-8?q?=E6=94=BE=E5=BC=80todo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/utils/YtHsResUtils.java | 29 +++++++++---------- .../impl/DataSyncConfigServiceImpl.java | 10 ++----- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java index cb28cf5419..46686d75f9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java @@ -41,10 +41,10 @@ public class YtHsResUtils { param.put(ROW_NUM, rowNum); param.put(PAGE_SIZE, pageSize); log.info("hscy api param:{}", param); - //todo 核酸检测 mock数据 放开她 - //Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"hscyxxcx", param); - String mockData = "{\"id\":\"1570924677539635484\",\"name\":\"杨XX\",\"card_type\":\"1\",\"card_no\":\"370283199912010302\",\"create_by\":\"370613594\",\"create_time\":\"2022-09-17 07:15:22\",\"sys_org_code\":\"370613\",\"sample_tube\":\"GCJ-0825-0441\",\"package_id\":\"bcj00208083952\",\"city\":\"烟台市\",\"uuid\":\"6225684525062602095\",\"county\":\"莱山区\",\"depart_ids\":\"未填写\",\"depart_name\":null,\"realname\":\"采样点327\",\"upload_time\":\"2022-09-17 07:56:45\",\"sd_id\":null,\"sd_batch\":null,\"sd_operation\":null,\"sd_time\":null,\"inserttime\":\"2022-09-17 09:36:20\"}"; - Result result = new Result().ok(mockData); + + Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"hscyxxcx", param); + //String mockData = "{\"id\":\"1570924677539635484\",\"name\":\"杨XX\",\"card_type\":\"1\",\"card_no\":\"370283199912010302\",\"create_by\":\"370613594\",\"create_time\":\"2022-09-17 07:15:22\",\"sys_org_code\":\"370613\",\"sample_tube\":\"GCJ-0825-0441\",\"package_id\":\"bcj00208083952\",\"city\":\"烟台市\",\"uuid\":\"6225684525062602095\",\"county\":\"莱山区\",\"depart_ids\":\"未填写\",\"depart_name\":null,\"realname\":\"采样点327\",\"upload_time\":\"2022-09-17 07:56:45\",\"sd_id\":null,\"sd_batch\":null,\"sd_operation\":null,\"sd_time\":null,\"inserttime\":\"2022-09-17 09:36:20\"}"; + //Result result = new Result().ok(mockData); log.info("hscy api result:{}", JSON.toJSONString(result)); if (result.success()) { return JSON.parseObject(result.getData(), YtHscyResDTO.class); @@ -72,10 +72,9 @@ public class YtHsResUtils { param.put(ROW_NUM, rowNum); param.put(PAGE_SIZE, pageSize); log.info("hsjc api param:{}", param); - //todo 核酸检测 mock数据 放开她 - //Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"hsjcxx", param); - String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":[{\"id\":\"6a31eb2d38c011eda054fa163ebc7ff4\",\"name\":\"数据同步测试用户\",\"card_no\":\"370283199912010302\",\"telephone\":\"13697890860\",\"address\":\"保利香榭里公馆18-1-302\",\"test_time\":\"2022-09-20 12:52:28\",\"depart_name\":\"天仁医学检验实验室有限公司\",\"county\":\"莱山区\",\"upload_time\":\"2022-09-20 21:23:10\",\"sample_result_pcr\":\"2\",\"sample_time\":\"2022-09-20 06:48:28\",\"sampling_org_pcr\":\"采样点327\"}],\"total\":1}"; - Result result = new Result().ok(mockData); + Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"hsjcxx", param); +// String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":[{\"id\":\"6a31eb2d38c011eda054fa163ebc7ff4\",\"name\":\"数据同步测试用户\",\"card_no\":\"370283199912010302\",\"telephone\":\"13697890860\",\"address\":\"保利香榭里公馆18-1-302\",\"test_time\":\"2022-09-20 12:52:28\",\"depart_name\":\"天仁医学检验实验室有限公司\",\"county\":\"莱山区\",\"upload_time\":\"2022-09-20 21:23:10\",\"sample_result_pcr\":\"2\",\"sample_time\":\"2022-09-20 06:48:28\",\"sampling_org_pcr\":\"采样点327\"}],\"total\":1}"; +// Result result = new Result().ok(mockData); log.info("hsjc api result:{}", JSON.toJSONString(result)); if (result.success()) { return JSON.parseObject(result.getData(), YtHsjcResDTO.class); @@ -109,10 +108,9 @@ public class YtHsResUtils { log.info("siWang api param:{}", param); - //todo 放开他 - //Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"mzt_hhrysj1", param); - String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":\"{\\\"code\\\":200,\\\"data\\\":\\\"{\\\\\\\"data\\\\\\\":[{\\\\\\\"AGE\\\\\\\":\\\\\\\"82\\\\\\\",\\\\\\\"BIRTHDAY\\\\\\\":\\\\\\\"1933-02-23\\\\\\\",\\\\\\\"CARD_TYPE\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"CREATE_ORGAN_NAME\\\\\\\":\\\\\\\"莱州市殡仪馆\\\\\\\",\\\\\\\"CREMATION_TIME\\\\\\\":\\\\\\\"2016-01-03 13:01\\\\\\\",\\\\\\\"DEAD_ID\\\\\\\":\\\\\\\"8abc809851ffaf1501520600555c2849\\\\\\\",\\\\\\\"DEATH_DATE\\\\\\\":\\\\\\\"2016-01-02\\\\\\\",\\\\\\\"FAMILY_ADD\\\\\\\":\\\\\\\"山东省莱州市光州西路420号\\\\\\\",\\\\\\\"FOLK\\\\\\\":\\\\\\\"01\\\\\\\",\\\\\\\"ID_CARD\\\\\\\":\\\\\\\"370625193302231929\\\\\\\",\\\\\\\"NAME\\\\\\\":\\\\\\\"陈秀芬\\\\\\\",\\\\\\\"NATION\\\\\\\":\\\\\\\"156\\\\\\\",\\\\\\\"POPULACE\\\\\\\":\\\\\\\"3381C300B4B9439FE05319003C0A0897\\\\\\\",\\\\\\\"POPULACE_NAME\\\\\\\":\\\\\\\"烟台市莱州市文昌路街道\\\\\\\",\\\\\\\"RECORD_ID\\\\\\\":\\\\\\\"8abc809851ffaf1501520600694e2877\\\\\\\",\\\\\\\"RN\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"SEX\\\\\\\":\\\\\\\"2\\\\\\\"}],\\\\\\\"fields\\\\\\\":[\\\\\\\"RN\\\\\\\",\\\\\\\"RECORD_ID\\\\\\\",\\\\\\\"DEAD_ID\\\\\\\",\\\\\\\"NAME\\\\\\\",\\\\\\\"SEX\\\\\\\",\\\\\\\"CARD_TYPE\\\\\\\",\\\\\\\"ID_CARD\\\\\\\",\\\\\\\"BIRTHDAY\\\\\\\",\\\\\\\"AGE\\\\\\\",\\\\\\\"NATION\\\\\\\",\\\\\\\"FOLK\\\\\\\",\\\\\\\"IF_LOCAL\\\\\\\",\\\\\\\"POPULACE\\\\\\\",\\\\\\\"FAMILY_ADD\\\\\\\",\\\\\\\"WORK_NAME\\\\\\\",\\\\\\\"DEATH_DATE\\\\\\\",\\\\\\\"CREMATION_TIME\\\\\\\",\\\\\\\"CREATE_ORGAN_NAME\\\\\\\",\\\\\\\"POPULACE_NAME\\\\\\\"],\\\\\\\"total\\\\\\\":\\\\\\\"1\\\\\\\"}\\\",\\\"message\\\":\\\"\\\"}\",\"total\":0}"; - Result result = new Result().ok(mockData); + Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"mzt_hhrysj1", param); +// String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":\"{\\\"code\\\":200,\\\"data\\\":\\\"{\\\\\\\"data\\\\\\\":[{\\\\\\\"AGE\\\\\\\":\\\\\\\"82\\\\\\\",\\\\\\\"BIRTHDAY\\\\\\\":\\\\\\\"1933-02-23\\\\\\\",\\\\\\\"CARD_TYPE\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"CREATE_ORGAN_NAME\\\\\\\":\\\\\\\"莱州市殡仪馆\\\\\\\",\\\\\\\"CREMATION_TIME\\\\\\\":\\\\\\\"2016-01-03 13:01\\\\\\\",\\\\\\\"DEAD_ID\\\\\\\":\\\\\\\"8abc809851ffaf1501520600555c2849\\\\\\\",\\\\\\\"DEATH_DATE\\\\\\\":\\\\\\\"2016-01-02\\\\\\\",\\\\\\\"FAMILY_ADD\\\\\\\":\\\\\\\"山东省莱州市光州西路420号\\\\\\\",\\\\\\\"FOLK\\\\\\\":\\\\\\\"01\\\\\\\",\\\\\\\"ID_CARD\\\\\\\":\\\\\\\"370625193302231929\\\\\\\",\\\\\\\"NAME\\\\\\\":\\\\\\\"陈秀芬\\\\\\\",\\\\\\\"NATION\\\\\\\":\\\\\\\"156\\\\\\\",\\\\\\\"POPULACE\\\\\\\":\\\\\\\"3381C300B4B9439FE05319003C0A0897\\\\\\\",\\\\\\\"POPULACE_NAME\\\\\\\":\\\\\\\"烟台市莱州市文昌路街道\\\\\\\",\\\\\\\"RECORD_ID\\\\\\\":\\\\\\\"8abc809851ffaf1501520600694e2877\\\\\\\",\\\\\\\"RN\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"SEX\\\\\\\":\\\\\\\"2\\\\\\\"}],\\\\\\\"fields\\\\\\\":[\\\\\\\"RN\\\\\\\",\\\\\\\"RECORD_ID\\\\\\\",\\\\\\\"DEAD_ID\\\\\\\",\\\\\\\"NAME\\\\\\\",\\\\\\\"SEX\\\\\\\",\\\\\\\"CARD_TYPE\\\\\\\",\\\\\\\"ID_CARD\\\\\\\",\\\\\\\"BIRTHDAY\\\\\\\",\\\\\\\"AGE\\\\\\\",\\\\\\\"NATION\\\\\\\",\\\\\\\"FOLK\\\\\\\",\\\\\\\"IF_LOCAL\\\\\\\",\\\\\\\"POPULACE\\\\\\\",\\\\\\\"FAMILY_ADD\\\\\\\",\\\\\\\"WORK_NAME\\\\\\\",\\\\\\\"DEATH_DATE\\\\\\\",\\\\\\\"CREMATION_TIME\\\\\\\",\\\\\\\"CREATE_ORGAN_NAME\\\\\\\",\\\\\\\"POPULACE_NAME\\\\\\\"],\\\\\\\"total\\\\\\\":\\\\\\\"1\\\\\\\"}\\\",\\\"message\\\":\\\"\\\"}\",\"total\":0}"; +// Result result = new Result().ok(mockData); log.info("siWang api result:{}", JSON.toJSONString(result)); String data = result.getData(); JSONObject jsonObject = JSON.parseObject(data); @@ -166,10 +164,9 @@ public class YtHsResUtils { log.info("canji api param:{}", param); - //todo 上线放开她 - //Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"sdcl_xxzx_czcjr1", param); - String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":\"{\\\"code\\\":200,\\\"data\\\":\\\"{\\\\\\\"result\\\\\\\":true,\\\\\\\"errorcode\\\\\\\":0,\\\\\\\"msg\\\\\\\":\\\\\\\"获取成功\\\\\\\",\\\\\\\"data\\\\\\\":{\\\\\\\"isNewRecord\\\\\\\":true,\\\\\\\"delFlag\\\\\\\":\\\\\\\"0\\\\\\\",\\\\\\\"pageNo\\\\\\\":0,\\\\\\\"pageSize\\\\\\\":0,\\\\\\\"name\\\\\\\":\\\\\\\"数据同步测试用户\\\\\\\",\\\\\\\"genderName\\\\\\\":\\\\\\\"男\\\\\\\",\\\\\\\"citizenId\\\\\\\":\\\\\\\"370682198002072719\\\\\\\",\\\\\\\"cardNum\\\\\\\":\\\\\\\"370283199912010302\\\\\\\",\\\\\\\"idtKindName\\\\\\\":\\\\\\\"精神\\\\\\\",\\\\\\\"idtLevelName\\\\\\\":\\\\\\\"二级\\\\\\\",\\\\\\\"eduLevelName\\\\\\\":\\\\\\\"小学\\\\\\\",\\\\\\\"marriagerName\\\\\\\":\\\\\\\"未婚\\\\\\\",\\\\\\\"guardian\\\\\\\":\\\\\\\"盖希仁\\\\\\\",\\\\\\\"guardianPhone\\\\\\\":\\\\\\\"13854516627\\\\\\\",\\\\\\\"guardianRName\\\\\\\":\\\\\\\"兄/弟/姐/妹\\\\\\\",\\\\\\\"raceName\\\\\\\":\\\\\\\"汉族\\\\\\\",\\\\\\\"certDate\\\\\\\":1620779842000,\\\\\\\"residentAdd\\\\\\\":\\\\\\\"姜疃镇凤头村248号附1号\\\\\\\",\\\\\\\"nowAdd\\\\\\\":\\\\\\\"山东省烟台市莱阳市姜疃镇凤头村委会\\\\\\\",\\\\\\\"phoneNo\\\\\\\":\\\\\\\"13854516627\\\\\\\"}}\\\",\\\"message\\\":\\\"\\\"}\",\"total\":0}"; - Result result = new Result().ok(mockData); + Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"sdcl_xxzx_czcjr1", param); +// String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":\"{\\\"code\\\":200,\\\"data\\\":\\\"{\\\\\\\"result\\\\\\\":true,\\\\\\\"errorcode\\\\\\\":0,\\\\\\\"msg\\\\\\\":\\\\\\\"获取成功\\\\\\\",\\\\\\\"data\\\\\\\":{\\\\\\\"isNewRecord\\\\\\\":true,\\\\\\\"delFlag\\\\\\\":\\\\\\\"0\\\\\\\",\\\\\\\"pageNo\\\\\\\":0,\\\\\\\"pageSize\\\\\\\":0,\\\\\\\"name\\\\\\\":\\\\\\\"数据同步测试用户\\\\\\\",\\\\\\\"genderName\\\\\\\":\\\\\\\"男\\\\\\\",\\\\\\\"citizenId\\\\\\\":\\\\\\\"370682198002072719\\\\\\\",\\\\\\\"cardNum\\\\\\\":\\\\\\\"370283199912010302\\\\\\\",\\\\\\\"idtKindName\\\\\\\":\\\\\\\"精神\\\\\\\",\\\\\\\"idtLevelName\\\\\\\":\\\\\\\"二级\\\\\\\",\\\\\\\"eduLevelName\\\\\\\":\\\\\\\"小学\\\\\\\",\\\\\\\"marriagerName\\\\\\\":\\\\\\\"未婚\\\\\\\",\\\\\\\"guardian\\\\\\\":\\\\\\\"盖希仁\\\\\\\",\\\\\\\"guardianPhone\\\\\\\":\\\\\\\"13854516627\\\\\\\",\\\\\\\"guardianRName\\\\\\\":\\\\\\\"兄/弟/姐/妹\\\\\\\",\\\\\\\"raceName\\\\\\\":\\\\\\\"汉族\\\\\\\",\\\\\\\"certDate\\\\\\\":1620779842000,\\\\\\\"residentAdd\\\\\\\":\\\\\\\"姜疃镇凤头村248号附1号\\\\\\\",\\\\\\\"nowAdd\\\\\\\":\\\\\\\"山东省烟台市莱阳市姜疃镇凤头村委会\\\\\\\",\\\\\\\"phoneNo\\\\\\\":\\\\\\\"13854516627\\\\\\\"}}\\\",\\\"message\\\":\\\"\\\"}\",\"total\":0}"; +// Result result = new Result().ok(mockData); log.info("canji api result:{}", JSON.toJSONString(result)); if (result.success()) { /*返回示例 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index 2517791025..fbdb3eb7d1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -8,13 +8,11 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.result.YtDataSyncResDTO; -import com.epmet.commons.tools.dto.result.YtHscyResDTO; import com.epmet.commons.tools.dto.result.YtHsjcResDTO; import com.epmet.commons.tools.enums.GenderEnum; 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.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; @@ -180,7 +178,6 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl dbResiList = null; //设置查询数据范围 formDTO.setOrgList(config.getScopeList()); @@ -241,7 +237,7 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl dbResiList) { From b36e4876073a3ffb7423beaaf81fb437d2e4bd1c Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 20 Oct 2022 23:54:53 +0800 Subject: [PATCH 231/249] =?UTF-8?q?=E6=94=BE=E5=BC=80todo12312?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/DataSyncConfigServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index 47d402e7d2..c2e6565703 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -8,6 +8,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.result.YtDataSyncResDTO; +import com.epmet.commons.tools.dto.result.YtHscyResDTO; import com.epmet.commons.tools.dto.result.YtHsjcResDTO; import com.epmet.commons.tools.enums.GenderEnum; import com.epmet.commons.tools.exception.EpmetException; From 6a999b27fd33cadbcd66998ddbb6303931dc990b Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 21 Oct 2022 08:50:14 +0800 Subject: [PATCH 232/249] token --- .../java/com/epmet/commons/tools/utils/YtHsResUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java index 46686d75f9..adb090d8f6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java @@ -36,7 +36,7 @@ public class YtHsResUtils { public static YtHscyResDTO hscy(String cardNo, Integer rowNum, Integer pageSize) { try { Map param = new HashMap<>(); - param.put(APP_KEY, APP_KEY_VALUE); + param.put(APP_KEY, "tz45j4kuWcnnjoJOVSlzGWJgI"); param.put(CARD_NO, cardNo); param.put(ROW_NUM, rowNum); param.put(PAGE_SIZE, pageSize); @@ -67,7 +67,7 @@ public class YtHsResUtils { //String param = String.format("&card_no=%s&ROWNUM=%s&PAGESIZE=%s", cardNo, rowNum, pageSize); //String apiUrl = url.concat(param); Map param = new HashMap<>(); - param.put(APP_KEY, APP_KEY_VALUE); + param.put(APP_KEY, "DR4jF5Be7sCsqDmCamq2tmYCl"); param.put(CARD_NO, cardNo); param.put(ROW_NUM, rowNum); param.put(PAGE_SIZE, pageSize); @@ -100,7 +100,7 @@ public class YtHsResUtils { // 4)start开始默认0 // 5)limit每页记录数 Map param = new HashMap<>(); - param.put(APP_KEY, APP_KEY_VALUE); + param.put(APP_KEY, "IGE8TMM6f4t1Sef7FfstOLHAL"); param.put("id_card", cardNo); param.put("name", userName); param.put("start", 0); @@ -157,7 +157,7 @@ public class YtHsResUtils { // 2)name姓名 // 3)citizenId身份证号 Map param = new HashMap<>(); - param.put(APP_KEY, APP_KEY_VALUE); + param.put(APP_KEY, "EWGsaK0aM21wkDjCIWbahGVk2"); param.put("citizenId", idCard); param.put("name", userName); From 32d383951f0f65a9c8824d5a1239493a1597037e Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 21 Oct 2022 09:04:25 +0800 Subject: [PATCH 233/249] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/StrConstant.java | 2 + .../commons/tools/utils/YtHsResUtils.java | 63 +++++++++---------- 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index b89a521218..1dd825b18e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -13,6 +13,8 @@ import org.springframework.http.MediaType; public interface StrConstant { String UTF_8 = CharEncoding.UTF_8; + String HTTP_STATUS_OK = "200"; + String HTTP_RESP_CODE = "code"; String ISO_8859_1 = CharEncoding.ISO_8859_1; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java index adb090d8f6..3a23dac10d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java @@ -2,6 +2,7 @@ package com.epmet.commons.tools.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.YtDataSyncResDTO; import com.epmet.commons.tools.dto.result.YtHscyResDTO; import com.epmet.commons.tools.dto.result.YtHsjcResDTO; @@ -19,14 +20,10 @@ import java.util.Map; @Slf4j public class YtHsResUtils { private static String SERVER_URL = "http://10.2.2.60:8191/sjzt/server/"; - private static final String APP_KEY_VALUE = "DR4jF5Be7sCsqDmCamq2tmYCl"; private static final String APP_KEY = "appkey"; private static final String CARD_NO = "card_no"; - private static final String USER_NAME = "name"; private static final String ROW_NUM = "ROWNUM"; private static final String PAGE_SIZE = "PAGESIZE"; - private static final String START = "ROWNUM"; - private static final String LIMIT = "PAGESIZE"; /** * desc:核酸采样查询 @@ -42,12 +39,18 @@ public class YtHsResUtils { param.put(PAGE_SIZE, pageSize); log.info("hscy api param:{}", param); - Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"hscyxxcx", param); + Result result = HttpClientManager.getInstance().sendGet(SERVER_URL + "hscyxxcx", param); //String mockData = "{\"id\":\"1570924677539635484\",\"name\":\"杨XX\",\"card_type\":\"1\",\"card_no\":\"370283199912010302\",\"create_by\":\"370613594\",\"create_time\":\"2022-09-17 07:15:22\",\"sys_org_code\":\"370613\",\"sample_tube\":\"GCJ-0825-0441\",\"package_id\":\"bcj00208083952\",\"city\":\"烟台市\",\"uuid\":\"6225684525062602095\",\"county\":\"莱山区\",\"depart_ids\":\"未填写\",\"depart_name\":null,\"realname\":\"采样点327\",\"upload_time\":\"2022-09-17 07:56:45\",\"sd_id\":null,\"sd_batch\":null,\"sd_operation\":null,\"sd_time\":null,\"inserttime\":\"2022-09-17 09:36:20\"}"; //Result result = new Result().ok(mockData); log.info("hscy api result:{}", JSON.toJSONString(result)); if (result.success()) { - return JSON.parseObject(result.getData(), YtHscyResDTO.class); + String data = result.getData(); + JSONObject jsonObject = JSON.parseObject(data); + if (jsonObject != null && StrConstant.HTTP_STATUS_OK.equals(jsonObject.getString(StrConstant.HTTP_RESP_CODE))) { + return JSON.parseObject(result.getData(), YtHscyResDTO.class); + } else { + log.warn("hscy 调用蓝图接口败"); + } } } catch (Exception e) { log.error(String.format("烟台核酸检测结果查询异常cardNo:%s,异常信息:%s", cardNo, e.getMessage())); @@ -64,20 +67,25 @@ public class YtHsResUtils { */ public static YtHsjcResDTO hsjc(String cardNo, Integer rowNum, Integer pageSize) { try { - //String param = String.format("&card_no=%s&ROWNUM=%s&PAGESIZE=%s", cardNo, rowNum, pageSize); - //String apiUrl = url.concat(param); Map param = new HashMap<>(); param.put(APP_KEY, "DR4jF5Be7sCsqDmCamq2tmYCl"); param.put(CARD_NO, cardNo); param.put(ROW_NUM, rowNum); param.put(PAGE_SIZE, pageSize); log.info("hsjc api param:{}", param); - Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"hsjcxx", param); + Result result = HttpClientManager.getInstance().sendGet(SERVER_URL + "hsjcxx", param); // String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":[{\"id\":\"6a31eb2d38c011eda054fa163ebc7ff4\",\"name\":\"数据同步测试用户\",\"card_no\":\"370283199912010302\",\"telephone\":\"13697890860\",\"address\":\"保利香榭里公馆18-1-302\",\"test_time\":\"2022-09-20 12:52:28\",\"depart_name\":\"天仁医学检验实验室有限公司\",\"county\":\"莱山区\",\"upload_time\":\"2022-09-20 21:23:10\",\"sample_result_pcr\":\"2\",\"sample_time\":\"2022-09-20 06:48:28\",\"sampling_org_pcr\":\"采样点327\"}],\"total\":1}"; // Result result = new Result().ok(mockData); log.info("hsjc api result:{}", JSON.toJSONString(result)); if (result.success()) { - return JSON.parseObject(result.getData(), YtHsjcResDTO.class); + String data = result.getData(); + JSONObject jsonObject = JSON.parseObject(data); + if (jsonObject != null && StrConstant.HTTP_STATUS_OK.equals(jsonObject.getString(StrConstant.HTTP_RESP_CODE))) { + return JSON.parseObject(result.getData(), YtHsjcResDTO.class); + } else { + log.warn("hsjc 调用蓝图接口败"); + } + } } catch (Exception e) { log.error(String.format("烟台核酸检测结果查询异常cardNo:%s,异常信息:%s", cardNo, e.getMessage())); @@ -108,19 +116,22 @@ public class YtHsResUtils { log.info("siWang api param:{}", param); - Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"mzt_hhrysj1", param); + Result result = HttpClientManager.getInstance().sendGet(SERVER_URL + "mzt_hhrysj1", param); // String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":\"{\\\"code\\\":200,\\\"data\\\":\\\"{\\\\\\\"data\\\\\\\":[{\\\\\\\"AGE\\\\\\\":\\\\\\\"82\\\\\\\",\\\\\\\"BIRTHDAY\\\\\\\":\\\\\\\"1933-02-23\\\\\\\",\\\\\\\"CARD_TYPE\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"CREATE_ORGAN_NAME\\\\\\\":\\\\\\\"莱州市殡仪馆\\\\\\\",\\\\\\\"CREMATION_TIME\\\\\\\":\\\\\\\"2016-01-03 13:01\\\\\\\",\\\\\\\"DEAD_ID\\\\\\\":\\\\\\\"8abc809851ffaf1501520600555c2849\\\\\\\",\\\\\\\"DEATH_DATE\\\\\\\":\\\\\\\"2016-01-02\\\\\\\",\\\\\\\"FAMILY_ADD\\\\\\\":\\\\\\\"山东省莱州市光州西路420号\\\\\\\",\\\\\\\"FOLK\\\\\\\":\\\\\\\"01\\\\\\\",\\\\\\\"ID_CARD\\\\\\\":\\\\\\\"370625193302231929\\\\\\\",\\\\\\\"NAME\\\\\\\":\\\\\\\"陈秀芬\\\\\\\",\\\\\\\"NATION\\\\\\\":\\\\\\\"156\\\\\\\",\\\\\\\"POPULACE\\\\\\\":\\\\\\\"3381C300B4B9439FE05319003C0A0897\\\\\\\",\\\\\\\"POPULACE_NAME\\\\\\\":\\\\\\\"烟台市莱州市文昌路街道\\\\\\\",\\\\\\\"RECORD_ID\\\\\\\":\\\\\\\"8abc809851ffaf1501520600694e2877\\\\\\\",\\\\\\\"RN\\\\\\\":\\\\\\\"1\\\\\\\",\\\\\\\"SEX\\\\\\\":\\\\\\\"2\\\\\\\"}],\\\\\\\"fields\\\\\\\":[\\\\\\\"RN\\\\\\\",\\\\\\\"RECORD_ID\\\\\\\",\\\\\\\"DEAD_ID\\\\\\\",\\\\\\\"NAME\\\\\\\",\\\\\\\"SEX\\\\\\\",\\\\\\\"CARD_TYPE\\\\\\\",\\\\\\\"ID_CARD\\\\\\\",\\\\\\\"BIRTHDAY\\\\\\\",\\\\\\\"AGE\\\\\\\",\\\\\\\"NATION\\\\\\\",\\\\\\\"FOLK\\\\\\\",\\\\\\\"IF_LOCAL\\\\\\\",\\\\\\\"POPULACE\\\\\\\",\\\\\\\"FAMILY_ADD\\\\\\\",\\\\\\\"WORK_NAME\\\\\\\",\\\\\\\"DEATH_DATE\\\\\\\",\\\\\\\"CREMATION_TIME\\\\\\\",\\\\\\\"CREATE_ORGAN_NAME\\\\\\\",\\\\\\\"POPULACE_NAME\\\\\\\"],\\\\\\\"total\\\\\\\":\\\\\\\"1\\\\\\\"}\\\",\\\"message\\\":\\\"\\\"}\",\"total\":0}"; // Result result = new Result().ok(mockData); log.info("siWang api result:{}", JSON.toJSONString(result)); + if (!result.success()) { + return new YtDataSyncResDTO(); + } String data = result.getData(); JSONObject jsonObject = JSON.parseObject(data); //他们的结果是成功的 - if (jsonObject != null && "200".equals(jsonObject.getString("code"))) { + if (jsonObject != null && StrConstant.HTTP_STATUS_OK.equals(jsonObject.getString(StrConstant.HTTP_RESP_CODE))) { //第一层 JSONObject firstData = JSON.parseObject(jsonObject.getString("data")); //第二层 data - if (firstData != null && "200".equals(firstData.getString("code"))) { + if (firstData != null && StrConstant.HTTP_STATUS_OK.equals(firstData.getString(StrConstant.HTTP_RESP_CODE))) { //第一层 JSONObject secondData = JSON.parseObject(firstData.getString("data")); Object thirdData = ""; @@ -164,38 +175,20 @@ public class YtHsResUtils { log.info("canji api param:{}", param); - Result result = HttpClientManager.getInstance().sendGet(SERVER_URL+"sdcl_xxzx_czcjr1", param); + Result result = HttpClientManager.getInstance().sendGet(SERVER_URL + "sdcl_xxzx_czcjr1", param); // String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":\"{\\\"code\\\":200,\\\"data\\\":\\\"{\\\\\\\"result\\\\\\\":true,\\\\\\\"errorcode\\\\\\\":0,\\\\\\\"msg\\\\\\\":\\\\\\\"获取成功\\\\\\\",\\\\\\\"data\\\\\\\":{\\\\\\\"isNewRecord\\\\\\\":true,\\\\\\\"delFlag\\\\\\\":\\\\\\\"0\\\\\\\",\\\\\\\"pageNo\\\\\\\":0,\\\\\\\"pageSize\\\\\\\":0,\\\\\\\"name\\\\\\\":\\\\\\\"数据同步测试用户\\\\\\\",\\\\\\\"genderName\\\\\\\":\\\\\\\"男\\\\\\\",\\\\\\\"citizenId\\\\\\\":\\\\\\\"370682198002072719\\\\\\\",\\\\\\\"cardNum\\\\\\\":\\\\\\\"370283199912010302\\\\\\\",\\\\\\\"idtKindName\\\\\\\":\\\\\\\"精神\\\\\\\",\\\\\\\"idtLevelName\\\\\\\":\\\\\\\"二级\\\\\\\",\\\\\\\"eduLevelName\\\\\\\":\\\\\\\"小学\\\\\\\",\\\\\\\"marriagerName\\\\\\\":\\\\\\\"未婚\\\\\\\",\\\\\\\"guardian\\\\\\\":\\\\\\\"盖希仁\\\\\\\",\\\\\\\"guardianPhone\\\\\\\":\\\\\\\"13854516627\\\\\\\",\\\\\\\"guardianRName\\\\\\\":\\\\\\\"兄/弟/姐/妹\\\\\\\",\\\\\\\"raceName\\\\\\\":\\\\\\\"汉族\\\\\\\",\\\\\\\"certDate\\\\\\\":1620779842000,\\\\\\\"residentAdd\\\\\\\":\\\\\\\"姜疃镇凤头村248号附1号\\\\\\\",\\\\\\\"nowAdd\\\\\\\":\\\\\\\"山东省烟台市莱阳市姜疃镇凤头村委会\\\\\\\",\\\\\\\"phoneNo\\\\\\\":\\\\\\\"13854516627\\\\\\\"}}\\\",\\\"message\\\":\\\"\\\"}\",\"total\":0}"; // Result result = new Result().ok(mockData); log.info("canji api result:{}", JSON.toJSONString(result)); + if (result.success()) { - /*返回示例 - { - "code":"200", - "msg":"请求成功", - "data":"{ - \"code\":200, - \"data\":{ - \\\"result\\\":true, - \\\"errorcode\\\":0, - \\\"msg\\\":\\\"获取成功\\\", - \\\"data\\\":{ - \\\"isNewRecord\\\":\\\"true\\\", - } - } - \"message\":\"\" - }", - "total":0 - } - */ String data = result.getData(); JSONObject jsonObject = JSON.parseObject(data); //他们的结果是成功的 - if (jsonObject != null && "200".equals(jsonObject.getString("code"))) { + if (jsonObject != null && StrConstant.HTTP_STATUS_OK.equals(jsonObject.getString(StrConstant.HTTP_RESP_CODE))) { //第一层data JSONObject realObject = JSON.parseObject(jsonObject.getString("data")); - if (realObject != null && "200".equals(realObject.getString("code"))) { + if (realObject != null && StrConstant.HTTP_STATUS_OK.equals(realObject.getString(StrConstant.HTTP_RESP_CODE))) { //第二层 data String thirdData = realObject.getString("data"); return JSON.parseObject(thirdData, YtDataSyncResDTO.class); From e2f209c669c1e26b5ed2b89a112447756f6f75b9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 21 Oct 2022 09:20:57 +0800 Subject: [PATCH 234/249] =?UTF-8?q?=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/IssueServiceImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 573da12cb7..8db95668b7 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -22,7 +22,6 @@ import com.epmet.resi.group.dto.topic.form.TopicDetailBatchFormDTO; import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.service.IssueService; -import com.epmet.util.ModuleConstant; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -393,8 +392,8 @@ public class IssueServiceImpl implements IssueService { issueSuggestionDTO.setPublicFlag(formDTO.getPublicFlag() == true ? NumConstant.ONE : NumConstant.ZERO); issueSuggestionDTO.setCreatedBy(loginUserUtil.getLoginUserId()); Result result = govIssueOpenFeignClient.saveIssueSuggestion(issueSuggestionDTO); - if(result.success()||null==result.getData()||StringUtils.isBlank(result.getData().getSuggestionId())){ - throw new EpmetException(result.getCode(),result.getInternalMsg(),result.getMsg()); + if(!result.success()||null==result.getData()||StringUtils.isBlank(result.getData().getSuggestionId())){ + throw new EpmetException(result.getCode(),"gov-issue saveIssueSuggestion error:"+result.getInternalMsg(),result.getMsg()); } return new PublishSuggestionResultDTO(result.getData().getIssueId(), result.getData().getSuggestionId()); } From d3515ce827ce751a9f0550466b1bc6e11223cd11 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 21 Oct 2022 10:22:06 +0800 Subject: [PATCH 235/249] =?UTF-8?q?=E5=AE=A2=E6=88=B7ID=E6=8D=A2=E6=88=90y?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java index 6b81da281f..7179573098 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/yantai/DataSyncUserAndOrgServiceImpl.java @@ -62,7 +62,7 @@ public class DataSyncUserAndOrgServiceImpl implements DataSyncUserAndOrgService */ @Override public Boolean yanTaiSyncUser(String organizationId) { - String customerId = "45687aa479955f9d06204d415238f7cc"; + String customerId = YT_CUSTOMER_ID; // 缓存初始化staffs epmetUserOpenFeignClient.allCustomerStaffInCache(customerId); Integer no = NumConstant.ONE; From 74b61e313ac206a25ea8eb81e0b402adbb79eaa9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 21 Oct 2022 10:32:07 +0800 Subject: [PATCH 236/249] =?UTF-8?q?=E6=94=B9=E4=B8=8B=E8=AF=95=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/utils/ScanContentUtils.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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..728263e229 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())){ + 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())){ + 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("参数错误"); From 1bd9d050ab402f5470d6ff50009a82f0df79f82c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 21 Oct 2022 10:42:18 +0800 Subject: [PATCH 237/249] =?UTF-8?q?ScanContentUtils.imgSyncScan+textSyncSc?= =?UTF-8?q?an=E6=9C=AC=E6=9C=BAor=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=BF=94=E5=9B=9E=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/utils/ScanContentUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 728263e229..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 @@ -35,7 +35,7 @@ public class ScanContentUtils { public static Result imgSyncScan(String url, ImgScanParamDTO param) { //start 测试环境停机了,先这样改试试 EnvEnum currentEnv = EnvEnum.getCurrentEnv(); - if(EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())){ + 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); @@ -70,7 +70,7 @@ public class ScanContentUtils { public static Result textSyncScan(String url, TextScanParamDTO param) { //start 测试环境停机了,先这样改试试 EnvEnum currentEnv = EnvEnum.getCurrentEnv(); - if(EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())){ + 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); From 1508d1fdf6a732ea8716113d845eb4d62be4b057 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 21 Oct 2022 12:03:32 +0800 Subject: [PATCH 238/249] @PostMapping("/epmetuser/dataSyncConfig/natInfoScanTask") --- .../src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java | 1 - 1 file changed, 1 deletion(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 368ed8720b..21347f6b23 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -924,7 +924,6 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/dataSyncConfig/natInfoScanTask") Result natInfoScanTask(@RequestBody DataSyncTaskParam formDTO); - Result natInfoScanTask(@RequestBody NatInfoScanTaskFormDTO formDTO); /** * Desc: 根据网格ID查询所有注册居民 From a582053be621de29228975cf33a9a739713519fb Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 21 Oct 2022 14:21:31 +0800 Subject: [PATCH 239/249] =?UTF-8?q?=E4=B8=8D=E7=9F=A5=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/utils/api/yt/YantaiApi.java | 149 ++++++++++++------ 1 file changed, 98 insertions(+), 51 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java index 84195d6711..3590186d68 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.utils.Result; import com.fasterxml.jackson.core.JsonProcessingException; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; import javax.crypto.BadPaddingException; import java.security.InvalidKeyException; @@ -28,9 +29,19 @@ import java.util.Map; @Slf4j public class YantaiApi { private static final String SSO_SERVER = "http://172.20.46.155:8080/sso/"; + /** + * 相当于 appKey + */ private static final String CLIENT_ID = "1000009"; + /** + * 相当于 appSecret 用于解密 他们重定向回来的code 解密他们的token 获取用户嘻嘻 + */ private static final String CLIENT_SECRET = "a1f9879119bc4080ab5575f832b7d98b"; - private static final String SSO_CLIENT_TOKEN = "PRm5Db96atozjPQsJOuwlA=="; + /** + * 调用sso后台api接口的 秘钥 + */ + private static final String SSO_API_TOKEN = "iJCDUgCBV/Zk5FkkaxLypA=="; + private static final String SSO_BACKGROUND_SERVER_URL = "http://172.20.46.155:8082/"; /** * desc:根据组织id获取下级组织 @@ -46,15 +57,24 @@ public class YantaiApi { //加密 String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(organizationId); //pwd = URLEncoder.encode(pwd, "UTF-8"); - System.out.println("加密组织Id = " + organizationIdEn); - String url = "ouinfo/getChildOuInfoByGuid?organizationId=" + organizationIdEn; + String url = SSO_BACKGROUND_SERVER_URL + "person/ouinfo/getChildOuInfoByGuid"; - Map headerMap = new HashMap<>(); Map paramMap = new HashMap<>(); - log.info("getChildOuInfoByGuid request param: url:{},header:{}", url, headerMap); - Result result = HttpClientManager.getInstance().sendGet(url, paramMap, headerMap); + paramMap.put("organizationId",organizationIdEn); + + log.info("getChildOuInfoByGuid request param:{} url:{}",paramMap, url); + Result result = HttpClientManager.getInstance().sendGet(url, paramMap, getApiHeaderMap()); log.info("getChildOuInfoByGuid request result:{}", result); + if (!result.success()){ + return new ArrayList<>(); + } JSONObject jsonObject = JSONObject.parseObject(result.getData()); + String secondCode = jsonObject.getString("code"); + String secondMessage = jsonObject.getString("message"); + if (!"200".equals(secondCode)) { + log.warn("getChildOuInfoByGuid 接口错误"); + return new ArrayList<>(); + } //解密 String data = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); List orgData = JSON.parseArray(data, OrgData.class); @@ -80,15 +100,24 @@ public class YantaiApi { //加密 String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(organizationId); //pwd = URLEncoder.encode(pwd, "UTF-8"); - System.out.println("加密组织Id = " + organizationIdEn); - String url = SSO_SERVER + "ouinfo/getUserByOuGuid?organizationId=" + organizationIdEn; + String url = SSO_BACKGROUND_SERVER_URL + "person/serInfo/getUserByOuGuid"; + - Map headerMap = new HashMap<>(); Map paramMap = new HashMap<>(); - log.info("getUserByOuGuid request param: url:{},header:{}", url, headerMap); - Result result = HttpClientManager.getInstance().sendGet(url, paramMap, headerMap); + paramMap.put("organizationId",organizationIdEn); + log.info("getUserByOuGuid request param: url:{},param:{}", url, paramMap); + Result result = HttpClientManager.getInstance().sendGet(url, paramMap, getApiHeaderMap()); log.info("getUserByOuGuid request result:{}", result); + if (!result.success()){ + return new ArrayList<>(); + } JSONObject jsonObject = JSONObject.parseObject(result.getData()); + String secondCode = jsonObject.getString("code"); + String secondMessage = jsonObject.getString("message"); + if (!"200".equals(secondCode)) { + log.warn("getUserByOuGuid 接口错误"); + return new ArrayList<>(); + } //解密 String data = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); List userData = JSON.parseArray(data, UserData.class); @@ -152,21 +181,15 @@ public class YantaiApi { public static String getUserInfoMobile(String userId) { try { - JSONObject token = new JSONObject(); - token.put("token", "iJCDUgCBV/Zk5FkkaxLypA=="); - // token.put("token","iJCDUgCBV/Zk5FkkaxLypA=="); - token.put("expiration", System.currentTimeMillis()); - String tokanStr = SM4UtilsForYanTai.dealEncryptData(token.toString()); String userIdEn = SM4UtilsForYanTai.dealEncryptData(userId); - System.out.println(tokanStr + "__" + userIdEn); - String serverUrl = "http://172.20.46.155:8082/person/userInfo/getUserByUserGuid"; + + String serverUrl = SSO_BACKGROUND_SERVER_URL + "person/userInfo/getUserByUserGuid"; //String serverUrl = "http://120.220.248.247:8081/person/userInfo/getUserByUserGuid"; Map param = new HashMap<>(); param.put("userGuid", userIdEn); - Map headerMap = new HashMap<>(); - headerMap.put("Authorization", "Bearer " + tokanStr); - Result result = HttpClientManager.getInstance().sendGet(serverUrl, param, headerMap); + + Result result = HttpClientManager.getInstance().sendGet(serverUrl, param, getApiHeaderMap()); System.out.println(JSON.toJSONString(result)); if (!result.success() || StringUtils.isBlank(result.getData())) { log.info("getUserInfoMobile fail result:{}", JSON.toJSONString(result)); @@ -190,36 +213,60 @@ public class YantaiApi { return null; } + @NotNull + private static Map getApiHeaderMap() { + Map headerMap = new HashMap<>(); + try { + JSONObject token = new JSONObject(); + token.put("token", SSO_API_TOKEN); + // token.put("token","iJCDUgCBV/Zk5FkkaxLypA=="); + token.put("expiration", System.currentTimeMillis()); + + String tokanStr = SM4UtilsForYanTai.dealEncryptData(token.toString()); + headerMap.put("Authorization", "Bearer " + tokanStr); + } catch (Exception e) { + log.error("getApiHeaderMap exception", e); + } + return headerMap; + } + public static void main(String[] args) throws BadPaddingException, InvalidKeyException, JsonProcessingException { -// JSONObject token = new JSONObject(); -// token.put("token", SSO_CLIENT_TOKEN); -// token.put("expiration", System.currentTimeMillis()); -// -// String tokanStr = SM4UtilsForYanTai.dealEncryptData(token.toString()); -// String testUserId = "0ffd76e2-27b5-4b33-be9a-186f9f878bf1"; -// String userId = SM4UtilsForYanTai.dealEncryptData(testUserId); -// System.out.println(tokanStr + "__" + userId); -// String serverUrl = "http://172.20.46.155:8082/person/userInfo/getUserByUserGuid"; -// //String serverUrl = "http://120.220.248.247:8081/person/userInfo/getUserByUserGuid"; -// Map param = new HashMap<>(); -// param.put("userGuid", userId); -// Map headerMap = new HashMap<>(); -// headerMap.put("Authorization", "Bearer " + tokanStr); -// Result stringResult = HttpClientManager.getInstance().sendGet(serverUrl, param, headerMap); -// System.out.println(JSON.toJSONString(stringResult)); -// -// String data = stringResult.getData(); -// JSONObject jsonObject = JSON.parseObject(data); -// String secondCode = jsonObject.getString("code"); -// String secondMessage = jsonObject.getString("message"); -// System.out.println(secondCode); -// System.out.println(secondMessage); -// String data1 = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); -// System.out.println("======" + data1); - String s = SM4UtilsForYanTai.dealDecryptData("R5TbfdZPJ7QA9uo02EGT/uDWyUWapZTmTQZwwLYnX5ZChQhV8bYa17yJ+d+KC5vUm9P/O9J25pkpKSzUSaXEmJz3oniLQdj3OyhmZFghKAKVbK/By+3oyVQG3ApRUMwir64RkvnjpP7MjgUaXXongNRheMrsarV2fjr8ZYDzIH0bhsTDgo0/qNSSmFc+0sWmcvraDyeeI5nRNyjaBzybuBQzOCkqf3LtQAwnqWj8lCVPi5dH7KiTzM0pwZWzhfr21xzaw80fQkUMznBfkiJJM8nI2vqgZfa6TgtTH3h7JYLq8LDcu5UMJpMuVjbWwW41N41I+c9magDCUOJ9LkbmrUTvg2Y0asccP7U3jt9NNgwmRT5L/vxNmuapDaADjFR83P3ospRaclr3vo9OWMORSw=="); - System.out.println("sssssss:"+s); - - - getLoginToken("0d554bccfbac4be3846d643252daf92b"); + + //testGetUserByUserId(); + + //code只能用一次 + //getLoginToken("0d554bccfbac4be3846d643252daf92b"); + + String organizationId = "44e05de9-34fa-48f6-b89f-02838d792cf9"; + List childOuInfoByGuid = getChildOuInfoByGuid(organizationId); + System.out.println("childOuInfoByGuid:"+JSON.toJSONString(childOuInfoByGuid)); + List userByOuGuid = getUserByOuGuid(organizationId); + System.out.println("getUserByOuGuid:"+JSON.toJSONString(userByOuGuid)); + + Map apiHeaderMap = getApiHeaderMap(); + System.out.println(apiHeaderMap); + //testGetUserByUserId(); + } + + private static void testGetUserByUserId() throws JsonProcessingException, InvalidKeyException, BadPaddingException { + String testUserId = "0ffd76e2-27b5-4b33-be9a-186f9f878bf1"; + + String serverUrl = SSO_BACKGROUND_SERVER_URL +"person/userInfo/getUserByUserGuid"; + //String serverUrl = "http://120.220.248.247:8081/person/userInfo/getUserByUserGuid"; + Map param = new HashMap<>(); + param.put("userGuid", SM4UtilsForYanTai.dealEncryptData(testUserId)); + Result stringResult = HttpClientManager.getInstance().sendGet(serverUrl, param, getApiHeaderMap()); + System.out.println(JSON.toJSONString(stringResult)); + + String data = stringResult.getData(); + JSONObject jsonObject = JSON.parseObject(data); + String secondCode = jsonObject.getString("code"); + String secondMessage = jsonObject.getString("message"); + System.out.println(secondCode); + System.out.println(secondMessage); + String data1 = SM4UtilsForYanTai.dealDecryptData(jsonObject.getString("data")); + System.out.println("======" + data1); + String s = SM4UtilsForYanTai.dealDecryptData("EsOeQX+A8+GG26lzLnuKeuylkBDRFcTbF+gE/jURIzddlVI8RToQQhzK4EHy0WfpS/L4dSAJC93UyVLJhj+r/pup2RFq/GjpH7Md+1Mjg3dM+eyDuGql71bUrldQwJXYnHrQm3Mn7tk5m2eLhEVNkFvdELjuy3Kg8YihZXf2Sox+kxtmK4DSIn/gxhVCoUneWeL0cA6JGHI6jNuq97rzgcNK3Mwen8MxOoWP3n3r+kIpwZCwIlL70MrBjIZ6FHIhcxpqL82gpLSe1K0TFgeWw+9PMo1yv4cGZn7rU86TDlQFoDP86dVa1jrBoyUmW/vvLXrMKwfBaiv9/EUzcCLZWYxEwH93n0X/NYCYem3pfv4uXk5A7/D+Npgj9OKCEIz0ROn0UW5NiXI5Vibz0dywaq4sfsR/LiwjV81QOGY9tsHzN2+MnyTVpQg1l7looNnq1j+wwLneS0aDmbTqBLEn/baph/Hnr2L/9HYpWfXkhz93XRNAdsbxhXdG5ZIiJSwNasHinPR3e2Hmn/02GOsBPFUifbyNUtslt4RS/gwboonBoXz8wrmXi+PfzUXwN8f2CKdBNEHl72USp70NtBSJUPAkHdXZEQPgGRped63Z9GA="); + System.out.println("sssssss:" + s); } } From 5d7f5352771e42e5c98b167d2da7c45e2f85816f Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 21 Oct 2022 15:00:33 +0800 Subject: [PATCH 240/249] =?UTF-8?q?=E6=AE=8B=E7=96=BE=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DataSyncRecordDisabilityServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java index 3b564f19e7..e3d397c44d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java @@ -109,6 +109,9 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl Date: Fri, 21 Oct 2022 15:45:54 +0800 Subject: [PATCH 241/249] =?UTF-8?q?=E6=AD=BB=E4=BA=A1=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/DataSyncConfigServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index c2e6565703..b7590a5987 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -252,6 +252,9 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl queryWrapper = new LambdaQueryWrapper<>(); From 972e583dfd924ff596b2b2fab49bcb8346067f8d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 21 Oct 2022 15:49:57 +0800 Subject: [PATCH 242/249] genderCn --- .../main/resources/mapper/DataSyncRecordDisabilityDao.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml index 889ca27c1c..bca57f359e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml @@ -132,6 +132,12 @@ when d.deal_status = 2 then '处理失败' else '处理失败' end) as dealStatusName, d.now_add as address, + ( + case when d.GENDER='1' then '男' + when d.GENDER='2' then '女' + else '未知' + end + )as genderCn, d.* FROM data_sync_record_disability d WHERE DEL_FLAG = 0 From f34870dec4fa04b5c352d9e45f456a76456a6f5a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 21 Oct 2022 16:05:21 +0800 Subject: [PATCH 243/249] =?UTF-8?q?=E8=A1=A8=E5=86=B3=E4=B8=AD=E8=AE=AE?= =?UTF-8?q?=E9=A2=98=E5=8F=91=E5=B8=83=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/VotingIssueListResultDTO.java | 5 ++++- .../src/main/resources/mapper/IssueDao.xml | 8 +++++--- .../com/epmet/dto/result/VotingIssueListResultDTO.java | 4 ++++ 3 files changed, 13 insertions(+), 4 deletions(-) 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 6725684610..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 @@ -19,7 +19,10 @@ public class VotingIssueListResultDTO implements Serializable { * 议题发布时间 * */ private Long issuePublishTime; - + /** + * 议题发布时间 + */ + private String issuePublishTimeStr; /** * 议题Id * */ 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 306a5c0204..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 @@ -232,6 +232,7 @@ + @@ -247,7 +248,8 @@ UNIX_TIMESTAMP( i.created_time ) AS issuePublishTime, i.SOURCE_ID AS sourceId, i.SOURCE_TYPE as sourceType, - ia.url + ia.url, + DATE_FORMAT(i.created_time,'%Y-%m-%d %H:%i') as created_time FROM issue i left join issue_attachment ia @@ -257,7 +259,7 @@ AND i.GRID_ID = #{gridId} AND i.ISSUE_STATUS = 'voting' ORDER BY - i.created_time DESC,ia.SORT asc + i.created_time DESC @@ -291,7 +293,7 @@ AND i.ISSUE_STATUS = 'closed' AND i.RESOLVE_TYPE = 'resolved' ORDER BY - i.created_time DESC,ia.sort asc + i.created_time DESC SELECT + ID, USER_ID, ID_CARD FROM ic_nat @@ -194,30 +195,29 @@ - when USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} then #{l.natTime} + when ID = #{l.id} then #{l.natTime} - when USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} then #{l.natAddress} + when ID = #{l.id} then #{l.natAddress} - when USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} then #{l.natResult} + when ID = #{l.id} then #{l.natResult} - when USER_ID = #{l.userId} AND ID_CARD = #{l.idCard} then #{l.mobile} + when ID = #{l.id} then #{l.mobile} UPDATED_TIME = NOW() WHERE DEL_FLAG = '0' - AND USER_ID = #{l.userId} - AND ID_CARD = #{l.idCard} + AND ID = #{l.id} From 4921cc8b5584ca8e9e35af405cbfe64e9e05f450 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 24 Oct 2022 11:00:18 +0800 Subject: [PATCH 247/249] =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B=E6=94=B9ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/utils/YtHsResUtils.java | 6 +++--- .../com/epmet/service/impl/DataSyncConfigServiceImpl.java | 5 ++++- .../src/main/resources/mapper/IcNatDao.xml | 5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java index 3a23dac10d..d30e1087cb 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YtHsResUtils.java @@ -40,8 +40,8 @@ public class YtHsResUtils { log.info("hscy api param:{}", param); Result result = HttpClientManager.getInstance().sendGet(SERVER_URL + "hscyxxcx", param); - //String mockData = "{\"id\":\"1570924677539635484\",\"name\":\"杨XX\",\"card_type\":\"1\",\"card_no\":\"370283199912010302\",\"create_by\":\"370613594\",\"create_time\":\"2022-09-17 07:15:22\",\"sys_org_code\":\"370613\",\"sample_tube\":\"GCJ-0825-0441\",\"package_id\":\"bcj00208083952\",\"city\":\"烟台市\",\"uuid\":\"6225684525062602095\",\"county\":\"莱山区\",\"depart_ids\":\"未填写\",\"depart_name\":null,\"realname\":\"采样点327\",\"upload_time\":\"2022-09-17 07:56:45\",\"sd_id\":null,\"sd_batch\":null,\"sd_operation\":null,\"sd_time\":null,\"inserttime\":\"2022-09-17 09:36:20\"}"; - //Result result = new Result().ok(mockData); +// String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":[{\"id\":\"1570924677539635484\",\"name\":\"杨XX\",\"card_type\":\"1\",\"card_no\":\"370283199912010302\",\"create_by\":\"370613594\",\"create_time\":\"2022-09-24 06:48:28\",\"sys_org_code\":\"370613\",\"sample_tube\":\"GCJ-0825-0441\",\"package_id\":\"bcj00208083952\",\"city\":\"烟台市\",\"uuid\":\"6225684525062602095\",\"county\":\"莱山区\",\"depart_ids\":\"未填写\",\"depart_name\":null,\"realname\":\"采样点327\",\"upload_time\":\"2022-09-17 07:56:45\",\"sd_id\":null,\"sd_batch\":null,\"sd_operation\":null,\"sd_time\":null,\"inserttime\":\"2022-09-17 09:36:20\"}]}"; +// Result result = new Result().ok(mockData); log.info("hscy api result:{}", JSON.toJSONString(result)); if (result.success()) { String data = result.getData(); @@ -74,7 +74,7 @@ public class YtHsResUtils { param.put(PAGE_SIZE, pageSize); log.info("hsjc api param:{}", param); Result result = HttpClientManager.getInstance().sendGet(SERVER_URL + "hsjcxx", param); -// String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":[{\"id\":\"6a31eb2d38c011eda054fa163ebc7ff4\",\"name\":\"数据同步测试用户\",\"card_no\":\"370283199912010302\",\"telephone\":\"13697890860\",\"address\":\"保利香榭里公馆18-1-302\",\"test_time\":\"2022-09-20 12:52:28\",\"depart_name\":\"天仁医学检验实验室有限公司\",\"county\":\"莱山区\",\"upload_time\":\"2022-09-20 21:23:10\",\"sample_result_pcr\":\"2\",\"sample_time\":\"2022-09-20 06:48:28\",\"sampling_org_pcr\":\"采样点327\"}],\"total\":1}"; +// String mockData = "{\"code\":\"200\",\"msg\":\"请求成功\",\"data\":[{\"id\":\"6a31eb2d38c011eda054fa163ebc7ff4\",\"name\":\"数据同步测试用户\",\"card_no\":\"370283199912010302\",\"telephone\":\"13697890860\",\"address\":\"保利香榭里公馆18-1-302\",\"test_time\":\"2022-09-24 12:52:28\",\"depart_name\":\"天仁医学检验实验室有限公司\",\"county\":\"莱山区\",\"upload_time\":\"2022-09-20 21:23:10\",\"sample_result_pcr\":\"2\",\"sample_time\":\"2022-09-24 06:48:28\",\"sampling_org_pcr\":\"采样点327\"}],\"total\":1}"; // Result result = new Result().ok(mockData); log.info("hsjc api result:{}", JSON.toJSONString(result)); if (result.success()) { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java index b7590a5987..7fc6aa2bb6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncConfigServiceImpl.java @@ -539,7 +539,10 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl existInfo.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> e.setExistStatus(true))); + entities.forEach(e -> existInfo.stream().filter(i -> i.getUserId().equals(e.getUserId()) && i.getIdCard().equals(e.getIdCard())).forEach(i -> { + e.setExistStatus(true); + e.setId(i.getId()); + })); Map> groupByStatus = entities.stream().collect(Collectors.groupingBy(IcNatEntity::getExistStatus)); if (CollectionUtils.isNotEmpty(groupByStatus.get(false))) { for (List icNatEntities : ListUtils.partition(groupByStatus.get(false), NumConstant.FIVE_HUNDRED)) { diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index df1cda47a4..991bc5220d 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -216,9 +216,10 @@ UPDATED_TIME = NOW() WHERE DEL_FLAG = '0' + AND ID IN( - AND ID = #{l.id} - + #{l.id} + ) From d3a89ced33c3a57ae3ad6ba35dd1dd6b7f7d65cd Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 24 Oct 2022 15:18:38 +0800 Subject: [PATCH 248/249] =?UTF-8?q?=E7=BB=84=E7=BB=87id=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E6=B5=8B=E4=BA=86=E4=B8=80=E4=B8=8B=E5=A4=96=E7=BD=91ip=20?= =?UTF-8?q?=E4=B8=8D=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java index 3590186d68..e5c885f4a2 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java @@ -42,6 +42,7 @@ public class YantaiApi { */ private static final String SSO_API_TOKEN = "iJCDUgCBV/Zk5FkkaxLypA=="; private static final String SSO_BACKGROUND_SERVER_URL = "http://172.20.46.155:8082/"; + //private static final String SSO_BACKGROUND_SERVER_URL = "http://120.220.248.247:8081/"; /** * desc:根据组织id获取下级组织 @@ -240,7 +241,9 @@ public class YantaiApi { String organizationId = "44e05de9-34fa-48f6-b89f-02838d792cf9"; List childOuInfoByGuid = getChildOuInfoByGuid(organizationId); System.out.println("childOuInfoByGuid:"+JSON.toJSONString(childOuInfoByGuid)); - List userByOuGuid = getUserByOuGuid(organizationId); + //先用他说的有人的组织id联调 + String orgId = "2b271845-ed51-48aa-9935-00b9e7e06311"; + List userByOuGuid = getUserByOuGuid(orgId); System.out.println("getUserByOuGuid:"+JSON.toJSONString(userByOuGuid)); Map apiHeaderMap = getApiHeaderMap(); From 2c3c1ab217e8228f8734af735ba2074a29299836 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 25 Oct 2022 08:35:26 +0800 Subject: [PATCH 249/249] =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/api/yt/YantaiApi.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java index e5c885f4a2..95a54779b0 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/api/yt/YantaiApi.java @@ -41,7 +41,13 @@ public class YantaiApi { * 调用sso后台api接口的 秘钥 */ private static final String SSO_API_TOKEN = "iJCDUgCBV/Zk5FkkaxLypA=="; + /** + * 政务网地址 + */ private static final String SSO_BACKGROUND_SERVER_URL = "http://172.20.46.155:8082/"; + /** + * 互联网地址 + */ //private static final String SSO_BACKGROUND_SERVER_URL = "http://120.220.248.247:8081/"; /** @@ -101,7 +107,7 @@ public class YantaiApi { //加密 String organizationIdEn = SM4UtilsForYanTai.dealEncryptData(organizationId); //pwd = URLEncoder.encode(pwd, "UTF-8"); - String url = SSO_BACKGROUND_SERVER_URL + "person/serInfo/getUserByOuGuid"; + String url = SSO_BACKGROUND_SERVER_URL + "person/userInfo/getUserByOuGuid"; Map paramMap = new HashMap<>(); @@ -242,8 +248,9 @@ public class YantaiApi { List childOuInfoByGuid = getChildOuInfoByGuid(organizationId); System.out.println("childOuInfoByGuid:"+JSON.toJSONString(childOuInfoByGuid)); //先用他说的有人的组织id联调 - String orgId = "2b271845-ed51-48aa-9935-00b9e7e06311"; - List userByOuGuid = getUserByOuGuid(orgId); + //String orgId = "2b271845-ed51-48aa-9935-00b9e7e06311"; + //orgId = "2b271845-ed51-48aa-9935-00b9e7e05778"; + List userByOuGuid = getUserByOuGuid(organizationId); System.out.println("getUserByOuGuid:"+JSON.toJSONString(userByOuGuid)); Map apiHeaderMap = getApiHeaderMap();