From 42b502b11b2f80acc232730bb7e97ddee8761cfc Mon Sep 17 00:00:00 2001 From: WendyYang Date: Fri, 22 Dec 2023 12:23:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8A=BD=E5=8F=96=E8=A7=84?= =?UTF-8?q?=E9=81=BF=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 7932894dd7d8887dd39d4c381b9b9cf54c3b201b) --- .../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