diff --git a/src/main/java/com/nbport/zgwl/contractlaunch/service/ContractLaunchServiceImpl.java b/src/main/java/com/nbport/zgwl/contractlaunch/service/ContractLaunchServiceImpl.java index 896bf91..4629b08 100644 --- a/src/main/java/com/nbport/zgwl/contractlaunch/service/ContractLaunchServiceImpl.java +++ b/src/main/java/com/nbport/zgwl/contractlaunch/service/ContractLaunchServiceImpl.java @@ -1008,7 +1008,8 @@ public class ContractLaunchServiceImpl implements ContractLaunchService { contract.setPushUrl(trim(contract.getPushUrl())); contract.setEwAmountType(trim(contract.getEwAmountType())); contract.setBiddingNo(trim(contract.getBiddingNo())); - if (contract.getDateType() == null || contract.getDateType().isBlank()) { + // dateType 仅在固定期限时使用,无固定期限不设默认值 + if ("0".equals(contract.getContractPeriodType()) && (contract.getDateType() == null || contract.getDateType().isBlank())) { contract.setDateType("0"); } if (contract.getTextSource() == null || contract.getTextSource().isBlank()) { @@ -1269,7 +1270,10 @@ public class ContractLaunchServiceImpl implements ContractLaunchService { payload.put("isMajorContract", contract.getIsMajorContract() == null ? 0 : contract.getIsMajorContract()); payload.put("sealType", contract.getSealType()); payload.put("creatorPhone", contract.getCreatorPhone()); - payload.put("dateType", contract.getDateType()); + // dateType 仅在固定期限时传递,无固定期限不传 + if ("0".equals(contract.getContractPeriodType())) { + payload.put("dateType", contract.getDateType()); + } payload.put("currencyName", contract.getCurrencyName()); payload.put("contractGistRemark", contract.getContractGistRemark()); payload.put("contractSysId", contract.getContractSysId()); @@ -1334,7 +1338,7 @@ public class ContractLaunchServiceImpl implements ContractLaunchService { private Map buildDataCollectionContractPayload(ContractLaunchDto contract) { Map payload = new LinkedHashMap<>(); payload.put("c_name", contract.getContractName()); - payload.put("c_code", contract.getLawContractCode() == null || contract.getLawContractCode().isBlank() ? contract.getContractCode() : contract.getLawContractCode()); + payload.put("c_code", contract.getContractCode()); payload.put("c_weNames", resolveSigningSubjectCodes(contract)); payload.put("c_oppositeNames", contract.getPartyList().stream() .filter(this::isOppositeParty) @@ -1376,7 +1380,10 @@ public class ContractLaunchServiceImpl implements ContractLaunchService { } else { payload.put("c_biddingNo", null); } - payload.put("c_currentBudget", contract.getIsYearBudget()); + // c_currentBudget 仅在收支方向为付款(1)时传,与 V3.0 文档一致 + if ("1".equals(contract.getPaymentDirection())) { + payload.put("c_currentBudget", contract.getIsYearBudget()); + } payload.put("c_major", contract.getIsMajorContract()); payload.put("c_signMethod", contract.getSealType()); // payload.put("c_authAttachs", buildCollectionFilePayloadList(contract, ContractLaunchConstants.FILE_CATEGORY_AUTH)); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..a396f36 --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,37 @@ +# ====================== 开发环境配置 ====================== +# 激活方式:spring.profiles.active=dev +# 或启动参数:--spring.profiles.active=dev + +spring: + datasource: + driver-class-name: oracle.jdbc.OracleDriver + url: jdbc:oracle:thin:@//127.0.0.1:1521/XEPDB1 + username: developer + password: dev123 + hikari: + connection-test-query: SELECT 1 FROM DUAL + +# 合同推送 —— 测试环境地址 +contract-push: + settlement: + systemKey: stamp-settlement-test-key + secretKey: stamp-settlement-test-secret + tokenUrl: http://10.168.53.211:8888/grcv5/serverapi/restapi/other/v1/ecp/getToken + pushContractUrl: http://10.168.53.211:8888/grcv5/serverapi/restapi/other/v1/ecp/pushContract + approveQueryUrl: http://10.168.53.211:8888/grcv5/serverapi/restapi/other/v1/ecp/queryInfoByContractSysId + archiveUrl: http://10.168.53.211:8888/grcv5/serverapi/restapi/other/v1/ecp/collectContractArchive + approveViewBaseUrl: http://10.168.53.211:8888/wp/grcv5/contractView/G_1_viewContractApprove.htm + dataCollection: + systemKey: stamp-collection-test-key + secretKey: stamp-collection-test-secret + sysCode: stamp-end-demo + tokenUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/getToken + uploadUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/upload + collectOppositesUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/collectOpposites + collectZtbsUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/collectZtbs + collectContractUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/collectContract + collectPlanFeedbackUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/collectPlanFeedback + collectContractCloseUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/collectContractClose + collectContractArchiveUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/collectContractArchive + queryApproveInfoUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/queryApproveInfo + approveViewBaseUrl: http://10.168.53.211:8888/grcv5/wp/contractView/G_1_viewContractApprove.htm diff --git a/src/main/resources/application-mysql.yml b/src/main/resources/application-mysql.yml deleted file mode 100644 index 10e79a1..0000000 --- a/src/main/resources/application-mysql.yml +++ /dev/null @@ -1,6 +0,0 @@ -spring: - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://127.0.0.1:3306/zgwl_end?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true - username: root - password: root diff --git a/src/main/resources/application-oracle.yml b/src/main/resources/application-oracle.yml deleted file mode 100644 index a45f55d..0000000 --- a/src/main/resources/application-oracle.yml +++ /dev/null @@ -1,8 +0,0 @@ -spring: - datasource: - driver-class-name: oracle.jdbc.OracleDriver - url: jdbc:oracle:thin:@//127.0.0.1:1521/XEPDB1 - username: developer - password: dev123 - hikari: - connection-test-query: SELECT 1 FROM DUAL diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..17257b4 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,41 @@ +# ====================== 生产环境配置 ====================== +# 激活方式:spring.profiles.active=prod +# 或启动参数:--spring.profiles.active=prod +# +# 注意:生产环境 datasource 密码等敏感信息请通过环境变量或启动参数注入, +# 不要明文写在配置文件中。 + +spring: + datasource: + driver-class-name: oracle.jdbc.OracleDriver + url: ${ORACLE_URL:jdbc:oracle:thin:@//127.0.0.1:1521/XEPDB1} + username: ${ORACLE_USERNAME:developer} + password: ${ORACLE_PASSWORD:} + hikari: + connection-test-query: SELECT 1 FROM DUAL + +# 合同推送 —— 正式环境地址 +contract-push: + settlement: + systemKey: ${SETTLEMENT_SYSTEM_KEY:stamp-settlement-prod-key} + secretKey: ${SETTLEMENT_SECRET_KEY:} + tokenUrl: https://jtfw.nbport.com.cn/grcv5/serverapi/restapi/other/v1/ecp/getToken + pushContractUrl: https://jtfw.nbport.com.cn/grcv5/serverapi/restapi/other/v1/ecp/pushContract + approveQueryUrl: https://jtfw.nbport.com.cn/grcv5/serverapi/restapi/other/v1/ecp/queryInfoByContractSysId + archiveUrl: https://jtfw.nbport.com.cn/grcv5/serverapi/restapi/other/v1/ecp/collectContractArchive + approveViewBaseUrl: https://jtfw.nbport.com.cn/wp/grcv5/contractView/G_1_viewContractApprove.htm + dataCollection: + systemKey: ${COLLECTION_SYSTEM_KEY:stamp-collection-prod-key} + secretKey: ${COLLECTION_SECRET_KEY:} + sysCode: ${COLLECTION_SYS_CODE:stamp-end-prod} + # V3.0 数据采集正式地址待集团提供,当前为占位符,部署前替换 + tokenUrl: ${COLLECTION_TOKEN_URL:http://x.x.x.x:x/x/cj/rest/dataCenter/getToken} + uploadUrl: ${COLLECTION_UPLOAD_URL:http://x.x.x.x:x/x/cj/rest/dataCenter/upload} + collectOppositesUrl: ${COLLECTION_OPPOSITES_URL:http://x.x.x.x:x/x/cj/rest/dataCenter/collectOpposites} + collectZtbsUrl: ${COLLECTION_ZTBS_URL:http://x.x.x.x:x/x/cj/rest/dataCenter/collectZtbs} + collectContractUrl: ${COLLECTION_CONTRACT_URL:http://x.x.x.x:x/x/cj/rest/dataCenter/collectContract} + collectPlanFeedbackUrl: ${COLLECTION_PLAN_FEEDBACK_URL:http://x.x.x.x:x/x/cj/rest/dataCenter/collectPlanFeedback} + collectContractCloseUrl: ${COLLECTION_CLOSE_URL:http://x.x.x.x:x/x/cj/rest/dataCenter/collectContractClose} + collectContractArchiveUrl: ${COLLECTION_ARCHIVE_URL:http://x.x.x.x:x/x/cj/rest/dataCenter/collectContractArchive} + queryApproveInfoUrl: ${COLLECTION_APPROVE_INFO_URL:http://x.x.x.x:x/x/cj/rest/dataCenter/queryApproveInfo} + approveViewBaseUrl: https://jtfw.nbport.com.cn/grcv5/wp/contractView/G_1_viewContractApprove.htm diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index cc28d64..7d720c8 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -5,7 +5,7 @@ spring: application: name: zgwl-end profiles: - active: ${SPRING_PROFILES_ACTIVE:oracle} + active: ${SPRING_PROFILES_ACTIVE:dev} servlet: multipart: max-file-size: 20MB @@ -36,30 +36,6 @@ seal: appSecret: 6c74358c28c149f18242bd614a101910 baseUrl: https://saasapi.certca.cn -contract-push: - settlement: - systemKey: stamp-settlement-test-key - secretKey: stamp-settlement-test-secret - tokenUrl: http://10.168.53.211:8888/grcv5/serverapi/restapi/other/v1/ecp/getToken - pushContractUrl: http://10.168.53.211:8888/grcv5/serverapi/restapi/other/v1/ecp/pushContract - approveQueryUrl: http://10.168.53.211:8888/grcv5/serverapi/restapi/other/v1/ecp/queryInfoByContractSysId - archiveUrl: http://10.168.53.211:8888/grcv5/serverapi/restapi/other/v1/ecp/collectContractArchive - approveViewBaseUrl: http://10.168.53.211:8888/wp/grcv5/contractView/G_1_viewContractApprove.htm - dataCollection: - systemKey: stamp-collection-test-key - secretKey: stamp-collection-test-secret - sysCode: stamp-end-demo - tokenUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/getToken - uploadUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/upload - collectOppositesUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/collectOpposites - collectZtbsUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/collectZtbs - collectContractUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/collectContract - collectPlanFeedbackUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/collectPlanFeedback - collectContractCloseUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/collectContractClose - collectContractArchiveUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/collectContractArchive - queryApproveInfoUrl: http://10.168.53.211:8888/grcv5/cj/rest/dataCenter/queryApproveInfo - approveViewBaseUrl: http://10.168.53.211:8888/grcv5/wp/contractView/G_1_viewContractApprove.htm - logging: level: com.nbport.zgwl.mapper: debug