From d15bf3f473ea69b1115602f0f7554ad479c08808 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 22 Dec 2023 09:45:45 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8A=BD=E5=8F=96?= =?UTF-8?q?=E8=A7=84=E9=81=BF=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/meeting/task/ExpertRandomInviteTask.java | 30 ++++++++++++---------- .../api/meeting/task/RandomInviteProperties.java | 4 +++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/task/ExpertRandomInviteTask.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/task/ExpertRandomInviteTask.java index 3078349..535784b 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/task/ExpertRandomInviteTask.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/task/ExpertRandomInviteTask.java @@ -4,10 +4,6 @@ import cn.hutool.core.util.ArrayUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.ningdatech.basic.util.CollUtils; -import com.ningdatech.basic.util.SpringUtils; -import com.ningdatech.cache.model.cache.CacheHashKey; -import com.ningdatech.cache.repository.CachePlusOps; import com.hz.pm.api.common.util.SpringContextHolder; import com.hz.pm.api.meeting.builder.ExpertInviteBuilder; import com.hz.pm.api.meeting.entity.domain.Meeting; @@ -25,11 +21,14 @@ import com.hz.pm.api.meeting.service.IExpertInviteAvoidRuleService; import com.hz.pm.api.meeting.service.IExpertInviteRuleService; import com.hz.pm.api.meeting.service.IMeetingExpertService; import com.hz.pm.api.meeting.service.IMeetingService; +import com.ningdatech.basic.util.CollUtils; +import com.ningdatech.basic.util.SpringUtils; +import com.ningdatech.cache.model.cache.CacheHashKey; +import com.ningdatech.cache.repository.CachePlusOps; import lombok.AllArgsConstructor; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.MapUtils; -import org.springframework.aop.framework.AopContext; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -37,10 +36,7 @@ import org.springframework.util.Assert; import javax.annotation.PostConstruct; import javax.annotation.Resource; -import java.time.Duration; -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.ZoneId; +import java.time.*; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -83,18 +79,20 @@ public class ExpertRandomInviteTask { */ private static final ConcurrentMap> INVITE_TASK_MAP = new ConcurrentHashMap<>(); - private ExpertRandomInviteTask currProxy() { - return (ExpertRandomInviteTask) AopContext.currentProxy(); - } - private CacheHashKey getCacheKey(Long meetingId) { String field = meetingId == null ? null : meetingId.toString(); return new CacheHashKey(MEETING_ID_INVITE_RANDOM, field, EXPIRE_TIME); } + private boolean inInviteTimeRange() { + int currHour = LocalTime.now().getHour(); + return currHour >= properties.getInviteStartHour() + && currHour < properties.getInviteEndHour(); + } + @PostConstruct public void initTask() { - if (!properties.getEnable()) { + if (Boolean.FALSE.equals(properties.getEnable())) { log.warn("随机邀请已关闭……"); return; } @@ -227,6 +225,10 @@ public class ExpertRandomInviteTask { @Transactional(rollbackFor = Exception.class) public void invite(Long meetingId, Boolean reInvite, LocalDateTime tsTime) { log.info("开始进行专家后台抽取:{}", meetingId); + if (!inInviteTimeRange()) { + log.warn("不在会议抽取执行时间:{}",meetingId); + return; + } Meeting meeting = meetingService.getById(meetingId); if (meeting.getInviteStatus() || meeting.getStartTime().isBefore(LocalDateTime.now())) { log.info("会议已开始停止抽取:{}", meeting); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/task/RandomInviteProperties.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/task/RandomInviteProperties.java index d6f9f57..0cab96e 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/task/RandomInviteProperties.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/task/RandomInviteProperties.java @@ -48,4 +48,8 @@ public class RandomInviteProperties { */ private Integer recentDays = 7; + private Integer inviteStartHour = 8; + + private Integer inviteEndHour = 20; + } From 7932894dd7d8887dd39d4c381b9b9cf54c3b201b Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 22 Dec 2023 12:23:41 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8A=BD=E5=8F=96?= =?UTF-8?q?=E8=A7=84=E9=81=BF=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/external/controller/MhSyncController.java | 46 ++++++++++++++++++++++ .../controller/MeetingExpertJudgeController.java | 6 +-- .../meeting/manage/MeetingExpertJudgeManage.java | 4 +- .../service/IMeetingExpertJudgeService.java | 9 +++++ hz-pm-api/src/main/resources/application-prod.yml | 36 ++++++++--------- .../src/main/resources/security/auth-prod.yml | 1 + 6 files changed, 77 insertions(+), 25 deletions(-) create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/external/controller/MhSyncController.java diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/external/controller/MhSyncController.java b/hz-pm-api/src/main/java/com/hz/pm/api/external/controller/MhSyncController.java new file mode 100644 index 0000000..fcb5058 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/external/controller/MhSyncController.java @@ -0,0 +1,46 @@ +package com.hz.pm.api.external.controller; + +import com.hz.pm.api.external.MhUserOrgClient; +import lombok.RequiredArgsConstructor; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.time.LocalDateTime; + +/** + *

+ * MhSyncController + *

+ * + * @author WendyYang + * @since 09:56 2023/12/22 + */ +@RestController +@RequiredArgsConstructor +@RequestMapping("/api/v1/mh/sync") +public class MhSyncController { + + private final MhUserOrgClient mhUserOrgClient; + + @GetMapping("/users") + public Object getUsers(@RequestParam(value = "syncTime", required = false) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime syncTime) { + return mhUserOrgClient.queryUsers(syncTime); + } + + @GetMapping("/orges") + public Object getOrges() { + return mhUserOrgClient.queryOrges(); + } + + @GetMapping("/experts") + public Object getExperts(@RequestParam(value = "syncTime", required = false) + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime syncTime) { + return mhUserOrgClient.queryExperts(syncTime); + } + + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingExpertJudgeController.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingExpertJudgeController.java index 1e98862..e5fc724 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingExpertJudgeController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/MeetingExpertJudgeController.java @@ -35,9 +35,9 @@ public class MeetingExpertJudgeController { } @ApiOperation("查看履职评价") - @GetMapping("/detail/{expertJudgeId}") - public MeetingExpertJudgeReq expertJudgeDetail(@PathVariable Long expertJudgeId) { - return expertJudgeManage.expertJudgeDetail(expertJudgeId); + @GetMapping("/detail/{meetingExpertId}") + public MeetingExpertJudgeReq expertJudgeDetail(@PathVariable Long meetingExpertId) { + return expertJudgeManage.expertJudgeDetail(meetingExpertId); } } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingExpertJudgeManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingExpertJudgeManage.java index 3274ab0..c78c5ad 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingExpertJudgeManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingExpertJudgeManage.java @@ -83,8 +83,8 @@ public class MeetingExpertJudgeManage { } } - public MeetingExpertJudgeReq expertJudgeDetail(Long expertJudgeId) { - MeetingExpertJudge judge = expertJudgeService.getById(expertJudgeId); + public MeetingExpertJudgeReq expertJudgeDetail(Long meetingExpertId) { + MeetingExpertJudge judge = expertJudgeService.getByMeetingExpertId(meetingExpertId); if (judge == null) { throw BizException.wrap("履职评价未提交"); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertJudgeService.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertJudgeService.java index dd6e98f..7e717e2 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertJudgeService.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/service/IMeetingExpertJudgeService.java @@ -1,9 +1,11 @@ package com.hz.pm.api.meeting.service; import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.IService; +import com.hz.pm.api.common.constant.BizConst; import com.hz.pm.api.meeting.entity.domain.MeetingExpertJudge; import com.ningdatech.basic.util.CollUtils; @@ -32,6 +34,13 @@ public interface IMeetingExpertJudgeService extends IService return CollUtils.fieldList(list(query), MeetingExpertJudge::getMeetingExpertId); } + default MeetingExpertJudge getByMeetingExpertId(Long meetingExpertId) { + Wrapper query = Wrappers.lambdaQuery(MeetingExpertJudge.class) + .eq(MeetingExpertJudge::getMeetingExpertId, meetingExpertId) + .last(BizConst.LIMIT_1); + return getOne(query); + } + default Map getExpertJudgeIdMap(Long meetingId) { LambdaQueryWrapper query = Wrappers.lambdaQuery(MeetingExpertJudge.class) .select(MeetingExpertJudge::getExpertId, MeetingExpertJudge::getId) diff --git a/hz-pm-api/src/main/resources/application-prod.yml b/hz-pm-api/src/main/resources/application-prod.yml index 592b8f2..1edc2cc 100644 --- a/hz-pm-api/src/main/resources/application-prod.yml +++ b/hz-pm-api/src/main/resources/application-prod.yml @@ -1,5 +1,5 @@ server: - port: 38888 + port: 8002 servlet: context-path: /hzpm #最大并发数,默认200 @@ -19,7 +19,7 @@ spring: host: localhost port: 6379 database: 0 - password: Ndkj1234 + password: jedis: pool: max-active: 200 @@ -27,7 +27,7 @@ spring: min-idle: 8 max-wait: 10000 application: - name: pm + name: hzpm jackson: default-property-inclusion: non_null time-zone: GMT+8 @@ -44,18 +44,18 @@ spring: ddl-auto: update datasource: type: com.zaxxer.hikari.HikariDataSource - driverClassName: com.kingbase8.Driver - url: jdbc:kingbase8://10.53.172.221:54321/nd_project_management?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&nullCatalogMeansCurrent=true - username: SYSTEM - password: Ndkj1234 + driverClassName: dm.jdbc.driver.DmDriver + url: jdbc:dm://10.54.38.191:5236/HZ_PROJECT_MANAGEMENT?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 + username: XMXTGL + password: XMXTGL@2023 # 数据源 hikari: # 是客户端等待连接池连接的最大毫秒数 connection-timeout: 30000 # 是允许连接在连接池中空闲的最长时间 - minimum-idle: 10 + minimum-idle: 20 # 配置最大池大小 - maximum-pool-size: 300 + maximum-pool-size: 200 # 是允许连接在连接池中空闲的最长时间(以毫秒为单位) idle-timeout: 60000 # 池中连接关闭后的最长生命周期(以毫秒为单位) @@ -100,11 +100,12 @@ nd: storage-type: ALI_OSS ali: protocol: http:// - bucket: projectmangmentoss - urlPrefix: oss-cn-lishui-gov-d01-a.ops.lsdx-zw.gov.cn - endpoint: oss-cn-lishui-gov-d01-a.ops.lsdx-zw.gov.cn - accessKeyId: XS3kNLtfW5i41SaC - accessKeySecret: 2cywvSZWANml7pZXxRAeAiHfisIhqm + bucket: szxcxtoss + urlPrefix: oss-cn-hangzhou-hzltzwy-d01-a.ops.hzegcxc.cn + endpoint: oss-cn-hangzhou-hzltzwy-d01-a.ops.hzegcxc.cn + accessKeyId: LNoIzKV82OvTJrKI + accessKeySecret: QI9y9jGqAbPXGn3oz1JHlbvsJQEnUo + # 日志文件配置 log: path: ./logs @@ -155,6 +156,7 @@ sa-token: token-style: uuid # 是否输出操作日志 is-log: false + #浙政钉公司顶级organizationCode organization: dept-visible-scopes: @@ -178,12 +180,6 @@ provincial: domainUrl: /api/v1/foreign/dominantUnit key: b5b2096953534a53991be4ea95f8cffa secret: 1bec9b77134d4962ac466fbe9696b897 -# host: http://223.4.72.75/prometheus-zhejiang_foreign -# pushUrl: /api/v1/foreign/importantPro -# detailUrl: /api/v1/foreign/importantProView -# key: b5b2096953534a53991be4ea95f8cffa -# secret: 1bec9b77134d4962ac466fbe9696b897 - #天印服务器接口信息 irs: diff --git a/hz-pm-api/src/main/resources/security/auth-prod.yml b/hz-pm-api/src/main/resources/security/auth-prod.yml index 7833ea3..e1550a1 100644 --- a/hz-pm-api/src/main/resources/security/auth-prod.yml +++ b/hz-pm-api/src/main/resources/security/auth-prod.yml @@ -39,6 +39,7 @@ security: - /api/v1/wps-convert/** - /api/v1/belong-org/business-strip/list - /expert/ephemeral/*/registration + - /api/v1/mh/sync/** ignore-csrf-urls: - /api/v1/user/auth/** - /v2/api-docs From 88f63085ddfb47d8e46ea6cbfb9244711bc3523c Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sun, 24 Dec 2023 20:54:04 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E6=96=87=E4=BB=B6=E6=A0=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ding/controller/DingInfoPullController.java | 49 ++++++++++++---------- .../hz/pm/api/ding/task/EmployeeBatchGetTask.java | 2 +- .../com/hz/pm/api/sms/task/YxtPollingTask.java | 1 - hz-pm-api/src/main/resources/application-dev.yml | 1 + hz-pm-api/src/main/resources/application-prod.yml | 4 +- resources/sql/SchemaChange.sql | 0 6 files changed, 30 insertions(+), 27 deletions(-) create mode 100644 resources/sql/SchemaChange.sql diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/ding/controller/DingInfoPullController.java b/hz-pm-api/src/main/java/com/hz/pm/api/ding/controller/DingInfoPullController.java index ff848f1..c0b9272 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/ding/controller/DingInfoPullController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/ding/controller/DingInfoPullController.java @@ -1,9 +1,7 @@ package com.hz.pm.api.ding.controller; import com.alibaba.fastjson.JSON; -import com.ningdatech.irs.service.IRefreshTokenService; import com.hz.pm.api.common.util.CryptUtils; -import com.hz.pm.api.common.util.RefreshKeyUtil; import com.hz.pm.api.ding.task.EmployeeBatchGetTask; import com.hz.pm.api.ding.task.GovBusinessStripsTask; import com.hz.pm.api.ding.task.OrganizationBatchGetTask; @@ -14,6 +12,7 @@ import com.hz.pm.api.projectdeclared.manage.IrsManage; import com.hz.pm.api.projectlib.model.dto.ProjectDTO; import com.hz.pm.api.projectlib.model.entity.Project; import com.hz.pm.api.projectlib.service.IProjectService; +import com.ningdatech.irs.service.IRefreshTokenService; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -29,9 +28,13 @@ import org.springframework.http.ResponseEntity; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.*; import org.springframework.web.client.RestTemplate; + import javax.annotation.Resource; import javax.validation.Valid; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; import java.security.NoSuchAlgorithmException; import java.util.Objects; @@ -116,7 +119,7 @@ public class DingInfoPullController { @GetMapping("/getToken") public String getToken() { - return employeeBatchGetTask.getToken(); + return employeeBatchGetTask.getToken(); } @GetMapping("/getAuthToken") @@ -141,11 +144,11 @@ public class DingInfoPullController { public String pushProject() throws Exception { File f = new File("/temp/遂昌归集项目信息(需补).xlsx"); // File f = new File("C:\\Users\\PoffyZhang\\Desktop\\遂昌归集项目信息(需补).xlsx"); - Workbook wb = readExcel(new FileInputStream(f),f.getName()); - Assert.notNull(wb,"文件流为空"); + Workbook wb = readExcel(new FileInputStream(f), f.getName()); + Assert.notNull(wb, "文件流为空"); Row row; Integer sucessNum = 0; - if(wb != null){ + if (wb != null) { //获取第一个sheet Sheet sheet = wb.getSheetAt(0); //获取最大行数 @@ -153,9 +156,9 @@ public class DingInfoPullController { //获取第一行 row = sheet.getRow(0); //获取最大列数 - for (int i = 1; i forEntity = restTemplate.getForEntity(url, String.class); log.info(JSON.toJSONString(forEntity)); @@ -263,9 +266,9 @@ public class DingInfoPullController { projectDto.setHigherSuperOrg(project.getHigherSuperOrg()); projectDto.setHigherSuperOrgCode(project.getHigherSuperOrgCode()); - log.info("projectDto :{}",JSON.toJSONString(projectDto)); + log.info("projectDto :{}", JSON.toJSONString(projectDto)); - if(StringUtils.isNotBlank(appIrsManage.pushProjectDetail(projectDto))){ + if (StringUtils.isNotBlank(appIrsManage.pushProjectDetail(projectDto))) { return "推送成功"; } return "推送失败"; @@ -283,16 +286,16 @@ public class DingInfoPullController { return irsManage.forward(dto); } - public static Workbook readExcel(InputStream is, String extString){ + public static Workbook readExcel(InputStream is, String extString) { Workbook wb = null; extString = extString.substring(extString.lastIndexOf(".")); try { - if(".xls".equals(extString)){ + if (".xls".equals(extString)) { return wb = new HSSFWorkbook(is); - }else if(".xlsx".equals(extString)){ + } else if (".xlsx".equals(extString)) { return wb = new XSSFWorkbook(is); - }else { + } else { return wb = null; } } catch (IOException e) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/ding/task/EmployeeBatchGetTask.java b/hz-pm-api/src/main/java/com/hz/pm/api/ding/task/EmployeeBatchGetTask.java index a7b2834..1ab6816 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/ding/task/EmployeeBatchGetTask.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/ding/task/EmployeeBatchGetTask.java @@ -69,7 +69,7 @@ public class EmployeeBatchGetTask { private IUserInfoService iUserInfoService; @Transactional(rollbackFor = Exception.class) -// @Scheduled(cron = "0 0 1 * * ?") + // @Scheduled(cron = "0 0 1 * * ?") public void batchGetEmployeeTask() { // 获取所有的组织列表用户获取组织下的 用户信息(暂时 只查 单位的类型) List dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/sms/task/YxtPollingTask.java b/hz-pm-api/src/main/java/com/hz/pm/api/sms/task/YxtPollingTask.java index 8b49caa..e8eea91 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/sms/task/YxtPollingTask.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/sms/task/YxtPollingTask.java @@ -22,7 +22,6 @@ public class YxtPollingTask { * 每5分钟执行一次 */ @Scheduled(cron = "0 */1 * * * ?") -// @Scheduled(cron = "${cron-expression.sms-msg-result-check-cron}") public void smsMsgResultCheck() { yxtContext.smsMsgResultCheck(); } diff --git a/hz-pm-api/src/main/resources/application-dev.yml b/hz-pm-api/src/main/resources/application-dev.yml index d1b96e5..2403d57 100644 --- a/hz-pm-api/src/main/resources/application-dev.yml +++ b/hz-pm-api/src/main/resources/application-dev.yml @@ -103,6 +103,7 @@ nd: endpoint: oss-cn-hangzhou.aliyuncs.com accessKeyId: LTAI4GL7uypycnBjiRn55rMG accessKeySecret: qwYC7bW9bkStsko7qkLVnToAzj0Y98 + rootPath: hzpm # 日志文件配置 log: path: ./logs diff --git a/hz-pm-api/src/main/resources/application-prod.yml b/hz-pm-api/src/main/resources/application-prod.yml index 1edc2cc..b33a13b 100644 --- a/hz-pm-api/src/main/resources/application-prod.yml +++ b/hz-pm-api/src/main/resources/application-prod.yml @@ -105,7 +105,7 @@ nd: endpoint: oss-cn-hangzhou-hzltzwy-d01-a.ops.hzegcxc.cn accessKeyId: LNoIzKV82OvTJrKI accessKeySecret: QI9y9jGqAbPXGn3oz1JHlbvsJQEnUo - + rootPath: hzpm # 日志文件配置 log: path: ./logs @@ -165,7 +165,7 @@ organization: yxt: wsdl-url: classpath:wsdl-prod.xml #账号 - user-code: Lssdsjj + user-code: Lssdsjj121 #密码 password: Lssdsjj@2021 #音信通开关 diff --git a/resources/sql/SchemaChange.sql b/resources/sql/SchemaChange.sql new file mode 100644 index 0000000..e69de29 From 121606f3c2609b845b86a94faebb24949c93acce Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Sat, 11 May 2024 16:14:21 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=A4=96=E9=83=A8=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E4=B8=93=E5=AE=B6=E4=BF=A1=E6=81=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/common/handler/GlobalResponseHandler.java | 4 +- .../api/meeting/entity/domain/MeetingExpert.java | 14 ++ .../OpenApiMeetingExpertInfoController.java | 48 ++++++ .../manage/OpenApiMeetingExpertInfoManage.java | 187 +++++++++++++++++++++ .../api/open/model/po/ReqMeetingExpertInfoPO.java | 28 +++ .../com/hz/pm/api/open/model/vo/ExpertInfoVO.java | 41 +++++ .../pm/api/open/model/vo/MeetingExpertInfoVO.java | 49 ++++++ hz-pm-api/src/main/resources/application-dev.yml | 5 +- hz-pm-api/src/main/resources/application-pre.yml | 5 +- hz-pm-api/src/main/resources/application-prod.yml | 5 +- hz-pm-api/src/main/resources/security/auth-dev.yml | 1 + 11 files changed, 383 insertions(+), 4 deletions(-) create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/open/controller/OpenApiMeetingExpertInfoController.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/open/manage/OpenApiMeetingExpertInfoManage.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/open/model/po/ReqMeetingExpertInfoPO.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/ExpertInfoVO.java create mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/MeetingExpertInfoVO.java diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/handler/GlobalResponseHandler.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/handler/GlobalResponseHandler.java index 79f7d13..338d1af 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/handler/GlobalResponseHandler.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/handler/GlobalResponseHandler.java @@ -37,7 +37,9 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; "com.hz.pm.api.gov.controller", "com.hz.pm.api.dashboard.controller", "com.hz.pm.api.wps.controller", - "com.hz.pm.api.gov.controller" + "com.hz.pm.api.gov.controller", + "com.hz.pm.api.open.controller" + }) public class GlobalResponseHandler implements ResponseBodyAdvice { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingExpert.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingExpert.java index 93d72f6..8af77ae 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingExpert.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingExpert.java @@ -73,4 +73,18 @@ public class MeetingExpert implements Serializable { @TableField(fill = FieldFill.INSERT_UPDATE) private LocalDateTime updateOn; + /** + * 20240511 新增字段 + */ + @ApiModelProperty("专家签到状态") + private Boolean signStatus; + + @ApiModelProperty("专家签到时间") + private LocalDateTime signTime; + + @ApiModelProperty("专家签到地点") + private String signAddress; + + + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/open/controller/OpenApiMeetingExpertInfoController.java b/hz-pm-api/src/main/java/com/hz/pm/api/open/controller/OpenApiMeetingExpertInfoController.java new file mode 100644 index 0000000..5b40ae4 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/open/controller/OpenApiMeetingExpertInfoController.java @@ -0,0 +1,48 @@ +package com.hz.pm.api.open.controller; + + + +import javax.validation.Valid; + +import com.hz.pm.api.open.manage.OpenApiMeetingExpertInfoManage; +import com.hz.pm.api.open.model.po.ReqMeetingExpertInfoPO; +import com.hz.pm.api.open.model.vo.MeetingExpertInfoVO; +import com.ningdatech.basic.model.PageVo; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.validation.annotation.Validated; +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 com.ningdatech.log.annotation.WebLog; + +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import java.util.List; + +/** + *

+ * 会议专家信息外部调用接口 + *

+ * @author CMM + * + */ +@Slf4j +@Validated +@RestController +@RequestMapping("/open/api/meeting-expert-info") +@RequiredArgsConstructor +public class OpenApiMeetingExpertInfoController { + + private final OpenApiMeetingExpertInfoManage openMeetingExpertInfoManage; + + @PostMapping("/list") + @ApiOperation("获取已抽取完成会议确定参加会议且未签到的专家信息列表") + @WebLog + public List infoList(@Valid @RequestBody ReqMeetingExpertInfoPO po) { + return openMeetingExpertInfoManage.infoList(po); + } +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/open/manage/OpenApiMeetingExpertInfoManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/open/manage/OpenApiMeetingExpertInfoManage.java new file mode 100644 index 0000000..b66d3c8 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/open/manage/OpenApiMeetingExpertInfoManage.java @@ -0,0 +1,187 @@ +package com.hz.pm.api.open.manage; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.*; +import java.util.stream.Collectors; + +import com.google.common.collect.Sets; +import com.hz.pm.api.expert.assembler.ExpertUserInfoAssembler; +import com.hz.pm.api.expert.model.DictionaryFieldInfo; +import com.hz.pm.api.expert.model.dto.ExpertDictionaryDTO; +import com.hz.pm.api.meta.constant.ExpertDictTypeEnum; +import com.hz.pm.api.meta.helper.DictionaryCache; +import com.hz.pm.api.meta.model.dto.DictDTO; +import com.hz.pm.api.meta.model.entity.ExpertDictionary; +import com.hz.pm.api.meta.service.IExpertDictionaryService; +import com.hz.pm.api.user.entity.UserInfo; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.google.common.collect.Lists; +import com.hz.pm.api.common.helper.UserInfoHelper; +import com.hz.pm.api.meeting.entity.domain.Meeting; +import com.hz.pm.api.meeting.entity.domain.MeetingExpert; +import com.hz.pm.api.meeting.service.IMeetingExpertService; +import com.hz.pm.api.meeting.service.IMeetingService; +import com.hz.pm.api.open.model.po.ReqMeetingExpertInfoPO; +import com.hz.pm.api.open.model.vo.ExpertInfoVO; +import com.hz.pm.api.open.model.vo.MeetingExpertInfoVO; +import com.hz.pm.api.user.security.auth.model.UserFullInfoDTO; +import com.hz.pm.api.user.service.IUserInfoService; +import com.ningdatech.basic.exception.BizException; +import com.ningdatech.basic.util.CollUtils; + +import cn.hutool.core.collection.CollUtil; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +/** + * @author CMM + * @since 2024/05/10 17:18 + */ +@Slf4j +@Component +@RequiredArgsConstructor +public class OpenApiMeetingExpertInfoManage { + + @Value("${hz-pm.interfaceKey}") + private String meetingExpertInfoKey; + + private final IMeetingService meetingService; + private final IMeetingExpertService meetingExpertService; + private final UserInfoHelper userInfoHelper; + private final IUserInfoService userInfoService; + private final IExpertDictionaryService iExpertDictionaryService; + private final DictionaryCache dictionaryCache; + public List infoList(ReqMeetingExpertInfoPO po) { + String key = po.getKey(); + // 校验传入的签名 + if (!checkSign(key)){ + throw new BizException("签名错误!"); + } + // 获取已经抽取完成 确认参加会议并且未签到的专家信息 + List meetingList = meetingService.list(Wrappers.lambdaQuery(Meeting.class) + .eq(Meeting::getConfirmedRoster, true)); + if(CollUtil.isEmpty(meetingList)){ + return Collections.emptyList(); + } + List result = Lists.newArrayList(); + // 获取已抽取完成会议中未签到的专家信息 + List meetingIds = meetingList.stream().map(Meeting::getId).collect(Collectors.toList()); + Map> meetingExpertMap = meetingExpertService.list(Wrappers.lambdaQuery(MeetingExpert.class) + .in(MeetingExpert::getMeetingId, meetingIds) + .eq(MeetingExpert::getSignStatus, Boolean.FALSE)) + .stream().collect(Collectors.groupingBy(MeetingExpert::getMeetingId)); + Map meetingMap = CollUtils.listToMap(meetingList, Meeting::getId); + List experts = Lists.newArrayList(); + for (Map.Entry> listEntry : meetingExpertMap.entrySet()) { + List value = listEntry.getValue(); + experts.addAll(value); + } + + // 获取未签到的专家信息 + List expertList = experts.stream().filter(m -> Boolean.FALSE.equals(m.getSignStatus())).collect(Collectors.toList()); + Set userIds = expertList.stream().map(MeetingExpert::getExpertId).collect(Collectors.toSet()); + List userInfoList = userInfoService.list(Wrappers.lambdaQuery(UserInfo.class).in(UserInfo::getId, userIds)); + Set employeeSet = Sets.newHashSet(); + userInfoList = userInfoList.stream().filter(u -> employeeSet.add(u.getEmployeeCode())).collect(Collectors.toList()); + List userFullInfos = userInfoHelper.getUserFullInfos(userInfoList); + Set userIdSet = Sets.newHashSet(); + userFullInfos = userFullInfos.stream().filter(u -> userIdSet.add(u.getUserId())).collect(Collectors.toList()); + Map infoMap = userFullInfos.stream().collect(Collectors.toMap(UserFullInfoDTO::getUserId, v -> v)); + + List expertDictionaryList = iExpertDictionaryService.list(Wrappers.lambdaQuery(ExpertDictionary.class) + .eq(ExpertDictionary::getExpertInfoField, ExpertDictTypeEnum.EXPERT_TYPE.getKey()) + .in(ExpertDictionary::getUserId, userIdSet)); + Map> dictMap = expertDictionaryList.stream().collect(Collectors.groupingBy(ExpertDictionary::getUserId)); + + for (Map.Entry> entry : meetingExpertMap.entrySet()) { + MeetingExpertInfoVO vo = new MeetingExpertInfoVO(); + Long meetingId = entry.getKey(); + Meeting meeting = meetingMap.get(meetingId); + if (Objects.nonNull(meeting)){ + vo.setMeetingId(meeting.getId()); + vo.setStartTime(meeting.getStartTime()); + vo.setEndTime(meeting.getEndTime()); + vo.setMeetingName(meeting.getName()); + vo.setMeetingAddress(meeting.getMeetingAddress()); + vo.setConnecter(meeting.getConnecter()); + vo.setContact(meeting.getContact()); + } + List meetingExperts = entry.getValue(); + if (CollUtil.isNotEmpty(meetingExperts)){ + // 获取未签到的专家信息 + List expertUserList = meetingExperts.stream().filter(m -> Boolean.FALSE.equals(m.getSignStatus())).collect(Collectors.toList()); + if (CollUtil.isNotEmpty(expertUserList)){ + List expertInfoVOList = expertUserList.stream().map(m -> { + ExpertInfoVO expertInfoVO = new ExpertInfoVO(); + expertInfoVO.setUserId(m.getExpertId()); + expertInfoVO.setName(m.getExpertName()); + expertInfoVO.setPhoneNo(m.getMobile()); + UserFullInfoDTO userFullInfoDTO = infoMap.get(m.getExpertId()); + if (Objects.nonNull(userFullInfoDTO)){ + expertInfoVO.setOrganizationCode(userFullInfoDTO.getOrganizationCode()); + expertInfoVO.setOrganizationName(userFullInfoDTO.getOrganizationName()); + } + List dictionaries = dictMap.get(m.getExpertId()); + if (CollUtil.isNotEmpty(dictionaries)){ + List dictionaryFieldInfos = dictionaries.stream().map(r -> { + DictionaryFieldInfo dictionaryFieldInfo = new DictionaryFieldInfo(); + dictionaryFieldInfo.setDictionaryFieldName(r.getExpertInfoField()); + dictionaryFieldInfo.setDictionaryCode(r.getDictionaryCode()); + Optional dictionaryDTO = dictionaryCache.getByCode(r.getDictionaryCode()); + dictionaryDTO.ifPresent(dictDTO -> dictionaryFieldInfo.setDictionaryName(dictDTO.getName())); + return dictionaryFieldInfo; + }).collect(Collectors.toList()); + expertInfoVO.setExpertType(dictionaryFieldInfos); + } + return expertInfoVO; + }).collect(Collectors.toList()); + vo.setExpertInfoList(expertInfoVOList); + } + } + result.add(vo); + } + return result; + } + + private Boolean checkSign(String key) { + StringBuilder sb = new StringBuilder(); + sb.append("key=").append(meetingExpertInfoKey); + // 使用SHA-256进行加密 + String sign = null; + try { + MessageDigest md = MessageDigest.getInstance("SHA-256"); + byte[] bytes = md.digest(sb.toString().getBytes()); + sign = bytesToHexString(bytes); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } + if (sign == null || sign.length() <= 8) { + return false; + } + String signStr = sign.substring(sign.length() - 8); + return signStr.equals(key); + } + + /** + * 将字节数组转换为十六进制字符串 + * + * @param bytes 字节数组 + * @return 十六进制字符串 + */ + private static String bytesToHexString(byte[] bytes) { + StringBuilder sb = new StringBuilder(); + for (byte b : bytes) { + String hex = Integer.toHexString(b & 0xFF); + if (hex.length() == 1) { + sb.append("0"); + } + sb.append(hex); + } + return sb.toString(); + } +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/open/model/po/ReqMeetingExpertInfoPO.java b/hz-pm-api/src/main/java/com/hz/pm/api/open/model/po/ReqMeetingExpertInfoPO.java new file mode 100644 index 0000000..1832469 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/open/model/po/ReqMeetingExpertInfoPO.java @@ -0,0 +1,28 @@ +package com.hz.pm.api.open.model.po; + +import javax.validation.constraints.NotBlank; + +import com.ningdatech.basic.model.PagePo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @author CMM + * @since 2024-05-10 + */ +@ApiModel(description = "会议专家信息列表请求入参") +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ReqMeetingExpertInfoPO extends PagePo { + + @ApiModelProperty("校验公钥") + @NotBlank(message = "秘钥不能为空") + private String key; +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/ExpertInfoVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/ExpertInfoVO.java new file mode 100644 index 0000000..70387c2 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/ExpertInfoVO.java @@ -0,0 +1,41 @@ +package com.hz.pm.api.open.model.vo; + +import java.util.List; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; + +import com.hz.pm.api.expert.model.*; +import com.hz.pm.api.meta.model.ExpertRegionInfo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author CMM + * @date 2024/5/11 + */ +@Data +@ApiModel("专家信息") +public class ExpertInfoVO { + + @ApiModelProperty("专家用户id") + private Long userId; + + @ApiModelProperty(value = "专家类型") + private List expertType; + + @ApiModelProperty(value = "专家姓名") + private String name; + + @ApiModelProperty(value = "手机号") + private String phoneNo; + + @ApiModelProperty(value = "单位code") + private String organizationCode; + + @ApiModelProperty(value = "单位名称") + private String organizationName; + +} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/MeetingExpertInfoVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/MeetingExpertInfoVO.java new file mode 100644 index 0000000..6f4c9c4 --- /dev/null +++ b/hz-pm-api/src/main/java/com/hz/pm/api/open/model/vo/MeetingExpertInfoVO.java @@ -0,0 +1,49 @@ +package com.hz.pm.api.open.model.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * 外部调用接口会议专家信息实体 + * + * @author CMM + * @since 2024/05/10 17:16 + */ +@Data +public class MeetingExpertInfoVO { + + + /** + * 会议信息 + */ + + @ApiModelProperty("会议ID") + private Long meetingId; + + @ApiModelProperty("会议开始时间") + private LocalDateTime startTime; + + @ApiModelProperty("会议结束时间") + private LocalDateTime endTime; + + @ApiModelProperty("会议名称") + private String meetingName; + + @ApiModelProperty("会议地址") + private String meetingAddress; + + @ApiModelProperty("联系人") + private String connecter; + + @ApiModelProperty("联系方式") + private String contact; + + /** + * 专家信息列表 + */ + @ApiModelProperty("专家信息列表") + private List expertInfoList; +} diff --git a/hz-pm-api/src/main/resources/application-dev.yml b/hz-pm-api/src/main/resources/application-dev.yml index 2403d57..7e540ec 100644 --- a/hz-pm-api/src/main/resources/application-dev.yml +++ b/hz-pm-api/src/main/resources/application-dev.yml @@ -43,7 +43,7 @@ spring: datasource: type: com.zaxxer.hikari.HikariDataSource driverClassName: dm.jdbc.driver.DmDriver - url: jdbc:dm://47.98.125.47:5236/HZ_PROJECT_MANAGEMENT?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 + url: jdbc:dm://47.98.125.47:5236/HZ_PROJECT_MANAGEMENT1?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 username: SYSDBA password: SYSDBA # 数据源 @@ -245,5 +245,8 @@ web: expert-registration: verify-code: check: false +# be942283f87c195de4d8d2a016e91378a0ef7cb533a6bff9ba0524700bacf423 +hz-pm: + interfaceKey: hz_meeting_expert_info diff --git a/hz-pm-api/src/main/resources/application-pre.yml b/hz-pm-api/src/main/resources/application-pre.yml index 57c8c9f..ac26a25 100644 --- a/hz-pm-api/src/main/resources/application-pre.yml +++ b/hz-pm-api/src/main/resources/application-pre.yml @@ -245,4 +245,7 @@ login: skip: true url: http://60.188.225.145:8080/login web: - url: http://60.188.225.145:8080 \ No newline at end of file + url: http://60.188.225.145:8080 +# be942283f87c195de4d8d2a016e91378a0ef7cb533a6bff9ba0524700bacf423 +hz-pm: + interfaceKey: hz_meeting_expert_info \ No newline at end of file diff --git a/hz-pm-api/src/main/resources/application-prod.yml b/hz-pm-api/src/main/resources/application-prod.yml index b33a13b..6515d70 100644 --- a/hz-pm-api/src/main/resources/application-prod.yml +++ b/hz-pm-api/src/main/resources/application-prod.yml @@ -241,4 +241,7 @@ login: skip: false url: http://60.188.225.145/login web: - url: http://60.188.225.145 \ No newline at end of file + url: http://60.188.225.145 +# be942283f87c195de4d8d2a016e91378a0ef7cb533a6bff9ba0524700bacf423 +hz-pm: + interfaceKey: hz_meeting_expert_info \ No newline at end of file diff --git a/hz-pm-api/src/main/resources/security/auth-dev.yml b/hz-pm-api/src/main/resources/security/auth-dev.yml index 7833ea3..ebfd945 100644 --- a/hz-pm-api/src/main/resources/security/auth-dev.yml +++ b/hz-pm-api/src/main/resources/security/auth-dev.yml @@ -70,6 +70,7 @@ security: - /api/v1/wps-convert/** - /api/v1/belong-org/business-strip/list - /expert/ephemeral/*/registration + - /open/api/** role-map: "engineer": "project_manager": From 7f6fd4d231ccbd1f7eff7b85501710d8bfded6e1 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Sat, 11 May 2024 17:09:40 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/PerformanceAppraisalPlanManage.java | 6 +----- .../projectdeclared/manage/ConstructionPlanManage.java | 4 ++-- .../manage/PrequalificationDeclaredProjectManage.java | 3 +-- .../projectdeclared/manage/ReviewByDeptJointManage.java | 2 +- .../projectlib/handle/ConstructionPlanReviewHandle.java | 2 +- .../api/projectlib/handle/DeptUnitedReviewHandle.java | 2 +- .../api/projectlib/handle/PreliminaryPreviewHandle.java | 2 +- .../projectlib/handle/ProjectFinalInspectionHandle.java | 2 +- .../pm/api/projectlib/handle/UnitInnerAuditHandle.java | 2 +- .../hz/pm/api/projectlib/manage/ProjectLibManage.java | 17 ++++++++--------- .../hz/pm/api/projectlib/model/entity/ProjectInst.java | 2 +- .../hz/pm/api/todocenter/manage/TodoCenterManage.java | 6 +++--- hz-pm-api/src/main/resources/security/auth-pre.yml | 1 + hz-pm-api/src/main/resources/security/auth-prod.yml | 1 + 14 files changed, 24 insertions(+), 28 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/PerformanceAppraisalPlanManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/PerformanceAppraisalPlanManage.java index 3324327..fcd0132 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/PerformanceAppraisalPlanManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/performance/manage/PerformanceAppraisalPlanManage.java @@ -7,13 +7,10 @@ import java.util.stream.Collectors; import com.hz.pm.api.performance.model.entity.*; import com.hz.pm.api.performance.service.*; import com.hz.pm.api.projectlib.enumeration.ProjectTypeNewEnum; -import com.hz.pm.api.projectlib.helper.ProjectHelper; import com.hz.pm.api.projectlib.manage.ProjectLibManage; import com.hz.pm.api.projectlib.model.req.ProjectListReq; import com.hz.pm.api.projectlib.model.vo.ProjectApplicationVO; import com.hz.pm.api.projectlib.model.vo.ProjectLibListItemVO; -import com.wflow.workflow.bean.vo.ProcessTaskVo; -import org.checkerframework.checker.nullness.qual.Nullable; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -44,7 +41,6 @@ import com.hz.pm.api.performance.model.vo.PerformanceAppraisalProjectVO; import com.hz.pm.api.performance.model.vo.PerformanceAppraisalVO; import com.hz.pm.api.projectlib.enumeration.InstTypeEnum; import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum; -import com.hz.pm.api.projectlib.enumeration.ProjectTypeEnum; import com.hz.pm.api.projectlib.model.entity.Project; import com.hz.pm.api.projectlib.model.entity.ProjectApplication; import com.hz.pm.api.projectlib.model.entity.ProjectInst; @@ -400,7 +396,7 @@ public class PerformanceAppraisalPlanManage { ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()) - .orderByDesc(ProjectInst::getCreatOn) + .orderByDesc(ProjectInst::getCreateOn) .last(BizConst.LIMIT_1)); if (Objects.isNull(projectInst)){ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java index 89b88d3..a445f12 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ConstructionPlanManage.java @@ -203,7 +203,7 @@ public class ConstructionPlanManage { ProjectInst projectInst = new ProjectInst(); projectInst.setProjectId(project.getId()); projectInst.setInstCode(instanceId); - projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setCreateOn(LocalDateTime.now()); projectInst.setUpdateOn(LocalDateTime.now()); projectInst.setInstType(ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS.getCode()); projectInstService.save(projectInst); @@ -257,7 +257,7 @@ public class ConstructionPlanManage { projectInst.setProjectId(project.getId()); projectInst.setInstCode(instanceId); projectInst.setInstType(InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()); - projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setCreateOn(LocalDateTime.now()); projectInst.setUpdateOn(LocalDateTime.now()); projectInstService.save(projectInst); } catch (Exception e) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PrequalificationDeclaredProjectManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PrequalificationDeclaredProjectManage.java index 7bec4ac..0f4d849 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PrequalificationDeclaredProjectManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/PrequalificationDeclaredProjectManage.java @@ -19,7 +19,6 @@ import com.hz.pm.api.projectdeclared.model.dto.DefaultDeclaredDTO; import com.hz.pm.api.projectdeclared.model.dto.PretrialDeclaredExportDTO; import com.hz.pm.api.projectdeclared.model.req.PrequalificationDeclaredListReq; import com.hz.pm.api.projectlib.enumeration.ProjectStatusEnum; -import com.hz.pm.api.projectlib.enumeration.ProjectTypeEnum; import com.hz.pm.api.projectlib.enumeration.ProjectTypeNewEnum; import com.hz.pm.api.projectlib.helper.ProjectHelper; import com.hz.pm.api.projectlib.manage.ProjectLibManage; @@ -232,7 +231,7 @@ public class PrequalificationDeclaredProjectManage { ProjectInst projectInst = new ProjectInst(); projectInst.setProjectId(project.getId()); projectInst.setInstCode(instanceId); - projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setCreateOn(LocalDateTime.now()); projectInst.setUpdateOn(LocalDateTime.now()); projectInst.setInstType(ProjectProcessStageEnum.PROJECT_PREQUALIFICATION_APPROVAL_PROCESS.getCode()); projectInstService.save(projectInst); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByDeptJointManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByDeptJointManage.java index 05f6d09..2b394e3 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByDeptJointManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/manage/ReviewByDeptJointManage.java @@ -120,7 +120,7 @@ public class ReviewByDeptJointManage { ProjectInst projectInst = new ProjectInst(); projectInst.setProjectId(project.getId()); projectInst.setInstCode(instanceId); - projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setCreateOn(LocalDateTime.now()); projectInst.setUpdateOn(LocalDateTime.now()); projectInst.setInstType(ProjectProcessStageEnum.DEPARTMENT_JOINT_APPROVAL_PROCESS.getCode()); projectInstService.save(projectInst); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ConstructionPlanReviewHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ConstructionPlanReviewHandle.java index b030906..b6a7ab9 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ConstructionPlanReviewHandle.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ConstructionPlanReviewHandle.java @@ -64,7 +64,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode()) .ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) - .orderByDesc(ProjectInst::getCreatOn) + .orderByDesc(ProjectInst::getCreateOn) .last(BizConst.LIMIT_1)); ProcessProgressVo instanceDetail = null; // 未找到当前版本项目的建设方案审核流程且当前项目版本号大于1(是被驳回重新申报的项目) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/DeptUnitedReviewHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/DeptUnitedReviewHandle.java index 967b84c..d4f11d9 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/DeptUnitedReviewHandle.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/DeptUnitedReviewHandle.java @@ -65,7 +65,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle { .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.DEPT_UNITED_REVIEW.getCode()) .ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) - .orderByDesc(ProjectInst::getCreatOn) + .orderByDesc(ProjectInst::getCreateOn) .last(BizConst.LIMIT_1)); if (Objects.isNull(projectInst)) { processDetailVO.setStepStatus(StepStatusEnum.NOT_START); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/PreliminaryPreviewHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/PreliminaryPreviewHandle.java index 42736c2..8280658 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/PreliminaryPreviewHandle.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/PreliminaryPreviewHandle.java @@ -68,7 +68,7 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle { .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.PRELIMINARY_PREVIEW.getCode()) .ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) - .orderByDesc(ProjectInst::getCreatOn) + .orderByDesc(ProjectInst::getCreateOn) .last("limit 1")); ProcessProgressVo instanceDetail = null; // 未找到当前版本项目的预审审核流程且当前项目版本号大于1(是被驳回重新申报的项目或者建设方案申报的项目) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProjectFinalInspectionHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProjectFinalInspectionHandle.java index 9a2f692..3e58f31 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProjectFinalInspectionHandle.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/ProjectFinalInspectionHandle.java @@ -62,7 +62,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode()) .ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) - .orderByDesc(ProjectInst::getCreatOn) + .orderByDesc(ProjectInst::getCreateOn) .last(BizConst.LIMIT_1)); if (Objects.isNull(projectInst)){ diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/UnitInnerAuditHandle.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/UnitInnerAuditHandle.java index d536393..ee5db27 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/UnitInnerAuditHandle.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/handle/UnitInnerAuditHandle.java @@ -67,7 +67,7 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle { .in(ProjectInst::getProjectId, allVersionProjectIds) .eq(ProjectInst::getInstType, InstTypeEnum.UNIT_INNER_AUDIT.getCode()) .ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE) - .orderByDesc(ProjectInst::getCreatOn) + .orderByDesc(ProjectInst::getCreateOn) .last(BizConst.LIMIT_1)); ProcessProgressVo instanceDetail = null; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java index fd3037b..8b2f2e5 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java @@ -78,7 +78,6 @@ import com.hz.pm.api.safety.service.IPersonSafetyInfoService; import com.hz.pm.api.safety.service.ISupplierSafetyQualificationService; import com.hz.pm.api.todocenter.model.req.ProcessDetailReq; import com.hz.pm.api.todocenter.service.ITodoService; -import com.hz.pm.api.user.entity.UserInfo; import com.hz.pm.api.user.security.auth.model.UserFullInfoDTO; import com.hz.pm.api.user.security.auth.model.UserInfoDetails; import com.hz.pm.api.user.util.LoginUserUtil; @@ -855,7 +854,7 @@ public class ProjectLibManage { ProjectInst projectInst = new ProjectInst(); projectInst.setProjectId(project.getId()); projectInst.setInstCode(instanceId); - projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setCreateOn(LocalDateTime.now()); projectInst.setUpdateOn(LocalDateTime.now()); projectInst.setInstType(ProjectProcessStageEnum.ORG_INTERNAL_APPROVAL_PROCESS.getCode()); projectInstService.save(projectInst); @@ -886,7 +885,7 @@ public class ProjectLibManage { ProjectInst projectInst = new ProjectInst(); projectInst.setProjectId(project.getId()); projectInst.setInstCode(instanceId); - projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setCreateOn(LocalDateTime.now()); projectInst.setUpdateOn(LocalDateTime.now()); projectInst.setInstType(ProjectProcessStageEnum.CONSTRUCTION_PROJECT_APPROVAL_PROCESS.getCode()); projectInstService.save(projectInst); @@ -1109,7 +1108,7 @@ public class ProjectLibManage { ProjectInst projectInst = new ProjectInst(); projectInst.setProjectId(project.getId()); projectInst.setInstCode(instanceId); - projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setCreateOn(LocalDateTime.now()); projectInst.setUpdateOn(LocalDateTime.now()); projectInst.setInstType(instType); projectInstService.save(projectInst); @@ -1143,7 +1142,7 @@ public class ProjectLibManage { ProjectInst projectInst = new ProjectInst(); projectInst.setProjectId(project.getId()); projectInst.setInstCode(instanceId); - projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setCreateOn(LocalDateTime.now()); projectInst.setUpdateOn(LocalDateTime.now()); projectInst.setInstType(instType); projectInstService.save(projectInst); @@ -1185,7 +1184,7 @@ public class ProjectLibManage { ProjectInst projectInst = new ProjectInst(); projectInst.setProjectId(project.getId()); projectInst.setInstCode(instanceId); - projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setCreateOn(LocalDateTime.now()); projectInst.setUpdateOn(LocalDateTime.now()); projectInst.setInstType(instType); projectInstService.save(projectInst); @@ -1225,7 +1224,7 @@ public class ProjectLibManage { ProjectInst projectInst = new ProjectInst(); projectInst.setProjectId(project.getId()); projectInst.setInstCode(instanceId); - projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setCreateOn(LocalDateTime.now()); projectInst.setUpdateOn(LocalDateTime.now()); projectInst.setInstType(instType); projectInstService.save(projectInst); @@ -1451,7 +1450,7 @@ public class ProjectLibManage { projectInst.setProjectId(project.getId()); projectInst.setInstCode(instanceId); projectInst.setInstType(InstTypeEnum.APPLY_DELAY.getCode()); - projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setCreateOn(LocalDateTime.now()); projectInst.setUpdateOn(LocalDateTime.now()); projectInstService.save(projectInst); } @@ -1481,7 +1480,7 @@ public class ProjectLibManage { projectInst.setProjectId(project.getId()); projectInst.setInstCode(instanceId); projectInst.setInstType(InstTypeEnum.APPLY_BORROW.getCode()); - projectInst.setCreatOn(LocalDateTime.now()); + projectInst.setCreateOn(LocalDateTime.now()); projectInst.setUpdateOn(LocalDateTime.now()); projectInstService.save(projectInst); } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/ProjectInst.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/ProjectInst.java index 7537377..0df444a 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/ProjectInst.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/model/entity/ProjectInst.java @@ -38,7 +38,7 @@ public class ProjectInst implements Serializable { private Integer instType; @ApiModelProperty("创建时间") - private LocalDateTime creatOn; + private LocalDateTime createOn; @ApiModelProperty("修改时间") private LocalDateTime updateOn; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java index 4afefdc..c0c8138 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/todocenter/manage/TodoCenterManage.java @@ -1170,7 +1170,7 @@ public class TodoCenterManage { newPi.setProjectId(project.getId()); newPi.setInstType(oldInst.getInstType()); newPi.setInstCode(instCode); - newPi.setCreatOn(LocalDateTime.now()); + newPi.setCreateOn(LocalDateTime.now()); newPi.setUpdateOn(LocalDateTime.now()); projectInstService.save(newPi); @@ -1574,11 +1574,11 @@ public class TodoCenterManage { ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class) .eq(ProjectInst::getProjectId, projectId) .eq(ProjectInst::getInstType, InstTypeEnum.PRELIMINARY_PREVIEW.getCode()) - .orderByDesc(ProjectInst::getCreatOn) + .orderByDesc(ProjectInst::getCreateOn) .last("limit 1")); LocalDateTime time = null; if (Objects.nonNull(projectInst)) { - time = projectInst.getCreatOn(); + time = projectInst.getCreateOn(); paramsMap.put("time", NdDateUtils.format(time, "yyyy-MM-dd HH:mm")); } else { paramsMap.put("time", null); diff --git a/hz-pm-api/src/main/resources/security/auth-pre.yml b/hz-pm-api/src/main/resources/security/auth-pre.yml index 7833ea3..ebfd945 100644 --- a/hz-pm-api/src/main/resources/security/auth-pre.yml +++ b/hz-pm-api/src/main/resources/security/auth-pre.yml @@ -70,6 +70,7 @@ security: - /api/v1/wps-convert/** - /api/v1/belong-org/business-strip/list - /expert/ephemeral/*/registration + - /open/api/** role-map: "engineer": "project_manager": diff --git a/hz-pm-api/src/main/resources/security/auth-prod.yml b/hz-pm-api/src/main/resources/security/auth-prod.yml index e1550a1..6228ff9 100644 --- a/hz-pm-api/src/main/resources/security/auth-prod.yml +++ b/hz-pm-api/src/main/resources/security/auth-prod.yml @@ -71,6 +71,7 @@ security: - /api/v1/wps-convert/** - /api/v1/belong-org/business-strip/list - /expert/ephemeral/*/registration + - /open/api/** role-map: "engineer": "project_manager":