From 31e77e8785e7958c7321ce12bfc7e054a1aa92a3 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 5 Sep 2023 17:23:49 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E5=BC=80=E5=8F=91=E5=8C=BA=20=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=BA=94=E7=94=A8=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ningdatech/pmapi/common/constant/RegionConst.java | 2 ++ pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java index d2ba86c..baf1b8e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java @@ -24,6 +24,8 @@ public interface RegionConst { * 丽水行政区划编码 */ String RC_LS = "331100"; + String LS_KF = "331118"; + String LS_KF_IRS = "331151"; String RC_LS_SBJ_IRS = "331101"; //遂昌县 String RC_SC = "331123"; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java index 3a709d9..964c421 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java @@ -260,13 +260,15 @@ public class AppIrsManage { } /** - * 如果是市本级的 结尾改成01 + * 如果是市本级的 结尾改成01 还要转换开发区的code * @param areaCode * @return */ private String convertAreaCode(String areaCode) { if(RegionConst.RC_LS.equals(areaCode)){ return RegionConst.RC_LS_SBJ_IRS; + }else if(RegionConst.LS_KF.equals(areaCode)){ + return RegionConst.LS_KF_IRS; } return areaCode; } From ad4c3b09271f1d342c318652bc6f21638c4a2f97 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 5 Sep 2023 17:37:25 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E5=BC=80=E5=8F=91=E5=8C=BA=20=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=BA=94=E7=94=A8=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java index 964c421..68b1109 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java @@ -235,10 +235,11 @@ public class AppIrsManage { "&appKey=" + searchAppKey + "&pageSize=1000&" + "pageNum=1&areaCode=" + areaCode + "&deptCode=&name="; + log.info("查询应用目录:{}",url); RestTemplate restTemplate = new RestTemplate(); ResponseEntity forEntity = restTemplate.getForEntity(url, String.class); - log.info("查询应用目录 : {}", forEntity.getStatusCode()); + log.info("查询应用目录 : {}", forEntity.getBody()); if (Objects.nonNull(forEntity.getBody())) { JSONObject body = JSON.parseObject(forEntity.getBody()); From 909451df656656ef0cfc03eb474233f22bdccf6e Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 6 Sep 2023 11:38:57 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ding/controller/DingInfoPullController.java | 5 +++ .../pmapi/ding/task/OrganizationBatchGetTask.java | 45 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java index 356c8c0..516cf06 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java @@ -84,6 +84,11 @@ public class DingInfoPullController { organizationBatchGetTask.batchGetOrganizationTask(); } + @GetMapping("/organization/{orgCode}") + public void organizationGetSubs(@PathVariable String orgCode) { + organizationBatchGetTask.organizationGetSubs(orgCode); + } + @GetMapping("/employeeByRegionCode/{regionCode}") public void employeeBatchGetByRegionCode(@PathVariable String regionCode) { employeeBatchGetTask.batchGetEmployeeTaskByRegionCode(regionCode); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java index f183d2f..5b1ddb3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; import com.ningdatech.basic.model.GenericResult; +import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.ding.model.DingOrgInfoTreeDTO; import com.ningdatech.pmapi.organization.model.entity.DingOrganization; import com.ningdatech.pmapi.organization.service.IDingOrganizationService; @@ -21,6 +22,7 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -103,6 +105,49 @@ public class OrganizationBatchGetTask { } } + /** + * 更新 其 子单位 + * @param orgCode + */ + public void organizationGetSubs(String orgCode) { + log.info("----拉取浙政钉组织子单位开始---,顶级code:" + orgCode); + DingOrganization topOrg = iDingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) + .eq(DingOrganization::getOrganizationCode, orgCode) + .last(BizConst.LIMIT_1)); + // 顶级组织code + List topOrgCodes = Lists.newArrayList(orgCode); + GenericResult> listGenericResult = zwddClient.listOrganizationsByCodes(topOrgCodes); + log.info("listGenericResult: {}" + JSON.toJSONString(listGenericResult)); + List dingOrgInfoDtos = listGenericResult.getData(); + + for(DingOrgInfoDTO dingOrgInfo : dingOrgInfoDtos){ + DingOrganization old = iDingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) + .eq(DingOrganization::getOrganizationCode, dingOrgInfo.getOrganizationCode()) + .last(BizConst.LIMIT_1)); + if(Objects.nonNull(old)){ + log.info("该单位已经存在 :{}",old.getOrganizationName()); + continue; + } + + DingOrganization organization = new DingOrganization(); + organization.setOrganizationCode(dingOrgInfo.getOrganizationCode()); + organization.setOrganizationName(dingOrgInfo.getOrganizationName()); + //和顶级单位一个区域 + organization.setDivisionCode(topOrg.getDivisionCode()); + organization.setParentCode(dingOrgInfo.getParentCode()); + organization.setTypeName(dingOrgInfo.getTypeName()); + organization.setAddress(dingOrgInfo.getAddress()); + organization.setBusinessStripCodes(dingOrgInfo.getBusinessStripCodes()); + organization.setDisplayOrder(dingOrgInfo.getDisplayOrder()); + organization.setGmtCreate(LocalDateTime.now()); + organization.setInstitutionLevelCode(dingOrgInfo.getInstitutionLevelCode()); + organization.setParentName(dingOrgInfo.getParentName()); + iDingOrganizationService.save(organization); + } + + log.info("----拉取浙政钉组织子单位结束---,顶级code:" + orgCode); + } + private void buildSaveRecordList(List treeDTOList, List saveRecordList) { if (CollectionUtils.isEmpty(treeDTOList)) { return; From 6129b2f446ed6d9d5443eef861542fde793e56b0 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 6 Sep 2023 11:56:33 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/ding/task/OrganizationBatchGetTask.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java index 5b1ddb3..2e5979d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java @@ -115,12 +115,14 @@ public class OrganizationBatchGetTask { .eq(DingOrganization::getOrganizationCode, orgCode) .last(BizConst.LIMIT_1)); // 顶级组织code - List topOrgCodes = Lists.newArrayList(orgCode); - GenericResult> listGenericResult = zwddClient.listOrganizationsByCodes(topOrgCodes); - log.info("listGenericResult: {}" + JSON.toJSONString(listGenericResult)); - List dingOrgInfoDtos = listGenericResult.getData(); - - for(DingOrgInfoDTO dingOrgInfo : dingOrgInfoDtos){ + GenericResult subOrganizationResult = zwddClient.pageSubOrganizationCodes(1, 10000, orgCode); + log.info("subOrganizationResult: {}" + JSON.toJSONString(subOrganizationResult)); + PageSubOrganizationCodeDTO data = subOrganizationResult.getData(); + List subOrganizationCodeList = data.getSubOrganizationCodeList(); + + for(String subOrganizationCode : subOrganizationCodeList){ + GenericResult organizationByCode = zwddClient.getOrganizationByCode(subOrganizationCode); + DingOrgInfoDTO dingOrgInfo = organizationByCode.getData(); DingOrganization old = iDingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) .eq(DingOrganization::getOrganizationCode, dingOrgInfo.getOrganizationCode()) .last(BizConst.LIMIT_1)); @@ -142,7 +144,9 @@ public class OrganizationBatchGetTask { organization.setGmtCreate(LocalDateTime.now()); organization.setInstitutionLevelCode(dingOrgInfo.getInstitutionLevelCode()); organization.setParentName(dingOrgInfo.getParentName()); - iDingOrganizationService.save(organization); + if(iDingOrganizationService.save(organization)){ + organizationGetSubs(organization.getOrganizationCode()); + } } log.info("----拉取浙政钉组织子单位结束---,顶级code:" + orgCode); From 7a25f6b7b843bec3299d3d48c25eb24bce508220 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 6 Sep 2023 15:18:17 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ding/controller/DingInfoPullController.java | 5 ++ .../pmapi/ding/task/EmployeeBatchGetTask.java | 10 ++- .../pmapi/ding/task/OrganizationBatchGetTask.java | 37 ++++++++++- .../ningdatech/pmapi/employee/EmployeeTest.java | 75 ++++++++++++++++++++++ pmapi/src/test/resources/application-prod.yml | 6 +- pmapi/src/test/resources/application.yml | 2 +- 6 files changed, 127 insertions(+), 8 deletions(-) create mode 100644 pmapi/src/test/java/com/ningdatech/pmapi/employee/EmployeeTest.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java index 516cf06..2d92494 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java @@ -89,6 +89,11 @@ public class DingInfoPullController { organizationBatchGetTask.organizationGetSubs(orgCode); } + @GetMapping("/organization-sub/{orgCode}") + public void organizationSubGetOrgs(@PathVariable String orgCode) { + organizationBatchGetTask.organizationSubGetOrgs(orgCode); + } + @GetMapping("/employeeByRegionCode/{regionCode}") public void employeeBatchGetByRegionCode(@PathVariable String regionCode) { employeeBatchGetTask.batchGetEmployeeTaskByRegionCode(regionCode); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java index e5fccfa..592cd8c 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/EmployeeBatchGetTask.java @@ -223,8 +223,8 @@ public class EmployeeBatchGetTask { String employeeCode = dingEmployeeInfo.getEmployeeCode(); DingEmployeeInfo employeeInfo = iDingEmployeeInfoService.getOne(Wrappers.lambdaQuery(DingEmployeeInfo.class) - .eq(DingEmployeeInfo::getEmpPosUnitCode, dingEmployeeInfo.getEmpPosUnitCode()) - .eq(DingEmployeeInfo::getEmployeeCode, employeeCode)); + .eq(DingEmployeeInfo::getEmployeeCode, employeeCode) + .last(BizConst.LIMIT_1)); if (Objects.isNull(employeeInfo)) { iDingEmployeeInfoService.save(dingEmployeeInfo); } else { @@ -261,6 +261,12 @@ public class EmployeeBatchGetTask { iUserInfoService.save(userInfo); }else{ userInfo.setAvatar(dingEmployeeInfo.getAvatar()); + userInfo.setEmpPosUnitCode(dingEmployeeInfo.getEmpPosUnitCode()); + if(StringUtils.isNotBlank(userInfo.getEmpPosUnitCode()) && organizationMap.containsKey(userInfo.getEmpPosUnitCode())){ + DingOrganization dingOrganization = organizationMap.get(userInfo.getEmpPosUnitCode()); + userInfo.setEmpPosUnitName(dingOrganization.getOrganizationName()); + userInfo.setRegionCode(dingOrganization.getDivisionCode()); + } iUserInfoService.updateById(userInfo); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java index 2e5979d..b944915 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java @@ -45,6 +45,9 @@ public class OrganizationBatchGetTask { @Autowired private IDingOrganizationService iDingOrganizationService; + @Autowired + private EmployeeBatchGetTask employeeBatchGetTask; + /** * 获取浙政钉组织架构 */ @@ -115,11 +118,16 @@ public class OrganizationBatchGetTask { .eq(DingOrganization::getOrganizationCode, orgCode) .last(BizConst.LIMIT_1)); // 顶级组织code - GenericResult subOrganizationResult = zwddClient.pageSubOrganizationCodes(1, 10000, orgCode); + GenericResult subOrganizationResult = zwddClient.pageSubOrganizationCodes(1, 100, orgCode); log.info("subOrganizationResult: {}" + JSON.toJSONString(subOrganizationResult)); PageSubOrganizationCodeDTO data = subOrganizationResult.getData(); List subOrganizationCodeList = data.getSubOrganizationCodeList(); + if(Objects.isNull(subOrganizationCodeList)){ + log.info("subOrganizationCodeList为null"); + return; + } + for(String subOrganizationCode : subOrganizationCodeList){ GenericResult organizationByCode = zwddClient.getOrganizationByCode(subOrganizationCode); DingOrgInfoDTO dingOrgInfo = organizationByCode.getData(); @@ -128,6 +136,8 @@ public class OrganizationBatchGetTask { .last(BizConst.LIMIT_1)); if(Objects.nonNull(old)){ log.info("该单位已经存在 :{}",old.getOrganizationName()); + organizationGetSubs(dingOrgInfo.getOrganizationCode()); + employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(dingOrgInfo.getOrganizationCode()); continue; } @@ -146,12 +156,36 @@ public class OrganizationBatchGetTask { organization.setParentName(dingOrgInfo.getParentName()); if(iDingOrganizationService.save(organization)){ organizationGetSubs(organization.getOrganizationCode()); + employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(organization.getOrganizationCode()); } } log.info("----拉取浙政钉组织子单位结束---,顶级code:" + orgCode); } + /** + * 查看下 当前的子单位信息 + * @param orgCode + */ + public void organizationSubGetOrgs(String orgCode) { + // 顶级组织code + GenericResult subOrganizationResult = zwddClient.pageSubOrganizationCodes(1, 100, orgCode); + log.info("subOrganizationResult: {}" + JSON.toJSONString(subOrganizationResult)); + PageSubOrganizationCodeDTO data = subOrganizationResult.getData(); + List subOrganizationCodeList = data.getSubOrganizationCodeList(); + + if(Objects.isNull(subOrganizationCodeList)){ + log.info("subOrganizationCodeList为null"); + return; + } + + for(String subOrganizationCode : subOrganizationCodeList){ + GenericResult organizationByCode = zwddClient.getOrganizationByCode(subOrganizationCode); + DingOrgInfoDTO dingOrgInfo = organizationByCode.getData(); + log.info("dingOrgInfo :{}",JSON.toJSONString(dingOrgInfo)); + } + } + private void buildSaveRecordList(List treeDTOList, List saveRecordList) { if (CollectionUtils.isEmpty(treeDTOList)) { return; @@ -216,7 +250,6 @@ public class OrganizationBatchGetTask { } } } - } diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/employee/EmployeeTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/employee/EmployeeTest.java new file mode 100644 index 0000000..0c63ef3 --- /dev/null +++ b/pmapi/src/test/java/com/ningdatech/pmapi/employee/EmployeeTest.java @@ -0,0 +1,75 @@ +package com.ningdatech.pmapi.employee; + +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.pmapi.AppTests; +import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.common.constant.RegionConst; +import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; +import com.ningdatech.pmapi.organization.model.entity.DingOrganization; +import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; +import com.ningdatech.pmapi.organization.service.IDingOrganizationService; +import com.ningdatech.pmapi.user.entity.UserInfo; +import com.ningdatech.pmapi.user.service.IUserInfoService; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.Objects; + +/** + * @Classname EmployeeTest + * @Description + * @Date 2023/9/6 14:34 + * @Author PoffyZhang + */ +public class EmployeeTest extends AppTests { + + @Autowired + private IDingEmployeeInfoService dingEmployeeInfoService; + + @Autowired + private IDingOrganizationService dingOrganizationService; + + @Autowired + private IUserInfoService userInfoService; + + @Test + public void test(){ + List employees = dingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) + .eq(DingEmployeeInfo::getEmployeeName, "吴玉斌")); + + for(DingEmployeeInfo employee : employees){ + UserInfo user = userInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) + .eq(UserInfo::getEmployeeCode, employee.getEmployeeCode()) + .last(BizConst.LIMIT_1)); + + if(Objects.nonNull(user)){ + DingOrganization organization = dingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) + .eq(DingOrganization::getOrganizationCode, employee.getOrganizationCode()) + .last(BizConst.LIMIT_1)); + user.setRegionCode(RegionConst.LS_KF); + user.setEmpPosUnitCode(employee.getEmpPosUnitCode()); + user.setEmpPosUnitName(organization.getOrganizationName()); + userInfoService.updateById(user); + }else{ + DingOrganization organization = dingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class) + .eq(DingOrganization::getOrganizationCode, employee.getOrganizationCode()) + .last(BizConst.LIMIT_1)); + UserInfo saveUser = new UserInfo(); + saveUser.setRegionCode(RegionConst.LS_KF); + saveUser.setEmpPosUnitCode(employee.getEmpPosUnitCode()); + saveUser.setEmpPosUnitName(organization.getOrganizationName()); + saveUser.setCreateOn(LocalDateTime.now()); + saveUser.setUsername("吴玉斌"); + saveUser.setRealName("吴玉斌"); + saveUser.setUpdateOn(LocalDateTime.now()); + saveUser.setAccountId(employee.getAccountId()); + saveUser.setEmployeeCode(employee.getEmployeeCode()); + userInfoService.save(saveUser); + } + + } + } + +} diff --git a/pmapi/src/test/resources/application-prod.yml b/pmapi/src/test/resources/application-prod.yml index c1a40fa..55d190b 100644 --- a/pmapi/src/test/resources/application-prod.yml +++ b/pmapi/src/test/resources/application-prod.yml @@ -13,9 +13,9 @@ spring: namespace: "spring:session" redis: timeout: 5000 - host: 10.53.168.116 - port: 6379 - database: 0 + host: 47.98.125.47 + port: 26379 + database: 4 password: Ndkj1234 jedis: pool: diff --git a/pmapi/src/test/resources/application.yml b/pmapi/src/test/resources/application.yml index 3d7808a..9f96606 100644 --- a/pmapi/src/test/resources/application.yml +++ b/pmapi/src/test/resources/application.yml @@ -1,3 +1,3 @@ spring: profiles: - active: dev + active: prod From 45f724602f87d2a607f9e02eac7141b3c0159cf7 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Wed, 6 Sep 2023 17:18:51 +0800 Subject: [PATCH 06/14] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/ding/task/OrganizationBatchGetTask.java | 6 ++++-- .../com/ningdatech/pmapi/employee/EmployeeTest.java | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java index b944915..ce564b2 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/task/OrganizationBatchGetTask.java @@ -128,6 +128,8 @@ public class OrganizationBatchGetTask { return; } + employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(orgCode); + for(String subOrganizationCode : subOrganizationCodeList){ GenericResult organizationByCode = zwddClient.getOrganizationByCode(subOrganizationCode); DingOrgInfoDTO dingOrgInfo = organizationByCode.getData(); @@ -137,7 +139,7 @@ public class OrganizationBatchGetTask { if(Objects.nonNull(old)){ log.info("该单位已经存在 :{}",old.getOrganizationName()); organizationGetSubs(dingOrgInfo.getOrganizationCode()); - employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(dingOrgInfo.getOrganizationCode()); +// employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(dingOrgInfo.getOrganizationCode()); continue; } @@ -156,7 +158,7 @@ public class OrganizationBatchGetTask { organization.setParentName(dingOrgInfo.getParentName()); if(iDingOrganizationService.save(organization)){ organizationGetSubs(organization.getOrganizationCode()); - employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(organization.getOrganizationCode()); +// employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(organization.getOrganizationCode()); } } diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/employee/EmployeeTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/employee/EmployeeTest.java index 0c63ef3..9168b03 100644 --- a/pmapi/src/test/java/com/ningdatech/pmapi/employee/EmployeeTest.java +++ b/pmapi/src/test/java/com/ningdatech/pmapi/employee/EmployeeTest.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ningdatech.pmapi.AppTests; import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.common.constant.RegionConst; +import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask; +import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask; import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; import com.ningdatech.pmapi.organization.model.entity.DingOrganization; import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; @@ -34,6 +36,12 @@ public class EmployeeTest extends AppTests { @Autowired private IUserInfoService userInfoService; + @Autowired + private OrganizationBatchGetTask organizationBatchGetTask; + + @Autowired + private EmployeeBatchGetTask employeeBatchGetTask; + @Test public void test(){ List employees = dingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) @@ -72,4 +80,17 @@ public class EmployeeTest extends AppTests { } } + @Test + public void test2(){ + String orgCode = "GO_4e6be07f25594df88e7bd1b7b7cdf9a8"; + organizationBatchGetTask.organizationGetSubs(orgCode); + } + + @Test + public void test3(){ + String orgCode = "GO_1aceac0b3a664afbb31ea0d627189781"; + employeeBatchGetTask.batchGetEmployeeTaskByOrdCode(orgCode); + } + + } From 67d46c2ede4ef5880feb4ae16effe855afd51211 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 7 Sep 2023 10:52:06 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E4=BB=B7=E6=A0=BC=20=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E6=98=AF=E7=9C=81=E7=BA=A7=E7=9A=84=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/gov/model/dto/GovBizProjectBaseinfoDTO.java | 3 +++ .../com/ningdatech/pmapi/gov/model/entity/GovBizProjectBaseinfo.java | 3 +++ .../com/ningdatech/pmapi/gov/model/vo/GovBizProjectBaseinfoVO.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/dto/GovBizProjectBaseinfoDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/dto/GovBizProjectBaseinfoDTO.java index a144226..61f9d61 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/dto/GovBizProjectBaseinfoDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/dto/GovBizProjectBaseinfoDTO.java @@ -55,6 +55,9 @@ public class GovBizProjectBaseinfoDTO implements Serializable { @ApiModelProperty("上级主管单位钉id") private String baseProvManDeprtDing; + @ApiModelProperty("是否省级 1省级 2非省级") + private Integer baseProvManDeprtType; + @ApiModelProperty("本级主管单位") private String baseManDeprt; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectBaseinfo.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectBaseinfo.java index a2a7b35..5eb207b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectBaseinfo.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectBaseinfo.java @@ -57,6 +57,9 @@ public class GovBizProjectBaseinfo implements Serializable { @ApiModelProperty("信息是否有效") private String isEffective; + @ApiModelProperty("是否省级 1省级 2非省级") + private Integer baseProvManDeprtType; + @ApiModelProperty("上级主管单位") private String baseProvManDeprt; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectBaseinfoVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectBaseinfoVO.java index 489c1f4..8733873 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectBaseinfoVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectBaseinfoVO.java @@ -51,6 +51,9 @@ public class GovBizProjectBaseinfoVO implements Serializable { @ApiModelProperty("信息是否有效") private String isEffective; + @ApiModelProperty("是否省级 1省级 2非省级") + private Integer baseProvManDeprtType; + @ApiModelProperty("上级主管单位") private String baseProvManDeprt; From 00f660d042c4c2e85a65b4bcadddd429a4c23f89 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 7 Sep 2023 11:51:17 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E8=B4=A2=E6=94=BF=E7=BC=96=E7=A0=81=20?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/fiscal/model/po/ReqCompanyFiscalCodeAndSealSnPO.java | 1 - 1 file changed, 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/fiscal/model/po/ReqCompanyFiscalCodeAndSealSnPO.java b/pmapi/src/main/java/com/ningdatech/pmapi/fiscal/model/po/ReqCompanyFiscalCodeAndSealSnPO.java index ff38f78..993abaa 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/fiscal/model/po/ReqCompanyFiscalCodeAndSealSnPO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/fiscal/model/po/ReqCompanyFiscalCodeAndSealSnPO.java @@ -18,7 +18,6 @@ public class ReqCompanyFiscalCodeAndSealSnPO { @ApiModelProperty("组织编码(需传入用户任职单位code)") private String organizationCode; - @NotBlank(message = "财政编码 不能为空") @ApiModelProperty("财政编码") private String fiscalCode; From 8dc2216cdc82bdae4bbdfcfe5c1eb0ce04b9bb17 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 7 Sep 2023 11:56:37 +0800 Subject: [PATCH 09/14] =?UTF-8?q?=E8=B4=A2=E6=94=BF=E7=BC=96=E7=A0=81=20?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/fiscal/model/po/ReqCompanyFiscalCodeAndSealSnPO.java | 1 - 1 file changed, 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/fiscal/model/po/ReqCompanyFiscalCodeAndSealSnPO.java b/pmapi/src/main/java/com/ningdatech/pmapi/fiscal/model/po/ReqCompanyFiscalCodeAndSealSnPO.java index ff38f78..993abaa 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/fiscal/model/po/ReqCompanyFiscalCodeAndSealSnPO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/fiscal/model/po/ReqCompanyFiscalCodeAndSealSnPO.java @@ -18,7 +18,6 @@ public class ReqCompanyFiscalCodeAndSealSnPO { @ApiModelProperty("组织编码(需传入用户任职单位code)") private String organizationCode; - @NotBlank(message = "财政编码 不能为空") @ApiModelProperty("财政编码") private String fiscalCode; From 549ac48f81260379f8d4311a55229d4238ec6d7a Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Thu, 7 Sep 2023 12:01:41 +0800 Subject: [PATCH 10/14] =?UTF-8?q?=E5=88=86=E6=94=AF=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/performance/manage/PerformanceAppraisalPlanManage.java | 1 - 1 file changed, 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java index 7c54e31..50e01df 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/PerformanceAppraisalPlanManage.java @@ -109,7 +109,6 @@ public class PerformanceAppraisalPlanManage { if(0L == page.getTotal()){ return PageVo.empty(); } - List paIds = page.getRecords().stream().map(PerformanceAppraisal::getId).collect(Collectors.toList()); List paps = performanceAppraisalProjectService.list(Wrappers.lambdaQuery(PerformanceAppraisalProject.class) .in(PerformanceAppraisalProject::getAppraisalId, paIds)); From 4045fa0e13a9697f8fd46c6f4df62272862b7fac Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 7 Sep 2023 12:13:55 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E8=B4=A2=E6=94=BF=E7=BC=96=E7=A0=81=20?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/common/config/BeanConfig.java | 2 +- .../pmapi/gov/manage/GovProjectCollectionManage.java | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java index f176489..daf2840 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java @@ -109,7 +109,7 @@ public class BeanConfig { .build(); } - @Bean + @Bean(value = "projectThreadPool") public ThreadPoolTaskExecutor getThreadPoolTaskExecutor(){ ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); threadPoolTaskExecutor.setCorePoolSize(5); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java index 74b12ee..248662d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java @@ -35,6 +35,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.poi.ss.formula.functions.T; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; @@ -45,6 +46,8 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; +import javax.annotation.Resource; +import javax.annotation.Resources; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; @@ -86,7 +89,8 @@ public class GovProjectCollectionManage { private final WpsConvertManage wpsConvertManage; - private final ThreadPoolTaskExecutor threadPoolTaskExecutor; + @Resource(name = "projectThreadPool") + private ThreadPoolTaskExecutor projectThreadPool; @Value("${project.push-url}") private String pushUrl; @@ -441,7 +445,7 @@ public class GovProjectCollectionManage { saveApply.setUpdateBy(user.getUsername()); saveApply.setUpdateOn(LocalDateTime.now()); if(projectApplyService.saveOrUpdate(saveApply)){ - threadPoolTaskExecutor.execute(() -> uploadFileToProvincialOssApply(apply,oldApply,saveApply)); + projectThreadPool.execute(() -> uploadFileToProvincialOssApply(apply,oldApply,saveApply)); } } @@ -466,7 +470,7 @@ public class GovProjectCollectionManage { saveApprove.setUpdateBy(user.getUsername()); saveApprove.setUpdateOn(LocalDateTime.now()); if(approveService.saveOrUpdate(saveApprove)){ - threadPoolTaskExecutor.execute(() -> uploadFileToProvincialOssApprove(approve,oldApprove,saveApprove)); + projectThreadPool.execute(() -> uploadFileToProvincialOssApprove(approve,oldApprove,saveApprove)); } } @@ -492,7 +496,7 @@ public class GovProjectCollectionManage { saveCimplement.setUpdateBy(user.getUsername()); saveCimplement.setUpdateOn(LocalDateTime.now()); if(cimplementService.saveOrUpdate(saveCimplement)){ - threadPoolTaskExecutor.execute(() -> uploadFileToProvincialOssCimplement(cimplement,oldCimplement,saveCimplement)); + projectThreadPool.execute(() -> uploadFileToProvincialOssCimplement(cimplement,oldCimplement,saveCimplement)); } } From 5301ec11e5502c00664e1a6a9a1e945cd4bc2680 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 7 Sep 2023 13:41:02 +0800 Subject: [PATCH 12/14] =?UTF-8?q?PDF=E8=BD=AC=E6=8D=A2=20=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E6=B1=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ningdatech/pmapi/common/config/BeanConfig.java | 11 ----------- .../com/ningdatech/pmapi/common/constant/RegionConst.java | 3 +-- .../pmapi/gov/manage/GovProjectCollectionManage.java | 11 ++++++----- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java index daf2840..d850df4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/config/BeanConfig.java @@ -108,15 +108,4 @@ public class BeanConfig { .setRetryHandler(new DefaultHttpRequestRetryHandler(2, true)) .build(); } - - @Bean(value = "projectThreadPool") - public ThreadPoolTaskExecutor getThreadPoolTaskExecutor(){ - ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); - threadPoolTaskExecutor.setCorePoolSize(5); - threadPoolTaskExecutor.setKeepAliveSeconds(200); - threadPoolTaskExecutor.setMaxPoolSize(10); - threadPoolTaskExecutor.setQueueCapacity(20); - threadPoolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); - return threadPoolTaskExecutor; - } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java index fecfab9..c9e327f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java @@ -24,13 +24,12 @@ public interface RegionConst { * 丽水行政区划编码 */ String RC_LS = "331100"; + //丽水开发区 String LS_KF = "331118"; String LS_KF_IRS = "331151"; String RC_LS_SBJ_IRS = "331101"; //遂昌县 String RC_SC = "331123"; - //丽水开发区 - String LS_KF = "331118"; String LS_KF_NAME = "开发区"; /** diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java index 248662d..e994689 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java @@ -42,6 +42,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; @@ -89,8 +90,8 @@ public class GovProjectCollectionManage { private final WpsConvertManage wpsConvertManage; - @Resource(name = "projectThreadPool") - private ThreadPoolTaskExecutor projectThreadPool; + @Resource + private ThreadPoolTaskScheduler threadPoolTaskScheduler; @Value("${project.push-url}") private String pushUrl; @@ -445,7 +446,7 @@ public class GovProjectCollectionManage { saveApply.setUpdateBy(user.getUsername()); saveApply.setUpdateOn(LocalDateTime.now()); if(projectApplyService.saveOrUpdate(saveApply)){ - projectThreadPool.execute(() -> uploadFileToProvincialOssApply(apply,oldApply,saveApply)); + threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssApply(apply,oldApply,saveApply)); } } @@ -470,7 +471,7 @@ public class GovProjectCollectionManage { saveApprove.setUpdateBy(user.getUsername()); saveApprove.setUpdateOn(LocalDateTime.now()); if(approveService.saveOrUpdate(saveApprove)){ - projectThreadPool.execute(() -> uploadFileToProvincialOssApprove(approve,oldApprove,saveApprove)); + threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssApprove(approve,oldApprove,saveApprove)); } } @@ -496,7 +497,7 @@ public class GovProjectCollectionManage { saveCimplement.setUpdateBy(user.getUsername()); saveCimplement.setUpdateOn(LocalDateTime.now()); if(cimplementService.saveOrUpdate(saveCimplement)){ - projectThreadPool.execute(() -> uploadFileToProvincialOssCimplement(cimplement,oldCimplement,saveCimplement)); + threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssCimplement(cimplement,oldCimplement,saveCimplement)); } } From 915878864b9cbcb1612d028350b31136244ad331 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 7 Sep 2023 15:07:40 +0800 Subject: [PATCH 13/14] =?UTF-8?q?PDF=E8=BD=AC=E6=8D=A2=20=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E6=B1=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/gov/convert/ProjectConvert.java | 163 +++++++++++++++++++++ .../gov/manage/GovProjectCollectionManage.java | 123 ++++++++++++---- .../pmapi/gov/model/entity/GovBizProjectDraft.java | 4 + .../gov/model/entity/GovBizProjectMimplement.java | 30 ++++ .../gov/model/entity/GovBizProjectProcure.java | 9 ++ .../pmapi/gov/model/vo/GovBizProjectApplyVO.java | 15 ++ .../pmapi/gov/model/vo/GovBizProjectApproveVO.java | 9 ++ .../gov/model/vo/GovBizProjectCimplementVO.java | 42 ++++++ .../gov/model/vo/GovBizProjectMimplementVO.java | 30 ++++ .../pmapi/gov/model/vo/GovBizProjectProcureVO.java | 9 ++ 10 files changed, 407 insertions(+), 27 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/convert/ProjectConvert.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/convert/ProjectConvert.java index 40c7ae2..d58fad1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/convert/ProjectConvert.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/convert/ProjectConvert.java @@ -6,6 +6,7 @@ import com.ningdatech.pmapi.gov.contants.BizProjectContant; import com.ningdatech.pmapi.gov.model.dto.*; import com.ningdatech.pmapi.gov.model.req.*; import com.ningdatech.pmapi.gov.model.vo.*; +import org.apache.commons.lang3.StringUtils; import java.util.Collections; import java.util.List; @@ -47,6 +48,17 @@ public class ProjectConvert { return req; } + public static ProjectPushReq convertWithConvertPdf(GovBizProjectDetailVO vo) { + ProjectPushReq req = new ProjectPushReq(); + req.setBaseinfo(convertBaseVo(vo.getBaseinfo(),BizProjectContant.EFFECTIVE_CODE)); + req.setApply(convertApplyVoWithConvertPdf(vo.getApply())); + req.setApprove(convertApproveVoWithConvertPdf(vo.getApprove())); + req.setCimplement(convertCimplementVoWithConvertPdf(vo.getCimplement())); + req.setMimplement(convertMimplementVoWithConvertPdf(vo.getMimplement())); + req.setProcures(convertProcuresVoWithConvertPdf(vo.getProcures())); + return req; + } + private static List convertProcures(List procures) { if(CollUtil.isEmpty(procures)){ return Collections.emptyList(); @@ -81,6 +93,26 @@ public class ProjectConvert { return req; } + private static List convertProcuresVoWithConvertPdf(List procures) { + if(CollUtil.isEmpty(procures)){ + return Collections.emptyList(); + } + + List req = procures.stream() + .map(p -> { + ProjectProcureReq r = BeanUtil.copyProperties(p, ProjectProcureReq.class); + r.setBiddingFile(StringUtils.isNotBlank(p.getBiddingFilePdf()) ? p.getBiddingFilePdf() : + p.getBiddingFile()); + r.setPurchaseFile(StringUtils.isNotBlank(p.getPurchaseFilePdf()) ? p.getPurchaseFilePdf() : + p.getPurchaseFile()); + r.setPurchaseContract(StringUtils.isNotBlank(p.getPurchaseContractPdf()) ? p.getPurchaseContractPdf() : + p.getPurchaseContract()); + return r; + }) + .collect(Collectors.toList()); + return req; + } + private static ProjectMimplementReq convertMimplement(GovBizProjectMimplementDTO mimplement) { ProjectMimplementReq req = BeanUtil.copyProperties(mimplement,ProjectMimplementReq.class); return req; @@ -91,6 +123,31 @@ public class ProjectConvert { return req; } + private static ProjectMimplementReq convertMimplementVoWithConvertPdf(GovBizProjectMimplementVO mimplement) { + ProjectMimplementReq req = BeanUtil.copyProperties(mimplement,ProjectMimplementReq.class); + req.setBaseUserConsFile(StringUtils.isNotBlank(mimplement.getBaseUserConsFilePdf()) ? mimplement.getBaseUserConsFilePdf() : + mimplement.getBaseUserConsFile()); + req.setBaseChanFile(StringUtils.isNotBlank(mimplement.getBaseChanFilePdf()) ? mimplement.getBaseChanFilePdf() : + mimplement.getBaseChanFile()); + req.setBasePasswAssessFile(StringUtils.isNotBlank(mimplement.getBasePasswAssessFilePdf()) ? mimplement.getBasePasswAssessFilePdf() : + mimplement.getBasePasswAssessFile()); + req.setBaseInforLevelFile(StringUtils.isNotBlank(mimplement.getBaseInforLevelFilePdf()) ? mimplement.getBaseInforLevelFilePdf() : + mimplement.getBaseInforLevelFile()); + req.setBaseEngineerPostpoFile(StringUtils.isNotBlank(mimplement.getBaseEngineerPostpoFilePdf()) ? mimplement.getBaseEngineerPostpoFilePdf() : + mimplement.getBaseEngineerPostpoFile()); + req.setBaseEstaSummFile(StringUtils.isNotBlank(mimplement.getBaseEstaSummFilePdf()) ? mimplement.getBaseEstaSummFilePdf() : + mimplement.getBaseEstaSummFile()); + req.setBaseFinalExpertOpinionFile(StringUtils.isNotBlank(mimplement.getBaseFinalExpertOpinionFilePdf()) ? mimplement.getBaseFinalExpertOpinionFilePdf() : + mimplement.getBaseFinalExpertOpinionFile()); + req.setBaseThirdAcceptFile(StringUtils.isNotBlank(mimplement.getBaseThirdAcceptFilePdf()) ? mimplement.getBaseThirdAcceptFilePdf() : + mimplement.getBaseThirdAcceptFile()); + req.setBaseOperatMaintenSummFile(StringUtils.isNotBlank(mimplement.getBaseOperatMaintenSummFilePdf()) ? mimplement.getBaseOperatMaintenSummFilePdf() : + mimplement.getBaseOperatMaintenSummFile()); + req.setBaseEngineerAlterFile(StringUtils.isNotBlank(mimplement.getBaseEngineerAlterFilePdf()) ? mimplement.getBaseEngineerAlterFilePdf() : + mimplement.getBaseEngineerAlterFile()); + return req; + } + public static ProjectCimplementReq convertCimplement(GovBizProjectCimplementDTO cimplement) { ProjectCimplementReq req = BeanUtil.copyProperties(cimplement,ProjectCimplementReq.class); return req; @@ -101,6 +158,39 @@ public class ProjectConvert { return req; } + public static ProjectCimplementReq convertCimplementVoWithConvertPdf(GovBizProjectCimplementVO cimplement) { + ProjectCimplementReq req = BeanUtil.copyProperties(cimplement,ProjectCimplementReq.class); + req.setBaseChangeFormFile(StringUtils.isNotBlank(cimplement.getBaseChangeFormFilePdf()) ? cimplement.getBaseChangeFormFilePdf() : + cimplement.getBaseChangeFormFile()); + req.setBaseUserConsFile(StringUtils.isNotBlank(cimplement.getBaseUserConsFilePdf()) ? cimplement.getBaseUserConsFilePdf() : + cimplement.getBaseUserConsFile()); + req.setBaseCheckFile(StringUtils.isNotBlank(cimplement.getBaseCheckFilePdf()) ? cimplement.getBaseCheckFilePdf() : + cimplement.getBaseCheckFile()); + req.setBaseChanFile(StringUtils.isNotBlank(cimplement.getBaseChanFilePdf()) ? cimplement.getBaseChanFilePdf() : + cimplement.getBaseChanFile()); + req.setBaseSummReportFile(StringUtils.isNotBlank(cimplement.getBaseSummReportFilePdf()) ? cimplement.getBaseSummReportFilePdf() : + cimplement.getBaseSummReportFile()); + req.setBasePasswAssessFile(StringUtils.isNotBlank(cimplement.getBasePasswAssessFilePdf()) ? cimplement.getBasePasswAssessFilePdf() : + cimplement.getBasePasswAssessFile()); + req.setBaseInforLevelFile(StringUtils.isNotBlank(cimplement.getBaseInforLevelFilePdf()) ? cimplement.getBaseInforLevelFilePdf() : + cimplement.getBaseInforLevelFile()); + req.setBaseEngineerPostpoFile(StringUtils.isNotBlank(cimplement.getBaseEngineerPostpoFilePdf()) ? cimplement.getBaseEngineerPostpoFilePdf() : + cimplement.getBaseEngineerPostpoFile()); + req.setBaseEstaSummFile(StringUtils.isNotBlank(cimplement.getBaseEstaSummFilePdf()) ? cimplement.getBaseEstaSummFilePdf() : + cimplement.getBaseEstaSummFile()); + req.setBaseFinanlAuditFile(StringUtils.isNotBlank(cimplement.getBaseFinanlAuditFilePdf()) ? cimplement.getBaseFinanlAuditFilePdf() : + cimplement.getBaseFinanlAuditFile()); + req.setBaseFinalExpertOpinionFile(StringUtils.isNotBlank(cimplement.getBaseFinalExpertOpinionFilePdf()) ? cimplement.getBaseFinalExpertOpinionFilePdf() : + cimplement.getBaseFinalExpertOpinionFile()); + req.setBaseThirdAcceptFile(StringUtils.isNotBlank(cimplement.getBaseThirdAcceptFilePdf()) ? cimplement.getBaseThirdAcceptFilePdf() : + cimplement.getBaseThirdAcceptFile()); + req.setBaseInitialOpinionFile(StringUtils.isNotBlank(cimplement.getBaseInitialOpinionFilePdf()) ? cimplement.getBaseInitialOpinionFilePdf() : + cimplement.getBaseInitialOpinionFile()); + req.setBaseIrsTestRunFile(StringUtils.isNotBlank(cimplement.getBaseIrsTestRunFilePdf()) ? cimplement.getBaseIrsTestRunFilePdf() : + cimplement.getBaseIrsTestRunFile()); + return req; + } + public static ProjectApproveReq convertApprove(GovBizProjectApproveDTO approve) { ProjectApproveReq req = new ProjectApproveReq(); if(Objects.isNull(approve)){ @@ -151,6 +241,34 @@ public class ProjectConvert { return req; } + public static ProjectApproveReq convertApproveVoWithConvertPdf(GovBizProjectApproveVO approve) { + ProjectApproveReq req = new ProjectApproveReq(); + if(Objects.isNull(approve)){ + return req; + } + req.setBaseProjId(approve.getBaseProjId()); + req.setBaseProjName(approve.getBaseProjName()); + req.setOp(approve.getOp()); + req.setApprovalFile(StringUtils.isNotBlank(approve.getApprovalFilePdf()) ? approve.getApprovalFilePdf() : + approve.getApprovalFile()); + req.setBaseReviewCommentsFile(StringUtils.isNotBlank(approve.getBaseReviewCommentsFilePdf()) ? approve.getBaseReviewCommentsFilePdf(): + approve.getBaseReviewCommentsFile()); + req.setPreliminaryDesignFile(StringUtils.isNotBlank(approve.getPreliminaryDesignFilePdf()) ? approve.getPreliminaryDesignFilePdf() : + approve.getPreliminaryDesignFile()); + req.setAreaCode(approve.getAreaCode()); + req.setBaseDevelopCode(approve.getBaseDevelopCode()); + req.setBaseExpertTotalMoney(String.valueOf(approve.getBaseExpertTotalMoney())); + req.setBaseExpertYearMoney(String.valueOf(approve.getBaseExpertYearMoney())); + req.setReleaseYearMoney(String.valueOf(approve.getReleaseYearMoney())); + req.setBaseInitialReviewTotalMoney(String.valueOf(approve.getBaseInitialReviewTotalMoney())); + req.setBaseReviewOpinion(approve.getBaseReviewOpinion()); + req.setBaseReviewResults(approve.getBaseReviewResults()); + req.setEqualProtectionLevel(approve.getEqualProtectionLevel()); + req.setPreliminaryDesignScheme(approve.getPreliminaryDesignScheme()); + req.setSetProjCodeFinan(approve.getSetProjCodeFinan()); + return req; + } + public static ProjectApplyReq convertApply(GovBizProjectApplyDTO apply) { ProjectApplyReq req = new ProjectApplyReq(); if(Objects.isNull(apply)){ @@ -231,6 +349,51 @@ public class ProjectConvert { return req; } + public static ProjectApplyReq convertApplyVoWithConvertPdf(GovBizProjectApplyVO apply) { + ProjectApplyReq req = new ProjectApplyReq(); + if(Objects.isNull(apply)){ + return req; + } + req.setOp(apply.getOp()); + req.setBaseProjId(apply.getBaseProjId()); + req.setBaseProjName(apply.getBaseProjName()); + req.setAreaCode(apply.getAreaCode()); + req.setBaseAccountAppName(apply.getBaseAccountAppName()); + req.setBaseBasisEstablish(apply.getBaseBasisEstablish()); + req.setBaseCoreBusiness(apply.getBaseCoreBusiness()); + req.setBaseCoreBusinessCode(apply.getBaseCoreBusinessCode()); + req.setBaseBrainName(apply.getBaseBrainName()); + req.setBaseDevelopCode(apply.getBaseDevelopCode()); + req.setBaseLowestLevel(apply.getBaseLowestLevel()); + req.setBaseHistorProjId(apply.getBaseHistorProjId()); + req.setBaseHistorProjName(apply.getBaseHistorProjName()); + req.setBaseOperatMaintenFile(StringUtils.isNotBlank(apply.getBaseOperatMaintenFilePdf()) ? apply.getBaseOperatMaintenFilePdf() : + apply.getBaseOperatMaintenFile()); + req.setBaseProjApplyFile(StringUtils.isNotBlank(apply.getBaseProjApplyFilePdf()) ? apply.getBaseProjApplyFilePdf() : + apply.getBaseProjApplyFile()); + req.setBaseProjBasisFile(StringUtils.isNotBlank(apply.getBaseProjBasisFilePdf()) ? apply.getBaseProjBasisFilePdf() : + apply.getBaseProjBasisFile()); + req.setBaseProjOtherFile(StringUtils.isNotBlank(apply.getBaseProjOtherFilePdf()) ? apply.getBaseProjOtherFilePdf() : + apply.getBaseProjOtherFile()); + req.setBaseResearchReportFile(StringUtils.isNotBlank(apply.getBaseResearchReportFilePdf()) ? apply.getBaseResearchReportFilePdf() : + apply.getBaseResearchReportFile()); + req.setBaseProjConsClass(apply.getBaseProjConsClass()); + req.setBaseProjDuration(String.valueOf(apply.getBaseProjDuration())); + req.setBaseProjIntro(apply.getBaseProjIntro()); + req.setBaseProjStartTime(String.valueOf(apply.getBaseProjStartTime())); + req.setBaseProjEndTime(String.valueOf(apply.getBaseProjEndTime())); + req.setBaseProjSetYear(apply.getBaseProjSetYear()); + req.setBaseProjSys(apply.getBaseProjSys()); + req.setBaseProjSysCode(apply.getBaseDevelopCode()); + req.setBaseProjDeclAmount(String.valueOf(apply.getBaseProjDeclAmount())); + req.setBaseProjTotalAmount(String.valueOf(apply.getBaseProjTotalAmount())); + req.setBaseBasisAmountOri(apply.getBaseBasisAmountOri()); + req.setBaseProjAmountOri(apply.getBaseProjAmountOri()); + req.setBaseProjRemark(apply.getBaseProjRemark()); + req.setBeseExpectedResults(apply.getBeseExpectedResults()); + return req; + } + public static ProjectBaseInfoReq convertBase(GovBizProjectBaseinfoDTO baseinfo,String isEffective) { ProjectBaseInfoReq req = BeanUtil.copyProperties(baseinfo,ProjectBaseInfoReq.class); req.setIsEffective(isEffective); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java index e994689..4505ef1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/manage/GovProjectCollectionManage.java @@ -31,24 +31,19 @@ import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum; import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; import com.ningdatech.pmapi.user.util.LoginUserUtil; import com.ningdatech.pmapi.wps.manage.WpsConvertManage; +import io.swagger.annotations.ApiModelProperty; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.formula.functions.T; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; - -import javax.annotation.Resource; -import javax.annotation.Resources; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; @@ -90,8 +85,7 @@ public class GovProjectCollectionManage { private final WpsConvertManage wpsConvertManage; - @Resource - private ThreadPoolTaskScheduler threadPoolTaskScheduler; + private final ThreadPoolTaskScheduler threadPoolTaskScheduler; @Value("${project.push-url}") private String pushUrl; @@ -526,31 +520,40 @@ public class GovProjectCollectionManage { saveMimplement.setBizTime(LocalDateTime.now()); saveMimplement.setUpdateBy(user.getUsername()); saveMimplement.setUpdateOn(LocalDateTime.now()); - mimplementService.saveOrUpdate(saveMimplement); + if(mimplementService.saveOrUpdate(saveMimplement)){ + threadPoolTaskScheduler.execute(() -> uploadFileToProvincialOssMimplement(mimplement,oldMimplement,saveMimplement)); + } } // 6.保存 采购信息 List procures = saveDTO.getProcures(); - Integer index = 1; + if(Objects.nonNull(procures)){ procureService.remove(Wrappers.lambdaQuery(GovBizProjectProcure.class) .eq(GovBizProjectProcure::getBaseProjId,baseProjId)); - for(GovBizProjectProcureDTO procure : procures){ - procure.setBaseProjId(baseProjId); - procure.setBaseProjName(baseProjName); - procure.setBaseBidCode(baseProjId + StrPool.DASH + index); - - GovBizProjectProcure saveProcure = BeanUtil.copyProperties(procure,GovBizProjectProcure.class); - saveProcure.setBaseProjId(baseProjId); - saveProcure.setId(null); - saveProcure.setAreaCode(RegionConst.RC_LS); - saveProcure.setTongTime(LocalDateTime.now()); - saveProcure.setBizTime(LocalDateTime.now()); - saveProcure.setUpdateBy(user.getUsername()); - saveProcure.setUpdateOn(LocalDateTime.now()); - procureService.save(saveProcure); - index++; - } + + String finalBaseProjId = baseProjId; + UserInfoDetails finalUser = user; + threadPoolTaskScheduler.execute(() -> { + Integer index = 1; + for(GovBizProjectProcureDTO procure : procures){ + procure.setBaseProjId(finalBaseProjId); + procure.setBaseProjName(baseProjName); + procure.setBaseBidCode(finalBaseProjId + StrPool.DASH + index); + GovBizProjectProcure saveProcure = BeanUtil.copyProperties(procure,GovBizProjectProcure.class); + saveProcure.setBaseProjId(finalBaseProjId); + saveProcure.setId(null); + saveProcure.setAreaCode(RegionConst.RC_LS); + saveProcure.setTongTime(LocalDateTime.now()); + saveProcure.setBizTime(LocalDateTime.now()); + saveProcure.setUpdateBy(finalUser.getUsername()); + saveProcure.setUpdateOn(LocalDateTime.now()); + if(procureService.save(saveProcure)){ + uploadFileToProvincialOssProcure(procure,null,saveProcure); + } + index++; + } + }); } //7. 推送数据(改为定时推送了) @@ -756,7 +759,7 @@ public class GovProjectCollectionManage { } public void pushProjectVo(GovBizProjectDetailVO vo) { String url = pushUrl; - ProjectPushReq req = ProjectConvert.convert(vo); + ProjectPushReq req = ProjectConvert.convertWithConvertPdf(vo); try{ log.info("推送消息体 {} ,{},{}",vo.getBaseProjId(),url, JSON.toJSONString(req)); HttpHeaders headers = new HttpHeaders(); @@ -919,6 +922,72 @@ public class GovProjectCollectionManage { cimplementService.updateById(saveCimplement); } + private void uploadFileToProvincialOssMimplement(GovBizProjectMimplementDTO mimplement, GovBizProjectMimplement oldMimplement, GovBizProjectMimplement saveMimplement) { + if(checkFieldHas(mimplement.getBaseChanFile(),oldMimplement,"baseChanFile")){ + StringJoiner sj = convertAndUpload(mimplement.getBaseChanFile()); + saveMimplement.setBaseChanFilePdf(sj.toString()); + } + if(checkFieldHas(mimplement.getBaseInforLevelFile(),oldMimplement,"baseInforLevelFile")){ + StringJoiner sj = convertAndUpload(mimplement.getBaseInforLevelFile()); + saveMimplement.setBaseInforLevelFilePdf(sj.toString()); + } + if(checkFieldHas(mimplement.getBasePasswAssessFile(),oldMimplement,"basePasswAssessFile")){ + StringJoiner sj = convertAndUpload(mimplement.getBasePasswAssessFile()); + saveMimplement.setBasePasswAssessFilePdf(sj.toString()); + } + if(checkFieldHas(mimplement.getBaseThirdAcceptFile(),oldMimplement,"baseThirdAcceptFile")){ + StringJoiner sj = convertAndUpload(mimplement.getBaseThirdAcceptFile()); + saveMimplement.setBaseThirdAcceptFilePdf(sj.toString()); + } + if(checkFieldHas(mimplement.getBaseEstaSummFile(),oldMimplement,"baseEstaSummFile")){ + StringJoiner sj = convertAndUpload(mimplement.getBaseEstaSummFile()); + saveMimplement.setBaseEstaSummFilePdf(sj.toString()); + } + if(checkFieldHas(mimplement.getBaseUserConsFile(),oldMimplement,"baseUserConsFile")){ + StringJoiner sj = convertAndUpload(mimplement.getBaseUserConsFile()); + saveMimplement.setBaseUserConsFilePdf(sj.toString()); + } + if(checkFieldHas(mimplement.getBaseOperatMaintenSummFile(),oldMimplement,"baseOperatMaintenSummFile")){ + StringJoiner sj = convertAndUpload(mimplement.getBaseOperatMaintenSummFile()); + saveMimplement.setBaseOperatMaintenSummFilePdf(sj.toString()); + } + if(checkFieldHas(mimplement.getBaseFinalExpertOpinionFile(),oldMimplement,"baseFinalExpertOpinionFile")){ + StringJoiner sj = convertAndUpload(mimplement.getBaseFinalExpertOpinionFile()); + saveMimplement.setBaseFinalExpertOpinionFilePdf(sj.toString()); + } + if(checkFieldHas(mimplement.getBaseEngineerPostpoFile(),oldMimplement,"baseEngineerPostpoFile")){ + StringJoiner sj = convertAndUpload(mimplement.getBaseEngineerPostpoFile()); + saveMimplement.setBaseEngineerPostpoFilePdf(sj.toString()); + } + if(checkFieldHas(mimplement.getBaseEngineerAlterFile(),oldMimplement,"baseEngineerAlterFile")){ + StringJoiner sj = convertAndUpload(mimplement.getBaseEngineerAlterFile()); + saveMimplement.setBaseEngineerAlterFilePdf(sj.toString()); + } + mimplementService.updateById(saveMimplement); + } + + /** + * 采购文件处理 + * @param procure + * @param o + * @param saveProcure + */ + private void uploadFileToProvincialOssProcure(GovBizProjectProcureDTO procure, Object o, GovBizProjectProcure saveProcure) { + if(checkFieldHas(procure.getPurchaseFile(),o,"purchaseFile")){ + StringJoiner sj = convertAndUpload(procure.getPurchaseFile()); + saveProcure.setPurchaseFilePdf(sj.toString()); + } + if(checkFieldHas(procure.getBiddingFile(),o,"biddingFile")){ + StringJoiner sj = convertAndUpload(procure.getBiddingFile()); + saveProcure.setBiddingFilePdf(sj.toString()); + } + if(checkFieldHas(procure.getPurchaseContract(),o,"purchaseContract")){ + StringJoiner sj = convertAndUpload(procure.getPurchaseContract()); + saveProcure.setPurchaseContractPdf(sj.toString()); + } + procureService.updateById(saveProcure); + } + private StringJoiner convertAndUpload(String baseProjBasisFile) { String[] baseProjBasisFileArr = baseProjBasisFile.split(";"); StringJoiner sj = new StringJoiner(";"); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectDraft.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectDraft.java index e1d0af8..880c06b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectDraft.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectDraft.java @@ -34,6 +34,10 @@ public class GovBizProjectDraft implements Serializable { private String baseConstructionType; private String baseProjSetProg; private String isEffective; + + @ApiModelProperty("是否省级 1省级 2非省级") + private Integer baseProvManDeprtType; + private String baseProvManDeprt; private String baseProvManDeprtDing; private String baseManDeprt; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectMimplement.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectMimplement.java index 8b25046..24ff394 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectMimplement.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectMimplement.java @@ -103,4 +103,34 @@ public class GovBizProjectMimplement implements Serializable { @ApiModelProperty("最后修改人") private String updateBy; + + @ApiModelProperty("信息安全等级保护测评报告PDF") + private String baseInforLevelFilePdf; + + @ApiModelProperty("商业密码应用评估报告PDF") + private String basePasswAssessFilePdf; + + @ApiModelProperty("第三方验收测试报告PDF") + private String baseThirdAcceptFilePdf; + + @ApiModelProperty("用户使用报告PDF") + private String baseUserConsFilePdf; + + @ApiModelProperty("监理总结报告PDF") + private String baseEstaSummFilePdf; + + @ApiModelProperty("运维总结报告PDF") + private String baseOperatMaintenSummFilePdf; + + @ApiModelProperty("终审意见PDF") + private String baseFinalExpertOpinionFilePdf; + + @ApiModelProperty("项目延期申请表PDF") + private String baseEngineerPostpoFilePdf; + + @ApiModelProperty("变更报告PDF") + private String baseEngineerAlterFilePdf; + + @ApiModelProperty("变更批复文件PDF") + private String baseChanFilePdf; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectProcure.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectProcure.java index a87f7c9..286a3e9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectProcure.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/entity/GovBizProjectProcure.java @@ -104,4 +104,13 @@ public class GovBizProjectProcure implements Serializable { @ApiModelProperty("最后修改人") private String updateBy; + + @ApiModelProperty("招标(采购)文件PDF") + private String purchaseFilePdf; + + @ApiModelProperty("采购合同PDF") + private String purchaseContractPdf; + + @ApiModelProperty("中标(成交)通知书PDF") + private String biddingFilePdf; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectApplyVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectApplyVO.java index 9010530..de11b72 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectApplyVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectApplyVO.java @@ -144,4 +144,19 @@ public class GovBizProjectApplyVO implements Serializable { @ApiModelProperty("最后修改人") private String updateBy; + + @ApiModelProperty("立项依据材料PDF版") + private String baseProjBasisFilePdf; + + @ApiModelProperty("项目申报书PDF版") + private String baseProjApplyFilePdf; + + @ApiModelProperty("运维方案PDF版") + private String baseOperatMaintenFilePdf; + + @ApiModelProperty("可研报告PDF版") + private String baseResearchReportFilePdf; + + @ApiModelProperty("其它文件PDF版") + private String baseProjOtherFilePdf; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectApproveVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectApproveVO.java index 1b93930..bc5b792 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectApproveVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectApproveVO.java @@ -94,4 +94,13 @@ public class GovBizProjectApproveVO implements Serializable { @ApiModelProperty("最后修改人") private String updateBy; + + @ApiModelProperty("立项批复文件") + private String approvalFilePdf; + + @ApiModelProperty("评审意见附件PDF") + private String baseReviewCommentsFilePdf; + + @ApiModelProperty("初步设计方案批复函PDF") + private String preliminaryDesignFilePdf; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectCimplementVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectCimplementVO.java index 9a07ef9..a30af3b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectCimplementVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectCimplementVO.java @@ -110,4 +110,46 @@ public class GovBizProjectCimplementVO implements Serializable { @ApiModelProperty("最后修改人") private String updateBy; + + @ApiModelProperty("生产批复文件PDF") + private String baseChanFilePdf; + + @ApiModelProperty("初验意见PDF") + private String baseInitialOpinionFilePdf; + + @ApiModelProperty("信息安全等级保护测评报告PDF") + private String baseInforLevelFilePdf; + + @ApiModelProperty("'商业密码应用评估报告'") + private String basePasswAssessFilePdf; + + @ApiModelProperty("第三方验收测试报告PDF") + private String baseThirdAcceptFilePdf; + + @ApiModelProperty("建设核查表PDF") + private String baseCheckFilePdf; + + @ApiModelProperty("财务审计报告PDF") + private String baseFinanlAuditFilePdf; + + @ApiModelProperty("用户使用报告PDF") + private String baseUserConsFilePdf; + + @ApiModelProperty("监理总结报告PDF") + private String baseEstaSummFilePdf; + + @ApiModelProperty("IRS应用试运行报告PDF") + private String baseIrsTestRunFilePdf; + + @ApiModelProperty("项目总结报告PDF") + private String baseSummReportFilePdf; + + @ApiModelProperty("终审意见PDF") + private String baseFinalExpertOpinionFilePdf; + + @ApiModelProperty("项目延期申请表PDF") + private String baseEngineerPostpoFilePdf; + + @ApiModelProperty("变更申请单PDF") + private String baseChangeFormFilePdf; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectMimplementVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectMimplementVO.java index 3676b42..12453b7 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectMimplementVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectMimplementVO.java @@ -98,4 +98,34 @@ public class GovBizProjectMimplementVO implements Serializable { @ApiModelProperty("最后修改人") private String updateBy; + + @ApiModelProperty("信息安全等级保护测评报告PDF") + private String baseInforLevelFilePdf; + + @ApiModelProperty("商业密码应用评估报告PDF") + private String basePasswAssessFilePdf; + + @ApiModelProperty("第三方验收测试报告PDF") + private String baseThirdAcceptFilePdf; + + @ApiModelProperty("用户使用报告PDF") + private String baseUserConsFilePdf; + + @ApiModelProperty("监理总结报告PDF") + private String baseEstaSummFilePdf; + + @ApiModelProperty("运维总结报告PDF") + private String baseOperatMaintenSummFilePdf; + + @ApiModelProperty("终审意见PDF") + private String baseFinalExpertOpinionFilePdf; + + @ApiModelProperty("项目延期申请表PDF") + private String baseEngineerPostpoFilePdf; + + @ApiModelProperty("变更报告PDF") + private String baseEngineerAlterFilePdf; + + @ApiModelProperty("变更批复文件PDF") + private String baseChanFilePdf; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectProcureVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectProcureVO.java index 9ff4798..fd90509 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectProcureVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/model/vo/GovBizProjectProcureVO.java @@ -99,4 +99,13 @@ public class GovBizProjectProcureVO implements Serializable { @ApiModelProperty("最后修改人") private String updateBy; + + @ApiModelProperty("招标(采购)文件PDF") + private String purchaseFilePdf; + + @ApiModelProperty("采购合同PDF") + private String purchaseContractPdf; + + @ApiModelProperty("中标(成交)通知书PDF") + private String biddingFilePdf; } From cc8e411de685d03d3646a4297401706a8a6f5fb6 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 7 Sep 2023 15:19:40 +0800 Subject: [PATCH 14/14] =?UTF-8?q?PDF=E8=BD=AC=E6=8D=A2=20=E5=90=8E=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projectCollection/ProjectCollectionTest.java | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollectionTest.java diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollectionTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollectionTest.java new file mode 100644 index 0000000..e4c5398 --- /dev/null +++ b/pmapi/src/test/java/com/ningdatech/pmapi/projectCollection/ProjectCollectionTest.java @@ -0,0 +1,75 @@ +package com.ningdatech.pmapi.projectCollection; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.pmapi.AppTests; +import com.ningdatech.pmapi.gov.model.dto.GovBizProjectApplyDTO; +import com.ningdatech.pmapi.gov.model.dto.GovBizProjectBaseinfoDTO; +import com.ningdatech.pmapi.gov.model.dto.GovBizProjectSaveDTO; +import com.ningdatech.pmapi.gov.model.entity.*; +import com.ningdatech.pmapi.gov.service.*; +import com.ningdatech.pmapi.projectdeclared.utils.GenerateProjectCodeUtil; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Classname ProjectCollectionTest + * @Description + * @Date 2023/9/7 15:08 + * @Author PoffyZhang + */ +public class ProjectCollectionTest extends AppTests { + + @Autowired + private IGovBizProjectBaseinfoService baseinfoService; + + @Autowired + private IGovBizProjectApplyService applyService; + + @Autowired + private IGovBizProjectApproveService approveService; + + @Autowired + private IGovBizProjectCimplementService cimplementService; + + @Autowired + private IGovBizProjectMimplementService mimplementService; + + @Autowired + private IGovBizProjectProcureService procureService; + + @Autowired + private GenerateProjectCodeUtil generateProjectCodeUtil; + + @Test + public void test(){ + String baseProjId = "33112500020210100003"; + GovBizProjectBaseinfo baseinfo = baseinfoService.getOne(Wrappers.lambdaQuery(GovBizProjectBaseinfo.class) + .eq(GovBizProjectBaseinfo::getBaseProjId, baseProjId)); + GovBizProjectApply apply = applyService.getOne(Wrappers.lambdaQuery(GovBizProjectApply.class) + .eq(GovBizProjectApply::getBaseProjId, baseProjId)); + + GovBizProjectSaveDTO saveDTO = new GovBizProjectSaveDTO(); + saveDTO.setApply(BeanUtil.copyProperties(apply, GovBizProjectApplyDTO.class)); + saveDTO.setBaseinfo(BeanUtil.copyProperties(baseinfo, GovBizProjectBaseinfoDTO.class)); + String newProjId = generateProjectCodeUtil.generateProjectCode(saveDTO); + + baseinfo.setBaseProjId(newProjId); + baseinfoService.updateById(baseinfo); + apply.setBaseProjId(newProjId); + applyService.updateById(apply); + approveService.update(Wrappers.lambdaUpdate(GovBizProjectApprove.class) + .eq(GovBizProjectApprove::getBaseProjId,baseProjId) + .set(GovBizProjectApprove::getBaseProjId,newProjId)); + cimplementService.update(Wrappers.lambdaUpdate(GovBizProjectCimplement.class) + .eq(GovBizProjectCimplement::getBaseProjId,baseProjId) + .set(GovBizProjectCimplement::getBaseProjId,newProjId)); + mimplementService.update(Wrappers.lambdaUpdate(GovBizProjectMimplement.class) + .eq(GovBizProjectMimplement::getBaseProjId,baseProjId) + .set(GovBizProjectMimplement::getBaseProjId,newProjId)); + procureService.update(Wrappers.lambdaUpdate(GovBizProjectProcure.class) + .eq(GovBizProjectProcure::getBaseProjId,baseProjId) + .set(GovBizProjectProcure::getBaseProjId,newProjId)); + } + +}