From 88f63085ddfb47d8e46ea6cbfb9244711bc3523c Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sun, 24 Dec 2023 20:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E5=AD=98?= =?UTF-8?q?=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