From 1828a08d25a580715881c2e3a7c48ebeb791735a Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 8 Jun 2023 18:13:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?debug=20=E4=B8=BB=E7=AE=A1=E5=8D=95?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/ding/task/EmployeeBatchGetTask.java | 1 + .../manage/DeclaredProjectManage.java | 2 +- .../manage/DefaultDeclaredProjectManage.java | 6 +- .../java/com/ningdatech/pmapi/org/OrgTest.java | 51 +++++ .../com/ningdatech/pmapi/region/RegionTest.java | 35 ++++ pmapi/src/test/resources/application-dev.yml | 18 +- pmapi/src/test/resources/application-prod.yml | 215 +++++++++++++++++++++ pmapi/src/test/resources/wsdl-prod.xml | 120 ++++++++++++ 8 files changed, 439 insertions(+), 9 deletions(-) create mode 100644 pmapi/src/test/java/com/ningdatech/pmapi/org/OrgTest.java create mode 100644 pmapi/src/test/java/com/ningdatech/pmapi/region/RegionTest.java create mode 100644 pmapi/src/test/resources/wsdl-prod.xml 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 de061ae..bca3948 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 @@ -331,6 +331,7 @@ public class EmployeeBatchGetTask { // 批量保存用户信息 saveBatch(dingEmployeeInfoSaveRecordList); } + log.info("员工同步完成"); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index 7de0409..67927b5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -214,7 +214,7 @@ public class DeclaredProjectManage { WflowModels model = processModelService.getOne(Wrappers.lambdaQuery(WflowModels.class) .eq(WflowModels::getRegionCode, regionCode) .eq(WflowModels::getProcessType, ProjectProcessStageEnum.ORG_INTERNAL_APPROVAL_PROCESS.getCode()) - .last("limit 1")); + .last(BizConst.LIMIT_1)); if (Objects.isNull(model)) { log.error("此 【{}】区域找不到单位流程配置", regionCode); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java index 4ab4823..142e3f5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DefaultDeclaredProjectManage.java @@ -7,6 +7,7 @@ import com.google.common.collect.Maps; import com.ningdatech.basic.function.VUtils; import com.ningdatech.pmapi.common.constant.BizConst; import com.ningdatech.pmapi.common.constant.RegionConst; +import com.ningdatech.pmapi.common.enumeration.CommonEnum; import com.ningdatech.pmapi.common.enumeration.ProjectProcessStageEnum; import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.projectdeclared.model.dto.DefaultDeclaredDTO; @@ -162,7 +163,7 @@ public class DefaultDeclaredProjectManage { String startOrgParentCode; String startOrgParentName; // 如果申报时 上级主管单位,由该单位自己审核 - if (Objects.isNull(project.getSuperOrgCode())){ + if (CommonEnum.NO.getCode().equals(project.getIsSuperOrg())){ startOrgParentCode = startOrgCode; startOrgParentName = startOrgName; }else { @@ -201,7 +202,8 @@ public class DefaultDeclaredProjectManage { orgMap.put(OrgTypeEnum.TARGET_LABEL.name(),orgInfoDTO); //如果有上级条线主管单位 并且 不是市本级 - if(!RegionConst.RC_LS.equals(project.getAreaCode())){ + if(!RegionConst.RC_LS.equals(project.getAreaCode()) && + CommonEnum.YES.getCode().equals(project.getIsHigherSuperOrg())){ OrgInfoDTO parentLineOrgInfoDto = new OrgInfoDTO(); parentLineOrgInfoDto.setOrganizationCode(project.getHigherSuperOrgCode()); parentLineOrgInfoDto.setOrganizationName(project.getHigherSuperOrg()); diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/org/OrgTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/org/OrgTest.java new file mode 100644 index 0000000..2a5775e --- /dev/null +++ b/pmapi/src/test/java/com/ningdatech/pmapi/org/OrgTest.java @@ -0,0 +1,51 @@ +package com.ningdatech.pmapi.org; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ningdatech.pmapi.AppTests; +import com.ningdatech.pmapi.organization.model.entity.DingOrganization; +import com.ningdatech.pmapi.organization.service.IDingOrganizationService; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; +import java.util.List; + +/** + * @Classname RegionTest + * @Description + * @Date 2023/6/8 14:44 + * @Author PoffyZhang + */ +public class OrgTest extends AppTests { + + @Autowired + private IDingOrganizationService organizationService; + + @Test + public void test(){ + List orgs = organizationService.list(Wrappers.lambdaQuery(DingOrganization.class) + .eq(DingOrganization::getDivisionCode, "331199")); + + for(DingOrganization org : orgs){ + List inners = organizationService.list(Wrappers.lambdaQuery(DingOrganization.class) + .eq(DingOrganization::getParentCode, org.getOrganizationCode())); + for(DingOrganization inner : inners){ + mergeRegionCode(inner); + } + } + } + + private void mergeRegionCode(DingOrganization inner) { + inner.setDivisionCode("331199"); + organizationService.updateById(inner); + + List is = organizationService.list(Wrappers.lambdaQuery(DingOrganization.class) + .eq(DingOrganization::getParentCode, inner.getOrganizationCode())); + if(CollUtil.isEmpty(is)){ + return; + } + for(DingOrganization i : is){ + mergeRegionCode(i); + } + } + +} diff --git a/pmapi/src/test/java/com/ningdatech/pmapi/region/RegionTest.java b/pmapi/src/test/java/com/ningdatech/pmapi/region/RegionTest.java new file mode 100644 index 0000000..9f42309 --- /dev/null +++ b/pmapi/src/test/java/com/ningdatech/pmapi/region/RegionTest.java @@ -0,0 +1,35 @@ +package com.ningdatech.pmapi.region; + +import com.ningdatech.pmapi.AppTests; +import com.ningdatech.pmapi.sys.model.entity.Region; +import com.ningdatech.pmapi.sys.service.IRegionService; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * @Classname RegionTest + * @Description + * @Date 2023/6/8 14:44 + * @Author PoffyZhang + */ +public class RegionTest extends AppTests { + + @Autowired + private IRegionService regionService; + + @Test + public void test(){ + Set set = regionService.list().stream().collect(Collectors.toSet()); + + Set ids = set.stream().map(Region::getId).collect(Collectors.toSet()); + + regionService.removeByIds(ids); + + regionService.saveBatch(set); + } + +} diff --git a/pmapi/src/test/resources/application-dev.yml b/pmapi/src/test/resources/application-dev.yml index 71396b1..819ea8c 100644 --- a/pmapi/src/test/resources/application-dev.yml +++ b/pmapi/src/test/resources/application-dev.yml @@ -181,7 +181,7 @@ organization: - GO_ff70e47bae684fdba0d64f4acab85661 yxt: -# wsdl-url: http://115.239.137.23:9501/ws/v1?wsdl + # wsdl-url: http://115.239.137.23:9501/ws/v1?wsdl wsdl-url: classpath:/wsdl.xml #账号 user-code: hzndkj @@ -203,8 +203,14 @@ provincial: #天印服务器接口信息 irs: seal-platform: - project-id: 1 - project-secret: 2 - access-key: 3 - secret-key: 4 - api-url: https://ibcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220309000004/seal-platform/seal/v1/rest/sign/signPdf + project-id: 330001110 + project-secret: 70e512d40c8f440484db4acab181570a + access-key: 42bcb49bea174986a3bfdfba7d005566 + secret-key: bebff29877d4443abd67fc4f8fb335d8 + api-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220309000004/seal-platform/seal/v1/rest/sign/signPdf + +hostname: iZbp13nwyvib53j4j1p2xoZ + +login: + phone-verify-code: + skip: true \ No newline at end of file diff --git a/pmapi/src/test/resources/application-prod.yml b/pmapi/src/test/resources/application-prod.yml index e69de29..f085ff9 100644 --- a/pmapi/src/test/resources/application-prod.yml +++ b/pmapi/src/test/resources/application-prod.yml @@ -0,0 +1,215 @@ +server: + port: 38888 + servlet: + context-path: /pm + +spring: + mvc: + pathmatch: + matching-strategy: ant_path_matcher + session: + store-type: redis + redis: + namespace: "spring:session" + redis: + timeout: 5000 + host: 47.98.125.47 + port: 26379 + database: 4 + password: Ndkj1234 + jedis: + pool: + max-active: 200 + max-idle: 500 + min-idle: 8 + max-wait: 10000 + application: + name: pm + jackson: + default-property-inclusion: non_null + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + jpa: + properties: + hibernate: + default_schema: PUBLIC + hbm2ddl: + auto: update + show_sql: true + show-sql: true + hibernate: + ddl-auto: update + datasource: + type: com.alibaba.druid.pool.DruidDataSource + driverClassName: com.kingbase8.Driver + # 数据源 + druid: + url: jdbc:kingbase8://10.53.172.221:54321/nd_project_management?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&nullCatalogMeansCurrent=true + username: SYSTEM + password: Ndkj1234 + # 初始连接数 + initialSize: 5 + # 最小连接池数量 + minIdle: 10 + # 最大连接池数量 + maxActive: 20 + # 配置获取连接等待超时的时间 + maxWait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + timeBetweenEvictionRunsMillis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + minEvictableIdleTimeMillis: 300000 + # 配置一个连接在池中最大生存的时间,单位是毫秒 + maxEvictableIdleTimeMillis: 900000 + # 配置检测连接是否有效 + #mysql使用:SELECT 1 FROM DUAL + validationQuery: SELECT 1 + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + webStatFilter: + enabled: true + statViewServlet: + enabled: true + # 设置白名单,不填则允许所有访问 + allow: + url-pattern: /druid/* + # 控制台管理用户名和密码 + login-username: admin + login-password: admin + filter: + stat: + enabled: true + # 慢SQL记录 + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: true + wall: + config: + multi-statement-allow: true + #设置上传 单个文件的大小 + servlet: + multipart: + max-file-size: 100MB + max-request-size: 150MB +mybatis-plus: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + db-config: + logic-delete-value: true + logic-not-delete-value: false +logging: + config: classpath:logback-spring.xml + #日志配置 + level: + root: info + file: + path: logs +nd: + cache: + type: REDIS + serializerType: ProtoStuff + cacheNullVal: true + def: + keyPrefix: pm + log: + enabled: true + type: DB + # 文件存储 + file: + 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 +# 日志文件配置 +log: + path: ./logs + info: + file-size: 50MB + max-size: 5 + total-size: 200MB + error: + file-size: 10MB + max-size: 5 + total-size: 50MB + +swagger: + enabled: true + +flowable: + async-executor-activate: true + #关闭一些不需要的功能服务 + rest-api-enabled: false + # database-schema-update: false + idm: + enabled: false + common: + enabled: false + dmn: + enabled: false + form: + enabled: false + app: + enabled: false + +wflow: + file: + max-size: 20 #最大文件上传大小,MB + +sa-token: + # token 名称 (同时也是cookie名称) + token-name: wflowToken + # token 有效期,单位s 默认30天, -1代表永不过期 + timeout: 172800 + # token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒 + activity-timeout: -1 + # 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) + is-concurrent: true + # 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token) + is-share: false + # token风格 + token-style: uuid + # 是否输出操作日志 + is-log: false +#浙政钉公司顶级organizationCode +organization: + dept-visible-scopes: + - GO_c1a6f8d5338e4a468337b08da76e2e31 + +yxt: + wsdl-url: classpath:wsdl-prod.xml + #账号 + user-code: Lssdsjj + #密码 + password: Lssdsjj@2021 + #音信通开关 + sms-enable: true + tel-enable: true + +#省局联审 请求信息 +provincial: + host: http://zj.ningdatech.com/prometheus-zhejiang_foreign + pushUrl: /api/v1/foreign/importantPro + detailUrl: /api/v1/foreign/importantProView + key: 7196317343a64e67895dc0375c098fe7 + secret: 75152a97f20e4c4c854dc6301cf72ad4 + + +#天印服务器接口信息 +irs: + seal-platform: + project-id: 330001110 + project-secret: 70e512d40c8f440484db4acab181570a + access-key: 42bcb49bea174986a3bfdfba7d005566 + secret-key: bebff29877d4443abd67fc4f8fb335d8 + api-url: https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020220309000004/seal-platform/seal/v1/rest/sign/signPdf + +hostname: iZ6mx01gyeodd80imxd2gbZ +login: + phone-verify-code: + skip: true diff --git a/pmapi/src/test/resources/wsdl-prod.xml b/pmapi/src/test/resources/wsdl-prod.xml new file mode 100644 index 0000000..0302851 --- /dev/null +++ b/pmapi/src/test/resources/wsdl-prod.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 9adf5d24bb68e92e61d740e5e937d2ceef819abd Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Fri, 9 Jun 2023 09:32:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?debug=20=E4=B8=BB=E7=AE=A1=E5=8D=95?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectdeclared/manage/DeclaredProjectManage.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index 67927b5..af37983 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -207,6 +207,13 @@ public class DeclaredProjectManage { projectDto.setProjectCode(projectInfo.getProjectCode()); defaultDeclaredProjectManage.checkDuplication(projectDto); } + + //如果主管单位没有 那么主管单位就是自己 + if(CommonEnum.NO.getCode().equals(projectDto.getIsSuperOrg())){ + projectInfo.setSuperOrgCode(user.getEmpPosUnitCode()); + projectInfo.setSuperOrg(user.getEmpPosUnitName()); + } + //判断申报金额 是否等于总的 判断年度支付金额 是否等于总金额 defaultDeclaredProjectManage.checkAmount(projectDto); From b64caec2bf6db090ef8f5dd4087acc3a123e9fc9 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Fri, 9 Jun 2023 10:00:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?debug=20=E4=B8=BB=E7=AE=A1=E5=8D=95?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java index af37983..215bc06 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/DeclaredProjectManage.java @@ -212,6 +212,8 @@ public class DeclaredProjectManage { if(CommonEnum.NO.getCode().equals(projectDto.getIsSuperOrg())){ projectInfo.setSuperOrgCode(user.getEmpPosUnitCode()); projectInfo.setSuperOrg(user.getEmpPosUnitName()); + projectDto.setSuperOrgCode(user.getEmpPosUnitCode()); + projectDto.setSuperOrg(user.getEmpPosUnitName()); } //判断申报金额 是否等于总的 判断年度支付金额 是否等于总金额