From 8b00953f4715f7392fce4acac4daa66c2fb15130 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Sat, 14 Sep 2024 10:08:39 +0800 Subject: [PATCH 01/42] =?UTF-8?q?fw-oa=E5=88=86=E6=94=AF=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-webapp/pom.xml | 10 +- fw-oa/pom.xml | 48 ++ .../frame/seeyon/cap4/form/dto/FormDTO.java | 74 ++ .../seeyon/cap4/form/dto/FormDataDTO.java | 36 + .../seeyon/cap4/form/dto/MasterTableDTO.java | 45 ++ .../frame/seeyon/cap4/form/dto/RecordDTO.java | 34 + .../seeyon/cap4/form/dto/RecordFieldDTO.java | 52 ++ .../seeyon/cap4/form/dto/SubTableDTO.java | 9 + .../seeyon/cbs8/dao/IAgentPaymentDao.java | 12 + .../cbs8/dao/IAgentPaymentDetailDao.java | 12 + .../frame/seeyon/cbs8/dao/ICbsLogDao.java | 12 + .../frame/seeyon/cbs8/dao/IPaymentDao.java | 10 + .../cbs8/dao/ITransactionDetailDao.java | 12 + .../cbs8/dao/impl/AgentPaymentDaoImpl.java | 15 + .../dao/impl/AgentPaymentDetailDaoImpl.java | 15 + .../seeyon/cbs8/dao/impl/CbsLogDaoImpl.java | 15 + .../seeyon/cbs8/dao/impl/PaymentDaoImpl.java | 15 + .../dao/impl/TransactionDetailDaoImpl.java | 17 + .../cbs8/entity/AgentPaymentDetailEntity.java | 113 +++ .../cbs8/entity/AgentPaymentDetailEntity.xml | 84 +++ .../cbs8/entity/AgentPaymentEntity.java | 145 ++++ .../seeyon/cbs8/entity/AgentPaymentEntity.xml | 126 ++++ .../seeyon/cbs8/entity/CbsLogEntity.java | 151 ++++ .../frame/seeyon/cbs8/entity/CbsLogEntity.xml | 116 +++ .../seeyon/cbs8/entity/PaymentEntity.java | 327 +++++++++ .../seeyon/cbs8/entity/PaymentEntity.xml | 339 +++++++++ .../cbs8/entity/TransactionDetailEntity.java | 155 ++++ .../cbs8/entity/TransactionDetailEntity.xml | 91 +++ .../service/IAgentPaymentDetailService.java | 18 + .../cbs8/service/IAgentPaymentService.java | 45 ++ .../seeyon/cbs8/service/ICbsLogService.java | 53 ++ .../seeyon/cbs8/service/IPaymentService.java | 63 ++ .../service/ITransactionDetailService.java | 29 + .../impl/AgentPaymentDetailServiceImpl.java | 39 + .../service/impl/AgentPaymentServiceImpl.java | 93 +++ .../cbs8/service/impl/CbsLogServiceImpl.java | 198 +++++ .../cbs8/service/impl/PaymentServiceImpl.java | 150 ++++ .../impl/TransactionDetailServiceImpl.java | 98 +++ .../seeyon/dao/ICapFormDefinitionDao.java | 51 ++ .../frame/seeyon/dao/ICtpAttachmentDao.java | 21 + .../hzya/frame/seeyon/dao/ICtpFileDao.java | 12 + .../com/hzya/frame/seeyon/dao/ISeeYonDao.java | 108 +++ .../frame/seeyon/dao/ISeeYonInterFaceDao.java | 37 + .../dao/impl/CapFormDefinitionDaoImpl.java | 39 + .../seeyon/dao/impl/CtpAttachmentDaoImpl.java | 31 + .../frame/seeyon/dao/impl/CtpFileDaoImpl.java | 17 + .../frame/seeyon/dao/impl/SeeYonDaoImpl.java | 94 +++ .../dao/impl/SeeYonInterFaceDaoImpl.java | 43 ++ .../entity/CapFormDefinitionEntity.java | 71 ++ .../seeyon/entity/CapFormDefinitionEntity.xml | 41 ++ .../frame/seeyon/entity/CfsLogEntity.java | 65 ++ .../seeyon/entity/CollAttachmentResDTO.java | 340 +++++++++ .../seeyon/entity/CtpAttachmentEntity.java | 124 ++++ .../seeyon/entity/CtpAttachmentEntity.xml | 89 +++ .../frame/seeyon/entity/CtpFileEntity.java | 113 +++ .../frame/seeyon/entity/CtpFileEntity.xml | 49 ++ .../frame/seeyon/entity/OAU8ResponseDTO.java | 89 +++ .../entity/OAWorkflowEventDataEntity.java | 153 ++++ .../seeyon/entity/SeeYonInterFaceEntity.java | 112 +++ .../seeyon/entity/SeeYonInterFaceEntity.xml | 52 ++ .../frame/seeyon/entity/SeeyonEntity.java | 684 ++++++++++++++++++ .../hzya/frame/seeyon/entity/SeeyonEntity.xml | 250 +++++++ .../frame/seeyon/enums/ColEventTypeEnum.java | 45 ++ .../frame/seeyon/paybill/dao/IPayBillDao.java | 33 + .../paybill/dao/impl/PayBillDaoImpl.java | 32 + .../seeyon/paybill/entity/PayBillEntity.java | 107 +++ .../seeyon/paybill/entity/PayBillEntity.xml | 62 ++ .../paybill/service/IPayBillService.java | 29 + .../service/impl/PayBillServiceImpl.java | 105 +++ .../frame/seeyon/recbill/dao/IRecBillDao.java | 31 + .../recbill/dao/impl/RecBillDaoImpl.java | 30 + .../seeyon/recbill/entity/RecBillEntity.java | 104 +++ .../seeyon/recbill/entity/RecBillEntity.xml | 40 + .../recbill/service/IRecBillService.java | 26 + .../service/impl/RecBillServiceImpl.java | 104 +++ .../seeyon/service/ICtpAttachmentService.java | 20 + .../frame/seeyon/service/ICtpFileService.java | 12 + .../seeyon/service/INoProcessService.java | 26 + .../seeyon/service/ISeeYonInterFace.java | 84 +++ .../seeyon/service/ISeeyonExtService.java | 29 + .../impl/CtpAttachmentServiceImpl.java | 70 ++ .../service/impl/CtpFileServiceImpl.java | 15 + .../service/impl/NoProcessServiceImpl.java | 119 +++ .../service/impl/SeeYonInterFaceImpl.java | 507 +++++++++++++ .../service/impl/SeeyonExtServiceImpl.java | 241 ++++++ .../com/hzya/frame/seeyon/util/OABipUtil.java | 65 ++ .../hzya/frame/seeyon/util/OAPayState.java | 73 ++ .../hzya/frame/seeyon/util/OARestUtil.java | 209 ++++++ .../com/hzya/frame/seeyon/util/OAU8Util.java | 34 + fw-oa/src/main/webapp/WEB-INF/web.xml | 6 + pom.xml | 2 +- 91 files changed, 7815 insertions(+), 6 deletions(-) create mode 100644 fw-oa/pom.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDataDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/MasterTableDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordFieldDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/SubTableDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDetailDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IPaymentDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ITransactionDetailDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDetailDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/PaymentDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/TransactionDetailDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentDetailService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ITransactionDetailService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentDetailServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/TransactionDetailServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpAttachmentDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpFileDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonInterFaceDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpAttachmentDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpFileDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonInterFaceDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CfsLogEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CollAttachmentResDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAU8ResponseDTO.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAWorkflowEventDataEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/enums/ColEventTypeEnum.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpFileService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeyonExtService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpFileServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/util/OABipUtil.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAPayState.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAU8Util.java create mode 100644 fw-oa/src/main/webapp/WEB-INF/web.xml diff --git a/base-webapp/pom.xml b/base-webapp/pom.xml index 79bd4cf9..0cd3f16b 100644 --- a/base-webapp/pom.xml +++ b/base-webapp/pom.xml @@ -54,11 +54,11 @@ - - - - - + + com.hzya.frame + fw-oa + ${revision} + diff --git a/fw-oa/pom.xml b/fw-oa/pom.xml new file mode 100644 index 00000000..04552396 --- /dev/null +++ b/fw-oa/pom.xml @@ -0,0 +1,48 @@ + + + + kangarooDataCenterV3 + com.hzya.frame + ${revision} + + 4.0.0 + fw-oa + jar + ${revision} + + + + com.hzya.frame + base-service + ${revision} + + + mysql + mysql-connector-java + ${mysql-connector-java} + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + none + execute + true + + + + + repackage + + + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDTO.java new file mode 100644 index 00000000..e9fe54b8 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDTO.java @@ -0,0 +1,74 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.List; + +/** + * @Description 无流程表单批量保存请求参数 + * @Author xiangerlin + * @Date 2024/1/8 11:18 + **/ +public class FormDTO { + @JSONField(ordinal = 4) + private String formCode;//模版编号 + @JSONField(ordinal = 5) + private String loginName;//模版编号 + @JSONField(ordinal = 2) + private String rightId;//权限id,找到无流程表单,点新增,弹出的窗口上会有这个参数 + @JSONField(ordinal = 3) + private List dataList;//导入的数据 + @JSONField(ordinal = 1) + private String[] uniqueFiled;//更新用的唯一标识 + @JSONField(ordinal = 6) + private Boolean doTrigger;//是否执行触发(Since V8.0sp2),测试中发现传了这个参数会报错 + + public String getFormCode() { + return formCode; + } + + public void setFormCode(String formCode) { + this.formCode = formCode; + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public String getRightId() { + return rightId; + } + + public void setRightId(String rightId) { + this.rightId = rightId; + } + + public List getDataList() { + return dataList; + } + + public void setDataList(List dataList) { + this.dataList = dataList; + } + + public String[] getUniqueFiled() { + return uniqueFiled; + } + + public void setUniqueFiled(String[] uniqueFiled) { + this.uniqueFiled = uniqueFiled; + } + + public Boolean getDoTrigger() { + return doTrigger; + } + + public void setDoTrigger(Boolean doTrigger) { + this.doTrigger = doTrigger; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDataDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDataDTO.java new file mode 100644 index 00000000..b69031d6 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/FormDataDTO.java @@ -0,0 +1,36 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.List; + +/** + * @Description dataList节点 + * @Author xiangerlin + * @Date 2024/1/8 11:26 + **/ +public class FormDataDTO { + @JSONField(ordinal = 1) + private MasterTableDTO masterTable;//主表数据 + @JSONField(ordinal = 2) + private List subTables;//子表数据 + + //private List<> attachmentInfos;//附件列表 + + public MasterTableDTO getMasterTable() { + return masterTable; + } + + public void setMasterTable(MasterTableDTO masterTable) { + this.masterTable = masterTable; + } + + public List getSubTables() { + return subTables; + } + + public void setSubTables(List subTables) { + this.subTables = subTables; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/MasterTableDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/MasterTableDTO.java new file mode 100644 index 00000000..56f5f9fb --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/MasterTableDTO.java @@ -0,0 +1,45 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.List; + +/** + * @Description 主表数据 + * @Author xiangerlin + * @Date 2024/1/8 11:29 + **/ + +public class MasterTableDTO { + @JSONField(ordinal = 1) + private String name;//表名 + @JSONField(ordinal = 2) + private RecordDTO record;//数据 + @JSONField(ordinal = 3) + private List changedFields;//需要计算的字段 + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public RecordDTO getRecord() { + return record; + } + + public void setRecord(RecordDTO record) { + this.record = record; + } + + public List getChangedFields() { + return changedFields; + } + + public void setChangedFields(List changedFields) { + this.changedFields = changedFields; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordDTO.java new file mode 100644 index 00000000..cc3857e0 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordDTO.java @@ -0,0 +1,34 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import java.util.List; + +/** + * @Description record节点 + * @Author xiangerlin + * @Date 2024/1/8 11:31 + **/ +public class RecordDTO { + @JSONField(ordinal = 1) + private long id;//数据id,测试中发现新增时这个参数随便填写 不影响导入 + @JSONField(ordinal = 2) + private List fields;//字段列表 + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public List getFields() { + return fields; + } + + public void setFields(List fields) { + this.fields = fields; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordFieldDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordFieldDTO.java new file mode 100644 index 00000000..a2bfa15b --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/RecordFieldDTO.java @@ -0,0 +1,52 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * @Description masterTable—record—fields的结构 + * @Author xiangerlin + * @Date 2024/1/8 11:32 + **/ +public class RecordFieldDTO { + @JSONField(ordinal = 1) + private String name;//数据域名称 ,fieldxxxx + @JSONField(ordinal = 2) + private String value;//数据值(优先) + @JSONField(ordinal = 3) + private String showValue;//显示值 + + public RecordFieldDTO() { + + } + + public RecordFieldDTO(String name, String value, String showValue) { + this.name = name; + this.value = value; + this.showValue = showValue; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public String getShowValue() { + return showValue; + } + + public void setShowValue(String showValue) { + this.showValue = showValue; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/SubTableDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/SubTableDTO.java new file mode 100644 index 00000000..8d5e5226 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cap4/form/dto/SubTableDTO.java @@ -0,0 +1,9 @@ +package com.hzya.frame.seeyon.cap4.form.dto; + +/** + * @Description 子表数据 + * @Author xiangerlin + * @Date 2024/1/8 11:29 + **/ +public class SubTableDTO { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDao.java new file mode 100644 index 00000000..5336cd91 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.cbs8.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; + +/** + * @Description 代发代扣 + * @Author xiangerlin + * @Date 2024/6/26 10:50 + **/ +public interface IAgentPaymentDao extends IBaseDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDetailDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDetailDao.java new file mode 100644 index 00000000..96895bb4 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IAgentPaymentDetailDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.cbs8.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; + +/** + * @Description 代发代扣明细 + * @Author xiangerlin + * @Date 2024/6/26 10:54 + **/ +public interface IAgentPaymentDetailDao extends IBaseDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java new file mode 100644 index 00000000..032d1a3e --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.cbs8.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; + +/** + * @Description cbs8支付日志 + * @Author xiangerlin + * @Date 2024/6/14 17:30 + **/ +public interface ICbsLogDao extends IBaseDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IPaymentDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IPaymentDao.java new file mode 100644 index 00000000..c8a18848 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IPaymentDao.java @@ -0,0 +1,10 @@ +package com.hzya.frame.seeyon.cbs8.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; + +/** + * oa集成cbs + */ +public interface IPaymentDao extends IBaseDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ITransactionDetailDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ITransactionDetailDao.java new file mode 100644 index 00000000..37cf015a --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ITransactionDetailDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.cbs8.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.cbs8.entity.TransactionDetailEntity; + +/** + * @Description cbs交易明细 oa底表 + * @Author xiangerlin + * @Date 2024/6/24 11:10 + **/ +public interface ITransactionDetailDao extends IBaseDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDaoImpl.java new file mode 100644 index 00000000..5b2e3852 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.seeyon.cbs8.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDao; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/26 10:51 + **/ +@Repository("OAAgentPaymentDaoImpl") +public class AgentPaymentDaoImpl extends MybatisGenericDao implements IAgentPaymentDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDetailDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDetailDaoImpl.java new file mode 100644 index 00000000..2b873067 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/AgentPaymentDetailDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.seeyon.cbs8.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDetailDao; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/26 10:55 + **/ +@Repository("OAAgentPaymentDetailDaoImpl") +public class AgentPaymentDetailDaoImpl extends MybatisGenericDao implements IAgentPaymentDetailDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java new file mode 100644 index 00000000..a42437b0 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.seeyon.cbs8.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.cbs8.dao.ICbsLogDao; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/14 17:31 + **/ +@Repository() +public class CbsLogDaoImpl extends MybatisGenericDao implements ICbsLogDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/PaymentDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/PaymentDaoImpl.java new file mode 100644 index 00000000..f2744983 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/PaymentDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.seeyon.cbs8.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.cbs8.dao.IPaymentDao; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description oa集成cbs + * @Author xiangerlin + * @Date 2024/6/6 16:28 + **/ +@Repository("OAPaymentDaoImpl") +public class PaymentDaoImpl extends MybatisGenericDao implements IPaymentDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/TransactionDetailDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/TransactionDetailDaoImpl.java new file mode 100644 index 00000000..e4fb1bac --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/TransactionDetailDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.seeyon.cbs8.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.cbs8.dao.IPaymentDao; +import com.hzya.frame.seeyon.cbs8.dao.ITransactionDetailDao; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.cbs8.entity.TransactionDetailEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/24 11:10 + **/ +@Repository("OATransactionDetailDaoImpl") +public class TransactionDetailDaoImpl extends MybatisGenericDao implements ITransactionDetailDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.java new file mode 100644 index 00000000..4776058c --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.java @@ -0,0 +1,113 @@ +package com.hzya.frame.seeyon.cbs8.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description 代发代扣明细表 + * @Author xiangerlin + * @Date 2024/6/18 14:58 + **/ +public class AgentPaymentDetailEntity extends BaseEntity { + //每笔明细金额 + private String dtlAmount; + //收款账号 + private String dtlRevAccount; + //联行号 同行可不传,跨行必传 + private String dtlCnapsCode; + //收款账户名称 + private String dtlRevName; + //收款开户行 ,如果传的联行号能匹配到对应到开户行,cbs8会自动带出 + private String dtlRevBankName; + //主表id + private String formmainId; + //表名 + private String tabName; + + //明细序号,从1开始递增 + private int dtlSeqNum; + + //支付结果 + private String payResult; + //支付日期 + private String payDate; + + public String getDtlAmount() { + return dtlAmount; + } + + public void setDtlAmount(String dtlAmount) { + this.dtlAmount = dtlAmount; + } + + public String getDtlRevAccount() { + return dtlRevAccount; + } + + public void setDtlRevAccount(String dtlRevAccount) { + this.dtlRevAccount = dtlRevAccount; + } + + public String getDtlCnapsCode() { + return dtlCnapsCode; + } + + public void setDtlCnapsCode(String dtlCnapsCode) { + this.dtlCnapsCode = dtlCnapsCode; + } + + public String getDtlRevName() { + return dtlRevName; + } + + public void setDtlRevName(String dtlRevName) { + this.dtlRevName = dtlRevName; + } + + public String getDtlRevBankName() { + return dtlRevBankName; + } + + public void setDtlRevBankName(String dtlRevBankName) { + this.dtlRevBankName = dtlRevBankName; + } + + public String getFormmainId() { + return formmainId; + } + + public void setFormmainId(String formmainId) { + this.formmainId = formmainId; + } + + public String getTabName() { + return tabName; + } + + public void setTabName(String tabName) { + this.tabName = tabName; + } + + public int getDtlSeqNum() { + return dtlSeqNum; + } + + public void setDtlSeqNum(int dtlSeqNum) { + this.dtlSeqNum = dtlSeqNum; + } + + public String getPayResult() { + return payResult; + } + + public void setPayResult(String payResult) { + this.payResult = payResult; + } + + public String getPayDate() { + return payDate; + } + + public void setPayDate(String payDate) { + this.payDate = payDate; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.xml new file mode 100644 index 00000000..43869fc1 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + id, + formmainId, + tabName, + dtlSeqNum, + dtlAmount, + dtlRevAccount, + dtlCnapsCode, + dtlRevName, + dtlRevBankName, + payResult, + payDate + + + + + + + + update formson_0225 set + + field0045 =#{payDate}, + field0044 =#{payResult} + + where id = #{id} + + + + + update formson_0225 set + + field0045 =#{payDate}, + field0044 =#{payResult} + + where field0001=#{dtlSeqNum} and field0019=#{dtlAmount} and field0035=#{dtlCnapsCode} and field0037=#{dtlRevName} + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.java new file mode 100644 index 00000000..b4b2748a --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.java @@ -0,0 +1,145 @@ +package com.hzya.frame.seeyon.cbs8.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description 代发代扣 主表 + * @Author xiangerlin + * @Date 2024/6/18 14:44 + **/ +public class AgentPaymentEntity extends BaseEntity { + + //oa id + private String oaId; + private String finishedflag; + //流程标题 + private String title; + //业务参考号 + private String referenceNum; + /** + * 业务类型 + * 201-代扣 + * 203-代发 + * 代发工资传203 + */ + private String busType; + //总金额 小数位2位 + private String amount; + //币种 + private String currency; + //付款账号 + private String payAccount; + //用途 + private String purpose; + //申请单号 + private String applyCode; + //支付结果 + private String payResult; + + private String tableName;//表名称 + private String billName;//单据名称 + + public String getReferenceNum() { + return referenceNum; + } + + public void setReferenceNum(String referenceNum) { + this.referenceNum = referenceNum; + } + + public String getBusType() { + return busType; + } + + public void setBusType(String busType) { + this.busType = busType; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getPayAccount() { + return payAccount; + } + + public void setPayAccount(String payAccount) { + this.payAccount = payAccount; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getBillName() { + return billName; + } + + public void setBillName(String billName) { + this.billName = billName; + } + + public String getOaId() { + return oaId; + } + + public void setOaId(String oaId) { + this.oaId = oaId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getFinishedflag() { + return finishedflag; + } + + public void setFinishedflag(String finishedflag) { + this.finishedflag = finishedflag; + } + + public String getApplyCode() { + return applyCode; + } + + public void setApplyCode(String applyCode) { + this.applyCode = applyCode; + } + + public String getPayResult() { + return payResult; + } + + public void setPayResult(String payResult) { + this.payResult = payResult; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.xml new file mode 100644 index 00000000..c0b0f6f0 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + oaId, + tableName, + finishedflag, + title, + billName, + referenceNum, + busType, + amount, + currency, + payAccount, + applyCode, + payResult, + purpose + + + + + + + + + + + update formmain_0224 set + + field0043 =#{applyCode}, + field0046 =#{payResult} + + where id = #{oaId} + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java new file mode 100644 index 00000000..21cc1a4f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java @@ -0,0 +1,151 @@ +package com.hzya.frame.seeyon.cbs8.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description cbs支付日志 + * @Author xiangerlin + * @Date 2024/6/14 17:16 + **/ +public class CbsLogEntity extends BaseEntity { + //流程标题 + private String title; + //请款主体 + private String pay_company; + //收款人 + private String payee; + //金额 + private String amount; + //cbs申请单号 + private String cbs_apply_code; + //日志表id + private String id; + //oa单据id + private String oa_id; + //oa单据号 + private String bill_code; + //英文表名 + private String tab_name_en; + //中文表名 + private String tab_name_ch; + //支付状态 + private String pay_state; + //支付信息 + private String message; + //支付申请状态 + private String apply_state; + //成功标记 + private String successed; + + public String getOa_id() { + return oa_id; + } + + public void setOa_id(String oa_id) { + this.oa_id = oa_id; + } + + public String getBill_code() { + return bill_code; + } + + public void setBill_code(String bill_code) { + this.bill_code = bill_code; + } + + public String getTab_name_en() { + return tab_name_en; + } + + public void setTab_name_en(String tab_name_en) { + this.tab_name_en = tab_name_en; + } + + public String getTab_name_ch() { + return tab_name_ch; + } + + public void setTab_name_ch(String tab_name_ch) { + this.tab_name_ch = tab_name_ch; + } + + public String getPay_state() { + return pay_state; + } + + public void setPay_state(String pay_state) { + this.pay_state = pay_state; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getApply_state() { + return apply_state; + } + + public void setApply_state(String apply_state) { + this.apply_state = apply_state; + } + + public String getSuccessed() { + return successed; + } + + public void setSuccessed(String successed) { + this.successed = successed; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getPay_company() { + return pay_company; + } + + public void setPay_company(String pay_company) { + this.pay_company = pay_company; + } + + public String getPayee() { + return payee; + } + + public void setPayee(String payee) { + this.payee = payee; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getCbs_apply_code() { + return cbs_apply_code; + } + + public void setCbs_apply_code(String cbs_apply_code) { + this.cbs_apply_code = cbs_apply_code; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml new file mode 100644 index 00000000..3e03a88a --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + id, + field0002 as title, + field0003 as pay_company, + field0004 as payee, + field0005 as cbs_apply_code, + field0006 as bill_code, + field0007 as oa_id, + field0008 as tab_name_ch, + field0009 as tab_name_en, + field0010 as pay_state, + field0011 as message, + field0012 as apply_state, + field0014 as successed + + + + + + + + + + + + + update formmain_0232 set + + field0010 =#{pay_state}, + field0011 =#{message}, + field0012 =#{apply_state}, + field0014 =#{successed} + + where id = #{id} + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.java new file mode 100644 index 00000000..9f68e3ff --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.java @@ -0,0 +1,327 @@ +package com.hzya.frame.seeyon.cbs8.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/6 16:17 + **/ +public class PaymentEntity extends BaseEntity { + + private String oaId;//主表id + private String formsonId;//明细表id + private String payCompany;//付款公司 + private String title;//流程标题 + private String tableName;//表名称 + private String billName;//单据名称 + private String referenceNum;//业务参考号 唯一id + private String referenceNumNew;//重试的时候生成新的业务参考号 + private String busType;//业务类型 + private String payResultField;//支付结果字段 + private String payDateField;//打款日期字段 + private String applyCodeField;//支付申请单号字段 + private String receiptFiled;//电子回单字段 + private String summaryId;//summaryid + private String startDate;//单据日期 + private String finishedflag;//流程状态 + private String payDate;//打款日期 + private String payResult;//支付结果 + private String applyCode;//支付申请单号 + private String payAccount;//付款账号 + private String payBankName;//付款开户银行 + private String amount;//金额 + private String purpose;//支付用途 + private String revAccount;//收款账号 + private String revBankName;//收款开户行名称 + private String revBankType;//收款银行类型 + private String revAccountName;//收款账户名称 + private String cnapsCode;//联行号 + private String receipt;//电子回单 + private String currency;//币种 数字 + private String currencyName;//币种 中文 + private String currencyCode;//币种编码 + private String personalFlag;//公私标记 + private String payType;//付款类别 + private String payCompanyCode;//付款公司编码 + + public String getOaId() { + return oaId; + } + + public void setOaId(String oaId) { + this.oaId = oaId; + } + + public String getPayCompany() { + return payCompany; + } + + public void setPayCompany(String payCompany) { + this.payCompany = payCompany; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getBillName() { + return billName; + } + + public void setBillName(String billName) { + this.billName = billName; + } + + public String getReferenceNum() { + return referenceNum; + } + + public void setReferenceNum(String referenceNum) { + this.referenceNum = referenceNum; + } + + public String getReferenceNumNew() { + return referenceNumNew; + } + + public void setReferenceNumNew(String referenceNumNew) { + this.referenceNumNew = referenceNumNew; + } + + public String getBusType() { + return busType; + } + + public void setBusType(String busType) { + this.busType = busType; + } + + public String getPayResultField() { + return payResultField; + } + + public void setPayResultField(String payResultField) { + this.payResultField = payResultField; + } + + public String getPayDateField() { + return payDateField; + } + + public void setPayDateField(String payDateField) { + this.payDateField = payDateField; + } + + public String getReceiptFiled() { + return receiptFiled; + } + + public void setReceiptFiled(String receiptFiled) { + this.receiptFiled = receiptFiled; + } + + public String getSummaryId() { + return summaryId; + } + + public void setSummaryId(String summaryId) { + this.summaryId = summaryId; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getFinishedflag() { + return finishedflag; + } + + public void setFinishedflag(String finishedflag) { + this.finishedflag = finishedflag; + } + + public String getPayDate() { + return payDate; + } + + public void setPayDate(String payDate) { + this.payDate = payDate; + } + + public String getPayResult() { + return payResult; + } + + public void setPayResult(String payResult) { + this.payResult = payResult; + } + + public String getPayAccount() { + return payAccount; + } + + public void setPayAccount(String payAccount) { + this.payAccount = payAccount; + } + + public String getPayBankName() { + return payBankName; + } + + public void setPayBankName(String payBankName) { + this.payBankName = payBankName; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getRevAccount() { + return revAccount; + } + + public void setRevAccount(String revAccount) { + this.revAccount = revAccount; + } + + public String getRevBankName() { + return revBankName; + } + + public void setRevBankName(String revBankName) { + this.revBankName = revBankName; + } + + public String getRevBankType() { + return revBankType; + } + + public void setRevBankType(String revBankType) { + this.revBankType = revBankType; + } + + public String getRevAccountName() { + return revAccountName; + } + + public void setRevAccountName(String revAccountName) { + this.revAccountName = revAccountName; + } + + public String getCnapsCode() { + return cnapsCode; + } + + public void setCnapsCode(String cnapsCode) { + this.cnapsCode = cnapsCode; + } + + public String getReceipt() { + return receipt; + } + + public void setReceipt(String receipt) { + this.receipt = receipt; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getCurrencyName() { + return currencyName; + } + + public void setCurrencyName(String currencyName) { + this.currencyName = currencyName; + } + + public String getCurrencyCode() { + return currencyCode; + } + + public void setCurrencyCode(String currencyCode) { + this.currencyCode = currencyCode; + } + + public String getPersonalFlag() { + return personalFlag; + } + + public void setPersonalFlag(String personalFlag) { + this.personalFlag = personalFlag; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType; + } + + public String getPayCompanyCode() { + return payCompanyCode; + } + + public void setPayCompanyCode(String payCompanyCode) { + this.payCompanyCode = payCompanyCode; + } + + public String getFormsonId() { + return formsonId; + } + + public void setFormsonId(String formsonId) { + this.formsonId = formsonId; + } + + public String getApplyCodeField() { + return applyCodeField; + } + + public void setApplyCodeField(String applyCodeField) { + this.applyCodeField = applyCodeField; + } + + public String getApplyCode() { + return applyCode; + } + + public void setApplyCode(String applyCode) { + this.applyCode = applyCode; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.xml new file mode 100644 index 00000000..b8d3deee --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.xml @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + oaId, + formsonId, + payCompany, + payCompanyCode, + title, + tableName, + billName, + referenceNum, + busType, + payResultField, + payDateField, + applyCodeField, + receiptFiled, + summaryId, + startDate, + finishedflag, + payDate, + payResult, + applyCode, + payAccount, + payBankName, + amount, + purpose, + revAccount, + revBankName, + revBankType, + revAccountName, + cnapsCode, + receipt, + currency, + personalFlag, + payType + + + + + SELECT + formmain_0209.id as oaId, -- 主表id + formson_0210.formsonId, + 'formson_0210' as tableName, -- 表名 + COL_SUMMARY.SUBJECT as title, -- 单据标题 + unit.name as payCompany, -- 付款公司 + '差旅费报销单' as billName, + 'field0072' as payResultField, -- 支付结果字段 + 'field0073' as payDateField, -- 打款日期字段 + 'field0080' AS applyCodeField,-- CBS支付申请单号 + '' as receiptFiled,-- 电子回单字段 + COL_SUMMARY.id as summaryId, + formmain_0209.field0017||'-'||formson_0210.sort as referenceNum, -- 单据编号 + formmain_0209.START_DATE as startDate, -- 单据日期 + formmain_0209.FINISHEDFLAG as finishedflag, -- 流程状态 + formson_0210.field0073 as payDate, -- 打款日期 + formson_0210.field0072 as payResult, -- 支付结果 + formson_0210.field0080 AS applyCode,-- 支付申请单号 + REGEXP_REPLACE(formmain_0209.field0042, '[[:space:]]', '') as payAccount, -- 付款账户 + REGEXP_REPLACE(formmain_0209.field0041, '[[:space:]]', '') as payBankName, -- 付款开户行 + formson_0210.field0031 as amount, -- 金额 + formmain_0209.field0038 as purpose, -- 用途 + formmain_0209.field0038 as cbsAbstract, -- 摘要 + REGEXP_REPLACE(formson_0210.field0069, '[[:space:]]', '') as revAccount, -- 收款账户 + formson_0210.field0068 as revBankName, -- 收款开户行 + formson_0210.field0075 as revAccountName, -- 收款人 + REGEXP_REPLACE(formson_0210.field0071, '[[:space:]]', '') as cnapsCode, -- 收款联行号 + item.ENUMVALUE as personalFlag,-- 公私标记 + formson_0210.field0079 as revBankType, + '10' as currency, + '202' as busType, + '' as receipt -- 电子回单 + FROM + ( + SELECT + WM_CONCAT(id) AS formsonId, + formmain_id, + SUM(field0031) AS field0031, + MIN(sort) AS sort, + field0068, + field0069, + field0071, + field0079, + field0075, + field0070, + field0072, + field0073, + field0080 + FROM + formson_0210 + WHERE + field0067 = '-5486592002512828355' + GROUP BY + formmain_id, + field0068, + field0069, + field0071, + field0079, + field0075, + field0070, + field0072, + field0073, + field0080 + )formson_0210 + LEFT JOIN formmain_0209 ON formson_0210.FORMMAIN_ID = formmain_0209.id + LEFT JOIN COL_SUMMARY ON COL_SUMMARY.FORM_RECORDID = formmain_0209.id + left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070 + left join ORG_UNIT unit on unit.id =formmain_0209.field0002 + + + + + + + + + + + + + + + + + + + + + + update ${tableName} set + + ${payDateField} =#{payDate}, + ${payResultField} =#{payResult}, + ${applyCodeField} =#{applyCode} + + where id = #{formsonId} + + + + + update ${tableName} set ${receiptFiled}=#{receipt} where id = #{oaId} and ${receiptFiled} is null + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.java new file mode 100644 index 00000000..e1d66a2d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.java @@ -0,0 +1,155 @@ +package com.hzya.frame.seeyon.cbs8.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description cbs交易明细日志OA底表 + * @Author xiangerlin + * @Date 2024/6/24 10:49 + **/ +public class TransactionDetailEntity extends BaseEntity { + private String id;//id + private String accountNo;//银行账号 + private String accountName;//户名 + private String openBank;//开户行名称 + private String bankType;//我方银行类型 + private String bankTransactionDate;//交易日期 + private String transactionSerialNumber;//交易流水号 + private String bankSerialNumber;//银行流水号 + private String currency;//币种 + private String incurredAmount;//发生额 + private String purpose;//用途 + private String digest;//摘要 + private String oppositeAccount;//对方账号 + private String oppositeName;//对方户名 + private String oppositeOpeningBank;//对方开户行 + + private String remark;//备注 + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getAccountNo() { + return accountNo; + } + + public void setAccountNo(String accountNo) { + this.accountNo = accountNo; + } + + public String getAccountName() { + return accountName; + } + + public void setAccountName(String accountName) { + this.accountName = accountName; + } + + public String getOpenBank() { + return openBank; + } + + public void setOpenBank(String openBank) { + this.openBank = openBank; + } + + public String getBankTransactionDate() { + return bankTransactionDate; + } + + public void setBankTransactionDate(String bankTransactionDate) { + this.bankTransactionDate = bankTransactionDate; + } + + public String getTransactionSerialNumber() { + return transactionSerialNumber; + } + + public void setTransactionSerialNumber(String transactionSerialNumber) { + this.transactionSerialNumber = transactionSerialNumber; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public String getIncurredAmount() { + return incurredAmount; + } + + public void setIncurredAmount(String incurredAmount) { + this.incurredAmount = incurredAmount; + } + + public String getPurpose() { + return purpose; + } + + public void setPurpose(String purpose) { + this.purpose = purpose; + } + + public String getDigest() { + return digest; + } + + public void setDigest(String digest) { + this.digest = digest; + } + + public String getOppositeAccount() { + return oppositeAccount; + } + + public void setOppositeAccount(String oppositeAccount) { + this.oppositeAccount = oppositeAccount; + } + + public String getOppositeName() { + return oppositeName; + } + + public void setOppositeName(String oppositeName) { + this.oppositeName = oppositeName; + } + + public String getOppositeOpeningBank() { + return oppositeOpeningBank; + } + + public void setOppositeOpeningBank(String oppositeOpeningBank) { + this.oppositeOpeningBank = oppositeOpeningBank; + } + + public String getBankType() { + return bankType; + } + + public void setBankType(String bankType) { + this.bankType = bankType; + } + + public String getBankSerialNumber() { + return bankSerialNumber; + } + + public void setBankSerialNumber(String bankSerialNumber) { + this.bankSerialNumber = bankSerialNumber; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.xml new file mode 100644 index 00000000..3fa7fc60 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + id, + field0001 as accountNo, + field0002 as accountName, + field0003 as openBank, + field0004 as bankType, + field0005 as transactionSerialNumber, + field0006 as bankTransactionDate, + field0007 as bankSerialNumber, + field0008 as currency, + field0009 as incurredAmount, + field0010 as purpose, + field0011 as digest, + field0012 as oppositeAccount, + field0013 as oppositeName, + field0014 as oppositeOpeningBank, + field0015 as remark + + + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentDetailService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentDetailService.java new file mode 100644 index 00000000..f0a4811b --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentDetailService.java @@ -0,0 +1,18 @@ +package com.hzya.frame.seeyon.cbs8.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; + +/** + * @Description 代发代扣明细 + * @Author xiangerlin + * @Date 2024/6/26 11:00 + **/ +public interface IAgentPaymentDetailService extends IBaseService { + /** + * 更新明细表支付状态 + * @param detail + */ + void updatePayResult(AgentPaymentDetailEntity detail); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentService.java new file mode 100644 index 00000000..dcb6d78f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentService.java @@ -0,0 +1,45 @@ +package com.hzya.frame.seeyon.cbs8.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; + +import java.util.List; + +/** + * @Description OA代发代扣 + * @Author xiangerlin + * @Date 2024/6/18 15:04 + **/ +public interface IAgentPaymentService extends IBaseService { + + /** + * 查询待支付待代发代扣 主表 + * @param entity + * @return + * @throws Exception + */ + List queryUnpaid(AgentPaymentEntity entity) throws Exception; + + /** + * 根据支付申请单号查询 + * @param agentPayment + * @return + * @throws Exception + */ + AgentPaymentEntity queryByApplyCode(AgentPaymentEntity agentPayment)throws Exception; + + /** + * 查询明细表 + * @param entity + * @return + * @throws Exception + */ + List queryDetails(AgentPaymentDetailEntity entity)throws Exception; + + /** + * 更新支付状态 + * @param entity + */ + void updateResult(AgentPaymentEntity entity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java new file mode 100644 index 00000000..7160c21f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java @@ -0,0 +1,53 @@ +package com.hzya.frame.seeyon.cbs8.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; + +import java.util.List; + +/** + * @Description cbs8支付日志 + * @Author xiangerlin + * @Date 2024/6/14 17:22 + **/ +public interface ICbsLogService extends IBaseService { + /** + * 查询支付中的数据 + * @param logEntity + * @return + */ + List queryInPayment(CbsLogEntity logEntity); + /** + * 保存日志,通过rest接口的形式 + * @param logEntity + */ + void saveLog(CbsLogEntity logEntity); + + /** + * 补推,从自己开发的页面或者APIpost + * 需要传oa表单id和表单编号 + * @param entity + */ + void retry(CbsLogEntity entity); + /** + * 补推,从OA页面 + * 只需要传日志表id就行 + * @param jsonObject + */ + void resend(JSONObject jsonObject); + + /** + * 获取token + * @param entity + * @return + */ + SysExtensionApiEntity getTokenExt(SysExtensionApiEntity entity); + + /** + * 更新日志 + * @param logEntity + */ + void updateLog(CbsLogEntity logEntity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java new file mode 100644 index 00000000..4243084c --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java @@ -0,0 +1,63 @@ +package com.hzya.frame.seeyon.cbs8.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; + +import java.util.List; + +/** + * @Description oa对接cbs + * @Author xiangerlin + * @Date 2024/6/6 16:31 + **/ +public interface IPaymentService extends IBaseService { + + /** + * 查询待支付的数据 需要推送到CBS的 + * 如果需要查询流程状态已结束的 需要调用方设置finishedflag=1 + * @param entity + * @return + * @throws Exception + */ + List queryUnpaid(PaymentEntity entity)throws Exception; + + /** + * 查询交易成功的数据 + * 内置了查询条件payResult = PayState.payStateGetValue("g"); 支付成功 + * @param entity + * @return + * @throws Exception + */ + List querySuccess(PaymentEntity entity)throws Exception; + + /** + * 查询交易成功,且电子回单为空的 + * @param entity + * @return + * @throws Exception + */ + List queryElecIsNull(PaymentEntity entity)throws Exception; + + /** + * 查询支付中的数据 + * 内置了查询条件 payResult = '支付中' or payResult not in ('审批撤销','审批拒绝','处理失败','退票','支付成功','取消支付','修改支付','支付失败') + * @param entity + * @return + * @throws Exception + */ + List queryInPayment(PaymentEntity entity)throws Exception; + + /** + * 更新支付状态 + * @param entity + * @throws Exception + */ + void updatePayState(PaymentEntity entity)throws Exception; + + /** + * 更新电子回单字段 + * @param entity + * @throws Exception + */ + void updateElec(PaymentEntity entity)throws Exception; +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ITransactionDetailService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ITransactionDetailService.java new file mode 100644 index 00000000..61126686 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/ITransactionDetailService.java @@ -0,0 +1,29 @@ +package com.hzya.frame.seeyon.cbs8.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.TransactionDetailEntity; + +import java.util.List; + +/** + * @Description cbs交易明细 OA底表 + * @Author xiangerlin + * @Date 2024/6/24 11:07 + **/ +public interface ITransactionDetailService extends IBaseService { + + + /** + * 只返回交易流水号 + * @param entity + * @return + */ + List querySerialNumber(TransactionDetailEntity entity); + + /** + * 保存交易明细,通过rest接口的方式 + * @param entity + * @throws Exception + */ + void restSave(TransactionDetailEntity entity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentDetailServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentDetailServiceImpl.java new file mode 100644 index 00000000..8bbbad34 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentDetailServiceImpl.java @@ -0,0 +1,39 @@ +package com.hzya.frame.seeyon.cbs8.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDetailDao; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; +import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentDetailService; +import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/26 11:01 + **/ +@Service("OAAgentPaymentDetailServiceImpl") +public class AgentPaymentDetailServiceImpl extends BaseService implements IAgentPaymentDetailService { + + private IAgentPaymentDetailDao agentPaymentDetailDao; + + @Autowired + public void setAgentPaymentDetailDao(IAgentPaymentDetailDao agentPaymentDetailDao) { + this.agentPaymentDetailDao = agentPaymentDetailDao; + this.dao = agentPaymentDetailDao; + } + + /** + * 更新明细表支付状态 + * + * @param detail + */ + @DS("#detail.dataSourceCode") + @Override + public void updatePayResult(AgentPaymentDetailEntity detail) { + agentPaymentDetailDao.update("com.hzya.frame.seeyon.cbs8.dao.impl.AgentPaymentDetailDaoImpl.entity_update_result",detail); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentServiceImpl.java new file mode 100644 index 00000000..ab3ab4b9 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentServiceImpl.java @@ -0,0 +1,93 @@ +package com.hzya.frame.seeyon.cbs8.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDao; +import com.hzya.frame.seeyon.cbs8.dao.IAgentPaymentDetailDao; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity; +import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity; +import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentDetailService; +import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentService; +import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/18 15:06 + **/ +@Service(value = "cbs8AgentPaymentServiceImpl") +public class AgentPaymentServiceImpl extends BaseService implements IAgentPaymentService { + + private IAgentPaymentDao agentPaymentDao; + + @Autowired + private IAgentPaymentDetailService agentPaymentDetailService; + @Autowired + public void setAgentPaymentDao(IAgentPaymentDao agentPaymentDao) { + this.agentPaymentDao = agentPaymentDao; + this.dao = agentPaymentDao; + } + /** + * 查询待支付待代发代扣 主表 + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List queryUnpaid(AgentPaymentEntity entity) throws Exception { + List list = agentPaymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.dao.impl.AgentPaymentDaoImpl.entity_list_base_unpaid"); + return list; + } + + /** + * 根据支付申请单号查询 + * + * @param entity + * @return + * @throws Exception + */ + @Override + public AgentPaymentEntity queryByApplyCode(AgentPaymentEntity entity) throws Exception { + if (null != entity && StrUtil.isNotEmpty(entity.getApplyCode())){ + List list = agentPaymentDao.query(entity); + if (CollectionUtils.isNotEmpty(list)){ + if (list.size() > 1){ + throw new BaseSystemException("根据"+entity.getApplyCode()+"查询到多条记录"); + } + return list.get(0); + } + } + return null; + } + + /** + * 查询明细表 + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List queryDetails(AgentPaymentDetailEntity entity) throws Exception { + List list = agentPaymentDetailService.query(entity); + return list; + } + + /** + * @param entity + */ + @DS("#entity.dataSourceCode") + @Override + public void updateResult(AgentPaymentEntity entity) { + agentPaymentDao.update("com.hzya.frame.seeyon.cbs8.dao.impl.AgentPaymentDaoImpl.entity_update",entity); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java new file mode 100644 index 00000000..07a89a52 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java @@ -0,0 +1,198 @@ +package com.hzya.frame.seeyon.cbs8.service.impl; + +import cn.hutool.core.map.MapBuilder; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.dao.ICbsLogDao; +import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.cbs8.service.ICbsLogService; +import com.hzya.frame.seeyon.util.OAPayState; +import com.hzya.frame.seeyon.util.OARestUtil; +import com.hzya.frame.stringutil.StringUtil; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.commons.collections.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Description cbs8支付日志 + * @Author xiangerlin + * @Date 2024/6/14 17:22 + **/ +@Service(value = "CbsLogServiceImpl") +public class CbsLogServiceImpl extends BaseService implements ICbsLogService { + + + Logger log = LoggerFactory.getLogger(getClass()); + + private ICbsLogDao cbsLogDao; + @Value("${OA.data_source_code:}") + private String oa_data_source_code; + @Autowired + public void setCbsLogDao(ICbsLogDao cbsLogDao) { + this.cbsLogDao = cbsLogDao; + this.dao = cbsLogDao; + } + @Autowired + private OARestUtil restUtil; + + /** + * 查询支付中的数据 + * + * @param logEntity + * @return + */ + @DS("#logEntity.dataSourceCode") + @Override + public List queryInPayment(CbsLogEntity logEntity) { + List logList = cbsLogDao.queryList(logEntity, "CbsLogEntity_list_base_in_payment"); + return logList; + } + + /** + * 保存日志,通过rest接口的形式 + * + * @param cbsLogEntity + */ + @Override + public void saveLog(CbsLogEntity cbsLogEntity) { + String oa_id = StringUtil.nullConvert(cbsLogEntity.getOa_id()); + String bill_code = StringUtil.nullConvert(cbsLogEntity.getBill_code()); + String tab_name_en = StringUtil.nullConvert(cbsLogEntity.getTab_name_en()); + String tab_name_ch = StringUtil.nullConvert(cbsLogEntity.getTab_name_ch()); + String pay_state = StringUtil.nullConvert(cbsLogEntity.getPay_state()); + String message = StringUtil.nullConvert(cbsLogEntity.getMessage()); + String apply_state = StringUtil.nullConvert(cbsLogEntity.getApply_state()); + String successed = StringUtil.nullConvert(cbsLogEntity.getSuccessed()); + String title = StringUtil.nullConvert(cbsLogEntity.getTitle()); + String pay_company = StringUtil.nullConvert(cbsLogEntity.getPay_company()); + String payee = StringUtil.nullConvert(cbsLogEntity.getPayee()); + String amount = StringUtil.nullConvert(cbsLogEntity.getAmount()); + String cbs_apply_code = StringUtil.nullConvert(cbsLogEntity.getCbs_apply_code()); + //根据oaid判断是否在日志表中存在,如果存在,则更新,如果不存在,则新增 + CbsLogEntity cbsLogEntityResend=new CbsLogEntity(); + cbsLogEntityResend.setOa_id(cbsLogEntity.getOa_id()); + cbsLogEntityResend.setDataSourceCode(oa_data_source_code); + List queryList = query(cbsLogEntityResend); + if(CollectionUtils.isEmpty(queryList)){ + String data = StrUtil.format(getXmlTemplate(),title,pay_company,payee,amount,cbs_apply_code,bill_code,oa_id,tab_name_ch,tab_name_en,pay_state,message,apply_state,successed); + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000240007") + .put("publicKey","ZJYAorA7JuRDfrVjywcx78BFcqlLwthgXNC65TXxxQMUHuxCe7eDIk+3zDUT+v578prj")//发送者 + .put("secretKey","a54vt9Wx7gdBig+4JCkZ/lISIIL2m4ZEyZkXtW0uQVBDHS+V4SVgT6xhNblacri/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//发送者 + .put("appId","800024") + .build(); + JSONObject paramsTemplate = new JSONObject(); + paramsTemplate.put("loginName", "hzya_rest"); + paramsTemplate.put("dataXml", data); + String params = JSONObject.toJSONString(paramsTemplate); + logger.info("保存支付申请日志到OA底表请求参数:{}",params); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(params).timeout(60000).execute().body(); + logger.info("保存支付申请日志到OA底表响应参数:{}",body); + }else{ + for (CbsLogEntity logEntity : queryList) { + logEntity.setPay_state(pay_state); + logEntity.setMessage(message); + logEntity.setApply_state(apply_state); + logEntity.setSuccessed(successed); + logEntity.setBill_code(cbsLogEntity.getBill_code()); + logEntity.setDataSourceCode(oa_data_source_code); + try { + update(logEntity); + }catch (Exception e){ + e.printStackTrace(); + logger.error("更新"); + } + } + } + } + + /** + * 补推,从自己开发的页面或者APIpost + * 需要传oa表单id和表单编号 + * + * @param entity + */ + @Override + public void retry(CbsLogEntity entity) { + PaymentEntity paymentEntity = new PaymentEntity(); + paymentEntity.setOaId(entity.getOa_id()); + paymentEntity.setReferenceNum(entity.getBill_code()); + CbsLogEntity logEntity = new CbsLogEntity(); + logEntity.setId(entity.getId()); + logEntity = cbsLogDao.queryOne(logEntity); + String pay_state = logEntity.getPay_state(); + if (OAPayState.h.getValue().equals(pay_state) + || OAPayState.three.getValue().equals(pay_state) + || OAPayState.k.getValue().equals(pay_state) + || "推送失败".equals(pay_state)){ + //todo 调用重试方法 + }else { + throw new BaseSystemException("只允许补推支付失败的记录"); + } + } + + /** + * 补推,从OA页面 + * 只需要传日志表id就行 + * + * @param jsonObject + */ + @Override + public void resend(JSONObject jsonObject) { + if (null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("id"))){ + String id = jsonObject.getString("id"); + CbsLogEntity cbsLogEntity = new CbsLogEntity(); + cbsLogEntity.setId(id); + cbsLogEntity =cbsLogDao.queryOne(cbsLogEntity); + if (null != cbsLogEntity && StrUtil.isNotEmpty(cbsLogEntity.getOa_id()) && StrUtil.isNotEmpty(cbsLogEntity.getBill_code())){ + retry(cbsLogEntity); + } + } + } + + /** + * 获取token + * + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity getTokenExt(SysExtensionApiEntity entity) { + String token = restUtil.getToken("hzya_rest", "8000240000"); + Map headers = entity.getHeaders(); + if (null == headers){ + headers = new HashMap<>(); + } + headers.put("token",token); + return entity; + } + + /** + * 更新日志 + * + * @param logEntity + */ + @DS("#logEntity.dataSourceCode") + @Override + public void updateLog(CbsLogEntity logEntity) { + cbsLogDao.update(logEntity); + } + + //获取xml模板 + private String getXmlTemplate(){ + return ""; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java new file mode 100644 index 00000000..3a8b01f1 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java @@ -0,0 +1,150 @@ +package com.hzya.frame.seeyon.cbs8.service.impl; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.dao.IPaymentDao; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.cbs8.service.IPaymentService; +import com.hzya.frame.seeyon.util.OAPayState; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/6 16:34 + **/ +@Service("OAPaymentServiceImpl") +public class PaymentServiceImpl extends BaseService implements IPaymentService { + + + + private IPaymentDao paymentDao; + + @Autowired + public void setPaymentDao(IPaymentDao paymentDao) { + this.paymentDao = paymentDao; + this.dao = paymentDao; + } + + /** + * 查询列表 + * @param entity + * @return + */ + @DS("#entity.dataSourceCode") + @Override + public List query(PaymentEntity entity) { + List list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.entity_list_base"); + return list; + } + + /** + * 查询待支付的数据 需要推送到CBS的 + * 如果需要查询流程状态已结束的 需要调用方设置finishedflag=1 + * + * @param entity + * @return + * @throws Exception + */ + + + @DS("#entity.dataSourceCode") + @Override + public List queryUnpaid(PaymentEntity entity) throws Exception { + List list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_list_base_unpaid"); + return list; + } + + /** + * 查询交易成功的数据 + * 内置了查询条件payResult = PayState.payStateGetValue("g"); 支付成功 + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List querySuccess(PaymentEntity entity) throws Exception { + if (null == entity){ + entity = new PaymentEntity(); + } + entity.setPayResult(OAPayState.payStateGetValue("g")); + List list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_list_base"); + return list; + } + + /** + * 查询交易成功,且电子回单为空的 + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List queryElecIsNull(PaymentEntity entity) throws Exception { + List list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_list_base_elec_isnull"); + return list; + } + + /** + * 查询支付中的数据 + * 内置了查询条件 payResult = '支付中' or payResult not in ('审批撤销','审批拒绝','处理失败','退票','支付成功','取消支付','修改支付','支付失败') + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List queryInPayment(PaymentEntity entity) throws Exception { + List list = paymentDao.queryList(entity, "com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_list_base_in_payment"); + return list; + } + + /** + * 更新支付状态 + * + * @param entity + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public void updatePayState(PaymentEntity entity) throws Exception { + if (null != entity + && StrUtil.isNotEmpty(entity.getTableName()) + && StrUtil.isNotEmpty(entity.getOaId()) + && StrUtil.isNotEmpty(entity.getFormsonId()) + && StrUtil.isNotEmpty(entity.getPayDateField()) + && StrUtil.isNotEmpty(entity.getPayResultField())){ + String formsonId = entity.getFormsonId(); + String[] formsonIdArray = formsonId.split(","); + for (String s : formsonIdArray) { + entity.setFormsonId(s); + paymentDao.update("com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_update_payState",entity); + } + } + } + + /** + * 更新电子回单字段 + * + * @param entity + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public void updateElec(PaymentEntity entity) throws Exception { + if (null != entity + && StrUtil.isNotEmpty(entity.getTableName()) + && StrUtil.isNotEmpty(entity.getOaId()) + && StrUtil.isNotEmpty(entity.getReceiptFiled())){ + paymentDao.update("com.hzya.frame.seeyon.cbs8.entity.PaymentEntity.PaymentEntity_update_electronic",entity); + } + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/TransactionDetailServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/TransactionDetailServiceImpl.java new file mode 100644 index 00000000..21cee3ea --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/TransactionDetailServiceImpl.java @@ -0,0 +1,98 @@ +package com.hzya.frame.seeyon.cbs8.service.impl; + +import cn.hutool.core.map.MapBuilder; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.dao.ITransactionDetailDao; +import com.hzya.frame.seeyon.cbs8.entity.TransactionDetailEntity; +import com.hzya.frame.seeyon.cbs8.service.IPaymentService; +import com.hzya.frame.seeyon.cbs8.service.ITransactionDetailService; +import com.hzya.frame.stringutil.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/24 11:08 + **/ +@Service(value = "OATransactionDetailServiceImpl") +public class TransactionDetailServiceImpl extends BaseService implements ITransactionDetailService { + + private ITransactionDetailDao transactionDetailDao; + + @Autowired + public void setTransactionDetailDao(ITransactionDetailDao dao) { + this.transactionDetailDao = dao; + this.dao=dao; + } + + /** + * 只返回交易流水号 + * + * @param entity + * @return + */ + @DS("#entity.dataSourceCode") + @Override + public List querySerialNumber(TransactionDetailEntity entity) { + List list = transactionDetailDao.queryList(entity, "TransactionDetailEntity_list_serialNumber");; + return list; + } + + /** + * 保存交易明细,通过rest接口的方式 + * + * @param entity + * @throws Exception + */ + @Override + public void restSave(TransactionDetailEntity entity) { + String field0001= StringUtil.nullConvert(entity.getAccountNo());//我方银行账号 + String field0002=StringUtil.nullConvert(entity.getAccountName());//我方户名 + String field0003=StringUtil.nullConvert(entity.getOpenBank());//我方开户行 + String field0004=StringUtil.nullConvert(entity.getBankType());//我方银行类型 + String field0005=StringUtil.nullConvert(entity.getTransactionSerialNumber());//交易流水号 + String field0006=StringUtil.nullConvert(entity.getBankTransactionDate());//交易日期 + String field0007=StringUtil.nullConvert(entity.getBankSerialNumber());//银行流水号 + String field0008=StringUtil.nullConvert(entity.getCurrency());//币种 + String field0009=StringUtil.nullConvert(entity.getIncurredAmount());//收款金额 + String field0010=StringUtil.nullConvert(entity.getPurpose());//用途 + String field0011=StringUtil.nullConvert(entity.getDigest());//摘要 + String field0012=StringUtil.nullConvert(entity.getOppositeAccount());//对方账号 + String field0013=StringUtil.nullConvert(entity.getOppositeName());//对方户名 + String field0014=StringUtil.nullConvert(entity.getOppositeOpeningBank());//对方开户行 + String field0015=StringUtil.nullConvert(entity.getRemark());//备注 + String data = StrUtil.format(getXmlTemplate(),field0001,field0002,field0003,field0004,field0005,field0006,field0007,field0008,field0009,field0010,field0011,field0012,field0013,field0014,field0015); + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000240006") + .put("publicKey","ZJYAorA7JuRDfrVjywcx78BFcqlLwthgXNC65TXxxQMUHuxCe7eDIk+3zDUT+v578prj") + .put("secretKey","a54vt9Wx7gdBig+4JCkZ/lISIIL2m4ZEyZkXtW0uQVBDHS+V4SVgT6xhNblacri/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800024") + .build(); + JSONObject paramsTemplate = new JSONObject(); + paramsTemplate.put("loginName", "hzya_rest"); + paramsTemplate.put("dataXml", data); + String params = JSONObject.toJSONString(paramsTemplate); + logger.info("保存交易明细到OA底表请求参数:{}",params); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(params).timeout(60000).execute().body(); + logger.info("保存交易明细到OA底表响应参数:{}",body); + } + + /** + * 无流程表单模版 + * transaction 交易明细 + * payApply 支付申请日志 + * @return + */ + private String getXmlTemplate(){ + return ""; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java new file mode 100644 index 00000000..f892fa11 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICapFormDefinitionDao.java @@ -0,0 +1,51 @@ +package com.hzya.frame.seeyon.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.entity.CapFormDefinitionEntity; +import com.hzya.frame.seeyon.entity.CtpFileEntity; +import com.hzya.frame.seeyon.paybill.entity.PayBillEntity; + +import java.util.List; + +/** + * + * @content OA字段配置表DAO + * @className: Administrator + * @author laborer + * @date 2024-09-09 16:00 + * + */ + +public interface ICapFormDefinitionDao extends IBaseDao { + + /** + * + * @content 通过模版编号获取无流程表单配置信息 + * @className: Administrator + * @author laborer + * @date 2024-09-09 16:02 + * + */ + List getFormFiled(CapFormDefinitionEntity fieldInfo); +/** + * + * @content 通过主键删除单据数据 + * @className: Administrator + * @author laborer + * @date 2024-09-09 17:04 + * + */ + + int deleteByKey(CapFormDefinitionEntity fieldInfo); +/** + * + * @content 通过客户传递的数据值查询古河条件的数据 + * @className: Administrator + * @author laborer + * @date 2024-09-09 17:05 + * + */ + + List getFormFiledByFileValue(CapFormDefinitionEntity fieldInfo); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpAttachmentDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpAttachmentDao.java new file mode 100644 index 00000000..5c64e35f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpAttachmentDao.java @@ -0,0 +1,21 @@ +package com.hzya.frame.seeyon.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; + +import java.util.List; + +public interface ICtpAttachmentDao extends IBaseDao { + //更新数据 + @DS("#ctpAttachmentEntity.dataSourceCode") + int updateCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity); + + //根据fiel_url查询附件业务记录,如果存在则更新,如果不存在则新增 + @DS("#ctpAttachmentEntity.dataSourceCode") + List queryCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity); + + //新增 + @DS("#ctpAttachmentEntity.dataSourceCode") + CtpAttachmentEntity saveCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpFileDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpFileDao.java new file mode 100644 index 00000000..87961648 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ICtpFileDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.entity.CtpFileEntity; + +/** + * @Description seeyon 附件对象 + * @Author xiangerlin + * @Date 2024/6/17 15:21 + **/ +public interface ICtpFileDao extends IBaseDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonDao.java new file mode 100644 index 00000000..02d6888a --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonDao.java @@ -0,0 +1,108 @@ +package com.hzya.frame.seeyon.dao; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.seeyon.entity.SeeyonEntity; + +import java.util.List; + +/** + * com.hzya.frame.seeyon.dao + * + * @author yqh + * @date 2023-08 -30 10:43 + */ + +public interface ISeeYonDao extends IBaseDao { + /*** + * @Content:通过类型获取OA基本档案数据 + * @Author 👻👻👻👻yqh👻👻👻👻 + * @Date 2023年8月30日11:33:17 + * @Param seeyon + * @return + **/ + @DS("ht_oa_sqlserver") + List selectOAListByTypeformson_0324(SeeyonEntity seeyon); + @DS("ht_oa_sqlserver") + List selectOAListByTypeformson_0352(SeeyonEntity seeyon); + @DS("ht_oa_sqlserver") + List selectOAListByTypeMain(SeeyonEntity seeyon); + /** + * 通过关联关系获取附件主键 + * @param seeyonEntity + * @return + */ + @DS("ht_oa_sqlserver") + List selectFileUrl(SeeyonEntity seeyonEntity); +/*** + * @Content:修改数据状态,避免重复抓取 + * @Author 👻👻👻👻yqh👻👻👻👻 + * @Date + * @Param + * @return + **/ + int updateFormStete(SeeyonEntity s); + + /** + * + * @content 查询付款单中得电子回单 + * @Param + * @Return + * @Author hecan + * @Date 2023/11/9 14:23 + * **/ + @DS("ht_oa_sqlserver") + List selectOAListByTypeformmain_0327(SeeyonEntity seeyon); + @DS("ht_oa_sqlserver") + int updateFormformmain_0327(SeeyonEntity seeyon); + + /** + * + * @content 根据付款方id查询付款名 + * @Param + * @Return + * @Author hecan + * @Date 2023/11/9 14:23 + * **/ + @DS("ht_oa_sqlserver") + List selectOAListByField0258(SeeyonEntity seeyon); + + /** + * + * @content 查询速网U8C中的所有组织 + * @Param + * @Return + * @Author hecan + * @Date 2023/11/13 11:56 + * **/ + @DS("sowow_sqlserver_test") + List selectOAListByCorp(SeeyonEntity seeyon); + + /** + * + * @content 修改OA中的字段为速网U8C销售订单主键 + * @Param + * @Return + * @Author hecan + * @Date 2023/11/15 11:28 + * **/ + @DS("swoa_mysql") + int updateFormformmain_0237(SeeyonEntity seeyonEntity); + @DS("swoa_mysql") + int updateFormformson_0238(SeeyonEntity seeyonEntity); + //根据销售订单编码查询档案主键 + @DS("swoa_mysql") + SeeyonEntity selectOAListByformmain_0237(SeeyonEntity seeyonEntity); + + /** + * + * @content 修改付款单报销单等单据的推送状态 + * @Param + * @Return + * @Author hecan + * @Date 2023/12/20 8:59 + * **/ + @DS("ht_oa_sqlserver") + int updatepush(SeeyonEntity seeyon); + +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonInterFaceDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonInterFaceDao.java new file mode 100644 index 00000000..2edbc648 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/ISeeYonInterFaceDao.java @@ -0,0 +1,37 @@ +package com.hzya.frame.seeyon.dao; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; + +import java.util.List; +import java.util.Map; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +public interface ISeeYonInterFaceDao { + /*** + * 查询OA档案数据,暂时只根据ID查询,只返回ID集合,此方法暂时用于更新无流程表单判断 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-30 10:54 + * @param + * @return java.util.List + **/ + List queryArchives(SeeYonInterFaceEntity seeYonInterFaceEntity); + + /*** + * 答应我写注释好吗 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2024-01-18 16:01 + * @param jsonObject 根据模版ID获取数据 + * @return java.util.List + **/ + List queryDefinitionInfo(SeeYonInterFaceEntity jsonObject); + List> queryDefinitionData(SeeYonInterFaceEntity jsonObject); + +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java new file mode 100644 index 00000000..07304f45 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CapFormDefinitionDaoImpl.java @@ -0,0 +1,39 @@ +package com.hzya.frame.seeyon.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.dao.ICapFormDefinitionDao; +import com.hzya.frame.seeyon.dao.ICtpFileDao; +import com.hzya.frame.seeyon.entity.CapFormDefinitionEntity; +import com.hzya.frame.seeyon.entity.CtpFileEntity; +import com.hzya.frame.seeyon.paybill.entity.PayBillEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * @content OA字段配置表DAO + * @className: Administrator + * @author laborer + * @date 2024-09-09 16:00 + * + */ +@Repository(value = "CapFormDefinitionDaoImpl") +public class CapFormDefinitionDaoImpl extends MybatisGenericDao implements ICapFormDefinitionDao { + @DS("#fieldInfo.dataSourceCode") + @Override + public List getFormFiled(CapFormDefinitionEntity fieldInfo) { + return (List) selectList("com.hzya.frame.seeyon.entity.CapFormDefinitionEntity.CapFormDefinitionEntity_list_base",fieldInfo); + } + @DS("#fieldInfo.dataSourceCode") + @Override + public int deleteByKey(CapFormDefinitionEntity fieldInfo) { + return super.delete("com.hzya.frame.seeyon.entity.CapFormDefinitionEntity.CapFormDefinitionEntity_delete",fieldInfo); + } + @DS("#fieldInfo.dataSourceCode") + @Override + public List getFormFiledByFileValue(CapFormDefinitionEntity fieldInfo) { + return (List) selectList("com.hzya.frame.seeyon.entity.CapFormDefinitionEntity.CapFormDefinitionEntity_list_table_info",fieldInfo); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpAttachmentDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpAttachmentDaoImpl.java new file mode 100644 index 00000000..080c28bc --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpAttachmentDaoImpl.java @@ -0,0 +1,31 @@ +package com.hzya.frame.seeyon.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.dao.ICtpAttachmentDao; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +@Repository(value = "ctpAttachmentDaoImpl") +public class +CtpAttachmentDaoImpl extends MybatisGenericDao implements ICtpAttachmentDao { + @DS("#ctpAttachmentEntity.dataSourceCode") + @Override + public int updateCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity) { + return super.update("com.hzya.frame.seeyon.dao.impl.CtpAttachmentDaoImpl.entity_update",ctpAttachmentEntity); + } + + @DS("#ctpAttachmentEntity.dataSourceCode") + @Override + public List queryCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.CtpAttachmentDaoImpl.entity_list_base",ctpAttachmentEntity); + } + + @DS("#ctpAttachmentEntity.dataSourceCode") + @Override + public CtpAttachmentEntity saveCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity) { + return super.save("com.hzya.frame.seeyon.dao.impl.CtpAttachmentDaoImpl.entity_insert",ctpAttachmentEntity); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpFileDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpFileDaoImpl.java new file mode 100644 index 00000000..8b80d3d7 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpFileDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.seeyon.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.dao.ICtpAttachmentDao; +import com.hzya.frame.seeyon.dao.ICtpFileDao; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; +import com.hzya.frame.seeyon.entity.CtpFileEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/17 15:22 + **/ +@Repository() +public class CtpFileDaoImpl extends MybatisGenericDao implements ICtpFileDao { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonDaoImpl.java new file mode 100644 index 00000000..332ae7fc --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonDaoImpl.java @@ -0,0 +1,94 @@ +package com.hzya.frame.seeyon.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.dao.ISeeYonDao; +import com.hzya.frame.seeyon.entity.SeeyonEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * com.hzya.frame.seeyon.dao.impl + * + * @author yqh + * @date 2023-08 -30 10:44 + */ +@DS("htsqlserver") +@Repository(value = "seeYonDaoImpl") +public class SeeYonDaoImpl extends MybatisGenericDao implements ISeeYonDao { + @DS("ht_oa_sqlserver") + @Override + public List selectOAListByTypeformson_0352(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_formson_0352",seeyon); + } + @DS("ht_oa_sqlserver") + @Override + public List selectOAListByTypeformson_0324(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_formson_0324",seeyon); + } + @DS("ht_oa_sqlserver") + @Override + public List selectOAListByTypeMain(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_main",seeyon); + } + @DS("ht_oa_sqlserver") + @Override + public List selectFileUrl(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_ctp_attachment",seeyon); + } + @DS("ht_oa_sqlserver") + @Override + public int updateFormStete(SeeyonEntity s) { + return super.update("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_update",s); + } + + @DS("ht_oa_sqlserver") + @Override + public List selectOAListByTypeformmain_0327(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_formmain_0327",seeyon); + } + + @DS("ht_oa_sqlserver") + @Override + public int updateFormformmain_0327(SeeyonEntity seeyon) { + return super.update("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_update_formmain_0327",seeyon); + } + + @DS("ht_oa_sqlserver") + @Override + public List selectOAListByField0258(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_field0258",seeyon); + } + + @DS("sowow_sqlserver_test") + @Override + public List selectOAListByCorp(SeeyonEntity seeyon) { + return (List) super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_corp",seeyon); + } + + @Override + @DS("swoa_mysql") + public int updateFormformmain_0237(SeeyonEntity seeyonEntity) { + return super.update("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_update_formmain_0237",seeyonEntity); + } + + @Override + @DS("swoa_mysql") + public int updateFormformson_0238(SeeyonEntity seeyonEntity) { + return super.update("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_update_formson_0238",seeyonEntity); + } + + @Override + @DS("swoa_mysql") + public SeeyonEntity selectOAListByformmain_0237(SeeyonEntity seeyonEntity) { + return (SeeyonEntity) super.selectOne("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_list_base_formmain_0237",seeyonEntity); + } + + @DS("ht_oa_sqlserver") + @Override + public int updatepush(SeeyonEntity seeyon) { + return super.update("com.hzya.frame.seeyon.dao.impl.SeeYonDaoImpl.entity_update_push",seeyon); + } + +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonInterFaceDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonInterFaceDaoImpl.java new file mode 100644 index 00000000..4091f0be --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/dao/impl/SeeYonInterFaceDaoImpl.java @@ -0,0 +1,43 @@ +package com.hzya.frame.seeyon.dao.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.dao.ISeeYonInterFaceDao; +import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +@Repository(value = "seeYonInterFaceDao") +public class SeeYonInterFaceDaoImpl extends MybatisGenericDao implements ISeeYonInterFaceDao { + + + @Override + @DS("ht_oa_sqlserver") + public List queryArchives(SeeYonInterFaceEntity seeYonInterFaceEntity) { + List list = super.query("com.hzya.frame.seeyon.dao.impl.SeeYonInterFaceDaoImpl.queryArchives",seeYonInterFaceEntity); + return list; + } + + @Override + @DS("#seeYonInterFaceEntity.dataSourceCode") + public List queryDefinitionInfo(SeeYonInterFaceEntity seeYonInterFaceEntity) { + + return super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonInterFaceDaoImpl.queryDefinitionInfo",seeYonInterFaceEntity); + } + + @Override + @DS("#seeYonInterFaceEntity.dataSourceCode") + public List> queryDefinitionData(SeeYonInterFaceEntity seeYonInterFaceEntity) { + List> list = super.selectList("com.hzya.frame.seeyon.dao.impl.SeeYonInterFaceDaoImpl.queryDefinitionData",seeYonInterFaceEntity); + return list ; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java new file mode 100644 index 00000000..2ab841bd --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.java @@ -0,0 +1,71 @@ +package com.hzya.frame.seeyon.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.io.File; + +/** + * + * @content OA字段配置表 + * @className: Administrator + * @author laborer + * @date 2024-09-09 15:48 + * + */ + +public class CapFormDefinitionEntity extends BaseEntity { + private String fieldInfo;//字段属性定义 + private String viewInfo;//视图权限定义 + private String appbindInfo;//应用绑定定义 + private String tableName;//表名 + private String fieldName;//字段名称 + private String fieldValue;//字段值 + + public String getFieldValue() { + return fieldValue; + } + + public void setFieldValue(String fieldValue) { + this.fieldValue = fieldValue; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getFieldInfo() { + return fieldInfo; + } + + public void setFieldInfo(String fieldInfo) { + this.fieldInfo = fieldInfo; + } + + public String getViewInfo() { + return viewInfo; + } + + public void setViewInfo(String viewInfo) { + this.viewInfo = viewInfo; + } + + public String getAppbindInfo() { + return appbindInfo; + } + + public void setAppbindInfo(String appbindInfo) { + this.appbindInfo = appbindInfo; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml new file mode 100644 index 00000000..5c0a498d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CapFormDefinitionEntity.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + id, + field_info, + view_info, + appbind_info + + + + + + + + + + delete from ${tableName} where ${fieldName} = #{id} + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CfsLogEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CfsLogEntity.java new file mode 100644 index 00000000..31c22e17 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CfsLogEntity.java @@ -0,0 +1,65 @@ +package com.hzya.frame.seeyon.entity; + +/** + * @Description 保存交行日志用 + * @Author xiangerlin + * @Date 2024/3/18 14:07 + **/ +public class CfsLogEntity { + + private String tab_name_ch;//中文表名 + private String tab_name_en;//英文表名 + private OAWorkflowEventDataEntity oaWorkflowEventDataEntity;//无流程表单数据 + + private String result;//交通银行返回的参数(解析后的) + public CfsLogEntity() { + + } + + /** + * + * @param tab_name_ch 中文表名 + * @param tab_name_en 英文表名 + * @param oaWorkflowEventDataEntity 无流程表单数据 + */ + public CfsLogEntity(String tab_name_ch, String tab_name_en, OAWorkflowEventDataEntity oaWorkflowEventDataEntity,String result) { + this.tab_name_ch = tab_name_ch; + this.tab_name_en = tab_name_en; + this.oaWorkflowEventDataEntity = oaWorkflowEventDataEntity; + this.result=result; + } + + public String getTab_name_ch() { + return tab_name_ch; + } + + public void setTab_name_ch(String tab_name_ch) { + this.tab_name_ch = tab_name_ch; + } + + public String getTab_name_en() { + return tab_name_en; + } + + public void setTab_name_en(String tab_name_en) { + this.tab_name_en = tab_name_en; + } + + + + public OAWorkflowEventDataEntity getOaWorkflowEventDataEntity() { + return oaWorkflowEventDataEntity; + } + + public void setOaWorkflowEventDataEntity(OAWorkflowEventDataEntity oaWorkflowEventDataEntity) { + this.oaWorkflowEventDataEntity = oaWorkflowEventDataEntity; + } + + public String getResult() { + return result; + } + + public void setResult(String result) { + this.result = result; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CollAttachmentResDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CollAttachmentResDTO.java new file mode 100644 index 00000000..42094a55 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CollAttachmentResDTO.java @@ -0,0 +1,340 @@ +package com.hzya.frame.seeyon.entity; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import com.alibaba.fastjson.annotation.JSONField; + +import java.util.List; +import java.util.Map; + +/** + * @Description 查询协同附件列表返回对象 /rest/coll/attachments/{summaryID}/{attType} + * @Author xiangerlin + * @Date 2024/8/16 09:11 + **/ +public class CollAttachmentResDTO { + private String id; //ctp_attachment 表的id + private String reference;// 流程表的id, col_summary + private String subReference;//流程表单附件字段存的id + private String category;//应用分类 + private String type; + private String filename;//附件名称 + private String mimeType;//附件类型 + private String createdate; + private String size;//附件大小 + private String description; + private String fileUrl;//附件id,ctp_file 表的逐渐 + private String extension; + private String icon; + private String iconFont; + private String genesisId; + private String sort; + private String officeTransformEnable; + private String obsObjectKey; + private String secretLevel; + private String secretLevelName; + private String canBrowse; + private String v; + private Boolean wpsOnlineEnable; + private Boolean allowTrans; + private JSONObject transValue; + private String createdateStr; + @JSONField(name = "new") + private Boolean newFile; + private Map extraMap; // 使用Map来存储额外的键值对 + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getReference() { + return reference; + } + + public void setReference(String reference) { + this.reference = reference; + } + + public String getSubReference() { + return subReference; + } + + public void setSubReference(String subReference) { + this.subReference = subReference; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getFilename() { + return filename; + } + + public void setFilename(String filename) { + this.filename = filename; + } + + public String getMimeType() { + return mimeType; + } + + public void setMimeType(String mimeType) { + this.mimeType = mimeType; + } + + public String getCreatedate() { + return createdate; + } + + public void setCreatedate(String createdate) { + this.createdate = createdate; + } + + public String getSize() { + return size; + } + + public void setSize(String size) { + this.size = size; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getFileUrl() { + return fileUrl; + } + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + public String getExtension() { + return extension; + } + + public void setExtension(String extension) { + this.extension = extension; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public String getIconFont() { + return iconFont; + } + + public void setIconFont(String iconFont) { + this.iconFont = iconFont; + } + + public String getGenesisId() { + return genesisId; + } + + public void setGenesisId(String genesisId) { + this.genesisId = genesisId; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public String getOfficeTransformEnable() { + return officeTransformEnable; + } + + public void setOfficeTransformEnable(String officeTransformEnable) { + this.officeTransformEnable = officeTransformEnable; + } + + public String getObsObjectKey() { + return obsObjectKey; + } + + public void setObsObjectKey(String obsObjectKey) { + this.obsObjectKey = obsObjectKey; + } + + public String getSecretLevel() { + return secretLevel; + } + + public void setSecretLevel(String secretLevel) { + this.secretLevel = secretLevel; + } + + public String getSecretLevelName() { + return secretLevelName; + } + + public void setSecretLevelName(String secretLevelName) { + this.secretLevelName = secretLevelName; + } + + public String getCanBrowse() { + return canBrowse; + } + + public void setCanBrowse(String canBrowse) { + this.canBrowse = canBrowse; + } + + public String getV() { + return v; + } + + public void setV(String v) { + this.v = v; + } + + public Boolean getWpsOnlineEnable() { + return wpsOnlineEnable; + } + + public void setWpsOnlineEnable(Boolean wpsOnlineEnable) { + this.wpsOnlineEnable = wpsOnlineEnable; + } + + public Boolean getAllowTrans() { + return allowTrans; + } + + public void setAllowTrans(Boolean allowTrans) { + this.allowTrans = allowTrans; + } + + public JSONObject getTransValue() { + return transValue; + } + + public void setTransValue(JSONObject transValue) { + this.transValue = transValue; + } + + public String getCreatedateStr() { + return createdateStr; + } + + public void setCreatedateStr(String createdateStr) { + this.createdateStr = createdateStr; + } + + public Boolean getNewFile() { + return newFile; + } + + public void setNewFile(Boolean newFile) { + this.newFile = newFile; + } + + public Map getExtraMap() { + return extraMap; + } + + public void setExtraMap(Map extraMap) { + this.extraMap = extraMap; + } + + public static void main(String[] args) { + String str = "[{\n" + + "\t\"id\": 5180424495316486643,\n" + + "\t\"reference\": -1741558410793893622,\n" + + "\t\"subReference\": 584122959825946183,\n" + + "\t\"category\": 66,\n" + + "\t\"type\": 0,\n" + + "\t\"filename\": \"Order.pdf\",\n" + + "\t\"mimeType\": \"application/pdf\",\n" + + "\t\"createdate\": 1723454209000,\n" + + "\t\"size\": 131234,\n" + + "\t\"description\": null,\n" + + "\t\"fileUrl\": -5577707714790406265,\n" + + "\t\"extension\": \"pdf\",\n" + + "\t\"icon\": \"pdf.gif\",\n" + + "\t\"iconFont\": \"pdf\",\n" + + "\t\"genesisId\": null,\n" + + "\t\"sort\": 0,\n" + + "\t\"officeTransformEnable\": \"disable\",\n" + + "\t\"obsObjectKey\": \"\",\n" + + "\t\"secretLevel\": null,\n" + + "\t\"secretLevelName\": null,\n" + + "\t\"canBrowse\": 1,\n" + + "\t\"v\": \"fcdf8ae9d97bf2969fa6005394442885\",\n" + + "\t\"wpsOnlineEnable\": false,\n" + + "\t\"allowTrans\": false,\n" + + "\t\"transValue\": {\n" + + "\t\t\"isWpsOnlineEnable\": false,\n" + + "\t\t\"isAllowTrans\": false\n" + + "\t},\n" + + "\t\"createdateStr\": \"1723454209000\",\n" + + "\t\"new\": false,\n" + + "\t\"extraMap\": {}\n" + + "}, {\n" + + "\t\"id\": -6639984402087339,\n" + + "\t\"reference\": -1741558410793893622,\n" + + "\t\"subReference\": 649078190027982545,\n" + + "\t\"category\": 66,\n" + + "\t\"type\": 0,\n" + + "\t\"filename\": \"Invoice.pdf\",\n" + + "\t\"mimeType\": \"application/pdf\",\n" + + "\t\"createdate\": 1723454201000,\n" + + "\t\"size\": 158553,\n" + + "\t\"description\": null,\n" + + "\t\"fileUrl\": -4345076582332676605,\n" + + "\t\"extension\": \"pdf\",\n" + + "\t\"icon\": \"pdf.gif\",\n" + + "\t\"iconFont\": \"pdf\",\n" + + "\t\"genesisId\": null,\n" + + "\t\"sort\": 0,\n" + + "\t\"officeTransformEnable\": \"disable\",\n" + + "\t\"obsObjectKey\": \"\",\n" + + "\t\"secretLevel\": null,\n" + + "\t\"secretLevelName\": null,\n" + + "\t\"canBrowse\": 1,\n" + + "\t\"v\": \"85d721af033c7dddf385be2c7ea8d423\",\n" + + "\t\"wpsOnlineEnable\": false,\n" + + "\t\"allowTrans\": false,\n" + + "\t\"transValue\": {\n" + + "\t\t\"isWpsOnlineEnable\": false,\n" + + "\t\t\"isAllowTrans\": false\n" + + "\t},\n" + + "\t\"createdateStr\": \"1723454201000\",\n" + + "\t\"new\": false,\n" + + "\t\"extraMap\": {}\n" + + "}]"; + List list = JSON.parseArray(str,CollAttachmentResDTO.class); + System.out.println(list); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.java new file mode 100644 index 00000000..1b482263 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.java @@ -0,0 +1,124 @@ +package com.hzya.frame.seeyon.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.Date; + +/** + * + * @content OA附件业务表 + * @Param + * @Return + * @Author hecan + * @Date 2023/11/1 14:58 + * **/ +public class CtpAttachmentEntity extends BaseEntity { + private String id;//主键ID + private String sub_reference;//次数据ID此id为真正写在流程表单中的ID + private String category; //应用分类、 + private String type;//分类 + private String filename;//附件名称 + private String file_url;//附件链接 + private String mime_type;// + private Date createdate;//创建时间 + private String attachment_size;//附件大小 + private String sort;//序号 + private String att_reference;//流程表的ID(col_summary) + private String uuid; + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getSub_reference() { + return sub_reference; + } + + public void setSub_reference(String sub_reference) { + this.sub_reference = sub_reference; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getFilename() { + return filename; + } + + public void setFilename(String filename) { + this.filename = filename; + } + + public String getFile_url() { + return file_url; + } + + public void setFile_url(String file_url) { + this.file_url = file_url; + } + + public String getMime_type() { + return mime_type; + } + + public void setMime_type(String mime_type) { + this.mime_type = mime_type; + } + + public Date getCreatedate() { + return createdate; + } + + public void setCreatedate(Date createdate) { + this.createdate = createdate; + } + + public String getAttachment_size() { + return attachment_size; + } + + public void setAttachment_size(String attachment_size) { + this.attachment_size = attachment_size; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public String getAtt_reference() { + return att_reference; + } + + public void setAtt_reference(String att_reference) { + this.att_reference = att_reference; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.xml new file mode 100644 index 00000000..f4747121 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpAttachmentEntity.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + id, + sub_reference, + category, + type, + filename, + file_url, + mime_type, + createdate, + attachment_size, + sort, + att_reference + + + + + + + + + + insert into CTP_ATTACHMENT( + + id, + sub_reference, + category, + type, + filename, + file_url, + mime_type, + attachment_size, + sort, + att_reference, + createdate + + )values + ( + + #{id}, + #{sub_reference}, + #{category}, + #{type}, + #{filename}, + #{file_url}, + #{mime_type}, + #{attachment_size}, + #{sort}, + #{att_reference}, + #{createdate} + + ) + + + + + update CTP_ATTACHMENT set + + sub_reference = #{sub_reference}, + att_reference = #{att_reference} + + where file_url = #{file_url} + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.java new file mode 100644 index 00000000..61ebce25 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.java @@ -0,0 +1,113 @@ +package com.hzya.frame.seeyon.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.io.File; + +/** + * @Description OA附件表 + * @Author xiangerlin + * @Date 2021/10/29 08:56 + **/ +public class CtpFileEntity extends BaseEntity { + private String category;//应用类别 + private String type;//类型 + private String filename;//文件名 + private String mime_type;//文件类型 + private String create_date; + private String create_member; + private String file_size;//大小 + private String description;//描述 + private String update_date; + private String account_id; + + + private File file;//临时用 + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getFilename() { + return filename; + } + + public void setFilename(String filename) { + this.filename = filename; + } + + public String getMime_type() { + return mime_type; + } + + public void setMime_type(String mime_type) { + this.mime_type = mime_type; + } + + public String getCreate_date() { + return create_date; + } + + public void setCreate_date(String create_date) { + this.create_date = create_date; + } + + public String getCreate_member() { + return create_member; + } + + public void setCreate_member(String create_member) { + this.create_member = create_member; + } + + public String getFile_size() { + return file_size; + } + + public void setFile_size(String file_size) { + this.file_size = file_size; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getUpdate_date() { + return update_date; + } + + public void setUpdate_date(String update_date) { + this.update_date = update_date; + } + + public String getAccount_id() { + return account_id; + } + + public void setAccount_id(String account_id) { + this.account_id = account_id; + } + + public File getFile() { + return file; + } + + public void setFile(File file) { + this.file = file; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.xml new file mode 100644 index 00000000..3f3c8cad --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + id, + category, + type, + filename, + mime_type, + create_date, + create_member, + file_size, + description, + update_date, + account_id + + + + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAU8ResponseDTO.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAU8ResponseDTO.java new file mode 100644 index 00000000..c8b473ec --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAU8ResponseDTO.java @@ -0,0 +1,89 @@ +package com.hzya.frame.seeyon.entity; + +import com.alibaba.fastjson.annotation.JSONField; + +/** + * @Description u8返回对象 + * @Author xiangerlin + * @Date 2024/5/14 15:40 + **/ +public class OAU8ResponseDTO { + @JSONField(name = "Flag") + private String flag; + @JSONField(name = "DataOne") + private String dataOne; + @JSONField(name = "DataTwo") + private String dataTwo; + @JSONField(name = "Msg") + private String msg; + + //如果co初始化失败,或者token不对的时候会返回这些信息 + private String code; + private String success; + private String message; + private String data; + + public String getFlag() { + return flag; + } + + public void setFlag(String flag) { + this.flag = flag; + } + + public String getDataOne() { + return dataOne; + } + + public void setDataOne(String dataOne) { + this.dataOne = dataOne; + } + + public String getDataTwo() { + return dataTwo; + } + + public void setDataTwo(String dataTwo) { + this.dataTwo = dataTwo; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getSuccess() { + return success; + } + + public void setSuccess(String success) { + this.success = success; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAWorkflowEventDataEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAWorkflowEventDataEntity.java new file mode 100644 index 00000000..341e553f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/OAWorkflowEventDataEntity.java @@ -0,0 +1,153 @@ +package com.hzya.frame.seeyon.entity; + + +import com.alibaba.fastjson.JSONObject; + +import java.util.Map; + +/** + * @Content OA监听事件提供的表单内容 + * @Author 👻👻👻👻👻👻👻👻👻👻 gjh + * @Date 2020-12-24 8:38 + * @Version 1.0 + */ +public class OAWorkflowEventDataEntity { + private String id;//业务表单id + private String eventType;//流程类型 + /** 流程ID*/ + private String summaryId; + /** 节点ID*/ + private String affairId; + private String currentActivityId; + /** 表单表的FORM ID,用此字段标记是哪个流程*/ + private String formApp; + /****/ + private String formViewOperation; + private Object summaryObj; + private String deeCfgId; + private String currentNodeLast; + private Map businessData; + private Map extData; + private String businessDataStr; + private JSONObject hzyaExtData;//存放一些扩展数据 + private String OnProcessFinished; + public String getSummaryId() { + return summaryId; + } + + public void setSummaryId(String summaryId) { + this.summaryId = summaryId; + } + + public String getAffairId() { + return affairId; + } + + public void setAffairId(String affairId) { + this.affairId = affairId; + } + + public String getCurrentActivityId() { + return currentActivityId; + } + + public void setCurrentActivityId(String currentActivityId) { + this.currentActivityId = currentActivityId; + } + + public String getFormApp() { + return formApp; + } + + public void setFormApp(String formApp) { + this.formApp = formApp; + } + + public String getFormViewOperation() { + return formViewOperation; + } + + public void setFormViewOperation(String formViewOperation) { + this.formViewOperation = formViewOperation; + } + + public Object getSummaryObj() { + return summaryObj; + } + + public void setSummaryObj(Object summaryObj) { + this.summaryObj = summaryObj; + } + + public String getDeeCfgId() { + return deeCfgId; + } + + public void setDeeCfgId(String deeCfgId) { + this.deeCfgId = deeCfgId; + } + + public String getCurrentNodeLast() { + return currentNodeLast; + } + + public void setCurrentNodeLast(String currentNodeLast) { + this.currentNodeLast = currentNodeLast; + } + + public Map getBusinessData() { + return businessData; + } + + public void setBusinessData(Map businessData) { + this.businessData = businessData; + } + + public Map getExtData() { + return extData; + } + + public void setExtData(Map extData) { + this.extData = extData; + } + + public String getBusinessDataStr() { + return businessDataStr; + } + + public void setBusinessDataStr(String businessDataStr) { + this.businessDataStr = businessDataStr; + } + + public String getOnProcessFinished() { + return OnProcessFinished; + } + + public void setOnProcessFinished(String onProcessFinished) { + OnProcessFinished = onProcessFinished; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public JSONObject getHzyaExtData() { + return hzyaExtData; + } + + public void setHzyaExtData(JSONObject hzyaExtData) { + this.hzyaExtData = hzyaExtData; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.java new file mode 100644 index 00000000..449da122 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.java @@ -0,0 +1,112 @@ +package com.hzya.frame.seeyon.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:38 + */ +public class SeeYonInterFaceEntity extends BaseEntity { + private String tabName; + //三方系统ID + private String tripartiteId; + //OA对应字段 + private String oaField; + //模板info + private String field_info; + //模版ID + private String formAppId; + //主表集合 + private List formMainIds; + //主表ID,用于查询明细数据 + private String formMainId; + //事件类型 + private String eventType; + //表单名称 + private String name; + //流程id + private String summaryId; + public String getTabName() { + return tabName; + } + + public void setTabName(String tabName) { + this.tabName = tabName; + } + + public String getTripartiteId() { + return tripartiteId; + } + + public void setTripartiteId(String tripartiteId) { + this.tripartiteId = tripartiteId; + } + + public String getOaField() { + return oaField; + } + + public void setOaField(String oaField) { + this.oaField = oaField; + } + + public String getField_info() { + return field_info; + } + + public void setField_info(String field_info) { + this.field_info = field_info; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getFormAppId() { + return formAppId; + } + + public void setFormAppId(String formAppId) { + this.formAppId = formAppId; + } + + public List getFormMainIds() { + return formMainIds; + } + + public void setFormMainIds(List formMainIds) { + this.formMainIds = formMainIds; + } + + public String getFormMainId() { + return formMainId; + } + + public void setFormMainId(String formMainId) { + this.formMainId = formMainId; + } + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public String getSummaryId() { + return summaryId; + } + + public void setSummaryId(String summaryId) { + this.summaryId = summaryId; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.xml new file mode 100644 index 00000000..4190704d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeYonInterFaceEntity.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + id as id + + + + + + + + + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.java new file mode 100644 index 00000000..773386d0 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.java @@ -0,0 +1,684 @@ +package com.hzya.frame.seeyon.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; + +/** + * com.hzya.frame.seeyon.entity + * + * @author yqh + * @date 2023-08 -30 10:45 + */ + +public class SeeyonEntity extends BaseEntity { + private String field0026;//合同评审编号 + private String field0001;//关联合同 + private String field0003;//合同编号 + private String field0016;//创建日期 + private String field0002;//合同名称 + private String field0004;//入账公司 + private String field0005;//供应商 + private String field0006;//合同类型 + private String field0015;//合同签订日期 + private String field0009;//合同开始时间 + private String field0010;//合同结束时间 + private String field0012;//是否固定金额 + private String field0013;//合同总金额 + private String field0027;//是否重大合同 + private String field0008;//项目 + private String field0032;//合同附件 + private String field0033;//其他附件 + private String field0034;//业务板块一级 + private String field0035;//合同分类 + private String field0038;//开票信息查询 + private String field0039;//付款信息查询 + private String field0044;//合同数量 + private String field0047;//业务板块二级 + private String field0048;//内容概要与评审理由 + private String field0049;//是否多方 + private String field0050;//是否多项目 + private String field0054;//合同已付金额 + private String field0055;//发票已收金额 + private String field0056;//审批中付款金额 + private String field0057;//审批中已收发票金额 + private String field0017;//行号 + private String field0018;//标的物名称 + private String field0019;//标的物编码 + private String field0021;//规格型号 + private String field0022;//总数量 + private String field0023;//单价 + private String field0024;//不含税金额 + private String field0025;//含税金额 + private String field0036;//税率 + private String field0037;//税务编码 + private String field0040;//已开票数量 + private String field0041;//剩余数量 + private String field0042;//在途数量 + private String field0051;//标的物明细表项目 + private String field0052;//相对方 + private String field0053;//其他相关方名称 + private String tableName;//表名称 + private List formson_0324;//合同标的物明细(明细表1) + private List formson_0352;// 相对方(明细表2) + private String formmain_id;//主表ID + private String file_url;//附件ID + private String sub_reference;//附件管理关系 + private String filename;//附件名称 + private String attachment_size;//文件大小 + private String field0067;//状态 + private String field0066;//业务板块三级 + private String loginName;//登录名 + private String dduid;//钉钉id + + private String field0137;//付款账号 + private String field0264;//CFS电子回单 + private String summary_id;//col_summary表id + private String name;//姓名 + private String pk_corp;//公司主键 + private String field0120;//OA关联速网U8C主键的字段 + + private String field0121;//oa对接erp明细主键 + private String details_id;//销售订单明细id + private String da_id;//销售订单档案id + + private String pushField;//杭泰推送标识字段 + private String pushValue;//推送的值 + private String updateTime; + private String field0066Id; + private String field0047Id; + private String field0034Id; + private String field0103;//钉钉ID + + public String getField0103() { + return field0103; + } + + public void setField0103(String field0103) { + this.field0103 = field0103; + } + + public String getField0066Id() { + return field0066Id; + } + + public void setField0066Id(String field0066Id) { + this.field0066Id = field0066Id; + } + + public String getField0047Id() { + return field0047Id; + } + + public void setField0047Id(String field0047Id) { + this.field0047Id = field0047Id; + } + + public String getField0034Id() { + return field0034Id; + } + + public void setField0034Id(String field0034Id) { + this.field0034Id = field0034Id; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getPushField() { + return pushField; + } + + public void setPushField(String pushField) { + this.pushField = pushField; + } + + public String getPushValue() { + return pushValue; + } + + public void setPushValue(String pushValue) { + this.pushValue = pushValue; + } + + public String getDa_id() { + return da_id; + } + + public void setDa_id(String da_id) { + this.da_id = da_id; + } + + public String getDetails_id() { + return details_id; + } + + public void setDetails_id(String details_id) { + this.details_id = details_id; + } + + public String getField0121() { + return field0121; + } + + public void setField0121(String field0121) { + this.field0121 = field0121; + } + + public String getField0120() { + return field0120; + } + + public void setField0120(String field0120) { + this.field0120 = field0120; + } + + public String getPk_corp() { + return pk_corp; + } + + public void setPk_corp(String pk_corp) { + this.pk_corp = pk_corp; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getField0264() { + return field0264; + } + + public void setField0264(String field0264) { + this.field0264 = field0264; + } + + public String getSummary_id() { + return summary_id; + } + + public void setSummary_id(String summary_id) { + this.summary_id = summary_id; + } + + public String getField0137() { + return field0137; + } + + public void setField0137(String field0137) { + this.field0137 = field0137; + } + + public String getDduid() { + return dduid; + } + + public void setDduid(String dduid) { + this.dduid = dduid; + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public String getField0067() { + return field0067; + } + + public void setField0067(String field0067) { + this.field0067 = field0067; + } + + public String getAttachment_size() { + return attachment_size; + } + + public void setAttachment_size(String attachment_size) { + this.attachment_size = attachment_size; + } + + public String getFilename() { + return filename; + } + + public void setFilename(String filename) { + this.filename = filename; + } + + public String getSub_reference() { + return sub_reference; + } + + public void setSub_reference(String sub_reference) { + this.sub_reference = sub_reference; + } + + public String getFile_url() { + return file_url; + } + + public void setFile_url(String file_url) { + this.file_url = file_url; + } + + public String getFormmain_id() { + return formmain_id; + } + + public void setFormmain_id(String formmain_id) { + this.formmain_id = formmain_id; + } + + public List getFormson_0324() { + return formson_0324; + } + + public void setFormson_0324(List formson_0324) { + this.formson_0324 = formson_0324; + } + + public List getFormson_0352() { + return formson_0352; + } + + public void setFormson_0352(List formson_0352) { + this.formson_0352 = formson_0352; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getField0026() { + return field0026; + } + + public void setField0026(String field0026) { + this.field0026 = field0026; + } + + public String getField0001() { + return field0001; + } + + public void setField0001(String field0001) { + this.field0001 = field0001; + } + + public String getField0003() { + return field0003; + } + + public void setField0003(String field0003) { + this.field0003 = field0003; + } + + public String getField0016() { + return field0016; + } + + public void setField0016(String field0016) { + this.field0016 = field0016; + } + + public String getField0002() { + return field0002; + } + + public void setField0002(String field0002) { + this.field0002 = field0002; + } + + public String getField0004() { + return field0004; + } + + public void setField0004(String field0004) { + this.field0004 = field0004; + } + + public String getField0005() { + return field0005; + } + + public void setField0005(String field0005) { + this.field0005 = field0005; + } + + public String getField0006() { + return field0006; + } + + public void setField0006(String field0006) { + this.field0006 = field0006; + } + + public String getField0015() { + return field0015; + } + + public void setField0015(String field0015) { + this.field0015 = field0015; + } + + public String getField0009() { + return field0009; + } + + public void setField0009(String field0009) { + this.field0009 = field0009; + } + + public String getField0010() { + return field0010; + } + + public void setField0010(String field0010) { + this.field0010 = field0010; + } + + public String getField0012() { + return field0012; + } + + public void setField0012(String field0012) { + this.field0012 = field0012; + } + + public String getField0013() { + return field0013; + } + + public void setField0013(String field0013) { + this.field0013 = field0013; + } + + public String getField0027() { + return field0027; + } + + public void setField0027(String field0027) { + this.field0027 = field0027; + } + + public String getField0008() { + return field0008; + } + + public void setField0008(String field0008) { + this.field0008 = field0008; + } + + public String getField0032() { + return field0032; + } + + public void setField0032(String field0032) { + this.field0032 = field0032; + } + + public String getField0033() { + return field0033; + } + + public void setField0033(String field0033) { + this.field0033 = field0033; + } + + public String getField0034() { + return field0034; + } + + public void setField0034(String field0034) { + this.field0034 = field0034; + } + + public String getField0035() { + return field0035; + } + + public void setField0035(String field0035) { + this.field0035 = field0035; + } + + public String getField0038() { + return field0038; + } + + public void setField0038(String field0038) { + this.field0038 = field0038; + } + + public String getField0039() { + return field0039; + } + + public void setField0039(String field0039) { + this.field0039 = field0039; + } + + public String getField0044() { + return field0044; + } + + public void setField0044(String field0044) { + this.field0044 = field0044; + } + + public String getField0047() { + return field0047; + } + + public void setField0047(String field0047) { + this.field0047 = field0047; + } + + public String getField0048() { + return field0048; + } + + public void setField0048(String field0048) { + this.field0048 = field0048; + } + + public String getField0049() { + return field0049; + } + + public void setField0049(String field0049) { + this.field0049 = field0049; + } + + public String getField0050() { + return field0050; + } + + public void setField0050(String field0050) { + this.field0050 = field0050; + } + + public String getField0054() { + return field0054; + } + + public void setField0054(String field0054) { + this.field0054 = field0054; + } + + public String getField0055() { + return field0055; + } + + public void setField0055(String field0055) { + this.field0055 = field0055; + } + + public String getField0056() { + return field0056; + } + + public void setField0056(String field0056) { + this.field0056 = field0056; + } + + public String getField0057() { + return field0057; + } + + public void setField0057(String field0057) { + this.field0057 = field0057; + } + + public String getField0017() { + return field0017; + } + + public void setField0017(String field0017) { + this.field0017 = field0017; + } + + public String getField0018() { + return field0018; + } + + public void setField0018(String field0018) { + this.field0018 = field0018; + } + + public String getField0019() { + return field0019; + } + + public void setField0019(String field0019) { + this.field0019 = field0019; + } + + public String getField0021() { + return field0021; + } + + public void setField0021(String field0021) { + this.field0021 = field0021; + } + + public String getField0022() { + return field0022; + } + + public void setField0022(String field0022) { + this.field0022 = field0022; + } + + public String getField0023() { + return field0023; + } + + public void setField0023(String field0023) { + this.field0023 = field0023; + } + + public String getField0024() { + return field0024; + } + + public void setField0024(String field0024) { + this.field0024 = field0024; + } + + public String getField0025() { + return field0025; + } + + public void setField0025(String field0025) { + this.field0025 = field0025; + } + + public String getField0036() { + return field0036; + } + + public void setField0036(String field0036) { + this.field0036 = field0036; + } + + public String getField0037() { + return field0037; + } + + public void setField0037(String field0037) { + this.field0037 = field0037; + } + + public String getField0040() { + return field0040; + } + + public void setField0040(String field0040) { + this.field0040 = field0040; + } + + public String getField0041() { + return field0041; + } + + public void setField0041(String field0041) { + this.field0041 = field0041; + } + + public String getField0042() { + return field0042; + } + + public void setField0042(String field0042) { + this.field0042 = field0042; + } + + public String getField0051() { + return field0051; + } + + public void setField0051(String field0051) { + this.field0051 = field0051; + } + + public String getField0052() { + return field0052; + } + + public void setField0052(String field0052) { + this.field0052 = field0052; + } + + public String getField0053() { + return field0053; + } + + public void setField0053(String field0053) { + this.field0053 = field0053; + } + + public String getField0066() { + return field0066; + } + + public void setField0066(String field0066) { + this.field0066 = field0066; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.xml new file mode 100644 index 00000000..83714c7d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/entity/SeeyonEntity.xml @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id + + + + splitbank,bankaccno,name,code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update formmain_0327 set field0264 = #{field0264} where id = #{id} + + + + + update formmain_0323 set field0067 = 'Y' + where id = #{id} + + + + + update formmain_0237 set field0120 = #{field0120} + where field0010 = #{field0010} + + + + + update formson_0238 set field0121 = #{field0121} + where field0012 = #{field0012} and formmain_id=#{formmain_id} + + + + + update ${tableName} set ${pushField} = #{pushValue} + where id=#{id} + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/enums/ColEventTypeEnum.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/enums/ColEventTypeEnum.java new file mode 100644 index 00000000..69b1af3e --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/enums/ColEventTypeEnum.java @@ -0,0 +1,45 @@ +package com.hzya.frame.seeyon.enums; + +/** + * 流程事件类型枚举 + */ +public enum ColEventTypeEnum { + + ONBEFORESTART("onBeforeStart","流程发起前"), + ONSTART("onStart","流程发起"), + ONBEFORESTOP("onBeforeStop","终止前事件"), + ONSTOP("onStop","终止事件"), + ONBEFORECANCEL("onBeforeCancel","撤销前事件"), + ONCANCEL("onCancel","撤销事件"), + ONPROCESSFINISHED("onProcessFinished","结束事件"), + ONBEFOREFINISHWORKITEM("onBeforeFinishWorkitem","处理前事件"), + ONFINISHWORKITEM("onFinishWorkitem","处理事件"), + ONBEFORESTEPBACK("onBeforeStepBack","回退前事件"), + ONSTEPBACK("onStepBack","回退事件"), + ONBEFORETAKEBACK("onBeforeTakeBack","取回前事件"), + ONTAKEBACK("onTakeBack","取回事件"), + ; + private String type; + private String name; + + ColEventTypeEnum(String type, String name) { + this.type = type; + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java new file mode 100644 index 00000000..a0ec8db8 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java @@ -0,0 +1,33 @@ +package com.hzya.frame.seeyon.paybill.dao; + +import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; +import com.hzya.frame.seeyon.paybill.entity.PayBillEntity; + +import java.util.List; +import java.util.Map; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +public interface IPayBillDao { +/** + * + * @content 获取OA工程付款单数据 + * @author laborer + * @date 2024/6/20 0020 11:30 + * + */ + List getOaEngineerPay(PayBillEntity entity); +/** + * + * @content 修改推送状态 + * @author laborer + * @date 2024/6/21 0021 11:15 + * + */ + + int updateState(PayBillEntity pay); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java new file mode 100644 index 00000000..3a753554 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java @@ -0,0 +1,32 @@ +package com.hzya.frame.seeyon.paybill.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; +import com.hzya.frame.seeyon.paybill.dao.IPayBillDao; +import com.hzya.frame.seeyon.paybill.entity.PayBillEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +@Repository(value = "PayBillDaoImpl") +public class PayBillDaoImpl extends MybatisGenericDao implements IPayBillDao { + + @DS("#entity.dataSourceCode") + @Override + public List getOaEngineerPay(PayBillEntity entity) { + return super.selectList("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_list_base",entity); + } + @DS("#pay.dataSourceCode") + @Override + public int updateState(PayBillEntity pay) { + return super.update("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_update",pay); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java new file mode 100644 index 00000000..1a9308de --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java @@ -0,0 +1,107 @@ +package com.hzya.frame.seeyon.paybill.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * @content 付款結算單 + * @author laborer + * @date 2024/6/20 0020 11:07 + * + */ + +public class PayBillEntity extends BaseEntity { + private String billDate;//付款日期 + private String primalMoney;//付款金额信息 + private String pkOppaccount;//付款银行信息 + private String pkSupplier;//供应商信息 + private String tableName;//表名称 + private String fieldName;//字段名称 + private String state;//推送状态 + private String pkOrg;//组织 + private String pkCustomer;//客户 + private String pk_oppaccount;//付款账户 + + public String getPkCustomer() { + return pkCustomer; + } + + public void setPkCustomer(String pkCustomer) { + this.pkCustomer = pkCustomer; + } + + public String getPk_oppaccount() { + return pk_oppaccount; + } + + public void setPk_oppaccount(String pk_oppaccount) { + this.pk_oppaccount = pk_oppaccount; + } + + public String getPkOrg() { + return pkOrg; + } + + public void setPkOrg(String pkOrg) { + this.pkOrg = pkOrg; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getBillDate() { + return billDate; + } + + public void setBillDate(String billDate) { + this.billDate = billDate; + } + + public String getPrimalMoney() { + return primalMoney; + } + + public void setPrimalMoney(String primalMoney) { + this.primalMoney = primalMoney; + } + + public String getPkOppaccount() { + return pkOppaccount; + } + + public void setPkOppaccount(String pkOppaccount) { + this.pkOppaccount = pkOppaccount; + } + + public String getPkSupplier() { + return pkSupplier; + } + + public void setPkSupplier(String pkSupplier) { + this.pkSupplier = pkSupplier; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml new file mode 100644 index 00000000..736d5914 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + update ${tableName} set ${fieldName} = #{state} where id = #{id} + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java new file mode 100644 index 00000000..caad27a7 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java @@ -0,0 +1,29 @@ +package com.hzya.frame.seeyon.paybill.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.paybill.entity.PayBillEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +import java.util.List; + +/** + * + * @content huoqu + * @author laborer获取OA付款单数据并推送BIP生成付款结算单 + * @date 2024/6/20 0020 11:19 + * + */ + +public interface IPayBillService extends IBaseService { +/** + * + * @content 工程付款单数据同步BIP + * @author laborer + * @date 2024/6/20 0020 11:24 + * + */ +JsonResultEntity sendEngineerPayBillToBip(JSONObject requestJson); + +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java new file mode 100644 index 00000000..5bdf9b4b --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java @@ -0,0 +1,105 @@ +package com.hzya.frame.seeyon.paybill.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.paybill.dao.IPayBillDao; +import com.hzya.frame.seeyon.paybill.entity.PayBillEntity; +import com.hzya.frame.seeyon.paybill.service.IPayBillService; +import com.hzya.frame.seeyon.service.impl.SeeYonInterFaceImpl; +import com.hzya.frame.seeyon.util.OABipUtil; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + * @content 付款单同步BIP + * @author laborer + * @date 2024/6/20 0020 15:20 + * + */ + +@Service("PayBillServiceImpl") +public class PayBillServiceImpl extends BaseService implements IPayBillService { + private static final Logger logger = LoggerFactory.getLogger(PayBillServiceImpl.class); + + @Autowired + private IPayBillDao payBillDao; + /** + * + * @content 工程付款单数据同步BIP + * @author laborer + * @date 2024/6/20 0020 11:24 + * + */ + @Override + public JsonResultEntity sendEngineerPayBillToBip(JSONObject requestJson) { + PayBillEntity entity = new PayBillEntity(); + requestJson.put("db_code","OA"); + entity.setDataSourceCode(requestJson.getString("db_code")); + ListpayBillEntityList = payBillDao.getOaEngineerPay(entity); + if(CollectionUtils.isNotEmpty(payBillEntityList)){ + for(PayBillEntity pay : payBillEntityList){ + String token = OABipUtil.getBipToken("yonyou","8000230000"); + JSONObject main = bindingAdd(pay); + logger.info("工程付款单调用中台生成BIP付款结算单推送报文{}",main.toString()); + String result = OABipUtil.sendU9cTOBipEsb(main.toString(),"8000230014",token); + logger.info("工程付款单调用中台生成BIP付款结算单返回结果{}",result); + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getBoolean("success"); + if(flag){ + pay.setState("Y"); + }else{ + pay.setState("N"); + } + pay.setDataSourceCode(requestJson.getString("db_code")); + payBillDao.updateState(pay); + // todo 后续在写吧(没字段等OA开了外网在创建),修改推送状态,避免再次查询 + } + } + return null; + } + + @NotNull + private JSONObject bindingAdd(PayBillEntity pay) { + JSONObject head = new JSONObject(); + head.put("pk_org","");//所属组织 + head.put("pk_group","");//集团 + head.put("bill_type","F5");//单据类型 默认F5 + head.put("trade_type","D5");//付款结算类型 默认D5 + head.put("source_flag","2");//付款结算类型 默认2 + head.put("bill_date",pay.getBillDate());//单据日期 + head.put("primal_money",pay.getPrimalMoney());//付款原币金额 + head.put("pk_currtype","CNY");//币种 + head.put("billmaker","");//制单人 + //处理明细数据,按照明细付款 多个明细生成多个付款结算单 + JSONArray detailsArr = new JSONArray(); + JSONObject body = new JSONObject(); + body.put("pk_org","");//所属组织 + body.put("pk_group","");//集团 + body.put("bill_type","F5");//单据类型 默认F5 + body.put("trade_type","D5");//付款结算类型 默认D5 + body.put("pk_currtype","CNY");//币种 + body.put("bill_date",pay.getBillDate());//单据日期 + body.put("pay_primal",pay.getPrimalMoney());//付款原币金额 + body.put("creationtime",pay.getBillDate());//创建时间 + body.put("direction","-1");//方向 :1=收;-1=付; + body.put("objecttype","0");//交易对象 + body.put("pk_customer",pay.getPkCustomer());//客户 + body.put("pk_account",pay.getPkOppaccount());//付款银行账号 + detailsArr.add(body); + JSONObject main = new JSONObject(); + main.put("head",head);//表头 + main.put("body",detailsArr);//明细数据 + return main; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java new file mode 100644 index 00000000..7668f65e --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java @@ -0,0 +1,31 @@ +package com.hzya.frame.seeyon.recbill.dao; + +import com.hzya.frame.seeyon.recbill.entity.RecBillEntity; + +import java.util.List; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +public interface IRecBillDao { +/** + * + * @content 获取OA工程付款单数据 + * @author laborer + * @date 2024/6/20 0020 11:30 + * + */ + List getOaRecBill(RecBillEntity rec); +/** + * + * @content 修改推送状态 + * @author laborer + * @date 2024/6/21 0021 11:15 + * + */ + + int updateState(RecBillEntity rec); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java new file mode 100644 index 00000000..3682e8a2 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java @@ -0,0 +1,30 @@ +package com.hzya.frame.seeyon.recbill.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.seeyon.recbill.dao.IRecBillDao; +import com.hzya.frame.seeyon.recbill.entity.RecBillEntity; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-30 10:27 + */ +@Repository(value = "RecBillDaoImpl") +public class RecBillDaoImpl extends MybatisGenericDao implements IRecBillDao { + + @DS("#rec.dataSourceCode") + @Override + public List getOaRecBill(RecBillEntity rec) { + return super.selectList("com.hzya.frame.seeyon.recbill.dao.impl.RecBillDaoImpl.PayBillEntity_list_base",rec); + } + @DS("#rec.dataSourceCode") + @Override + public int updateState(RecBillEntity rec) { + return super.update("com.hzya.frame.seeyon.recbill.dao.impl.RecBillDaoImpl.PayBillEntity_update",rec); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java new file mode 100644 index 00000000..5a271b5d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java @@ -0,0 +1,104 @@ +package com.hzya.frame.seeyon.recbill.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * + * @content 付款結算單 + * @author laborer + * @date 2024/6/20 0020 11:07 + * + */ + +public class RecBillEntity extends BaseEntity { + private String billDate;//付款日期 + private String primalMoney;//付款金额信息 + private String pkOppaccount;//付款银行信息 + private String pkSupplier;//供应商信息 + private String tableName;//表名称 + private String fieldName;//字段名称 + private String state;//推送状态 + private String pkCustomer;//客户 + private String pkAccount;//收款账户 + private String pkOrg;//组织 + + public String getPkCustomer() { + return pkCustomer; + } + + public void setPkCustomer(String pkCustomer) { + this.pkCustomer = pkCustomer; + } + + public String getPkAccount() { + return pkAccount; + } + + public void setPkAccount(String pkAccount) { + this.pkAccount = pkAccount; + } + + public String getPkOrg() { + return pkOrg; + } + + public void setPkOrg(String pkOrg) { + this.pkOrg = pkOrg; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getTableName() { + return tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public String getFieldName() { + return fieldName; + } + + public void setFieldName(String fieldName) { + this.fieldName = fieldName; + } + + public String getBillDate() { + return billDate; + } + + public void setBillDate(String billDate) { + this.billDate = billDate; + } + + public String getPrimalMoney() { + return primalMoney; + } + + public void setPrimalMoney(String primalMoney) { + this.primalMoney = primalMoney; + } + + public String getPkOppaccount() { + return pkOppaccount; + } + + public void setPkOppaccount(String pkOppaccount) { + this.pkOppaccount = pkOppaccount; + } + + public String getPkSupplier() { + return pkSupplier; + } + + public void setPkSupplier(String pkSupplier) { + this.pkSupplier = pkSupplier; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml new file mode 100644 index 00000000..21f3fc7e --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + update ${tableName} set ${fieldName} = #{state} where id = #{id} + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java new file mode 100644 index 00000000..96930a43 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java @@ -0,0 +1,26 @@ +package com.hzya.frame.seeyon.recbill.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * + * @content huoqu + * @author laborer获取OA付款单数据并推送BIP生成付款结算单 + * @date 2024/6/20 0020 11:19 + * + */ + +public interface IRecBillService extends IBaseService { +/** + * + * @content 工程付款单数据同步BIP + * @author laborer + * @date 2024/6/20 0020 11:24 + * + */ +JsonResultEntity sendRecBillToBip(JSONObject requestJson); + +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java new file mode 100644 index 00000000..f65d2855 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java @@ -0,0 +1,104 @@ +package com.hzya.frame.seeyon.recbill.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity; +import com.hzya.frame.seeyon.recbill.dao.IRecBillDao; +import com.hzya.frame.seeyon.recbill.entity.RecBillEntity; +import com.hzya.frame.seeyon.recbill.service.IRecBillService; +import com.hzya.frame.seeyon.util.OABipUtil; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.jetbrains.annotations.NotNull; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * + * @content 付款单同步BIP + * @author laborer + * @date 2024/6/20 0020 15:20 + * + */ + +@Service("RecBillServiceImpl") +public class RecBillServiceImpl extends BaseService implements IRecBillService { + private static final Logger logger = LoggerFactory.getLogger(RecBillServiceImpl.class); + + @Autowired + private IRecBillDao payBillDao; + /** + * + * @content 工程付款单数据同步BIP + * @author laborer + * @date 2024/6/20 0020 11:24 + * + */ + @Override + public JsonResultEntity sendRecBillToBip(JSONObject requestJson) { + RecBillEntity entity = new RecBillEntity(); + requestJson.put("db_code","OA"); + entity.setDataSourceCode(requestJson.getString("db_code")); + ListpayBillEntityList = payBillDao.getOaRecBill(entity); + if(CollectionUtils.isNotEmpty(payBillEntityList)){ + for(RecBillEntity pay : payBillEntityList){ + String token = OABipUtil.getBipToken("yonyou","8000230000"); + JSONObject main = bindingAdd(pay); + logger.info("银行流水收款信息数据{}",main.toString()); + String result = OABipUtil.sendU9cTOBipEsb(main.toString(),"8000230016",token); + logger.info("银行流水收款信息数据{}",result); + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getBoolean("success"); + if(flag){ + pay.setState("Y"); + }else{ + pay.setState("N"); + } + pay.setDataSourceCode(requestJson.getString("db_code")); + payBillDao.updateState(pay); + // todo 后续在写吧(没字段等OA开了外网在创建),修改推送状态,避免再次查询 + } + } + return null; + } + + @NotNull + private JSONObject bindingAdd(RecBillEntity pay) { + JSONObject head = new JSONObject(); + head.put("pk_org","");//所属组织 + head.put("pk_group","");//集团 + head.put("bill_type","F4");//单据类型 默认F5 + head.put("trade_type","D4");//付款结算类型 默认D5 + head.put("source_flag","2");//付款结算类型 默认2 + head.put("bill_date",pay.getBillDate());//单据日期 + head.put("primal_money",pay.getPrimalMoney());//付款原币金额 + head.put("pk_currtype","CNY");//币种 + head.put("billmaker","");//制单人 + //处理明细数据,按照明细付款 多个明细生成多个付款结算单 + JSONArray detailsArr = new JSONArray(); + JSONObject body = new JSONObject(); + body.put("pk_org","");//所属组织 + body.put("pk_group","");//集团 + body.put("bill_type","F4");//单据类型 默认F5 + body.put("trade_type","D4");//付款结算类型 默认D5 + body.put("pk_currtype","CNY");//币种 + body.put("bill_date",pay.getBillDate());//单据日期 + body.put("pay_primal",pay.getPrimalMoney());//付款原币金额 + body.put("creationtime",pay.getBillDate());//创建时间 + body.put("direction","-1");//方向 :1=收;-1=付; + body.put("objecttype","0");//交易对象 + body.put("pk_customer",pay.getPkCustomer());//客户 + body.put("pk_account",pay.getPkAccount());//收款银行账号 + detailsArr.add(body); + JSONObject main = new JSONObject(); + main.put("head",head);//表头 + main.put("body",detailsArr);//明细数据 + return main; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java new file mode 100644 index 00000000..3af20d9d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java @@ -0,0 +1,20 @@ +package com.hzya.frame.seeyon.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; + +/** + * @Description seeyon 附件关系 + * @Author xiangerlin + * @Date 2024/6/17 15:30 + **/ +public interface ICtpAttachmentService extends IBaseService { + /** + * 保存附件关系表 + * @param fileUrl ctp_file id + * @param col_summary_id col_summary id + * @param sub_reference 随机uuid + * @return + */ + CtpAttachmentEntity saveAttachment(String fileUrl, String col_summary_id, String sub_reference)throws Exception; +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpFileService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpFileService.java new file mode 100644 index 00000000..b34826ef --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpFileService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.seeyon.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.entity.CtpFileEntity; + +/** + * @Description seeyon 附件 + * @Author xiangerlin + * @Date 2024/6/17 15:23 + **/ +public interface ICtpFileService extends IBaseService { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java new file mode 100644 index 00000000..57e72e80 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/INoProcessService.java @@ -0,0 +1,26 @@ +package com.hzya.frame.seeyon.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * + * @content 无流程表单公用service + * @className: Administrator + * @author laborer + * @date 2024-09-09 14:53 + * + */ +public interface INoProcessService { +/** + * + * @content 无流程删除通用接口 + * @className: Administrator + * @author laborer + * @date 2024-09-09 15:08 + * + */ + + JsonResultEntity DeleteProcessField(JSONObject requestData); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java new file mode 100644 index 00000000..762023b7 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java @@ -0,0 +1,84 @@ +package com.hzya.frame.seeyon.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * 致远OA接口类 + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-22 9:29 + */ +public interface ISeeYonInterFace { + + /*** + * 发起OA表单方法 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-22 9:31 + * @param requestData 请求json + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity thirdInterfaceSend(JSONObject requestData); + + + + /*** + * @Content: 提供给OA的标准接口方法,包含参数 entity 为OA 的data信息, , eventType 为事件类型 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2020-12-24 10:36 + * @Param [entity, eventType] + * eventType: + * 发起前事件 onBeforeStart , + * 发起事件 onStart , + * 终止前事件 onBeforeStop , + * 终止事件 onStop, + * 撤销前事件 onBeforeCancel, + * 撤销事件 onCancel, + * 结束事件 onProcessFinished, + * 处理前事件 onBeforeFinishWorkitem, + * 处理事件 onFinishWorkitem, + * 回退前事件 onBeforeStepBack, + * 回退事件 onStepBack, + * 取回前事件 onBeforeTakeBack, + * 取回事件 onTakeBack, + * @return string + **/ + JsonResultEntity thirdInterfaceSeeYonPlugInInterfaceEntrance(JSONObject requestData); + + + /*** + * 致远OA业务流程集成补推方法,需要传递参数 + * @param jsonObject formAppId 表单模版ID CAP_FORM_DEFINITION, formMainIds 集合 dataSourceCode 数据源编码 + * @return ht_oa_sqlserver + * @throws Exception + */ + JsonResultEntity thirdInterfaceSeeYonDefinitionRePush(JSONObject jsonObject) throws Exception; + + /** + * seeyon流程事件监听前置方法,绑定数据源 + * @param sysExtensionApi + * @return + * @throws Exception + */ + SysExtensionApiEntity colEventPre(SysExtensionApiEntity sysExtensionApi)throws Exception; + /** + * seeyon流程事件监听 + * @param jsonObject + * @return + * @throws Exception + */ + JsonResultEntity colEventListener(JSONObject jsonObject)throws Exception; + + /** + * seeyon流程事件监听后置方法,调用三方接口 + * @param jsonStr + * @param formAppId + * @param eventType + * @return + * @throws Exception + */ + String colEventPost(String jsonStr,String formAppId,String eventType)throws Exception; +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeyonExtService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeyonExtService.java new file mode 100644 index 00000000..4f06472d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeyonExtService.java @@ -0,0 +1,29 @@ +package com.hzya.frame.seeyon.service; + +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * @Description seeyon扩展类 + * @Author xiangerlin + * @Date 2024/5/14 14:04 + **/ +public interface ISeeyonExtService { + + /** + * @Since 3.0 + * 英德赛 OA档案传U8 + * 根据不同formApp来调U8不同接口 + * @param entity + * @return + */ + SysExtensionApiEntity ydcSeeyon2u8(SysExtensionApiEntity entity); + + /** + * @Since 3.0 + * 回调方法 + * @param logEntity + */ + void ydcSeeyon2u8CallBack(SysMessageManageLogEntity logEntity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java new file mode 100644 index 00000000..0ee1e68f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java @@ -0,0 +1,70 @@ +package com.hzya.frame.seeyon.service.impl; + +import cn.hutool.core.date.DateUtil; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.dao.ICtpAttachmentDao; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; +import com.hzya.frame.seeyon.entity.CtpFileEntity; +import com.hzya.frame.seeyon.service.ICtpAttachmentService; +import com.hzya.frame.seeyon.service.ICtpFileService; +import com.hzya.frame.uuid.UUIDLong; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/17 15:31 + **/ +@Service(value = "ctpAttachmentService") +public class CtpAttachmentServiceImpl extends BaseService implements ICtpAttachmentService { + + private ICtpAttachmentDao ctpAttachmentDao; + @Autowired + private ICtpFileService ctpFileService; + @Autowired + public void setCtpAttachmentDao(ICtpAttachmentDao dao) { + this.ctpAttachmentDao = dao; + this.dao = dao; + } + + /** + * 保存附件关系表 + * + * @param fileUrl ctp_file id + * @param col_summary_id col_summary id + * @param sub_reference 随机uuid + * @return + */ + @Override + public CtpAttachmentEntity saveAttachment(String fileUrl, String col_summary_id, String sub_reference)throws Exception { + //查一下附件 + CtpFileEntity ctpFileEntity = new CtpFileEntity(); + ctpFileEntity.setId(fileUrl); + ctpFileEntity.setDataSourceCode(""); + List ctpFileList = ctpFileService.query(ctpFileEntity); + if (CollectionUtils.isNotEmpty(ctpFileList)){ + CtpFileEntity ctpFile = ctpFileList.get(0); + if (null != ctpFile){ + CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity(); + ctpAttachmentEntity.setId(String.valueOf(UUIDLong.longUUID())); + ctpAttachmentEntity.setFile_url(ctpFile.getId());//ctp_file表的id + ctpAttachmentEntity.setAtt_reference(col_summary_id);//业务表单的id + ctpAttachmentEntity.setSub_reference(sub_reference);//这个字段要保存到业务表附件到字段上 + ctpAttachmentEntity.setCategory("66");//这里写66 才可以显示图片 + ctpAttachmentEntity.setFilename(ctpFile.getFilename()); + ctpAttachmentEntity.setType(ctpFile.getType()); + ctpAttachmentEntity.setMime_type(ctpFile.getMime_type()); + ctpAttachmentEntity.setAttachment_size(ctpFile.getFile_size()); + ctpAttachmentEntity.setCreatedate(new Date()); + this.save(ctpAttachmentEntity); + return ctpAttachmentEntity; + } + } + return null; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpFileServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpFileServiceImpl.java new file mode 100644 index 00000000..31f96553 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpFileServiceImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.seeyon.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.seeyon.entity.CtpFileEntity; +import com.hzya.frame.seeyon.service.ICtpFileService; +import org.springframework.stereotype.Service; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/6/17 15:24 + **/ +@Service() +public class CtpFileServiceImpl extends BaseService implements ICtpFileService { +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java new file mode 100644 index 00000000..87ba10be --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/NoProcessServiceImpl.java @@ -0,0 +1,119 @@ +package com.hzya.frame.seeyon.service.impl; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.dao.ICapFormDefinitionDao; +import com.hzya.frame.seeyon.entity.CapFormDefinitionEntity; +import com.hzya.frame.seeyon.service.INoProcessService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.checkerframework.checker.units.qual.A; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; + +/** + * + * @content 无流程表单公用service + * @className: Administrator + * @author laborer + * @date 2024-09-09 14:53 + * + */ + +@Service(value = "NoProcessServiceImpl") +public class NoProcessServiceImpl implements INoProcessService { + private static final Logger logger = LoggerFactory.getLogger(NoProcessServiceImpl.class); + @Autowired + private ICapFormDefinitionDao capFormDefinitionDao; + @Override + public JsonResultEntity DeleteProcessField(JSONObject requestData) { + Listcount =new ArrayList<>(); + JSONObject jsonStrObj = requestData.getJSONObject("jsonStr"); + String formCode = jsonStrObj.getString("formCode"); + String fieldName = jsonStrObj.getString("fieldName"); + String fieldValue = jsonStrObj.getString("fieldValue"); + if(StrUtil.isEmpty(formCode)){ + return new JsonResultEntity("表单编码不能为空:formCode",false); + } + if(StrUtil.isEmpty(fieldName)){ + return new JsonResultEntity("字段名称不能为空:fieldName",false); + } + if(StrUtil.isEmpty(fieldValue)){ + return new JsonResultEntity("字段值不能为空:fieldValue",false); + } + + //通过表单编号获取表单字段信息 + CapFormDefinitionEntity fieldInfo = new CapFormDefinitionEntity(); + fieldInfo.setAppbindInfo(formCode); + fieldInfo.setDataSourceCode("djoatest"); + ListcapFormDefinitionEntityList = capFormDefinitionDao.getFormFiled(fieldInfo); + if(CollectionUtils.isEmpty(capFormDefinitionEntityList)){ + return new JsonResultEntity("通过表单编号查询表单有误,请检查表单编号:"+formCode,false); + } + + try { + capFormDefinitionEntityList.forEach(item->{ + String appbindInfo = item.getAppbindInfo(); + //格式化字段信息 + JSONObject jsonObject = JSONObject.parseObject(appbindInfo); + boolean queryFlag = false; + //如果模版编号相同则继续删除,反正跳过 + if(formCode.equals(jsonObject.getString("formCode"))){ + JSONObject field = JSONObject.parseObject(item.getFieldInfo()); + JSONObject frontFormmain = field.getJSONObject("front_formmain"); + JSONArray formsons = field.getJSONArray("formsons"); + JSONArray fieldInfoTable = frontFormmain.getJSONArray("fieldInfo"); + //验证需要删除的条件字段在表单属性中是否存在 + for (int i = 0; i < fieldInfoTable.size(); i++) { + JSONObject fieldInfoTableObj = fieldInfoTable.getJSONObject(i); + String name = fieldInfoTableObj.getString("name"); + //如果表单属性中存在该字段则验证通过,如果不存在直接返回错误 + if(name.equals(fieldName)){ + queryFlag = true; + + } + } + //验证通过获取数据库表名称进行数据删除 + if(queryFlag){ + String tableName = frontFormmain.getString("tableName"); + //如果主表名称获取主表的主键进行数据删除 + fieldInfo.setTableName(tableName); + fieldInfo.setFieldName(fieldName); + fieldInfo.setFieldValue(fieldValue); + ListdataFormList = capFormDefinitionDao.getFormFiledByFileValue(fieldInfo); + if(CollectionUtils.isNotEmpty(dataFormList)){ + dataFormList.forEach(item1->{ + String id = item1.getId(); + count.add(id); + fieldInfo.setFieldName("id"); + fieldInfo.setId(id); + capFormDefinitionDao.deleteByKey(fieldInfo); + //循环该表单下面的所有子表信息进行子表删除 + if(CollectionUtils.isNotEmpty(formsons)){ + formsons.forEach(formsonsItem->{ + JSONObject jsonObjectBoddy = JSONObject.parseObject(formsonsItem.toString()); + String bodyTableName = jsonObjectBoddy.getString("tableName"); + fieldInfo.setTableName(bodyTableName); + fieldInfo.setFieldName("formmain_id"); + fieldInfo.setId(id); + capFormDefinitionDao.deleteByKey(fieldInfo); + }); + } + }); + } + } + } + }); + } catch (Exception e) { + throw new RuntimeException(e); + } + return new JsonResultEntity("删除成功,删除的数据ID"+ JSON.toJSONString(count),true); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java new file mode 100644 index 00000000..8e8be89e --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java @@ -0,0 +1,507 @@ +package com.hzya.frame.seeyon.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.map.MapBuilder; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.dao.ISeeYonInterFaceDao; +import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; +import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; +import com.hzya.frame.seeyon.service.ISeeYonInterFace; +import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; +import com.hzya.frame.sysnew.application.api.service.ISysApplicationApiService; +import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao; +import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 👻👻👻👻👻👻👻👻👻👻 gjh + * @version 1.0 + * @content + * @date 2023-08-22 9:30 + */ +@Service(value = "seeYonInterFace") +public class SeeYonInterFaceImpl implements ISeeYonInterFace { + private static final Logger logger = LoggerFactory.getLogger(SeeYonInterFaceImpl.class); + /*** rest 用户名*/ + private static final String RESTUSERNAME = "hzyaRest"; + /*** rest 密码*/ + private static final String RESTPASSWORD = "a5ce21b8-91db-4cec-b3e3-3e44719655fd"; + // TODO 此处URL暂时写死,后续根据传递的应用ID获取 + private static final String sendUrl = "http://60.204.152.210/seeyon/"; + //速网esb地址 + private static final String baseUrl = "http://hzya.ufyct.com:9067/kangarooDataCenter/entranceController/externalCallInterface"; + @Resource + private ISysApplicationDatabaseDao sysApplicationDatabaseDao; + @Autowired + private ISysApplicationApiService sysApplicationApiService; + /** + * 定义所支持的事件静态代码块 + */ + private static final StringBuffer eventTypeBuffer = new StringBuffer(); + + { + eventTypeBuffer.append("发起前事件 onBeforeStart ,"); + eventTypeBuffer.append("发起事件 onStart ,"); + eventTypeBuffer.append("终止前事件 onBeforeStop ,"); + eventTypeBuffer.append("终止事件 onStop,"); + eventTypeBuffer.append("撤销前事件 onBeforeCancel,"); + eventTypeBuffer.append("撤销事件 onCancel,"); + eventTypeBuffer.append("结束事件 onProcessFinished,"); + eventTypeBuffer.append("处理前事件 onBeforeFinishWorkitem,"); + eventTypeBuffer.append("处理事件 onFinishWorkitem,"); + eventTypeBuffer.append("回退前事件 onBeforeStepBack,"); + eventTypeBuffer.append("回退事件 onStepBack,"); + eventTypeBuffer.append("取回前事件 onBeforeTakeBack,"); + eventTypeBuffer.append("取回事件 onTakeBack,"); + } + + //基础档案类型 + private final String ARCHIVESTYPE = "archives"; + //流程表单类型 + private final String FLOWTYPE = "flow"; + //创建基础档案 + private final String CREATEARCHIVES = "create"; + //更新基础档案 + private final String UPDATEARCHIVES = "update"; + //创建基础档案 + private final String CREATEARCHIVESURL = "rest/form/import/"; + //创建基础档案 + private final String UPDATEARCHIVESURL = "rest/form/update"; + @Resource + private ISeeYonInterFaceDao seeYonInterFaceDao; + + + //上一次同步时间 + private String LAST_SYNCHRONISED_TIME = ""; + /**** + * @Content:发起无流程表单接口实现 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2019/12/23 17:03 + * @Param [templateCode 模版编码, sendLoginName 发送人登录帐号 ,xmlData ] + * @return java.lang.Integer + **/ + public static JsonResultEntity saveNoProcess(String templateCode , String interfaceUrl,String sendLoginName, String xmlData) { + String token = getToken(RESTUSERNAME, RESTPASSWORD, sendLoginName); + Map res = new HashMap(); + res.put("loginName", sendLoginName); + res.put("dataXml", xmlData); + res.put("token", token); + String result = HttpRequest.post(sendUrl + interfaceUrl + templateCode).header("token", token).body(JSON.toJSONString(res)).execute().body(); + logger.info("无流程表单执行结果:" + result); + return BaseResult.getFailureMessageEntity("执行成功", result); + } + + public static JsonResultEntity upDateNoProcess(String interfaceUrl, String templateCode, String sendLoginName, String moduleId, String xmlData) { + String token = getToken(RESTUSERNAME, RESTPASSWORD, sendLoginName); + Map res = new HashMap(); + res.put("loginName", sendLoginName); + res.put("dataXml", xmlData); + res.put("token", token); + res.put("moduleId", moduleId); + res.put("templateCode", templateCode); + logger.info("更新无流程表单参数:{}",JSON.toJSONString(res)); + String result = HttpRequest.put(sendUrl + interfaceUrl).header("token", token).body(JSON.toJSONString(res)).execute().body(); + logger.info("更新无流程表单执行结果:" + result); + return BaseResult.getFailureMessageEntity("执行成功", result); + } + + // { +// "moduleId":"5701605966502512923", +// "templateCode":"formmain_0360", +// "loginName":"seeyon", +// "dataXml":"<![CDATA[1438373948291346275]]><![CDATA[9218745623489128746]]><![CDATA[6897123456789123456]]><![CDATA[5729461284567891234]]>" +// } + private static String getToken(String userName, String password, String loginName) { + JSONObject jsonObject = new JSONObject(); + /** 获取token*/ + + jsonObject.put("userName", userName); + jsonObject.put("password", password); + jsonObject.put("loginName", loginName); + logger.info("请求获取token开始---------------------------------------------"); + logger.info("请求参数" + jsonObject.toJSONString()); + String result = HttpUtil.post(sendUrl + "rest/token", jsonObject.toJSONString()); + logger.info("获取token结果---------------------------------------------" + result); + logger.info("获取token结果---------------------------------------------" + result); + jsonObject = JSONObject.parseObject(result); + if ("".equals(result) || result == null) { + logger.info("获取token失败!"); + throw new RuntimeException("获取token失败!"); + } else { + String token = jsonObject.get("id").toString(); + return token; + } + } + + /*** + * 发起OA表单方法 + * @content: + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-22 9:32 + * @param + * @return com.hzya.frame.web.entity.BaseResult + **/ + @Override + public JsonResultEntity thirdInterfaceSend(JSONObject requestData) { + JSONObject jsonStr = requestData.getJSONObject("jsonStr"); + if (ObjectUtils.isEmpty(jsonStr)) { + throw new BaseSystemException("jsonStr为空!请传递参数"); + } + //类型 flow archives + String type = jsonStr.getString("type"); + if (StringUtils.isEmpty(type)) { + throw new BaseSystemException("请传递类型!type 流程表单:flow 基础档案:archives"); + } + //模版编号 + String templateCode = jsonStr.getString("templateCode"); + if (StringUtils.isEmpty(templateCode)) { + throw new BaseSystemException("请传入模版编号!templateCode不允许为空"); + } + JSONObject data = jsonStr.getJSONObject("data"); + String attributeArrayStr = jsonStr.getString("attribute"); + if (StringUtils.isEmpty(attributeArrayStr)) { + throw new BaseSystemException("attribute不允许为空"); + } + List attributeArray = JSON.parseArray(attributeArrayStr, JSONObject.class); + JsonResultEntity result = null; + if (ARCHIVESTYPE.equalsIgnoreCase(type)) { + switch (templateCode){ + //预留的 + case "abc123": + break; + } + } + if (FLOWTYPE.equalsIgnoreCase(type)) { + } + return result; + } + + + @Override + public JsonResultEntity thirdInterfaceSeeYonPlugInInterfaceEntrance(JSONObject requestData){ + String jsonStr = requestData.getString("jsonStr"); + JSONObject jsonObject = requestData.getJSONObject("jsonStr"); + OAWorkflowEventDataEntity entity = JSON.parseObject(jsonStr,OAWorkflowEventDataEntity.class); + logger.info("监听OA事件入参:"+jsonObject.toJSONString()); + JSONObject formBeanData = jsonObject.getJSONObject("businessDataStr"); + String eventType = jsonObject.getString("eventType") ; + /** 流程ID*/ + String summaryId = entity.getSummaryId(); + /** 节点ID*/ + String affairId = entity.getAffairId(); + String currentActivityId = entity.getCurrentActivityId(); + /****/ + String formViewOperation = entity.getFormViewOperation(); + Object summaryObj = entity.getSummaryObj(); + String deeCfgId = entity.getDeeCfgId(); + String currentNodeLast = entity.getCurrentNodeLast(); + Map businessData = JSON.parseObject(entity.getBusinessDataStr(), Map.class); + Map extData = entity.getExtData(); + /** 表单表的FORM ID,用此字段标记是哪个流程*/ + String formApp = entity.getFormApp(); + + //formApp 最好过滤一下 + + + String result = null; + try { + //流程事件处理 + result = colEventPost(jsonStr, formApp, eventType); + }catch (Exception e){ + return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); + } + try { + /** 根据事件类型处理相关事件*/ + switch (eventType) { + /** 发起前事件*/ + case "onBeforeStart": + break; + /** 发起事件*/ + case "onStart": + //流程发起 新增grpu8单据 + break; + /** 终止前事件*/ + case "onBeforeStop": + break; + /** 终止事件*/ + case "onStop": + //流程终止,更新grpu8单据 + break; + /** 撤销前事件*/ + case "onBeforeCancel": + break; + /** 撤销事件*/ + case "onCancel": + //流程撤销,更新grpu8单据 + break; + /** 结束事件*/ + case "onProcessFinished": + break; + /** 处理前事件*/ + case "onBeforeFinishWorkitem": + /** 根据form处理相关业务表单的数据*/ + switch (formApp) { + case "abc123": + break; + default: + return BaseResult.getFailureMessageEntity("未匹配到表单!当前formID:" + formApp, ""); + } + break; + /** 处理事件*/ + case "onFinishWorkitem": + break; + /** 回退前事件*/ + case "onBeforeStepBack": + break; + /** 回退事件*/ + case "onStepBack": + break; + /** 取回前事件*/ + case "onBeforeTakeBack": + break; + /** 取回事件*/ + case "onTakeBack": + break; + default: +// throw new RuntimeException("传入了非法事件类型!请参照:" + eventTypeBuffer.toString()); + return BaseResult.getFailureMessageEntity("传入了非法事件类型!请参照:" + eventTypeBuffer.toString(), "", ""); + } + return BaseResult.getSuccessMessageEntity("传递成功", result); + }catch (Exception e){ + return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); + } + } + + + @Override + public JsonResultEntity thirdInterfaceSeeYonDefinitionRePush(JSONObject jsonObject) throws Exception { + JSONObject requestData = jsonObject.getJSONObject("jsonStr"); + JSONArray resultEntityArray = new JSONArray(); + if(null == requestData){ + throw new BaseSystemException("参数传递错误需要jsonStr!"); + } + //表单模版ID + String formAppId = requestData.getString("formAppId"); + //事件事件类型 + String eventType = requestData.getString("eventType"); + //数据源编码 + String dataSourceCode = requestData.getString("dataSourceCode"); + //主表ID集合 formMainIds + JSONArray formMainIds = requestData.getJSONArray("formMainIds"); + if(StrUtil.isEmpty(eventType)){ + throw new BaseSystemException("需要传递eventType 参照致远OA事件!"); + } + if(StrUtil.isEmpty(formAppId)){ + throw new BaseSystemException("需要传递formAppId 参照致远OA 表 CAP_FORM_DEFINITION!"); + } + if(StrUtil.isEmpty(dataSourceCode)){ + throw new BaseSystemException("需要传递dataSourceCode 参照中台表 sys_data_source!"); + } + if(null == formMainIds || formMainIds.size() == 0){ + throw new BaseSystemException("需要传递业务主表数据id集合,不允许全量推送!"); + } + + SeeYonInterFaceEntity seeYonInterFaceEntity = new SeeYonInterFaceEntity(); + BeanUtil.copyProperties(requestData,seeYonInterFaceEntity); + List seeYonInterFaceEntityList = seeYonInterFaceDao.queryDefinitionInfo(seeYonInterFaceEntity); + if(null != seeYonInterFaceEntityList && seeYonInterFaceEntityList.size() >0){ + for(SeeYonInterFaceEntity interFaceEntity : seeYonInterFaceEntityList){ + String field_info = interFaceEntity.getField_info(); + JSONObject infoJson = JSON.parseObject(field_info); + //获取主表信息 + JSONObject formMain = infoJson.getJSONObject("front_formmain"); + //获取明细表信息 + JSONArray formSons = infoJson.getJSONArray("formsons"); + //主表tableName + String formMainTableName = formMain.getString("tableName"); + + /** 设置主表查询条件*/ + interFaceEntity.setTabName(formMainTableName); + interFaceEntity.setDataSourceCode(dataSourceCode); + interFaceEntity.setFormMainIds( formMainIds.toJavaList(String.class) ); + + List> forMainList = seeYonInterFaceDao.queryDefinitionData(interFaceEntity); + for (Map forMainRow : forMainList) { + //定义致远OA事件对象 + JSONObject seeYonBean = new JSONObject(); + //定义主表对象 + JSONObject formMainObj = new JSONObject(); + //获取主表ID + String forMainId = String.valueOf(forMainRow.get("ID")); + //组装主表数据 + for (Map.Entry entry : forMainRow.entrySet()) { + formMainObj.put(entry.getKey().toLowerCase(),entry.getValue()); + } + //组装明细表数据 + if(null != formSons && formSons.size() > 0){ + for(Object formSon : formSons){ + JSONObject son = JSON.parseObject(JSON.toJSONString(formSon)); + //明细数据 + String sonTableName = son.getString("tableName"); + SeeYonInterFaceEntity details = new SeeYonInterFaceEntity(); + details.setFormMainId(forMainId); + details.setTabName(sonTableName); + details.setDataSourceCode(dataSourceCode); + JSONArray jsonArray = new JSONArray(); + List> forSonList = seeYonInterFaceDao.queryDefinitionData(details); + for (Map forSons : forSonList) { + //组装明细数据 + JSONObject forSonJson = new JSONObject(); + for (Map.Entry entry : forSons.entrySet()) { + forSonJson.put(entry.getKey().toLowerCase(),entry.getValue()); + } + jsonArray.add(forSonJson); + } + //设置明细表数据 + seeYonBean.put(sonTableName,jsonArray); + } + } + + seeYonBean.put(formMainTableName,formMainObj); + JSONObject rePushRequestData = new JSONObject(); + JSONObject object = new JSONObject(); + object.put("formApp",formAppId); + object.put("eventType",eventType); + object.put("businessDataStr",seeYonBean.toJSONString()); + object.put("affairId",""); + object.put("summaryId",requestData.getString("summaryId")); + object.put("currentActivityId",""); + object.put("id",forMainId); + object.put("hzyaExtData",requestData.getJSONObject("hzyaExtData")); + logger.info("Method:thirdInterfaceSeeYonDefinitionRePush 组装seeYonBean DATA: {}",seeYonBean.toJSONString()); + + rePushRequestData.put("jsonStr",object); + + + JsonResultEntity resultEntity = thirdInterfaceSeeYonPlugInInterfaceEntrance(rePushRequestData); + if(null != resultEntity){ + resultEntityArray.add(resultEntity.getAttribute()); + }else{ + JSONObject jsonResultEntity = new JSONObject(); + jsonResultEntity.put("msg","从新推送失败"); + jsonResultEntity.put("id",forMainId); + resultEntityArray.add(jsonResultEntity); + + } + + } + } + } + return BaseResult.getSuccessMessageEntity("从新推送执行结束",resultEntityArray); + } + + /** + * seeyon流程事件监听前置方法,绑定数据源 + * @param entity + * @return + * @throws Exception + */ + @Override + public SysExtensionApiEntity colEventPre(SysExtensionApiEntity entity) throws Exception { + try { + SysApplicationEntity applicationEntity = entity.getSendApp(); + SysApplicationDatabaseEntity sysApplicationDatabaseEntity = new SysApplicationDatabaseEntity(); + sysApplicationDatabaseEntity.setSts("Y"); + sysApplicationDatabaseEntity.setDbStatus("1"); + sysApplicationDatabaseEntity.setAppId(applicationEntity.getId()); + sysApplicationDatabaseEntity.setDataSourceCode("master"); + List sysDataSourceEntities = sysApplicationDatabaseDao.queryDSBase(sysApplicationDatabaseEntity); + if(sysDataSourceEntities != null && sysDataSourceEntities.size() > 0){ + String parm = entity.getBodys(); + JSONObject jsonObject = JSONObject.parseObject(parm); + jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); + entity.setBodys(jsonObject.toJSONString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return entity; + } + + /** + * seeyon流程事件监听 + * + * @param jsonObject + * @return + * @throws Exception + */ + @Override + public JsonResultEntity colEventListener(JSONObject jsonObject) throws Exception { + try { + if (null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("jsonStr"))){ + SeeYonInterFaceEntity entity = jsonObject.getJSONObject("jsonStr").toJavaObject(SeeYonInterFaceEntity.class); + JSONObject requestData = new JSONObject(); + //表单模版ID + requestData.put("formAppId", entity.getFormAppId()); + //事件事件类型 + requestData.put("eventType",entity.getEventType()); + //数据源编码 + requestData.put("dataSourceCode",entity.getDataSourceCode()); + requestData.put("formMainIds",entity.getFormMainIds()); + requestData.put("summaryId",entity.getSummaryId()); + JSONObject jsonStr = new JSONObject(); + jsonStr.put("jsonStr",requestData); + thirdInterfaceSeeYonDefinitionRePush(jsonStr); + } + }catch (Exception e){ + logger.error("流程事件通知接口出错:{}",e); + return BaseResult.getSuccessMessageEntity("失败",e.getMessage()); + } + return BaseResult.getSuccessMessageEntity("成功"); + } + + /** + * seeyon流程事件监听后置方法,调用三方接口 + * + * @param jsonStr + * @param formAppId + * @param eventType + * @return + * @throws Exception + */ + @Override + public String colEventPost(String jsonStr, String formAppId, String eventType) throws Exception { + if (StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType)){ + SysApplicationApiEntity sysApplicationApiEntity = new SysApplicationApiEntity(); + sysApplicationApiEntity.setHeaderIn(formAppId+"_"+eventType); + List applist = sysApplicationApiService.queryLike(sysApplicationApiEntity); + if (CollectionUtil.isNotEmpty(applist)){ + if (applist.size() > 1){ + throw new BaseSystemException("根据formID:" + formAppId+"查询出多条数据"); + } + SysApplicationApiEntity sysApp = applist.get(0); + Map headerMap = MapBuilder.create(true) + .put("apiCode", String.valueOf(sysApp.getApiCode())) + //这里用中台做为发送方 + .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") + .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId",String.valueOf(sysApp.getAppCode())) + .build(); + String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body(); + logger.info("调用中台返回的参数:{}",body); + return body; + } + } + return null; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java new file mode 100644 index 00000000..9849bb40 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeyonExtServiceImpl.java @@ -0,0 +1,241 @@ +package com.hzya.frame.seeyon.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; +import com.hzya.frame.seeyon.service.ISeeyonExtService; +import com.hzya.frame.seeyon.util.OAU8Util; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity; +import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogStatusEnum; +import com.hzya.frame.uuid.UUIDLong; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @Description seeyon扩展类 + * @Author xiangerlin + * @Date 2024/5/14 14:04 + **/ +@Service(value = "seeyonExt") +public class SeeyonExtServiceImpl implements ISeeyonExtService { + + + Logger logger = LogManager.getLogger(getClass()); + + @Autowired + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + + /** + * 英德赛 OA档案传U8 + * 根据不同formApp来调U8不同接口 + * @Since 3.0 + * @param entity + * @return + */ + @Override + public SysExtensionApiEntity ydcSeeyon2u8(SysExtensionApiEntity entity) { + String bodys = entity.getBodys(); + if (StrUtil.isNotEmpty(bodys)){ + try { + OAWorkflowEventDataEntity dataEntity = JSON.parseObject(bodys,OAWorkflowEventDataEntity.class); + String businessDataStr = dataEntity.getBusinessDataStr();//oa表单参数 + JSONObject businessData = JSON.parseObject(businessDataStr); + String formApp = dataEntity.getFormApp(); + SysExtensionApiEntity param = new SysExtensionApiEntity(); + Map headerMap = entity.getHeaders(); + JSONObject hzyaExtData = dataEntity.getHzyaExtData();//扩展参数 + if (null == hzyaExtData){ + hzyaExtData = new JSONObject(); + } + //根据forApp组装不同参数 + switch (formApp){ + case "-8691606453890363968":// + hzyaExtData.put("billCode", "cunhuoabc123456"); + getInventory(businessData,param); + break; + case "6223456019738676230": + getSupplier(businessData,param,hzyaExtData); + break; + case "-9122508232154527168": + getCustomer(businessData,param,hzyaExtData); + break; + default: + param.setBodys("未匹配到表单!当前formID:"+ formApp); + logger.error("未匹配到表单!当前formID:"+formApp); + } + headerMap.put("hzyaExtData", JSON.toJSONString(hzyaExtData)); + return param; + }catch (Exception e){ + e.printStackTrace(); + logger.error("执行英德赛OA存货同步U8接口报错:{}", e); + } + } + return null; + } + + /** + * 回调方法 + * @Since 3.0 + * @param logEntity + */ + @Override + public void ydcSeeyon2u8CallBack(SysMessageManageLogEntity logEntity) { + + + //在这里记录日志 + JSONObject targetData = JSON.parseObject(logEntity.getTargetData());//这个对象里的body是 发送到u8的请求报文 + JSONObject sourceData = JSON.parseObject(logEntity.getSourceData()); + JSONObject sourceHeaders = sourceData.getJSONObject("header");//源数据header + JSONObject sourceBody = sourceData.getJSONObject("body");//源数据body + JSONObject hzyaExtData = sourceHeaders.getJSONObject("hzyaExtData"); + JSONArray formMainIds = new JSONArray(); + formMainIds.add(sourceBody.getString("id")); + JSONObject param = new JSONObject(); + String formApp = sourceBody.getString("formApp"); + param.put("formAppId",formApp); + param.put("formMainIds",formMainIds); + param.put("dataSourceCode","ht_oa_sqlserver"); + param.put("eventType",sourceBody.getString("eventType")); + + //把返回的单号更新到oa档案表 + String sql = ""; + switch (formApp){ + case "-8691606453890363968"://存货 + sql = ""; + break; + case "6223456019738676230"://供应商 + sql = "update formmain_0229 set field0002 = '' where field0001 = "+hzyaExtData.getString("billCode"); + break; + case "-9122508232154527168"://客户 + sql = "update formmain_0230 set field0002 = '' where field0001 = "+hzyaExtData.getString("billCode"); + break; + } + IntegrationTaskLivingDetailsEntity logDetails = new IntegrationTaskLivingDetailsEntity(); + logDetails.setRootAppPk(JSON.toJSONString(param)); + logDetails.setRootAppBill(hzyaExtData.getString("billCode")); + logDetails.setNewTransmitInfo(logEntity.getReturnData()); + logDetails.setNewPushDate(new Date()); + logDetails.setRootAppNewData(targetData.getString("body")); + //logDetails.setNewState(SysMessageManageLogStatusEnum.statusGetValue(logEntity.getStatus())); + logDetails.setPluginId("SeeyonExtPlugin"); + try { + if (StrUtil.isEmpty(hzyaExtData.getString("integration_task_living_details_id"))){ + if (SysMessageManageLogStatusEnum.SUCCESS.getType().equals(logEntity.getStatus())) {//成功 + taskLivingDetailsService.saveLogToSuccess(logDetails); + }else { + taskLivingDetailsService.saveLogToFail(logDetails);//失败 + } + }else { + logDetails.setId(hzyaExtData.getString("integration_task_living_details_id")); + if (SysMessageManageLogStatusEnum.SUCCESS.getType().equals(logEntity.getStatus())) {//成功 + taskLivingDetailsService.saveLogFailToSuccess(logDetails); + }else { + taskLivingDetailsService.updateLogFailToSuccess(logDetails);//失败 + } + } + }catch (Exception e){ + logger.error("保存日志出错:{}",e); + } + } + + //存货参数组装 + private SysExtensionApiEntity getInventory(JSONObject businessData,SysExtensionApiEntity param){ + if (null != businessData){ + JSONObject formmain0227 = businessData.getJSONObject("formmain_0227"); + JSONArray formson0228Arr = businessData.getJSONArray("formson_0228"); + for (int i=0; i< formson0228Arr.size(); i++){ + JSONObject formson0228 = formson0228Arr.getJSONObject(i); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("Token", "Hzya1314_CheckSkip"); + jsonObject.put("billid", formson0228.getString("id")); + jsonObject.put("AccId", formmain0227.getString("field0015")); + + JSONObject oArchives = new JSONObject(); + oArchives.put("cInvCode", formson0228.getString("field0002")); + oArchives.put("cInvCCode", formson0228.getString("field0005")); + oArchives.put("cInvName", formson0228.getString("field0003")); + //todo 这个没值 + oArchives.put("cGroupCode", "01"); + oArchives.put("cComUnitCode", formson0228.getString("field0006")); + + jsonObject.put("oArchives", oArchives); + param.setBodys(JSON.toJSONString(jsonObject)); + } + } + return param; + } + //供应商参数组装 + private SysExtensionApiEntity getSupplier(JSONObject businessData,SysExtensionApiEntity param,JSONObject hzyaExtData){ + if (null != businessData){ + JSONObject formmain0225 = businessData.getJSONObject("formmain_0225"); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("billid", formmain0225.getString("id")); + jsonObject.put("AccId", formmain0225.getString("field0020")); + jsonObject.put("Token", OAU8Util.getToken()); + JSONObject oArchives = new JSONObject(); + oArchives.put("cVenCode", formmain0225.getString("field0002")); + oArchives.put("cVenName ", formmain0225.getString("field0003")); + oArchives.put("cVenAbbName", formmain0225.getString("field0004")); + oArchives.put("cVCCode", formmain0225.getString("field0006")); + oArchives.put("cVenExch_name", formmain0225.getString("field0010")); + //oArchives.put("bVenTax", "false"); + //oArchives.put("bLicenceDate", "false"); + //oArchives.put("bBusinessDate", "false"); + //oArchives.put("bProxyDate", "false"); + //oArchives.put("bPassGMP", "false"); + //oArchives.put("bVenCargo", "false"); + //oArchives.put("bProxyForeign", "true"); + //oArchives.put("bVenService", "true"); + //oArchives.put("iVenGSPType", "0"); + //oArchives.put("bVenOverseas", "false"); + //oArchives.put("bVenAccPeriodMng", "false"); + //oArchives.put("bVenHomeBranch", "false"); + oArchives.put("dVenCreateDatetime", DateUtil.now()); + oArchives.put("cVenRegCode", formmain0225.getString("field0009")); + oArchives.put("cVenBank", formmain0225.getString("field0011")); + oArchives.put("cVenAccount", formmain0225.getString("field0012")); + jsonObject.put("oArchives", oArchives); + param.setBodys(JSON.toJSONString(jsonObject)); + hzyaExtData.put("billCode", formmain0225.getString("field0001")); + hzyaExtData.put("formmainId", formmain0225.getString("id")); + } + return param; + } + //客户参数组装 + private SysExtensionApiEntity getCustomer(JSONObject businessData,SysExtensionApiEntity param,JSONObject hzyaExtData){ + if (null != businessData){ + JSONObject formmain0226 = businessData.getJSONObject("formmain_0226"); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("billid", formmain0226.getString("id")); + jsonObject.put("AccId", formmain0226.getString("field0025")); + jsonObject.put("Token", "Hzya1314_CheckSkip"); + + JSONObject oArchives = new JSONObject(); + oArchives.put("cCusCode", formmain0226.getString("field0002")); + oArchives.put("cCusName", formmain0226.getString("field0007")); + oArchives.put("cCusAbbName", formmain0226.getString("field0008")); + oArchives.put("cCCCode", formmain0226.getString("field0012")); + oArchives.put("cCusExch_name", formmain0226.getString("field0013")); + // todo 这个字段没值 + oArchives.put("cCusMngTypeCode", "999"); + + jsonObject.put("oArchives", oArchives); + param.setBodys(JSON.toJSONString(jsonObject)); + hzyaExtData.put("billCode",formmain0226.getString("field0001")); + hzyaExtData.put("formmainId",formmain0226.getString("id")); + } + return param; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OABipUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OABipUtil.java new file mode 100644 index 00000000..9484e2fb --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OABipUtil.java @@ -0,0 +1,65 @@ +package com.hzya.frame.seeyon.util; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; + +/** + * com.hzya.frame.bip.v3.v2207.util + * + * @author makejava + * @date 2024-05 -30 14:20 + */ + +public class OABipUtil { + /** + * + * @content 发送单据到BIP系统 + * @author laborer + * @date 2024/6/21 0021 10:51 + * + */ + + public static String sendU9cTOBipEsb(String parm, String apiCode,String token){ + String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; + System.out.println("推送参数"+parm); + String result = HttpRequest.post(baseUrl) + .header("appId", "800023")//头信息,多个头信息多次调用此方法即可 + .header("access_token", token)//头信息,多个头信息多次调用此方法即可 + .header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可 + .header("publicKey", "ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 + .header("secretKey", "7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 + .body(parm)//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + System.out.println("返回参数"+result); + if(StrUtil.isNotEmpty(result)){ + return analytic(result); + } + return null; + } + public static String getBipToken(String userCode, String apiCode){ + String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; + String result = HttpRequest.post(baseUrl) + .header("appId", "800023")//头信息,多个头信息多次调用此方法即可 + .header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可 + .header("usercode", userCode)//头信息,多个头信息多次调用此方法即可 + .header("publicKey", "ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 + .header("secretKey", "7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 + .body("")//表单内容 + .timeout(20000)//超时,毫秒 + .execute().body(); + System.out.println("返回参数"+result); + if(StrUtil.isNotEmpty(result)){ + JSONObject obj = JSON.parseObject( analytic(result)); + JSONObject data = obj.getJSONObject("data"); + return data.getString("access_token"); + } + return null; + } + public static String analytic(String parm){ + JSONObject main = JSON.parseObject(parm); + return main.getString("attribute"); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAPayState.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAPayState.java new file mode 100644 index 00000000..3fdfac15 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAPayState.java @@ -0,0 +1,73 @@ +package com.hzya.frame.seeyon.util; + +/** + * @Author:hecan + * @Description:支付类型(支付状态) + * @params: + * @return: + * @Date: 2023/3/14 15:05 + */ +public enum OAPayState { + a("a","待提交直联"), + b("b","已提交直联"), + c("c","银行已受理"), + d("d","银行未受理"), + e("e","可疑"), + f("f","待人工确认"), + g("g","支付成功"), + h("h","支付失败"), + i("i","部分成功"), + j("j","退票"), + k("k","取消支付"), + n("n","其他"), + p("p","支付中"), + q("q","待支付"), + one("1","待处理"), + two("2","审批中"), + three("3","处理失败"), + four("4","审批完成"), + five("5","审批撤销"), + six("6","审批拒绝"), + seven("7","待发送审批"), + eight("8","集中受理中"), + nine("9","审批退回"), + ten("10","预处理中"), + eleven("11","预处理拒绝"), + twelve("12","资金监控审批中"); + + + //类型 + private String type; + //值 + private String value; + + OAPayState(String type, String value){ + this.type=type; + this.value=value; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public static String payStateGetValue(String type){ + for (OAPayState payState : OAPayState.values()){ + if(payState.getType()==type||payState.getType().equals(type)){ + return payState.getValue().toString(); + } + } + return null; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java new file mode 100644 index 00000000..84b42102 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java @@ -0,0 +1,209 @@ +package com.hzya.frame.seeyon.util; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.entity.CollAttachmentResDTO; +import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; +import com.hzya.frame.sysnew.application.api.service.ISysApplicationApiService; +import com.hzya.frame.web.exception.BaseSystemException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.io.File; +import java.util.HashMap; +import java.util.List; + +/** + * @Description 致远rest接口工具类 + * @Author xiangerlin + * @Date 2024/6/17 15:49 + **/ +@Component +public class OARestUtil { + @Autowired + private ISysApplicationApiService sysApplicationApiService; + static Logger logger = LoggerFactory.getLogger(OARestUtil.class); + + private OARestUtil() { + } + + + /** + * 附件上传 + * @param file 附件对象 + * @param api_code 接口编码 + * @return + */ + public JSONObject fileUpload(File file,String api_code) { + if (StrUtil.isNotEmpty(api_code)){ + //1、查询附件上传api接口信息 + SysApplicationApiEntity sysApp = getByCode(api_code); + if (null != sysApp){ + String app_url = sysApp.getAppUrl(); + String url = app_url+"/seeyon/rest/attachment?token=@token@"; + String token = getToken(null,"8000240000"); + url = url.replaceAll("@token@",token); + HashMap paramMap = new HashMap<>(); + paramMap.put("file", file); + String result = HttpUtil.post(url, paramMap); + if (StrUtil.isNotBlank(result)) { + logger.info("附件上传结果"+result); + JSONObject jsonObject = JSONObject.parseObject(result); + String atts = jsonObject.get("atts").toString(); + if (StrUtil.isNotEmpty(atts)) { + JSONArray jsonArray = JSONArray.parseArray(atts); + JSONObject res = (JSONObject) jsonArray.get(0); + return res; + } + } + } + }else { + throw new BaseSystemException("api_code不能为空"); + } + return null; + } + + /*** + * 查询协同附件列表 + * @param summaryId col_summary表id + * @param attType 0代表附件,2代表关联文档,“0,2”代表附件和关联文档 + * @param apiCode 接口编码 + * @return + */ + public List getColAttachments(String summaryId,String attType,String apiCode,String loginName){ + if (StrUtil.isNotEmpty(summaryId) && StrUtil.isNotEmpty(apiCode)){ + SysApplicationApiEntity sysApp = getByCode(apiCode); + String token = getToken(loginName,sysApp); + String appUrl = StrUtil.removeSuffix(sysApp.getAppUrl(),"/"); + if (StrUtil.isEmpty(attType)){ + attType = "0"; + } + String url = "/seeyon/rest/coll/attachments/@SummaryID@/@attType@"; + url = url.replaceAll("@SummaryID@",summaryId).replaceAll("@attType@",attType); + String body = HttpRequest.get(appUrl + url).header("token", token).execute().body(); + if (StrUtil.isNotEmpty(body) && JSONUtil.isTypeJSON(body)){ + List list = JSON.parseArray(body,CollAttachmentResDTO.class); + return list; + } + } + return null; + } + + /** + * 附件下载 + * @param loginName oa登录名 + * @param apiCode 接口编码 + * @param fileId 附件id + * @param fileName 附件名 + * @return 附件字节数组 + */ + public byte[] downloadFileBytes(String loginName,String apiCode,String fileId,String fileName){ + if (StrUtil.isNotEmpty(apiCode)){ + SysApplicationApiEntity sysApp = getByCode(apiCode); + String token = getToken(loginName,sysApp); + String appUrl = StrUtil.removeSuffix(sysApp.getAppUrl(),"/"); + String url = "/seeyon/rest/attachment/file/@ctp_file_ID@?fileName=@文件名@&token=@token@"; + url = url.replaceAll("@ctp_file_ID@",fileId).replaceAll("@文件名@",fileName).replaceAll("@token@",token); + byte[] bytes = HttpUtil.downloadBytes(appUrl + url); + return bytes; + } + return null; + } + + + /** + * 附件下载 + * @param loginName oa登录名 + * @param apiCode 接口编码 + * @param fileId 附件id + * @param fileName 附件名 + * @param token + * @return 附件字节数组 + */ + public byte[] downloadFileBytes(String loginName,String apiCode,String fileId,String fileName,String token){ + if (StrUtil.isNotEmpty(apiCode)){ + SysApplicationApiEntity sysApp = getByCode(apiCode); + if (StrUtil.isEmpty(token)){ + token = getToken(loginName,sysApp); + } + String appUrl = StrUtil.removeSuffix(sysApp.getAppUrl(),"/"); + String url = "/seeyon/rest/attachment/file/@ctp_file_ID@?fileName=@文件名@&token=@token@"; + url = url.replaceAll("@ctp_file_ID@",fileId).replaceAll("@文件名@",fileName).replaceAll("@token@",token); + byte[] bytes = HttpUtil.downloadBytes(appUrl + url); + return bytes; + } + return null; + } + /** + * 获取token + * @param login_name + * @param api_code + * @return + */ + public String getToken(String login_name,String api_code){ + if (StrUtil.isNotEmpty(api_code)){ + SysApplicationApiEntity sysApp = getByCode(api_code); + return getToken(login_name,sysApp); + }else { + throw new BaseSystemException("api_code不能为空"); + } + } + + /** + * 获取token + * @param login_name oa登录名 + * @param sysApp 应用信息 + * @return + */ + public String getToken(String login_name,SysApplicationApiEntity sysApp){ + if (null != sysApp){ + HashMap hashMap = new HashMap<>(); + String app_url = StrUtil.removeSuffix(sysApp.getAppUrl(), "/"); + String url = app_url+"/seeyon/rest/token"; + String headerIn = sysApp.getHeaderIn(); + JSONArray headers = JSON.parseArray(headerIn); + for (int i = 0; i < headers.size(); i++) { + JSONObject object1 = headers.getJSONObject(i); + String parameterName = object1.getString("parameterName"); + if ("userName".equals(parameterName) || "password".equals(parameterName) || "loginName".equals(parameterName)){ + String example = object1.getString("example"); + hashMap.put(parameterName,example); + } + } + login_name = hashMap.get("loginName"); + if (StrUtil.isEmpty(login_name)){ + hashMap.put("loginName","hzya"); + } + String result = HttpRequest.post(url).body(JSON.toJSONString(hashMap)).execute().body(); + JSONObject jsonObject = JSONObject.parseObject(result); + if (null != jsonObject) { + logger.info("======token:{}======" ,jsonObject.getString("id")); + return jsonObject.getString("id"); + } + } + return null; + } + private SysApplicationApiEntity getByCode(String api_code){ + if (StrUtil.isNotEmpty(api_code)){ + SysApplicationApiEntity sysApp = new SysApplicationApiEntity(); + sysApp.setApiCode(Long.valueOf(api_code)); + sysApp = sysApplicationApiService.queryOne(sysApp); + if (null != sysApp && StrUtil.isNotEmpty(sysApp.getId())){ + sysApp = sysApplicationApiService.get(sysApp.getId()); + if (null != sysApp){ + return sysApp; + } + } + }else { + throw new BaseSystemException("api_code不能为空"); + } + return null; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAU8Util.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAU8Util.java new file mode 100644 index 00000000..76decc6d --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OAU8Util.java @@ -0,0 +1,34 @@ +package com.hzya.frame.seeyon.util; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.entity.OAU8ResponseDTO; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +/** + * @Description + * @Author xiangerlin + * @Date 2024/5/14 15:30 + **/ +public class OAU8Util { + + static Logger logger = LogManager.getLogger(OAU8Util.class); + + //获取token + public static String getToken() { + String url = "http://127.0.0.1:51910/Api/Base/GetToken"; + JSONObject jsonObject = new JSONObject(); + jsonObject.put("secretkey", "L1NhkDrQhtBDzTxFxPI0jxWcBzTBSPvaI5xZusRRi9ofS9d6ngxrj1erwbdjxtUT"); + logger.info("获取U8token参数:{}", jsonObject.toJSONString()); + String token = HttpRequest.post( url).body(jsonObject.toJSONString()).timeout(60000).execute().body(); + logger.info("token返回参数:{}", jsonObject.toJSONString()); + if (StrUtil.isNotEmpty(token)) { + OAU8ResponseDTO u8ResponseDTO = JSONObject.parseObject(token, OAU8ResponseDTO.class); + return u8ResponseDTO.getMessage(); + } + return token; + + } +} diff --git a/fw-oa/src/main/webapp/WEB-INF/web.xml b/fw-oa/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..d80081d1 --- /dev/null +++ b/fw-oa/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index fc53bd54..1d2115b9 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ - + fw-oa From e9bdda5cf07121a7bb3586680b8fa8c289500397 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 24 Mar 2025 11:27:54 +0800 Subject: [PATCH 02/42] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BB=8Esysnew?= =?UTF-8?q?=E4=B8=AD=E7=A7=BB=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-buildpackage/pom.xml | 5 +++ .../ZxBankDistributePluginInitializer.java | 9 ++--- .../plugin/ZxBankPluginInitializer.java | 4 +-- .../plugin/ZxBankResultPluginInitializer.java | 2 +- .../spring/spring-buildpackage-plugin.xml | 2 ++ .../seeyon/zxbank/entity/ZxBankEntity.xml | 4 +-- .../service/impl/ZxBankServiceImpl.java | 34 ++++++++++++------- 7 files changed, 34 insertions(+), 26 deletions(-) diff --git a/base-buildpackage/pom.xml b/base-buildpackage/pom.xml index f4f9b259..c5ae48c4 100644 --- a/base-buildpackage/pom.xml +++ b/base-buildpackage/pom.xml @@ -18,6 +18,11 @@ base-webapp ${revision} + + com.hzya.frame + fw-oa + 0.0.1-SNAPSHOT + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankDistributePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankDistributePluginInitializer.java index 7ace1f25..32edad78 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankDistributePluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankDistributePluginInitializer.java @@ -21,6 +21,7 @@ import com.hzya.frame.mdm.mdmModuleDistributeTripartite.entity.MdmModuleDistribu import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao; import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; import com.hzya.frame.mdm.service.IMdmServiceCache; +import com.hzya.frame.seeyon.zxbank.service.IZxBankService; import com.hzya.frame.sys.sysenum.SysEnum; import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; @@ -31,7 +32,6 @@ import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntit import com.hzya.frame.sysnew.grovy.service.IGroovyIntegrationService; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; -import com.hzya.frame.sysnew.zxbank.service.IZxBankService; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; @@ -474,6 +474,7 @@ public class ZxBankDistributePluginInitializer extends PluginBaseEntity { //查询主数据 MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity(); queryMdmModuleEntity.setSts("Y"); + queryMdmModuleEntity.setMdmCode(Long.valueOf("10048")); List mdmModuleEntities = mdmModuleDao.queryBase(queryMdmModuleEntity); if(mdmModuleEntities == null || mdmModuleEntities.size() == 0){ return BaseResult.getSuccessMessageEntity("主数据未设置,不需要下发"); @@ -508,18 +509,12 @@ public class ZxBankDistributePluginInitializer extends PluginBaseEntity { queryFildRule.setMdmId(mdmModuleEntities.get(i).getId()); queryFildRule.setRuleCode("service"); List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule); - - if(mdmModuleEntities.get(i).getMdmCode()!= 10045L){ //新增 doAdd(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); //修改 doUpdate(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); //删除 doDelete(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); - }else{ - logger.info("主数据编码为10045,已经在业务数据下发执行,主数据下发不执行"); - continue; - } } } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankPluginInitializer.java index 2eb03f95..65d0c3fc 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankPluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankPluginInitializer.java @@ -2,9 +2,7 @@ package com.hzya.frame.plugin.zxBank.plugin; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; -import com.hzya.frame.plugin.masterData.plugin.MdmPluginInitializer; -import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService; -import com.hzya.frame.sysnew.zxbank.service.IZxBankService; +import com.hzya.frame.seeyon.zxbank.service.IZxBankService; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankResultPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankResultPluginInitializer.java index 9a9c901a..399e1989 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankResultPluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankResultPluginInitializer.java @@ -2,7 +2,7 @@ package com.hzya.frame.plugin.zxBank.plugin; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; -import com.hzya.frame.sysnew.zxbank.service.IZxBankService; +import com.hzya.frame.seeyon.zxbank.service.IZxBankService; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/zxBank/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/zxBank/spring/spring-buildpackage-plugin.xml index ca361062..cb28c7ce 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/zxBank/spring/spring-buildpackage-plugin.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/zxBank/spring/spring-buildpackage-plugin.xml @@ -2,4 +2,6 @@ + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml index 0f53c4e9..4087d5c5 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml @@ -85,12 +85,12 @@ - update ${tabName} set ${pushStatusField} =#{pushStatus} where id=#{dataId} + update ${tabName} set ${pushStatusField} =#{pushStatus} where id=#{id} - update ${tabName} set ${payResultField} =#{payResult} where id=#{dataId} + update ${tabName} set ${payResultField} =#{payResult} where id=#{id} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java index 4057b6ef..9cb5bcc7 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java @@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; import com.hzya.frame.basedao.service.impl.BaseService; import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl; import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.util.SM2Util; import com.hzya.frame.seeyon.zxbank.dao.IZxBankDao; import com.hzya.frame.seeyon.zxbank.entity.PayState; import com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity; @@ -15,6 +16,7 @@ import com.hzya.frame.seeyon.zxbank.service.IZxBankService; import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.uuid.UUIDLong; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; @@ -43,6 +45,12 @@ public class ZxBankServiceImpl extends BaseService impleme @Value("${zt.url}") private String url; + + @Value("${zx.privateKey}") + private String privateKey; + + @Value("${zx.publicKey}") + private String publicKey; @Override public JsonResultEntity queryArchives(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -63,7 +71,7 @@ public class ZxBankServiceImpl extends BaseService impleme switch (appTyp){ case "1": switch (mdmCode){ - case ""://杭泰付款单 + case "10048"://杭泰付款单 tableName = "mdm_zxbank"; listAll = bindingZxBank(jsonObject, mdmModuleSourceEntity, dbCode); break; @@ -83,7 +91,7 @@ public class ZxBankServiceImpl extends BaseService impleme JSONObject attributeResult = (JSONObject) JSON.toJSON(obj); if (attributeResult.getString("status").equals("200")) { String resultString = attributeResult.getString("list"); - if ("".equals(mdmCode)) { + if ("10048".equals(mdmCode)) { JSONArray jsonArray = JSONArray.parseArray(resultString); if (CollectionUtils.isNotEmpty(jsonArray)) { for (Object o : jsonArray) { @@ -128,7 +136,7 @@ public class ZxBankServiceImpl extends BaseService impleme try { JSONObject jsonObject = json.getJSONObject("jsonStr"); ZxBankEntity zxBankEntity = jsonObject.toJavaObject(ZxBankEntity.class); - zxBankEntity.setDataSourceCode(""); + zxBankEntity.setDataSourceCode("HT-OA"); logger.info("======开始查询中信返回的支付结果====="); List zxBankEntities = zxBankDao.queryResultIsNull(zxBankEntity); if(CollectionUtils.isEmpty(zxBankEntities)){ @@ -142,11 +150,11 @@ public class ZxBankServiceImpl extends BaseService impleme logger.info("=======杭泰付款单调用中信支付结果查询请求参数为:{}", params); //发送数据 String result = HttpRequest.post(url). - header("appId", ""). - header("apiCode", ""). + header("appId", "800058"). + header("apiCode", "8000580001"). //header("access_token", tokenBody). - header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj"). - header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + header("publicKey", "ZJYALA1PchEI1s2D5vaapO9RZ6CiDFv/pJAV88lRYg0oBwBCe7eDIk+3zDUT+v578prj"). + header("secretKey", "jcoATYyty05KgDwL4O0xD+Ulq5ExYWkGvZGf2bhKrMaCehb3NIm5DUnJSK/r2SUaj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). body(params). execute(). body(); @@ -191,7 +199,7 @@ public class ZxBankServiceImpl extends BaseService impleme try { JSONObject jsonObject = json.getJSONObject("jsonStr"); ZxBankEntity zxBankEntity = jsonObject.toJavaObject(ZxBankEntity.class); - zxBankEntity.setDataSourceCode(""); + zxBankEntity.setDataSourceCode("HT-OA"); logger.info("======开始查询中信电子回单====="); List zxBankEntities = zxBankDao.queryElecIsNull(zxBankEntity); if(CollectionUtils.isEmpty(zxBankEntities)){ @@ -206,11 +214,11 @@ public class ZxBankServiceImpl extends BaseService impleme logger.info("======杭泰付款单调用中信电子回单查询请求参数为:{}========",params); //发送数据 String result = HttpRequest.post(url). - header("appId", ""). - header("apiCode", ""). + header("appId", "800058"). + header("apiCode", "8000580002"). //header("access_token", tokenBody). - header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj"). - header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + header("publicKey", "ZJYALA1PchEI1s2D5vaapO9RZ6CiDFv/pJAV88lRYg0oBwBCe7eDIk+3zDUT+v578prj"). + header("secretKey", "jcoATYyty05KgDwL4O0xD+Ulq5ExYWkGvZGf2bhKrMaCehb3NIm5DUnJSK/r2SUaj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). body(params). execute(). body(); @@ -263,7 +271,7 @@ public class ZxBankServiceImpl extends BaseService impleme private List bindingZxBank(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { List list = new ArrayList<>(); StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("select * from v_hzya_pay where 1=1 and pushStatus is null "); + stringBuffer.append("select * from v_hzya_pay where 1=1 and push_status is null "); mdmModuleSourceEntity.setDataSourceCode(dbCode); List> hashMaps = zxBankDao.queryListByBank(stringBuffer.toString(), mdmModuleSourceEntity); int i = 0; From 1a41553fb2bc9a0cb0afc685f0d0f9a3af96d756 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 24 Mar 2025 11:30:30 +0800 Subject: [PATCH 03/42] =?UTF-8?q?yml=E4=B8=AD=E5=A2=9E=E5=8A=A0=E4=B8=AD?= =?UTF-8?q?=E4=BF=A1=E5=85=AC=E9=92=A5=E7=A7=81=E9=92=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-buildpackage/src/main/resources/application-ht.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/base-buildpackage/src/main/resources/application-ht.yml b/base-buildpackage/src/main/resources/application-ht.yml index 9188fd1d..81a1c4a7 100644 --- a/base-buildpackage/src/main/resources/application-ht.yml +++ b/base-buildpackage/src/main/resources/application-ht.yml @@ -39,4 +39,8 @@ cbs8: OA: data_source_code: yc_oa zt: - url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file + url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface +zx: + # 测试用这个 这个是银行给的 + privateKey: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgtzMo2o6THK3yLIm+83Ch/560+02l2hjjBSFGieWY/Z6gCgYIKoEcz1UBgi2hRANCAATKhwZX4P3XI8vYTKeCOLMVbanUNbaXjrIEZynshwdOzRVgzRQSiPNWo6OBBkAPvqE+2RS+5ABpS82DSlKl81z0 + publicKey: MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEyocGV+D91yPL2EyngjizFW2p1DW2l46yBGcp7IcHTs0VYM0UEojzVqOjgQZAD76hPtkUvuQAaUvNg0pSpfNc9A== \ No newline at end of file From 29113c35f16cf39bd67901fdacddb9d7666ddd28 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 26 Mar 2025 17:04:07 +0800 Subject: [PATCH 04/42] =?UTF-8?q?=E4=B8=AD=E4=BF=A1=E5=85=AC=E7=A7=81?= =?UTF-8?q?=E9=92=A5=E5=8A=A0=E5=AF=86=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hzya/frame/seeyon/util/SM2Util.java | 353 ++++++++++++++++++ 1 file changed, 353 insertions(+) create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java new file mode 100644 index 00000000..47ff93c4 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java @@ -0,0 +1,353 @@ +package com.hzya.frame.seeyon.util; + +import org.bouncycastle.crypto.CipherParameters; +import org.bouncycastle.crypto.engines.SM2Engine; +import org.bouncycastle.crypto.params.ECPrivateKeyParameters; +import org.bouncycastle.crypto.params.ECPublicKeyParameters; +import org.bouncycastle.crypto.params.ParametersWithRandom; +import org.bouncycastle.jcajce.provider.asymmetric.util.ECUtil; +import org.bouncycastle.jce.provider.BouncyCastleProvider; + +import java.nio.charset.StandardCharsets; +import java.security.*; +import java.security.spec.*; +import java.util.Base64; +import java.util.HashMap; +import java.util.Map; + +public class SM2Util { + + private final static SM2Engine.Mode DIGEST = SM2Engine.Mode.C1C3C2; + + private static final String PRIVATE_KEY = "privateKey"; + + private static final String PUBLIC_KEY = "publicKey"; + + private static final String STD_NAME = "sm2p256v1"; + + private static final String ALGORITHM = "EC"; + + public static final String LF = "\n"; + + public static final String CR = "\r"; + + public static final String SPACE = " "; + + public static final String EMPTY = ""; + + + /** + * 生成密钥 + * + * @return + */ + public Map generate() { + Map keyMap = new HashMap<>(); + try { + ECGenParameterSpec sm2Spec = new ECGenParameterSpec(STD_NAME); + KeyPairGenerator kpg = KeyPairGenerator.getInstance(ALGORITHM, new BouncyCastleProvider()); + kpg.initialize(sm2Spec); + KeyPair keyPair = kpg.generateKeyPair(); + PublicKey publicKey = keyPair.getPublic(); + PrivateKey privateKey = keyPair.getPrivate(); + keyMap.put(PRIVATE_KEY, new String(Base64.getEncoder().encode(privateKey.getEncoded()), StandardCharsets.UTF_8)); + keyMap.put(PUBLIC_KEY, new String(Base64.getEncoder().encode(publicKey.getEncoded()), StandardCharsets.UTF_8)); + } catch (Exception e) { + /*this.log.info("SM2Util生成密钥出现异常", e);*/ + } + return keyMap; + } + + /** + * 加密 + * + * @param data 数据Str + * @param publicKey 公钥Str + * @return 加密之后的数据 + */ + public static String encrypt(String data, String publicKey) { + try { + return new String(Base64.getEncoder().encode(encrypt(data.getBytes(StandardCharsets.UTF_8), Base64.getDecoder().decode(publicKey.getBytes(StandardCharsets.UTF_8))))); + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } + + /** + * 加密 + * + * @param data 数据 + * @param publicKey 公钥 + * @return 加密之后的数据 + */ + public static byte[] encrypt(byte[] data, byte[] publicKey) throws Exception { + CipherParameters pubKeyParameters = new ParametersWithRandom(publicKeyToParams("SM2", publicKey)); + SM2Engine engine = new SM2Engine(DIGEST); + engine.init(true, pubKeyParameters); + return engine.processBlock(data, 0, data.length); + } + + /** + * 解密 + * + * @param data 数据 + * @param privateKey 私钥 + * @return 解密之后的数据 + */ + public static String decrypt(String data, String privateKey) throws Exception { + return new String(decrypt(Base64.getDecoder().decode(data.getBytes(StandardCharsets.UTF_8)), Base64.getDecoder().decode(privateKey.getBytes(StandardCharsets.UTF_8))), StandardCharsets.UTF_8); + } + + /** + * 解密 + * + * @param data 数据 + * @param privateKey 私钥 + * @return 解密之后的数据 + */ + public static byte[] decrypt(byte[] data, byte[] privateKey) throws Exception { + CipherParameters privateKeyParameters = privateKeyToParams("SM2", privateKey); + SM2Engine engine = new SM2Engine(DIGEST); + engine.init(false, privateKeyParameters); + return engine.processBlock(data, 0, data.length); + } + + /** + * SM2密文转换空格等特殊字符 + * + * @param sm2Content + * @return + */ + public static String fixSm2Content(String sm2Content) { + if (sm2Content == null) { + return sm2Content; + } + return sm2Content.replace(LF, EMPTY).replace(CR, EMPTY).replace(SPACE, "+"); + } + + /** + * 私钥转换为 {@link ECPrivateKeyParameters} + * + * @param key key + * @return + * @throws InvalidKeyException + */ + public static ECPrivateKeyParameters privateKeyToParams(String algorithm, byte[] key) throws InvalidKeyException, InvalidKeySpecException, NoSuchAlgorithmException { + if (key == null || key.length == 0) { + throw new NullPointerException("key must be not null !"); + } + PrivateKey privateKey = generatePrivateKey(algorithm, key); + return (ECPrivateKeyParameters) ECUtil.generatePrivateKeyParameter(privateKey); + } + + /** + * 生成私钥 + * + * @param algorithm 算法 + * @param key key + * @return + */ + public static PrivateKey generatePrivateKey(String algorithm, byte[] key) throws NoSuchAlgorithmException, InvalidKeySpecException { + if (isBlank(algorithm)) { + throw new NullPointerException("algorithm must be not null !"); + } + if (key == null || key.length == 0) { + throw new NullPointerException("key must be not null !"); + } + KeySpec keySpec = new PKCS8EncodedKeySpec(key); + algorithm = getAlgorithmAfterWith(algorithm); + return getKeyFactory(algorithm).generatePrivate(keySpec); + } + + /** + * 公钥转换为 {@link ECPublicKeyParameters} + * + * @param key key + * @return + * @throws InvalidKeyException + */ + public static ECPublicKeyParameters publicKeyToParams(String algorithm, byte[] key) throws InvalidKeyException, InvalidKeySpecException, NoSuchAlgorithmException { + if (isBlank(algorithm)) { + throw new NullPointerException("algorithm must be not null !"); + } + if (key == null || key.length == 0) { + throw new NullPointerException("key must be not null !"); + } + PublicKey publicKey = generatePublicKey(algorithm, key); + return (ECPublicKeyParameters) ECUtil.generatePublicKeyParameter(publicKey); + } + + /** + * 生成公钥 + * + * @param algorithm 算法 + * @param key key + * @return + */ + public static PublicKey generatePublicKey(String algorithm, byte[] key) throws NoSuchAlgorithmException, InvalidKeySpecException { + if (isBlank(algorithm)) { + throw new NullPointerException("algorithm must be not null !"); + } + if (key == null || key.length == 0) { + throw new NullPointerException("key must be not null !"); + } + KeySpec keySpec = new X509EncodedKeySpec(key); + algorithm = getAlgorithmAfterWith(algorithm); + return getKeyFactory(algorithm).generatePublic(keySpec); + } + + /** + * 获取用于密钥生成的算法
+ * 获取XXXwithXXX算法的后半部分算法,如果为ECDSA或SM2,返回算法为EC + * + * @param algorithm XXXwithXXX算法 + * @return 算法 + */ + private static String getAlgorithmAfterWith(String algorithm) { + if (isBlank(algorithm)) { + throw new NullPointerException("algorithm must be not null !"); + } + int indexOfWith = lastIndexOfIgnoreCase(algorithm, "with"); + if (indexOfWith > 0) { + algorithm = substring(algorithm, indexOfWith + "with".length()); + } + if ("ECDSA".equalsIgnoreCase(algorithm) || "SM2".equalsIgnoreCase(algorithm)) { + algorithm = ALGORITHM; + } + return algorithm; + } + + /** + * 获取{@link KeyFactory} + * + * @param algorithm 非对称加密算法 + * @return {@link KeyFactory} + */ + private static KeyFactory getKeyFactory(String algorithm) throws NoSuchAlgorithmException { + final Provider provider = new BouncyCastleProvider(); + return KeyFactory.getInstance(algorithm, provider); + } + + public static void main(String[] args) throws Exception { + SM2Util sm2Utils = new SM2Util(); + sm2Utils.testSignByQuickpass(); + } + + private void testSignByQuickpass() throws Exception { + //密钥生成 + String privateKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgtzMo2o6THK3yLIm+83Ch/560+02l2hjjBSFGieWY/Z6gCgYIKoEcz1UBgi2hRANCAATKhwZX4P3XI8vYTKeCOLMVbanUNbaXjrIEZynshwdOzRVgzRQSiPNWo6OBBkAPvqE+2RS+5ABpS82DSlKl81z0"; + String publicKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEyocGV+D91yPL2EyngjizFW2p1DW2l46yBGcp7IcHTs0VYM0UEojzVqOjgQZAD76hPtkUvuQAaUvNg0pSpfNc9A=="; + // 加验签 + //String value = "{\"partner\": \"test\",\"tranTime\": \"20240128003627\",\"seqNo\": \"123456\",\"orderNo\": \"order123456\", \"orderAmt\": \"1500\"}"; + String value="{\"data\":{\"companyCode\":\"CN000001\",\"purpose\":\"加入中国光伏行业协会会员单位,获得行业技术支持,2025年会员单位缴纳标准为1万元/年,汇款时需注明“会费”字样,并在备注中注明汇款单位;缴纳会费后,需有付款凭证,将付款凭证发送至协会邮箱,并填写开票信息等内容\",\"recAccountNum\":\"8110701012801540483\",\"recAccountName\":\"\",\"payAccountNum\":\"8110701012601540892\",\"fundType\":\"0001\",\"transAmount\":\"9.90\",\"documentNo\":\"DG202503240321\",\"recBankCode\":\"\",\"settleAccountType\":\"CASH_TRANSFER\",\"sourceFlowNumber\":\"-3854827654841675885_1539\",\"submitUser\":\"user1\",\"digest\":\"加入中国光伏行业协会会员单位,获得行业技术支持,2025年会\",\"payChannel\":\"DIRECT\",\"currency\":\"CNY\",\"toPublic\":true,\"payAccountName\":\"\",\"payDate\":\"2025-03-26\"}}"; + System.out.println("明文:" + value); + //加密 + String encryptStr = encrypt(value, publicKey); + //String encryptStr="BAYF5RocTMvWHK4JLruoWNmvoBtSgEK6bHrXUIBcso3dx312VyI57p3bahg/qjcQufpa59XiMd8wA+cjyXmYm9+P4Y7DY5dZJQi6FdPZpL6awouRZMagdlceOL8yW5zDnx8tMqreUTAwkpvViwKn4DydKdV9EW0XuWkBwsN+4ZQftrY3FT/5Y/g8XtNSQMBu9PIwGWtPtpEtwO0HnaGCu7DGCSF+lo4PvYFmIlj0f2hQ1V1osdNIJ3IqUeZ0IZVFulaaOE72+vgAQN7UO0447kPq5iC8++oyXP7Bhf9kfU1gYOVXciIeAXoxIcjX+5DCB1q/FOmzqnOIBLRhSysqRXJa0ZvFgf1Ebpr6Fvz2Beim8SOEl3pXeLnLCJe91qsMuENLfNTOYnuESgSmdE1np3OJKcZwgeryUIt+WP7L28aJ1zNisWhB+TJaGtvWR++zY2fmMeZmwtJEz25jdmN1OWSuxgjXpI7fhIYoDnKQBQJKM5FQ+cWqJJozUMOlKG8Xhf5Lv1NjZOiNM7klp/Uprb3kUQj466ArWvsLzsoT1OOTOyBRJTbhKPSKi39ekcz4/ELuGSNB8Oz0pNg1tjbuyIcbiy2WCQI9/feiE+LyGgQPiUsaNxte10bYZuJJV33UWrBiezL0eA5pSm55zd98ToCX0QnJJq5OGW/8t8O/7+fZcSq5EFXSfS+3An8+EMLnBvI1ycjb9Q7PFVP4PmZ/VFqWJDNyi98iekWV09DVCtnCHqA5ZqEcPgZCeY40ZN5EQARvy11RWzs14Gj8JninjFbV6qtgB1Cadmy/piZS/SZdEvSnBfe04vTOElgG5GhraLrfMyVhnsmLeoqzLXmMT62uktPXKITjvFgr2NfdzbY5TkkDVMJu1b3VhZxOZENnJ4kW6nctYO0I7Z+xpVuMUnNOVxQBSJch2AdwIuyEL3odJSOXUt+RZIXhGNhyKw2Y8PvPQx+hOoCUyKyaUIS8G6RK/LI+TyMZTMsCUXYBEIxP10slFPp/4PCa7RPLhvdHsgik+cWNJj45tJRql9YXF1moWIaAUmLeu/ytCho1arA3V6/NjjckWI9mnqs41U2FAchJXdU2wNdIDB4AgGSsZs+o9sv+chgMgITV8/8xPNchu6g1UuczEXZRPFtKsVXlAJkNzQgBrMwCatby1S4CJFc5S/AJNIYipwLGW+M+3rh2+Ay+3HqDv7+7LUn+MTxgFfiosyK3hxkekY/eUg=="; + System.out.println("加密结果:" + encryptStr); + + //解密 + String decryptStr = decrypt(encryptStr, privateKey); + System.out.println("解密结果:" + decryptStr); + } + + /** + * 判断字符串是否为空 + * + * @param str 字符串 + * @return true/false + */ + public static boolean isBlank(String str) { + int strLen; + if (str != null && (strLen = str.length()) != 0) { + for (int i = 0; i < strLen; ++i) { + if (!Character.isWhitespace(str.charAt(i))) { + return false; + } + } + } + return true; + } + + + public static String substring(final String str, int start) { + if (str == null) { + return null; + } + // handle negatives, which means last n characters + if (start < 0) { + start = str.length() + start; // remember start is negative + } + if (start < 0) { + start = 0; + } + if (start > str.length()) { + return ""; + } + return str.substring(start); + } + + public static int lastIndexOfIgnoreCase(final CharSequence str, final CharSequence searchStr) { + if (str == null || searchStr == null) { + return -1; + } + return lastIndexOfIgnoreCase(str, searchStr, str.length()); + } + + public static int lastIndexOfIgnoreCase(final CharSequence str, final CharSequence searchStr, int startPos) { + if (str == null || searchStr == null) { + return -1; + } + if (startPos > str.length() - searchStr.length()) { + startPos = str.length() - searchStr.length(); + } + if (startPos < 0) { + return -1; + } + if (searchStr.length() == 0) { + return startPos; + } + for (int i = startPos; i >= 0; i--) { + if (regionMatches(str, i, searchStr, searchStr.length())) { + return i; + } + } + return -1; + } + + static boolean regionMatches(final CharSequence cs, final int thisStart, + final CharSequence substring, final int length) { + if (cs instanceof String && substring instanceof String) { + return ((String) cs).regionMatches(true, thisStart, (String) substring, 0, length); + } + int index1 = thisStart; + int index2 = 0; + int tmpLen = length; + // Extract these first so we detect NPEs the same as the java.lang.String version + final int srcLen = cs.length() - thisStart; + final int otherLen = substring.length(); + // Check for invalid parameters + if (thisStart < 0 || length < 0) { + return false; + } + // Check that the regions are long enough + if (srcLen < length || otherLen < length) { + return false; + } + while (tmpLen-- > 0) { + final char c1 = cs.charAt(index1++); + final char c2 = substring.charAt(index2++); + + if (c1 == c2) { + continue; + } + // The same check as in String.regionMatches(): + if (Character.toUpperCase(c1) != Character.toUpperCase(c2) + && Character.toLowerCase(c1) != Character.toLowerCase(c2)) { + return false; + } + } + return true; + } +} From c7472dead7d90093de08f75afa67a8dfcdef1ef7 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 1 Apr 2025 11:51:56 +0800 Subject: [PATCH 05/42] =?UTF-8?q?=E5=90=88=E5=90=8C=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E8=B6=85=E6=9C=9F=E5=90=88=E5=90=8C=E6=B5=81=E7=A8=8B=E7=BB=88?= =?UTF-8?q?=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contract/dao/IContractAuditDao.java | 12 ++ .../dao/impl/ContractAuditDaoImpl.java | 15 ++ .../contract/entity/ContractAuditEntity.java | 144 ++++++++++++++++ .../contract/entity/ContractAuditEntity.xml | 57 +++++++ .../ContractAuditPluginInitializer.java | 160 ++++++++++++++++++ .../service/IContractAuditService.java | 22 +++ .../impl/ContractAuditServiceImpl.java | 46 +++++ .../cfgHome/plugin/contract/pluginCfg.xml | 6 + .../spring/spring-buildpackage-plugin.xml | 5 + 9 files changed, 467 insertions(+) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/IContractAuditDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/impl/ContractAuditDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/plugin/ContractAuditPluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/IContractAuditService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/impl/ContractAuditServiceImpl.java create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/contract/pluginCfg.xml create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/contract/spring/spring-buildpackage-plugin.xml diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/IContractAuditDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/IContractAuditDao.java new file mode 100644 index 00000000..ca94f335 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/IContractAuditDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.contract.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.contract.entity.ContractAuditEntity; + +/** + * @Description 合同评审 + * @Author xiangerlin + * @Date 2025/3/31 14:55 + **/ +public interface IContractAuditDao extends IBaseDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/impl/ContractAuditDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/impl/ContractAuditDaoImpl.java new file mode 100644 index 00000000..981ed004 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/impl/ContractAuditDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.contract.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.contract.dao.IContractAuditDao; +import com.hzya.frame.plugin.contract.entity.ContractAuditEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description 合同评审 + * @Author xiangerlin + * @Date 2025/3/31 14:56 + **/ +@Repository() +public class ContractAuditDaoImpl extends MybatisGenericDao implements IContractAuditDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.java new file mode 100644 index 00000000..5d3b3cbe --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.java @@ -0,0 +1,144 @@ +package com.hzya.frame.plugin.contract.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description + * @Author xiangerlin + * @Date 2025/3/31 11:22 + **/ +public class ContractAuditEntity extends BaseEntity { + + //表单id + private String id; + //单据号 + private String field0168; + //合同编号 + private String field0239; + //合同名称 + private String field0005; + //流程id + private String col_summary_id; + //待办id + private String affairId; + //待办表体 + private String subject; + //节点名称 + private String node_name; + //节点权限 + private String node_policy; + //待办接收时间 + private String receive_time; + //待办完成时间 + private String complete_time; + //待办状态 + private String state; + //待办人登录名 + private String login_name; + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + public String getCol_summary_id() { + return col_summary_id; + } + + public void setCol_summary_id(String col_summary_id) { + this.col_summary_id = col_summary_id; + } + + public String getAffairId() { + return affairId; + } + + public void setAffairId(String affairId) { + this.affairId = affairId; + } + + public String getField0168() { + return field0168; + } + + public void setField0168(String field0168) { + this.field0168 = field0168; + } + + public String getField0239() { + return field0239; + } + + public void setField0239(String field0239) { + this.field0239 = field0239; + } + + public String getField0005() { + return field0005; + } + + public void setField0005(String field0005) { + this.field0005 = field0005; + } + + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public String getNode_name() { + return node_name; + } + + public void setNode_name(String node_name) { + this.node_name = node_name; + } + + public String getNode_policy() { + return node_policy; + } + + public void setNode_policy(String node_policy) { + this.node_policy = node_policy; + } + + public String getReceive_time() { + return receive_time; + } + + public void setReceive_time(String receive_time) { + this.receive_time = receive_time; + } + + public String getComplete_time() { + return complete_time; + } + + public void setComplete_time(String complete_time) { + this.complete_time = complete_time; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getLogin_name() { + return login_name; + } + + public void setLogin_name(String login_name) { + this.login_name = login_name; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.xml new file mode 100644 index 00000000..5f5f918e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/plugin/ContractAuditPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/plugin/ContractAuditPluginInitializer.java new file mode 100644 index 00000000..6f7ae7e7 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/plugin/ContractAuditPluginInitializer.java @@ -0,0 +1,160 @@ +package com.hzya.frame.plugin.contract.plugin; + +import cn.hutool.core.map.MapBuilder; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.contract.entity.ContractAuditEntity; +import com.hzya.frame.plugin.contract.service.IContractAuditService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @Description 合同评审,超过60天流程未审批的,把流程终止掉 + * @Author xiangerlin + * @Date 2025/3/31 11:07 + **/ +public class ContractAuditPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + + @Resource + private IContractAuditService contractAuditService; + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + /**** + * 插件销毁方法 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + /**** + * 插件的ID + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginId() { + return "ContractAuditPluginInitializer"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "OA合同评审流程检测插件"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "OA合同评审流程检测插件"; + } + + /*** + * 插件类型 1、场景插件 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 14:01 + * @Param [] + * @return java.lang.String + **/ + @Override + public String getPluginType() { + return "1"; + } + + /*** + * 执行业务代码 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-07 11:20 + * @param requestJson 执行业务代码的参数 + * @return void + **/ + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + logger.info("======开始执行合同评审流程检测插件定时任务======"); + //1、查询超期的合同 + ContractAuditEntity contractAuditEntity = new ContractAuditEntity(); + contractAuditEntity.setDataSourceCode(requestJson.getString("sourceCode")); + //contractAuditEntity.setField0168("PS202503270198"); + List contractAuditList = contractAuditService.queryOverdueList(contractAuditEntity); + if (CollectionUtils.isNotEmpty(contractAuditList)){ + String token = getToken(); + for (ContractAuditEntity auditEntity : contractAuditList) { + //2、更新流程状态为终止状态 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("affairId",auditEntity.getAffairId());//待办id + jsonObject.put("member",auditEntity.getLogin_name());//当前待办登录名 + //jsonObject.put("affairId","9022465059383233743");//待办id + //jsonObject.put("member","yonyou");//当前待办登录名 + String reqParams = jsonObject.toString(); + logger.info("合同评审流程终止接口请求参数:{}",reqParams); + //调用wms接口 + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000590002") + .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") + .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800059") + .put("token",token) + .build(); + String body = HttpRequest.post("http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(reqParams).timeout(60000).execute().body(); + logger.info("合同评审流程终止接口返回参数:{}",body); + } + } + return null; + } + + //获取token + private String getToken(){ + String token = null; + JSONObject tokenObj = new JSONObject(); + tokenObj.put("userName","rest0331"); + tokenObj.put("password","27db12a6-e09d-488f-90fb-143d9f45938d"); + tokenObj.put("loginName","yonyou"); + String tokenReqParams = tokenObj.toString(); + Map tokenHeaderMap = MapBuilder.create(true) + .put("apiCode", "8000590001") + .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") + .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800059") + .build(); + String tokenBody = HttpRequest.post("http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(tokenHeaderMap).body(tokenReqParams).timeout(60000).execute().body(); + if (StrUtil.isNotEmpty(tokenBody)){ + JsonResultEntity jsonResultEntity = JSONObject.parseObject(tokenBody, JsonResultEntity.class); + JSONObject jsonObject = (JSONObject) jsonResultEntity.getAttribute(); + token = jsonObject.getString("id"); + } + return token; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/IContractAuditService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/IContractAuditService.java new file mode 100644 index 00000000..8d216ac0 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/IContractAuditService.java @@ -0,0 +1,22 @@ +package com.hzya.frame.plugin.contract.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.contract.entity.ContractAuditEntity; + +import java.util.List; + +/** + * @Description 合同评审 + * @Author xiangerlin + * @Date 2025/3/31 11:15 + **/ +public interface IContractAuditService extends IBaseService { + + /** + * 查询超过60天还没审批的逾期合同 + * @param entity + * @return + * @throws Exception + */ + List queryOverdueList(ContractAuditEntity entity)throws Exception; +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/impl/ContractAuditServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/impl/ContractAuditServiceImpl.java new file mode 100644 index 00000000..5d953f29 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/impl/ContractAuditServiceImpl.java @@ -0,0 +1,46 @@ +package com.hzya.frame.plugin.contract.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.contract.dao.IContractAuditDao; +import com.hzya.frame.plugin.contract.entity.ContractAuditEntity; +import com.hzya.frame.plugin.contract.service.IContractAuditService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description 合同评审 + * @Author xiangerlin + * @Date 2025/3/31 11:16 + **/ +@Service() +public class ContractAuditServiceImpl extends BaseService implements IContractAuditService { + + Logger logger = LogManager.getLogger(getClass()); + + private IContractAuditDao contractAuditDao; + + @Autowired + public void setContractAuditDao(IContractAuditDao dao) { + this.contractAuditDao = dao; + this.dao = dao; + } + + /** + * 查询超过60天还没审批的逾期合同 + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List queryOverdueList(ContractAuditEntity entity) throws Exception { + List query = contractAuditDao.query(entity); + return query; + } +} diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/contract/pluginCfg.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/contract/pluginCfg.xml new file mode 100644 index 00000000..6c8f8261 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/contract/pluginCfg.xml @@ -0,0 +1,6 @@ + + +ContractAuditPluginInitializer +ContractAuditPluginInitializer插件 +25033101 + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/contract/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/contract/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..aea3fc4b --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/contract/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + From aecbb8e57773dc29eb3545c841aefbebca639a0a Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 2 Apr 2025 14:57:23 +0800 Subject: [PATCH 06/42] =?UTF-8?q?=E4=BA=91=E8=B4=A6=E6=88=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-buildpackage/pom.xml | 8 +- .../src/main/resources/application-ht.yml | 8 +- .../src/main/resources/application-httest.yml | 46 +++++ .../test/java/com/hzya/frame/temButtom.java | 170 ++++++++++++++++-- .../hzya/frame/seeyon/util/YzfObjectUtil.java | 81 +++++++++ .../hzya/frame/seeyon/util/YzfSHA256Util.java | 50 ++++++ .../hzya/frame/seeyon/util/YzfSignUtil.java | 45 +++++ pom.xml | 54 +++--- 8 files changed, 417 insertions(+), 45 deletions(-) create mode 100644 base-buildpackage/src/main/resources/application-httest.yml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfObjectUtil.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSHA256Util.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSignUtil.java diff --git a/base-buildpackage/pom.xml b/base-buildpackage/pom.xml index c5ae48c4..92fa0ece 100644 --- a/base-buildpackage/pom.xml +++ b/base-buildpackage/pom.xml @@ -37,8 +37,12 @@ true - - + + httest + + httest + +
kangarooDataCenterV3 diff --git a/base-buildpackage/src/main/resources/application-ht.yml b/base-buildpackage/src/main/resources/application-ht.yml index 81a1c4a7..744db85b 100644 --- a/base-buildpackage/src/main/resources/application-ht.yml +++ b/base-buildpackage/src/main/resources/application-ht.yml @@ -6,15 +6,15 @@ logging: encodings: UTF-8 file: # 日志保存路径 - path: /home/webservice/zt/log + path: D:\yongansystem\serverV3\log\zs spring: datasource: dynamic: datasource: master: - url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter_ht?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + url: jdbc:mysql://127.0.0.1:3307/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true username: root - password: 62e4295b615a30dbf3b8ee96f41c820b + password: bd993088e8a7c3dc5f44441617f9b4bf driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 @@ -39,7 +39,7 @@ cbs8: OA: data_source_code: yc_oa zt: - url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface + url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface zx: # 测试用这个 这个是银行给的 privateKey: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgtzMo2o6THK3yLIm+83Ch/560+02l2hjjBSFGieWY/Z6gCgYIKoEcz1UBgi2hRANCAATKhwZX4P3XI8vYTKeCOLMVbanUNbaXjrIEZynshwdOzRVgzRQSiPNWo6OBBkAPvqE+2RS+5ABpS82DSlKl81z0 diff --git a/base-buildpackage/src/main/resources/application-httest.yml b/base-buildpackage/src/main/resources/application-httest.yml new file mode 100644 index 00000000..e76f67c7 --- /dev/null +++ b/base-buildpackage/src/main/resources/application-httest.yml @@ -0,0 +1,46 @@ +#######################dev环境####################### +logging: + #日志级别 指定目录级别 + level: + root: INFO + encodings: UTF-8 + file: + # 日志保存路径 + path: D:\yongansystem\serverV3\log\test +spring: + datasource: + dynamic: + datasource: + master: + url: jdbc:mysql://127.0.0.1:3307/businesscenter_test?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + username: root + password: bd993088e8a7c3dc5f44441617f9b4bf + driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +savefile: + # 文件保存路径 + path: /home/webservice/zt/file +# path: D:\webservice\file +# pluginpath: D:\webservice\plugin + pluginpath: /home/webservice/zt/plugin +# tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\ + tomcatpath: /home/webservice/zt/tomcatV3/webapps/kangarooDataCenterV3/WEB-INF/classes/ +cbs8: + appId: 1P4AGrpz + appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a + url: https://cbs8-openapi-reprd.csuat.cmburl.cn + # 测试用这个 这个是银行给的,和下面的公钥不是一对密钥 + ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44 + # 这个私钥到时候上传到cbs,和下面到是同一对 + #ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46 + ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde + cbs_public_key: 0469146F06BF3B01236E84632441E826 + #电子回单下载临时存放位置 + elec_path: /Users/xiangerlin/Downloads/ +OA: + data_source_code: yc_oa +zt: + url: http://127.0.0.1:10087/kangarooDataCenterV3/entranceController/externalCallInterface +zx: + # 测试用这个 这个是银行给的 + privateKey: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgtzMo2o6THK3yLIm+83Ch/560+02l2hjjBSFGieWY/Z6gCgYIKoEcz1UBgi2hRANCAATKhwZX4P3XI8vYTKeCOLMVbanUNbaXjrIEZynshwdOzRVgzRQSiPNWo6OBBkAPvqE+2RS+5ABpS82DSlKl81z0 + publicKey: MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEyocGV+D91yPL2EyngjizFW2p1DW2l46yBGcp7IcHTs0VYM0UEojzVqOjgQZAD76hPtkUvuQAaUvNg0pSpfNc9A== \ No newline at end of file diff --git a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java index 825925b0..e26d6d1c 100644 --- a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -2,23 +2,34 @@ package com.hzya.frame; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.util.YzfSignUtil; +import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity; import com.hzya.frame.util.AESUtil; +import com.hzya.frame.web.entity.BaseResult; import org.apache.http.HttpEntity; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.TrustAllStrategy; +import org.apache.http.entity.ByteArrayEntity; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClients; +import org.apache.http.ssl.SSLContextBuilder; import org.apache.http.util.EntityUtils; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import javax.net.ssl.SSLContext; import java.io.IOException; +import java.lang.reflect.Method; +import java.sql.Timestamp; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -36,7 +47,7 @@ public class temButtom { @Test public void test01() { - String a = AESUtil.encrypt("hzya@1314"); + String a = AESUtil.encrypt("hzya1314"); System.out.println(a); String b = AESUtil.decrypt("62e4295b615a30dbf3b8ee96f41c820b"); System.out.println(b); @@ -50,32 +61,31 @@ public class temButtom { // task7803207f54ff047d6008dcce31c2628f 新增成功! // 2024-10-24 2024-10-24 - String phone ="19357235324"; - String taskid ="task8b0c7ca72439bc9b0c1c89e8866c8275"; + String phone = "19357235324"; + String taskid = "task8b0c7ca72439bc9b0c1c89e8866c8275"; //token Map headers = new HashMap<>(); - String token ="https://oapi.dingtalk.com/gettoken?appkey=dingxewtjaserj292ggu&appsecret=DuRw6EEEvhGXfr6Q8wN_x4025qKjrffIGCXF9KeCKKIID-LVSsR6_8KWMei6sug1"; - String body = sendGet(token,headers); + String token = "https://oapi.dingtalk.com/gettoken?appkey=dingxewtjaserj292ggu&appsecret=DuRw6EEEvhGXfr6Q8wN_x4025qKjrffIGCXF9KeCKKIID-LVSsR6_8KWMei6sug1"; + String body = sendGet(token, headers); JSONObject tokenobject = JSONObject.parseObject(body); //钉钉id headers = new HashMap<>(); //https://oapi.dingtalk.com/user/get_by_mobile?access_token=9abd3996cb103ba48dd8c69fea5473e7&mobile=15700100840 - String ddid ="https://oapi.dingtalk.com/user/get_by_mobile?access_token="+tokenobject.get("access_token")+"&mobile="+phone; - String ddidbody = sendGet(ddid,headers); + String ddid = "https://oapi.dingtalk.com/user/get_by_mobile?access_token=" + tokenobject.get("access_token") + "&mobile=" + phone; + String ddidbody = sendGet(ddid, headers); JSONObject ddidobject = JSONObject.parseObject(ddidbody); //人员id headers = new HashMap<>(); //https://oapi.dingtalk.com/user/get?userid=111336474727636213&access_token=3d21a6614fb037a98542a537336e8149 - String userid ="https://oapi.dingtalk.com/user/get?userid="+ddidobject.get("userid")+"&access_token="+tokenobject.get("access_token"); - String useridbody = sendGet(userid,headers); + String userid = "https://oapi.dingtalk.com/user/get?userid=" + ddidobject.get("userid") + "&access_token=" + tokenobject.get("access_token"); + String useridbody = sendGet(userid, headers); JSONObject useridobject = JSONObject.parseObject(useridbody); - CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPut httpPut = new HttpPut("https://api.dingtalk.com/v1.0/todo/users/"+useridobject.get("unionid")+"/tasks/"+taskid); + HttpPut httpPut = new HttpPut("https://api.dingtalk.com/v1.0/todo/users/" + useridobject.get("unionid") + "/tasks/" + taskid); RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000).setConnectionRequestTimeout(35000).setSocketTimeout(60000).build(); httpPut.setConfig(requestConfig); httpPut.setHeader("Content-type", "application/json"); @@ -122,7 +132,7 @@ public class temButtom { response = closeableHttpClient.execute(get); HttpEntity entity = response.getEntity(); - body.append(EntityUtils.toString(entity,"UTF-8")); + body.append(EntityUtils.toString(entity, "UTF-8")); } catch (Exception e) { body.append(e.getMessage()); } finally { @@ -143,4 +153,140 @@ public class temButtom { } + @Test + public void test0111() { + //请求token + String accessToken = getToken(); + //请求分页查询全量进项发票 + String data = getdata(accessToken); + + + } + + private String getdata(String accessToken) { + String url = "http://oapi.nanofintax.com/api/invoice_receive/fp/v1/query?accessToken="+accessToken; + JSONObject dayabody = new JSONObject(); + dayabody.put("accessKey","6X3B526P5HqE6ums"); + long timestamp = System.currentTimeMillis(); + dayabody.put("timestamp",timestamp); + JSONObject queryParams = new JSONObject(); + queryParams.put("page",1); + queryParams.put("size",50); + dayabody.put("queryParams",queryParams); + Map parametersMap = new HashMap<>(); + parametersMap.put("accessKey","6X3B526P5HqE6ums"); + parametersMap.put("timestamp",timestamp); + + String a = YzfSignUtil.signRequest(parametersMap,"34e5fc32ac894a2ba2ade8c3852c7a0a"); + dayabody.put("sign",a); + + StringBuilder body = new StringBuilder(); + SSLContext sslContext = null; + try { + sslContext = new SSLContextBuilder() + .loadTrustMaterial(null, TrustAllStrategy.INSTANCE) + .build(); + } catch (Exception e) { + + } + CloseableHttpClient closeableHttpClient = HttpClients.custom() + .setSSLContext(sslContext) + .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + .build(); + + HttpPost post = new HttpPost(url); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(6000).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + post.setHeader("Content-Type", "application/json; charset=utf-8"); + + try { + if (dayabody.toJSONString() != null && !"".equals(dayabody.toJSONString())) { + ByteArrayEntity entity = new ByteArrayEntity(dayabody.toJSONString().getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + + HttpEntity entity = response.getEntity(); + body.append(EntityUtils.toString(entity, "UTF-8")); + } catch (Exception e) { + body.append(e.getMessage()); + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + System.out.println("body"+body); + + return body.toString(); + } + + private String getToken() { + String url = "http://oapi.nanofintax.com/api/getToken"; + String bodys = "{\"accessKey\":\"6X3B526P5HqE6ums\",\"accessSecret\":\"34e5fc32ac894a2ba2ade8c3852c7a0a\"}"; + StringBuilder body = new StringBuilder(); + SSLContext sslContext = null; + try { + sslContext = new SSLContextBuilder() + .loadTrustMaterial(null, TrustAllStrategy.INSTANCE) + .build(); + } catch (Exception e) { + + } + CloseableHttpClient closeableHttpClient = HttpClients.custom() + .setSSLContext(sslContext) + .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + .build(); + + HttpPost post = new HttpPost(url); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(6000).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + post.setHeader("Content-Type", "application/json; charset=utf-8"); + + try { + if (bodys != null && !"".equals(bodys)) { + ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + + HttpEntity entity = response.getEntity(); + body.append(EntityUtils.toString(entity, "UTF-8")); + } catch (Exception e) { + body.append(e.getMessage()); + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + System.out.println("body"+body); + String accessToken = JSONObject.parseObject(body.toString()).getJSONObject("result").getString("accessToken"); + + return accessToken; + } } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfObjectUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfObjectUtil.java new file mode 100644 index 00000000..85e29f99 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfObjectUtil.java @@ -0,0 +1,81 @@ +package com.hzya.frame.seeyon.util; + +import java.util.Date; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @ClassName YzfObjectUtil + * @Description + * @Author llg + * Date 2025/4/2 2:12 下午 + */ +public class YzfObjectUtil { + /** + * 是否为包装类型 + * + * @param clazz 类 + * @return 是否为包装类型 + */ + public static boolean isPrimitiveWrapper(Class clazz) { + if (null == clazz) { + return false; + } + return BasicType.wrapperPrimitiveMap.containsKey(clazz); + } + + /** + * 是否为基本类型(包括包装类和原始类) + * + * @param clazz 类 + * @return 是否为基本类型 + */ + public static boolean isBasicType(Class clazz) { + if (null == clazz) { + return false; + } + return (clazz.isPrimitive() || isPrimitiveWrapper(clazz)); + } + + + /** + * @param clazz 类 + * @return 是否为简单值类型 + * 判断是否是基本数据类型、String类型、other CharSequence、Number、Date + */ + public static boolean isSimpleTypeOrString(Class clazz) { + if(clazz == null) { + return false; + } + return isBasicType(clazz) || clazz.isEnum() || CharSequence.class.isAssignableFrom(clazz) + || Number.class.isAssignableFrom(clazz) || Date.class.isAssignableFrom(clazz); + } + + enum BasicType { + BYTE, SHORT, INT, INTEGER, LONG, DOUBLE, FLOAT, BOOLEAN, CHAR, CHARACTER, STRING; + + /** + * 包装类型为Key,原始类型为Value,例如: Integer.class =》 int.class. + */ + public static final Map, Class> wrapperPrimitiveMap = new ConcurrentHashMap<>(8); + /** + * 原始类型为Key,包装类型为Value,例如: int.class =》 Integer.class. + */ + public static final Map, Class> primitiveWrapperMap = new ConcurrentHashMap<>(8); + + static { + wrapperPrimitiveMap.put(Boolean.class, boolean.class); + wrapperPrimitiveMap.put(Byte.class, byte.class); + wrapperPrimitiveMap.put(Character.class, char.class); + wrapperPrimitiveMap.put(Double.class, double.class); + wrapperPrimitiveMap.put(Float.class, float.class); + wrapperPrimitiveMap.put(Integer.class, int.class); + wrapperPrimitiveMap.put(Long.class, long.class); + wrapperPrimitiveMap.put(Short.class, short.class); + + for (Map.Entry, Class> entry : wrapperPrimitiveMap.entrySet()) { + primitiveWrapperMap.put(entry.getValue(), entry.getKey()); + } + } + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSHA256Util.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSHA256Util.java new file mode 100644 index 00000000..cd65e231 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSHA256Util.java @@ -0,0 +1,50 @@ +package com.hzya.frame.seeyon.util; +import java.security.MessageDigest; + +/** + * @ClassName YzfSHA256Util + * @Description + * @Author llg + * Date 2025/4/2 2:11 下午 + */ +public class YzfSHA256Util { + + /** +   * 利用java原生的摘要实现SHA256加密 +   * @param str 加密后的报文 +   * @return + */ + public static String getSHA256StrJava(String str, String charsetName) { + MessageDigest messageDigest; + String encodeStr = ""; + + try { + messageDigest = MessageDigest.getInstance("SHA-256"); + messageDigest.update(str.getBytes(charsetName)); + encodeStr = byte2Hex(messageDigest.digest()); + } catch (Exception e) { + e.printStackTrace(); + } + + return encodeStr; + } + + /** +   * 将byte转为16进制 +   * @param bytes +   * @return + */ + private static String byte2Hex(byte[] bytes) { + StringBuffer stringBuffer = new StringBuffer(); + String temp = null; + for (int i = 0; i < bytes.length; i++) { + temp = Integer.toHexString(bytes[i] & 0xFF); + if (temp.length() == 1) { + //1得到一位的进行补0操作 + stringBuffer.append("0"); + } + stringBuffer.append(temp); + } + return stringBuffer.toString(); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSignUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSignUtil.java new file mode 100644 index 00000000..1a37738b --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSignUtil.java @@ -0,0 +1,45 @@ +package com.hzya.frame.seeyon.util; + +import org.apache.commons.lang.StringUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Map; + +/** + * @ClassName YzfSignUtil + * @Description + * @Author llg + * Date 2025/4/2 2:14 下午 + */ +public class YzfSignUtil { + private static final String CHARSET = "utf-8"; + + public static String signRequest(Map parametersMap, String secretkey) { + ArrayList list = new ArrayList<>(); + for (Map.Entry entry : parametersMap.entrySet()) { + String key = entry.getKey(); + Object val = entry.getValue(); + if (StringUtils.isBlank(key) || val == null) { + continue; + } + + if (YzfObjectUtil.isSimpleTypeOrString(val.getClass())) { + if (null != val && !"".equals(val)) { + list.add(key + "=" + val + "&"); + } + } + } + int size = list.size(); + String[] arrayToSort = list.toArray(new String[size]); + Arrays.sort(arrayToSort, String.CASE_INSENSITIVE_ORDER); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < size; i++) { + sb.append(arrayToSort[i]); + } + String result = sb.toString(); + result += secretkey; + result = YzfSHA256Util.getSHA256StrJava(result, CHARSET); + return result; + } +} diff --git a/pom.xml b/pom.xml index 349fd315..2d3edc15 100644 --- a/pom.xml +++ b/pom.xml @@ -471,33 +471,33 @@ maven-war-plugin - - ${basedir}/../base-service/src/main/webapp/WEB-INF/lib - WEB-INF/lib/ - false - - - **/*.jar - - - - ${basedir}/../fw-bip/src/main/webapp/WEB-INF/lib - WEB-INF/lib/ - false - - - **/*.jar - - - - ${basedir}/../fw-ningbobank/src/main/webapp/WEB-INF/lib - WEB-INF/lib/ - false - - - **/*.jar - - + + + + + + + + + + + + + + + + + + + + + + + + + + + From d3ce01de28b85feaeca19957922e5f52104d0767 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 2 Apr 2025 16:44:49 +0800 Subject: [PATCH 07/42] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/com/hzya/frame/Test1.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 base-buildpackage/src/test/java/com/hzya/frame/Test1.java diff --git a/base-buildpackage/src/test/java/com/hzya/frame/Test1.java b/base-buildpackage/src/test/java/com/hzya/frame/Test1.java new file mode 100644 index 00000000..a52aef06 --- /dev/null +++ b/base-buildpackage/src/test/java/com/hzya/frame/Test1.java @@ -0,0 +1,34 @@ +package com.hzya.frame; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.contract.plugin.ContractAuditPluginInitializer; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.junit.Test; + +import javax.annotation.Resource; + +/** + * @Description + * @Author xiangerlin + * @Date 2025/4/1 09:12 + **/ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {WebappApplication.class}) +public class Test1 { + + + @Resource + private ContractAuditPluginInitializer contractPlugin; + @Test + public void contractAuditPluginTest(){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("sourceCode","HT-OA"); + try { + contractPlugin.executeBusiness(jsonObject); + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} From 29bfbb3107db52680cfd21a661434338d91f8ed5 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 2 Apr 2025 17:08:00 +0800 Subject: [PATCH 08/42] =?UTF-8?q?=E4=B8=AD=E4=BF=A1=E7=94=B5=E5=AD=90?= =?UTF-8?q?=E5=9B=9E=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/ZxBankElecPluginInitializer.java | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankElecPluginInitializer.java diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankElecPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankElecPluginInitializer.java new file mode 100644 index 00000000..6c812a88 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankElecPluginInitializer.java @@ -0,0 +1,57 @@ +package com.hzya.frame.plugin.zxBank.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.seeyon.zxbank.service.IZxBankService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +public class ZxBankElecPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(ZxBankElecPluginInitializer.class); + @Autowired + private IZxBankService zxBankService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "ZxBankElecPluginInitializer"; + } + + @Override + public String getPluginName() { + return "ZxBankElecPluginInitializer插件"; + } + + @Override + public String getPluginLabel() { + return "ZxBankElecPluginInitializer"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行杭泰付款单查询电子回单并下载电子回单========"); + return zxBankService.queryArchivesElec(requestJson); + }catch (Exception e){ + logger.info("======执行杭泰付款单查询电子回单并下载电子回单失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } + +} From e0f5d5f5ea200de9eb0847a1f387acd7a08d4cab Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Mon, 7 Apr 2025 11:13:17 +0800 Subject: [PATCH 09/42] =?UTF-8?q?=E4=B8=AD=E5=8F=B0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-buildpackage/src/test/java/com/hzya/frame/temButtom.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java index e26d6d1c..a332bb96 100644 --- a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -172,6 +172,9 @@ public class temButtom { JSONObject queryParams = new JSONObject(); queryParams.put("page",1); queryParams.put("size",50); + //queryParams.put("kprqq","2025-04-06"); + //queryParams.put("kprqz","2025-04-06"); + queryParams.put("taxNo","91330110MAC5FPUY2U"); dayabody.put("queryParams",queryParams); Map parametersMap = new HashMap<>(); parametersMap.put("accessKey","6X3B526P5HqE6ums"); From a6af70de5f72e9d5b06ef5447120a8cc988438a5 Mon Sep 17 00:00:00 2001 From: "476474485@qq.com" Date: Mon, 7 Apr 2025 16:49:25 +0800 Subject: [PATCH 10/42] =?UTF-8?q?=E8=B0=83=E6=95=B4OA=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../seeyon/service/ISeeYonInterFace.java | 22 +- .../service/impl/SeeYonInterFaceImpl.java | 393 +++++++++++------- 2 files changed, 250 insertions(+), 165 deletions(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java index 762023b7..5dc53395 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java @@ -6,6 +6,7 @@ import com.hzya.frame.web.entity.JsonResultEntity; /** * 致远OA接口类 + * * @author 👻👻👻👻👻👻👻👻👻👻 gjh * @version 1.0 * @content @@ -17,18 +18,17 @@ public interface ISeeYonInterFace { * 发起OA表单方法 * @content: * @author 👻👻👻👻👻👻👻👻 gjh - * @date 2023-08-22 9:31 + * @date 2023-08-22 9:31 * @param requestData 请求json * @return com.hzya.frame.web.entity.JsonResultEntity **/ JsonResultEntity thirdInterfaceSend(JSONObject requestData); - /*** * @Content: 提供给OA的标准接口方法,包含参数 entity 为OA 的data信息, , eventType 为事件类型 * @Author 👻👻👻👻👻👻👻👻 gjh - * @Date 2020-12-24 10:36 + * @Date 2020-12-24 10:36 * @Param [entity, eventType] * eventType: * 发起前事件 onBeforeStart , @@ -59,26 +59,36 @@ public interface ISeeYonInterFace { /** * seeyon流程事件监听前置方法,绑定数据源 + * * @param sysExtensionApi * @return * @throws Exception */ - SysExtensionApiEntity colEventPre(SysExtensionApiEntity sysExtensionApi)throws Exception; + SysExtensionApiEntity colEventPre(SysExtensionApiEntity sysExtensionApi) throws Exception; + /** * seeyon流程事件监听 + * * @param jsonObject * @return * @throws Exception */ - JsonResultEntity colEventListener(JSONObject jsonObject)throws Exception; + JsonResultEntity colEventListener(JSONObject jsonObject) throws Exception; /** * seeyon流程事件监听后置方法,调用三方接口 + * * @param jsonStr * @param formAppId * @param eventType * @return * @throws Exception */ - String colEventPost(String jsonStr,String formAppId,String eventType)throws Exception; + JsonResultEntity colEventPost(String jsonStr, String formAppId, String eventType) throws Exception; + + + JsonResultEntity chengeBody(JSONObject jsonObject) throws Exception; + + SysExtensionApiEntity chengeBodySetPlug(SysExtensionApiEntity entity); + } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java index 8e8be89e..b2e196b3 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java @@ -2,13 +2,13 @@ package com.hzya.frame.seeyon.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.map.MapBuilder; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.seeyon.dao.ISeeYonInterFaceDao; import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; @@ -19,6 +19,7 @@ import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.util.PluginUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.exception.BaseSystemException; @@ -28,6 +29,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + import javax.annotation.Resource; import java.util.HashMap; import java.util.List; @@ -50,14 +52,30 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { private static final String sendUrl = "http://60.204.152.210/seeyon/"; //速网esb地址 private static final String baseUrl = "http://hzya.ufyct.com:9067/kangarooDataCenter/entranceController/externalCallInterface"; - @Resource - private ISysApplicationDatabaseDao sysApplicationDatabaseDao; - @Autowired - private ISysApplicationApiService sysApplicationApiService; /** * 定义所支持的事件静态代码块 */ private static final StringBuffer eventTypeBuffer = new StringBuffer(); + //基础档案类型 + private final String ARCHIVESTYPE = "archives"; + //流程表单类型 + private final String FLOWTYPE = "flow"; + //创建基础档案 + private final String CREATEARCHIVES = "create"; + //更新基础档案 + private final String UPDATEARCHIVES = "update"; + //创建基础档案 + private final String CREATEARCHIVESURL = "rest/form/import/"; + //创建基础档案 + private final String UPDATEARCHIVESURL = "rest/form/update"; + @Resource + private ISysApplicationDatabaseDao sysApplicationDatabaseDao; + @Autowired + private ISysApplicationApiService sysApplicationApiService; + @Resource + private ISeeYonInterFaceDao seeYonInterFaceDao; + //上一次同步时间 + private final String LAST_SYNCHRONISED_TIME = ""; { eventTypeBuffer.append("发起前事件 onBeforeStart ,"); @@ -75,24 +93,6 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { eventTypeBuffer.append("取回事件 onTakeBack,"); } - //基础档案类型 - private final String ARCHIVESTYPE = "archives"; - //流程表单类型 - private final String FLOWTYPE = "flow"; - //创建基础档案 - private final String CREATEARCHIVES = "create"; - //更新基础档案 - private final String UPDATEARCHIVES = "update"; - //创建基础档案 - private final String CREATEARCHIVESURL = "rest/form/import/"; - //创建基础档案 - private final String UPDATEARCHIVESURL = "rest/form/update"; - @Resource - private ISeeYonInterFaceDao seeYonInterFaceDao; - - - //上一次同步时间 - private String LAST_SYNCHRONISED_TIME = ""; /**** * @Content:发起无流程表单接口实现 * @Author 👻👻👻👻👻👻👻👻 gjh @@ -100,7 +100,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { * @Param [templateCode 模版编码, sendLoginName 发送人登录帐号 ,xmlData ] * @return java.lang.Integer **/ - public static JsonResultEntity saveNoProcess(String templateCode , String interfaceUrl,String sendLoginName, String xmlData) { + public static JsonResultEntity saveNoProcess(String templateCode, String interfaceUrl, String sendLoginName, String xmlData) { String token = getToken(RESTUSERNAME, RESTPASSWORD, sendLoginName); Map res = new HashMap(); res.put("loginName", sendLoginName); @@ -119,7 +119,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { res.put("token", token); res.put("moduleId", moduleId); res.put("templateCode", templateCode); - logger.info("更新无流程表单参数:{}",JSON.toJSONString(res)); + logger.info("更新无流程表单参数:{}", JSON.toJSONString(res)); String result = HttpRequest.put(sendUrl + interfaceUrl).header("token", token).body(JSON.toJSONString(res)).execute().body(); logger.info("更新无流程表单执行结果:" + result); return BaseResult.getFailureMessageEntity("执行成功", result); @@ -185,7 +185,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { List attributeArray = JSON.parseArray(attributeArrayStr, JSONObject.class); JsonResultEntity result = null; if (ARCHIVESTYPE.equalsIgnoreCase(type)) { - switch (templateCode){ + switch (templateCode) { //预留的 case "abc123": break; @@ -198,13 +198,13 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { @Override - public JsonResultEntity thirdInterfaceSeeYonPlugInInterfaceEntrance(JSONObject requestData){ + public JsonResultEntity thirdInterfaceSeeYonPlugInInterfaceEntrance(JSONObject requestData) { String jsonStr = requestData.getString("jsonStr"); JSONObject jsonObject = requestData.getJSONObject("jsonStr"); - OAWorkflowEventDataEntity entity = JSON.parseObject(jsonStr,OAWorkflowEventDataEntity.class); - logger.info("监听OA事件入参:"+jsonObject.toJSONString()); + OAWorkflowEventDataEntity entity = JSON.parseObject(jsonStr, OAWorkflowEventDataEntity.class); + logger.info("监听OA事件入参:" + jsonObject.toJSONString()); JSONObject formBeanData = jsonObject.getJSONObject("businessDataStr"); - String eventType = jsonObject.getString("eventType") ; + String eventType = jsonObject.getString("eventType"); /** 流程ID*/ String summaryId = entity.getSummaryId(); /** 节点ID*/ @@ -223,73 +223,74 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { //formApp 最好过滤一下 - String result = null; + JsonResultEntity result = null; try { //流程事件处理 result = colEventPost(jsonStr, formApp, eventType); - }catch (Exception e){ - return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); - } - try { - /** 根据事件类型处理相关事件*/ - switch (eventType) { - /** 发起前事件*/ - case "onBeforeStart": - break; - /** 发起事件*/ - case "onStart": - //流程发起 新增grpu8单据 - break; - /** 终止前事件*/ - case "onBeforeStop": - break; - /** 终止事件*/ - case "onStop": - //流程终止,更新grpu8单据 - break; - /** 撤销前事件*/ - case "onBeforeCancel": - break; - /** 撤销事件*/ - case "onCancel": - //流程撤销,更新grpu8单据 - break; - /** 结束事件*/ - case "onProcessFinished": - break; - /** 处理前事件*/ - case "onBeforeFinishWorkitem": - /** 根据form处理相关业务表单的数据*/ - switch (formApp) { - case "abc123": - break; - default: - return BaseResult.getFailureMessageEntity("未匹配到表单!当前formID:" + formApp, ""); - } - break; - /** 处理事件*/ - case "onFinishWorkitem": - break; - /** 回退前事件*/ - case "onBeforeStepBack": - break; - /** 回退事件*/ - case "onStepBack": - break; - /** 取回前事件*/ - case "onBeforeTakeBack": - break; - /** 取回事件*/ - case "onTakeBack": - break; - default: -// throw new RuntimeException("传入了非法事件类型!请参照:" + eventTypeBuffer.toString()); - return BaseResult.getFailureMessageEntity("传入了非法事件类型!请参照:" + eventTypeBuffer.toString(), "", ""); - } - return BaseResult.getSuccessMessageEntity("传递成功", result); - }catch (Exception e){ - return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); + } catch (Exception e) { + return BaseResult.getFailureMessageEntity("传递失败", e.getMessage()); } + return result; +// try { +// /** 根据事件类型处理相关事件*/ +// switch (eventType) { +// /** 发起前事件*/ +// case "onBeforeStart": +// break; +// /** 发起事件*/ +// case "onStart": +// //流程发起 新增grpu8单据 +// break; +// /** 终止前事件*/ +// case "onBeforeStop": +// break; +// /** 终止事件*/ +// case "onStop": +// //流程终止,更新grpu8单据 +// break; +// /** 撤销前事件*/ +// case "onBeforeCancel": +// break; +// /** 撤销事件*/ +// case "onCancel": +// //流程撤销,更新grpu8单据 +// break; +// /** 结束事件*/ +// case "onProcessFinished": +// break; +// /** 处理前事件*/ +// case "onBeforeFinishWorkitem": +// /** 根据form处理相关业务表单的数据*/ +// switch (formApp) { +// case "abc123": +// break; +// default: +// return BaseResult.getFailureMessageEntity("未匹配到表单!当前formID:" + formApp, ""); +// } +// break; +// /** 处理事件*/ +// case "onFinishWorkitem": +// break; +// /** 回退前事件*/ +// case "onBeforeStepBack": +// break; +// /** 回退事件*/ +// case "onStepBack": +// break; +// /** 取回前事件*/ +// case "onBeforeTakeBack": +// break; +// /** 取回事件*/ +// case "onTakeBack": +// break; +// default: +//// throw new RuntimeException("传入了非法事件类型!请参照:" + eventTypeBuffer.toString()); +// return BaseResult.getFailureMessageEntity("传入了非法事件类型!请参照:" + eventTypeBuffer.toString(), "", ""); +// } +// return BaseResult.getSuccessMessageEntity("传递成功", result); +// }catch (Exception e){ +// return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); +// } } @@ -297,8 +298,8 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { public JsonResultEntity thirdInterfaceSeeYonDefinitionRePush(JSONObject jsonObject) throws Exception { JSONObject requestData = jsonObject.getJSONObject("jsonStr"); JSONArray resultEntityArray = new JSONArray(); - if(null == requestData){ - throw new BaseSystemException("参数传递错误需要jsonStr!"); + if (null == requestData) { + throw new BaseSystemException("参数传递错误需要jsonStr!"); } //表单模版ID String formAppId = requestData.getString("formAppId"); @@ -308,24 +309,24 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { String dataSourceCode = requestData.getString("dataSourceCode"); //主表ID集合 formMainIds JSONArray formMainIds = requestData.getJSONArray("formMainIds"); - if(StrUtil.isEmpty(eventType)){ - throw new BaseSystemException("需要传递eventType 参照致远OA事件!"); + if (StrUtil.isEmpty(eventType)) { + throw new BaseSystemException("需要传递eventType 参照致远OA事件!"); } - if(StrUtil.isEmpty(formAppId)){ - throw new BaseSystemException("需要传递formAppId 参照致远OA 表 CAP_FORM_DEFINITION!"); + if (StrUtil.isEmpty(formAppId)) { + throw new BaseSystemException("需要传递formAppId 参照致远OA 表 CAP_FORM_DEFINITION!"); } - if(StrUtil.isEmpty(dataSourceCode)){ - throw new BaseSystemException("需要传递dataSourceCode 参照中台表 sys_data_source!"); + if (StrUtil.isEmpty(dataSourceCode)) { + throw new BaseSystemException("需要传递dataSourceCode 参照中台表 sys_data_source!"); } - if(null == formMainIds || formMainIds.size() == 0){ - throw new BaseSystemException("需要传递业务主表数据id集合,不允许全量推送!"); + if (null == formMainIds || formMainIds.size() == 0) { + throw new BaseSystemException("需要传递业务主表数据id集合,不允许全量推送!"); } SeeYonInterFaceEntity seeYonInterFaceEntity = new SeeYonInterFaceEntity(); - BeanUtil.copyProperties(requestData,seeYonInterFaceEntity); + BeanUtil.copyProperties(requestData, seeYonInterFaceEntity); List seeYonInterFaceEntityList = seeYonInterFaceDao.queryDefinitionInfo(seeYonInterFaceEntity); - if(null != seeYonInterFaceEntityList && seeYonInterFaceEntityList.size() >0){ - for(SeeYonInterFaceEntity interFaceEntity : seeYonInterFaceEntityList){ + if (null != seeYonInterFaceEntityList && seeYonInterFaceEntityList.size() > 0) { + for (SeeYonInterFaceEntity interFaceEntity : seeYonInterFaceEntityList) { String field_info = interFaceEntity.getField_info(); JSONObject infoJson = JSON.parseObject(field_info); //获取主表信息 @@ -338,7 +339,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { /** 设置主表查询条件*/ interFaceEntity.setTabName(formMainTableName); interFaceEntity.setDataSourceCode(dataSourceCode); - interFaceEntity.setFormMainIds( formMainIds.toJavaList(String.class) ); + interFaceEntity.setFormMainIds(formMainIds.toJavaList(String.class)); List> forMainList = seeYonInterFaceDao.queryDefinitionData(interFaceEntity); for (Map forMainRow : forMainList) { @@ -350,11 +351,11 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { String forMainId = String.valueOf(forMainRow.get("ID")); //组装主表数据 for (Map.Entry entry : forMainRow.entrySet()) { - formMainObj.put(entry.getKey().toLowerCase(),entry.getValue()); - } + formMainObj.put(entry.getKey().toLowerCase(), entry.getValue()); + } //组装明细表数据 - if(null != formSons && formSons.size() > 0){ - for(Object formSon : formSons){ + if (null != formSons && formSons.size() > 0) { + for (Object formSon : formSons) { JSONObject son = JSON.parseObject(JSON.toJSONString(formSon)); //明细数据 String sonTableName = son.getString("tableName"); @@ -368,38 +369,38 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { //组装明细数据 JSONObject forSonJson = new JSONObject(); for (Map.Entry entry : forSons.entrySet()) { - forSonJson.put(entry.getKey().toLowerCase(),entry.getValue()); - } + forSonJson.put(entry.getKey().toLowerCase(), entry.getValue()); + } jsonArray.add(forSonJson); } //设置明细表数据 - seeYonBean.put(sonTableName,jsonArray); + seeYonBean.put(sonTableName, jsonArray); } } - seeYonBean.put(formMainTableName,formMainObj); + seeYonBean.put(formMainTableName, formMainObj); JSONObject rePushRequestData = new JSONObject(); JSONObject object = new JSONObject(); - object.put("formApp",formAppId); - object.put("eventType",eventType); - object.put("businessDataStr",seeYonBean.toJSONString()); - object.put("affairId",""); - object.put("summaryId",requestData.getString("summaryId")); - object.put("currentActivityId",""); - object.put("id",forMainId); - object.put("hzyaExtData",requestData.getJSONObject("hzyaExtData")); - logger.info("Method:thirdInterfaceSeeYonDefinitionRePush 组装seeYonBean DATA: {}",seeYonBean.toJSONString()); + object.put("formApp", formAppId); + object.put("eventType", eventType); + object.put("businessDataStr", seeYonBean.toJSONString()); + object.put("affairId", ""); + object.put("summaryId", requestData.getString("summaryId")); + object.put("currentActivityId", ""); + object.put("id", forMainId); + object.put("hzyaExtData", requestData.getJSONObject("hzyaExtData")); + logger.info("Method:thirdInterfaceSeeYonDefinitionRePush 组装seeYonBean DATA: {}", seeYonBean.toJSONString()); - rePushRequestData.put("jsonStr",object); + rePushRequestData.put("jsonStr", object); - JsonResultEntity resultEntity = thirdInterfaceSeeYonPlugInInterfaceEntrance(rePushRequestData); - if(null != resultEntity){ + JsonResultEntity resultEntity = thirdInterfaceSeeYonPlugInInterfaceEntrance(rePushRequestData); + if (null != resultEntity) { resultEntityArray.add(resultEntity.getAttribute()); - }else{ - JSONObject jsonResultEntity = new JSONObject(); - jsonResultEntity.put("msg","从新推送失败"); - jsonResultEntity.put("id",forMainId); + } else { + JSONObject jsonResultEntity = new JSONObject(); + jsonResultEntity.put("msg", "从新推送失败"); + jsonResultEntity.put("id", forMainId); resultEntityArray.add(jsonResultEntity); } @@ -407,11 +408,12 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { } } } - return BaseResult.getSuccessMessageEntity("从新推送执行结束",resultEntityArray); + return BaseResult.getSuccessMessageEntity("从新推送执行结束", resultEntityArray); } /** * seeyon流程事件监听前置方法,绑定数据源 + * * @param entity * @return * @throws Exception @@ -426,10 +428,10 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { sysApplicationDatabaseEntity.setAppId(applicationEntity.getId()); sysApplicationDatabaseEntity.setDataSourceCode("master"); List sysDataSourceEntities = sysApplicationDatabaseDao.queryDSBase(sysApplicationDatabaseEntity); - if(sysDataSourceEntities != null && sysDataSourceEntities.size() > 0){ + if (sysDataSourceEntities != null && sysDataSourceEntities.size() > 0) { String parm = entity.getBodys(); JSONObject jsonObject = JSONObject.parseObject(parm); - jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); + jsonObject.put("dataSourceCode", sysDataSourceEntities.get(0).getSourceCode()); entity.setBodys(jsonObject.toJSONString()); } } catch (Exception e) { @@ -448,24 +450,24 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { @Override public JsonResultEntity colEventListener(JSONObject jsonObject) throws Exception { try { - if (null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("jsonStr"))){ + if (null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("jsonStr"))) { SeeYonInterFaceEntity entity = jsonObject.getJSONObject("jsonStr").toJavaObject(SeeYonInterFaceEntity.class); JSONObject requestData = new JSONObject(); //表单模版ID requestData.put("formAppId", entity.getFormAppId()); //事件事件类型 - requestData.put("eventType",entity.getEventType()); + requestData.put("eventType", entity.getEventType()); //数据源编码 - requestData.put("dataSourceCode",entity.getDataSourceCode()); - requestData.put("formMainIds",entity.getFormMainIds()); - requestData.put("summaryId",entity.getSummaryId()); + requestData.put("dataSourceCode", entity.getDataSourceCode()); + requestData.put("formMainIds", entity.getFormMainIds()); + requestData.put("summaryId", entity.getSummaryId()); JSONObject jsonStr = new JSONObject(); - jsonStr.put("jsonStr",requestData); + jsonStr.put("jsonStr", requestData); thirdInterfaceSeeYonDefinitionRePush(jsonStr); } - }catch (Exception e){ - logger.error("流程事件通知接口出错:{}",e); - return BaseResult.getSuccessMessageEntity("失败",e.getMessage()); + } catch (Exception e) { + logger.error("流程事件通知接口出错:{}", e); + return BaseResult.getSuccessMessageEntity("失败", e.getMessage()); } return BaseResult.getSuccessMessageEntity("成功"); } @@ -480,28 +482,101 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { * @throws Exception */ @Override - public String colEventPost(String jsonStr, String formAppId, String eventType) throws Exception { - if (StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType)){ + public JsonResultEntity colEventPost(String jsonStr, String formAppId, String eventType) throws Exception { + if (StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType)) { SysApplicationApiEntity sysApplicationApiEntity = new SysApplicationApiEntity(); - sysApplicationApiEntity.setHeaderIn(formAppId+"_"+eventType); + sysApplicationApiEntity.setHeaderIn(formAppId + "_" + eventType); List applist = sysApplicationApiService.queryLike(sysApplicationApiEntity); - if (CollectionUtil.isNotEmpty(applist)){ - if (applist.size() > 1){ - throw new BaseSystemException("根据formID:" + formAppId+"查询出多条数据"); + if (CollectionUtil.isNotEmpty(applist)) { + if (applist.size() > 1) { + throw new BaseSystemException("根据formID:" + formAppId + "查询出多条数据"); + } + if (applist.size() == 0 ) { + throw new BaseSystemException("根据formID:" + formAppId + "eventType:"+eventType+"未查询到API配置"); } SysApplicationApiEntity sysApp = applist.get(0); - Map headerMap = MapBuilder.create(true) - .put("apiCode", String.valueOf(sysApp.getApiCode())) - //这里用中台做为发送方 - .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") - .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") - .put("appId",String.valueOf(sysApp.getAppCode())) - .build(); - String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body(); - logger.info("调用中台返回的参数:{}",body); - return body; + JSONArray headerArray = JSONArray.parseArray(sysApp.getHeaderIn()); + if (null != headerArray && headerArray.size() > 0) { + String plugId = null; + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + String parameterName = querys.getString("parameterName"); + if (null != parameterName && "plugId".equals(parameterName)) { + plugId = querys.getString("example"); + break; + } + } + if (null == plugId) { + throw new BaseSystemException("根据formID:" + formAppId + "未获取到head参数"); + } else { + PluginBaseEntity pluginBaseEntity = null; + JsonResultEntity result; + pluginBaseEntity = PluginUtils.getPluginsById(plugId); + if (null == pluginBaseEntity) { + throw new BaseSystemException("根据ID获取插件错误!请传入正确的 pluginId"); + } else { + //执行业务逻辑代码 + JSONObject reqJson = new JSONObject(); + reqJson.put("jsonStr",jsonStr); + reqJson.put("formAppId",formAppId); + reqJson.put("eventType",eventType); + result = pluginBaseEntity.executeBusiness(reqJson); + return result; + } + } + + + } else { + throw new BaseSystemException("根据formID:" + formAppId + "未获取到head参数"); + } + + +// Map headerMap = MapBuilder.create(true) +// .put("apiCode", String.valueOf(sysApp.getApiCode())) +// //这里用中台做为发送方 +// .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") +// .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") +// .put("appId",String.valueOf(sysApp.getAppCode())) +// .build(); +// String body = HttpRequest.post("http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body(); +// logger.info("调用中台返回的参数:{}",body); +// return body; } + }else{ + // StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType) + logger.info("jsonStr,formAppId,eventType为空!执行错误"+jsonStr+formAppId+eventType); + throw new BaseSystemException("jsonStr,formAppId,eventType为空!执行错误"); } return null; } + + @Override + public JsonResultEntity chengeBody(JSONObject object) throws Exception { + JSONObject jsonstr = object.getJSONObject("jsonStr"); + PluginBaseEntity pluginBaseEntity = null; + JsonResultEntity result; + String pluginId = jsonstr.getString("plugId"); + pluginBaseEntity = PluginUtils.getPluginsById(pluginId); + if (null == pluginBaseEntity) { + throw new BaseSystemException("根据ID获取插件错误!请传入正确的 pluginId"); + } else { + //执行业务逻辑代码 + result = pluginBaseEntity.executeBusiness(object); + } + return result; + } + + @Override + public SysExtensionApiEntity chengeBodySetPlug(SysExtensionApiEntity entity) { + Map headers = entity.getHeaders(); + JSONObject jsonObject = JSONObject.parseObject(entity.getBodys()); + jsonObject.put("plugId", headers.get("plugId")); + entity.setBodys(jsonObject.toJSONString()); + return entity; + } + + } From 6f0c9cf45c855e0420a0c1e5ebd0ed8429968bd0 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Tue, 8 Apr 2025 10:51:36 +0800 Subject: [PATCH 11/42] =?UTF-8?q?=E5=BC=80=E7=A5=A8=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=92=8C=E6=9F=A5=E8=AF=A2=E7=94=B3=E8=AF=B7=E5=8D=95=E8=AF=A6?= =?UTF-8?q?=E6=83=85,=E4=BB=A5=E5=8F=8A=E4=B8=AD=E4=BF=A1=E7=94=B5?= =?UTF-8?q?=E5=AD=90=E5=9B=9E=E5=8D=95=E4=B8=8A=E4=BC=A0OA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/MakeInvoicePluginInitializer.java | 15 +- .../src/main/resources/application-ht.yml | 4 +- .../spring/spring-buildpackage-plugin.xml | 1 + .../frame/seeyon/invoice/dao/IInvoiceDao.java | 32 + .../invoice/dao/IInvoiceDetailsDao.java | 20 + .../invoice/dao/impl/InvoiceDaoImpl.java | 41 ++ .../dao/impl/InvoiceDetailsDaoImpl.java | 35 + .../invoice/entity/InvoiceDetailsEntity.java | 141 ++++ .../invoice/entity/InvoiceDetailsEntity.xml | 41 ++ .../seeyon/invoice/entity/InvoiceEntity.java | 618 ++++++++++++++++++ .../seeyon/invoice/entity/InvoiceEntity.xml | 92 +++ .../invoice/service/IInvoiceService.java | 29 + .../service/impl/InvoiceServiceImpl.java | 246 +++++++ .../frame/seeyon/zxbank/dao/IZxBankDao.java | 16 +- .../seeyon/zxbank/dao/impl/ZxBankDaoImpl.java | 18 +- .../seeyon/zxbank/entity/ZxBankEntity.java | 8 + .../seeyon/zxbank/entity/ZxBankEntity.xml | 13 +- .../service/impl/ZxBankServiceImpl.java | 338 ++++++++-- 18 files changed, 1637 insertions(+), 71 deletions(-) create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDetailsDao.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDetailsDaoImpl.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/IInvoiceService.java create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/MakeInvoicePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/MakeInvoicePluginInitializer.java index 4736a39c..6ce63b2d 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/MakeInvoicePluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/MakeInvoicePluginInitializer.java @@ -2,10 +2,12 @@ package com.hzya.frame.plugin.ht.plugin; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.seeyon.invoice.service.impl.InvoiceServiceImpl; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; /** * @Description @@ -13,6 +15,9 @@ import org.slf4j.LoggerFactory; * @Date 2024/8/22 16:39 **/ public class MakeInvoicePluginInitializer extends PluginBaseEntity { + + @Autowired + private InvoiceServiceImpl invoiceService; Logger logger = LoggerFactory.getLogger(getClass()); /*** * 插件初始化方法 @@ -91,7 +96,13 @@ public class MakeInvoicePluginInitializer extends PluginBaseEntity { **/ @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { - - return BaseResult.getSuccessMessageEntity("操作成功"); + try { + logger.info("======开始执行杭泰开票申请单同步========"); + return invoiceService.queryArchives(requestJson); + }catch (Exception e){ + logger.info("======执行杭泰开票申请单同步失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; } } diff --git a/base-buildpackage/src/main/resources/application-ht.yml b/base-buildpackage/src/main/resources/application-ht.yml index 744db85b..85d1b848 100644 --- a/base-buildpackage/src/main/resources/application-ht.yml +++ b/base-buildpackage/src/main/resources/application-ht.yml @@ -12,7 +12,7 @@ spring: dynamic: datasource: master: - url: jdbc:mysql://127.0.0.1:3307/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true username: root password: bd993088e8a7c3dc5f44441617f9b4bf driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 @@ -39,7 +39,7 @@ cbs8: OA: data_source_code: yc_oa zt: - url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface + url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface zx: # 测试用这个 这个是银行给的 privateKey: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgtzMo2o6THK3yLIm+83Ch/560+02l2hjjBSFGieWY/Z6gCgYIKoEcz1UBgi2hRANCAATKhwZX4P3XI8vYTKeCOLMVbanUNbaXjrIEZynshwdOzRVgzRQSiPNWo6OBBkAPvqE+2RS+5ABpS82DSlKl81z0 diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/zxBank/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/zxBank/spring/spring-buildpackage-plugin.xml index cb28c7ce..845017ce 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/zxBank/spring/spring-buildpackage-plugin.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/zxBank/spring/spring-buildpackage-plugin.xml @@ -4,4 +4,5 @@ + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java new file mode 100644 index 00000000..50747bc2 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java @@ -0,0 +1,32 @@ +package com.hzya.frame.seeyon.invoice.dao; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity; + +import java.util.HashMap; +import java.util.List; + +public interface IInvoiceDao extends IBaseDao { + + /** + * + * @content 查询需要推送税务的数据 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-01 15:33 + * **/ + List> queryInvoice(String str , MdmModuleSourceEntity entity); + + /** + * + * @content 查询申请单详情 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-07 14:05 + * **/ + List queryInvoiceResult(InvoiceEntity entity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDetailsDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDetailsDao.java new file mode 100644 index 00000000..8a61f896 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDetailsDao.java @@ -0,0 +1,20 @@ +package com.hzya.frame.seeyon.invoice.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.invoice.entity.InvoiceDetailsEntity; + +import java.util.HashMap; +import java.util.List; + +public interface IInvoiceDetailsDao extends IBaseDao { + /** + * + * @content 查询需要推送税务的数据 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-01 15:33 + * **/ + List> queryInvoiceDetails(String str , MdmModuleSourceEntity entity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java new file mode 100644 index 00000000..92743132 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java @@ -0,0 +1,41 @@ +package com.hzya.frame.seeyon.invoice.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.execsql.service.IExecSqlService; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao; +import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.util.HashMap; +import java.util.List; + +@Repository(value = "InvoiceDaoImpl") +public class InvoiceDaoImpl extends MybatisGenericDao implements IInvoiceDao { + @Autowired + private IExecSqlService execSqlService; + + private Logger logger = LogManager.getLogger(super.getClass()); + + @DS("#entity.dataSourceCode") + @Override + public List> queryInvoice(String str, MdmModuleSourceEntity entity) { + try { + List> hashMaps = execSqlService.execSelectSql(str, ""); + return hashMaps; + }catch (Exception e){ + logger.info("没有需要推送税务的数据"); + return null; + } + } + + @DS("#entity.dataSourceCode") + @Override + public List queryInvoiceResult(InvoiceEntity entity) { + return (List) super.selectList("queryInvoiceResult",entity); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDetailsDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDetailsDaoImpl.java new file mode 100644 index 00000000..55b1b481 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDetailsDaoImpl.java @@ -0,0 +1,35 @@ +package com.hzya.frame.seeyon.invoice.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.execsql.service.IExecSqlService; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.invoice.dao.IInvoiceDetailsDao; +import com.hzya.frame.seeyon.invoice.entity.InvoiceDetailsEntity; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.util.HashMap; +import java.util.List; + +@Repository(value ="InvoiceDetailsDaoImpl") +public class InvoiceDetailsDaoImpl extends MybatisGenericDao implements IInvoiceDetailsDao { + @Autowired + private IExecSqlService execSqlService; + + private Logger logger = LogManager.getLogger(super.getClass()); + + @DS("#entity.dataSourceCode") + @Override + public List> queryInvoiceDetails(String str, MdmModuleSourceEntity entity) { + try { + List> hashMaps = execSqlService.execSelectSql(str, ""); + return hashMaps; + }catch (Exception e){ + logger.info("没有需要推送税务的明细数据"); + return null; + } + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.java new file mode 100644 index 00000000..a7bc58fd --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.java @@ -0,0 +1,141 @@ +package com.hzya.frame.seeyon.invoice.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +public class InvoiceDetailsEntity extends BaseEntity { + private String item_no;//明细行编号 + private String item_name;//商品名称 + private String tax_cate_code;//税收分类编码,19位 + private String spec;//规格型号 + private String unit;//单位 + private String quantity;//数量 + private String unit_price;//单价 + private String price;//金额 + private String tax_rate;//税率 + private String zero_flag;//零税率 + private String tax;//税额 + private String include_tax_tag;//含税标识 + private String detail_type;//明细行性质 + private String enjoy_preferential_flag;//是否享受优惠0 否1是 + private String preferential_policy_type;//优惠政策类型 + + public String getItem_no() { + return item_no; + } + + public void setItem_no(String item_no) { + this.item_no = item_no; + } + + public String getItem_name() { + return item_name; + } + + public void setItem_name(String item_name) { + this.item_name = item_name; + } + + public String getTax_cate_code() { + return tax_cate_code; + } + + public void setTax_cate_code(String tax_cate_code) { + this.tax_cate_code = tax_cate_code; + } + + public String getSpec() { + return spec; + } + + public void setSpec(String spec) { + this.spec = spec; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getQuantity() { + return quantity; + } + + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + public String getUnit_price() { + return unit_price; + } + + public void setUnit_price(String unit_price) { + this.unit_price = unit_price; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } + + public String getTax_rate() { + return tax_rate; + } + + public void setTax_rate(String tax_rate) { + this.tax_rate = tax_rate; + } + + public String getZero_flag() { + return zero_flag; + } + + public void setZero_flag(String zero_flag) { + this.zero_flag = zero_flag; + } + + public String getTax() { + return tax; + } + + public void setTax(String tax) { + this.tax = tax; + } + + public String getInclude_tax_tag() { + return include_tax_tag; + } + + public void setInclude_tax_tag(String include_tax_tag) { + this.include_tax_tag = include_tax_tag; + } + + public String getDetail_type() { + return detail_type; + } + + public void setDetail_type(String detail_type) { + this.detail_type = detail_type; + } + + public String getEnjoy_preferential_flag() { + return enjoy_preferential_flag; + } + + public void setEnjoy_preferential_flag(String enjoy_preferential_flag) { + this.enjoy_preferential_flag = enjoy_preferential_flag; + } + + public String getPreferential_policy_type() { + return preferential_policy_type; + } + + public void setPreferential_policy_type(String preferential_policy_type) { + this.preferential_policy_type = preferential_policy_type; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.xml new file mode 100644 index 00000000..4238f173 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + * + + + + + + + + + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java new file mode 100644 index 00000000..c3afa017 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java @@ -0,0 +1,618 @@ +package com.hzya.frame.seeyon.invoice.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +public class InvoiceEntity extends BaseEntity { + private String sfhc;// 是否红冲 + private String xf;// 销方 + private String access_key;// 申请开放平台分配的accessKey + private String sign;// 加密签名 + private String timestamp;// 用户发起请求的时间 + private String serial_number;// 请求唯一流水号 + private String company_code;// 企业编码 + private String seller_tax_no;// 企业纳税人识别号 + private String template_id;// 模版ID,固定值: + private String business_no;// 业务单号 + private String superior_business_no;// 上级业务单号 + private String buyer_name;// 购买方名称 + private String buyer_tax_no;// 购买方纳税人识别号 + private String buyer_addr_phone;// 购买方地址、电话 + private String buyer_bank_account;// 购买方开户行及账号 + private String apply_person;// 申请人 + private String apply_email_notice;// 是否邮件通知申请人 1 是0 否 + private String buyer_email_notice;// 是否邮件通知购买方 1 是0 否 + private String workcode;// 申请人工号 + private String other_email;// 其他发票接收邮箱 + private String buyer_contact;// 购买方发票邮寄接收联系人名称 + private String buyer_mobile;// 购买方发票邮寄接收手机号 + private String buyer_recv_address;// 购买方发票邮寄接收地址 + private String application_remark;// 申请单其他说明 + private String attachments;// 附件,文件Url地址列表 + private String notify_url;// 回调通知地址 + private String special_invoice_mark;// 特殊票种标识 + private String seller_name;// 销售方名称 + private String seller_addr_phone;// 销售方地址、电话 + private String seller_bank_account;// 销售方银行账号 + private String extend_fields;// 自定义扩展字段 + private String invoice_type;// 发票种类示例值 + private String is_person;// 是否自然人1是默认为否 + private String levy_tax_type;// 征税方式 + private String deduction;// 扣除额,差额征税时必填 + private String remark;// 发票备注 + private String place;// 地址 + private String place_of_detail;// 详细地址 + private String construction_project_name;// 建筑项目名称 + private String kqysssxbgglbm;// 跨区域涉税事项报验管理編号 + private String product_no;// 土地增值税项目编号 + private String cross_distinct_city_flag;// 跨地(市)标志:是,否 + private String certificate_of_title;// 产权证书/不动产权证号 + private String area_unit;// 面积 + private String start_date;// 租赁开始,格式yyyy-MM-dd + private String end_date;// 租赁结束,格式yyyy-MM-dd + private String original_seller_name;// 原开票企业-销售方名称 + private String original_seller_tax_no;// 原开票企业-销售方纳税人识别号 + private String applicant;// 申请方 + private String deduction_status;// 抵扣状态 + private String original_invoice_code;// 原发票代码 + private String original_invoice_number;// 原发票号码 + private String original_invoice_date;// 原发票开票日期 + private String original_invoice_price;// 原发票不含税总金额 + private String red_flush_reason;// 红冲原因 + private String original_superior_business_no;// 原上级业务单号 + private String red_letter_info_sheet_no;// 红字信息表编号 + private String original_invoice_check_ode;// 原发票校验码 + private String push_status_filed;// 推送标识字段 + private String invoice_code_field;// 发票代码字段 + private String invoice_number_field;// 发票号码字段 + private String url_field;// 发票文件字段 + private String result_status_field;// 开票结果字段 + private String push_status;// 推送标识 + private String invoice_code;// 发票代码 + private String invoice_number;// 发票号码 + private String url;// 发票文件 + private String result_status;// 开票结果 + + public String getPush_status_filed() { + return push_status_filed; + } + + public void setPush_status_filed(String push_status_filed) { + this.push_status_filed = push_status_filed; + } + + public String getInvoice_code_field() { + return invoice_code_field; + } + + public void setInvoice_code_field(String invoice_code_field) { + this.invoice_code_field = invoice_code_field; + } + + public String getInvoice_number_field() { + return invoice_number_field; + } + + public void setInvoice_number_field(String invoice_number_field) { + this.invoice_number_field = invoice_number_field; + } + + public String getUrl_field() { + return url_field; + } + + public void setUrl_field(String url_field) { + this.url_field = url_field; + } + + public String getResult_status_field() { + return result_status_field; + } + + public void setResult_status_field(String result_status_field) { + this.result_status_field = result_status_field; + } + + public String getPush_status() { + return push_status; + } + + public void setPush_status(String push_status) { + this.push_status = push_status; + } + + public String getInvoice_code() { + return invoice_code; + } + + public void setInvoice_code(String invoice_code) { + this.invoice_code = invoice_code; + } + + public String getInvoice_number() { + return invoice_number; + } + + public void setInvoice_number(String invoice_number) { + this.invoice_number = invoice_number; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getResult_status() { + return result_status; + } + + public void setResult_status(String result_status) { + this.result_status = result_status; + } + + public String getSfhc() { + return sfhc; + } + + public void setSfhc(String sfhc) { + this.sfhc = sfhc; + } + + public String getXf() { + return xf; + } + + public void setXf(String xf) { + this.xf = xf; + } + + public String getAccess_key() { + return access_key; + } + + public void setAccess_key(String access_key) { + this.access_key = access_key; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getTimestamp() { + return timestamp; + } + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + public String getSerial_number() { + return serial_number; + } + + public void setSerial_number(String serial_number) { + this.serial_number = serial_number; + } + + public String getCompany_code() { + return company_code; + } + + public void setCompany_code(String company_code) { + this.company_code = company_code; + } + + public String getSeller_tax_no() { + return seller_tax_no; + } + + public void setSeller_tax_no(String seller_tax_no) { + this.seller_tax_no = seller_tax_no; + } + + public String getTemplate_id() { + return template_id; + } + + public void setTemplate_id(String template_id) { + this.template_id = template_id; + } + + public String getBusiness_no() { + return business_no; + } + + public void setBusiness_no(String business_no) { + this.business_no = business_no; + } + + public String getSuperior_business_no() { + return superior_business_no; + } + + public void setSuperior_business_no(String superior_business_no) { + this.superior_business_no = superior_business_no; + } + + public String getBuyer_name() { + return buyer_name; + } + + public void setBuyer_name(String buyer_name) { + this.buyer_name = buyer_name; + } + + public String getBuyer_tax_no() { + return buyer_tax_no; + } + + public void setBuyer_tax_no(String buyer_tax_no) { + this.buyer_tax_no = buyer_tax_no; + } + + public String getBuyer_addr_phone() { + return buyer_addr_phone; + } + + public void setBuyer_addr_phone(String buyer_addr_phone) { + this.buyer_addr_phone = buyer_addr_phone; + } + + public String getBuyer_bank_account() { + return buyer_bank_account; + } + + public void setBuyer_bank_account(String buyer_bank_account) { + this.buyer_bank_account = buyer_bank_account; + } + + public String getApply_person() { + return apply_person; + } + + public void setApply_person(String apply_person) { + this.apply_person = apply_person; + } + + public String getApply_email_notice() { + return apply_email_notice; + } + + public void setApply_email_notice(String apply_email_notice) { + this.apply_email_notice = apply_email_notice; + } + + public String getBuyer_email_notice() { + return buyer_email_notice; + } + + public void setBuyer_email_notice(String buyer_email_notice) { + this.buyer_email_notice = buyer_email_notice; + } + + public String getWorkcode() { + return workcode; + } + + public void setWorkcode(String workcode) { + this.workcode = workcode; + } + + public String getOther_email() { + return other_email; + } + + public void setOther_email(String other_email) { + this.other_email = other_email; + } + + public String getBuyer_contact() { + return buyer_contact; + } + + public void setBuyer_contact(String buyer_contact) { + this.buyer_contact = buyer_contact; + } + + public String getBuyer_mobile() { + return buyer_mobile; + } + + public void setBuyer_mobile(String buyer_mobile) { + this.buyer_mobile = buyer_mobile; + } + + public String getBuyer_recv_address() { + return buyer_recv_address; + } + + public void setBuyer_recv_address(String buyer_recv_address) { + this.buyer_recv_address = buyer_recv_address; + } + + public String getApplication_remark() { + return application_remark; + } + + public void setApplication_remark(String application_remark) { + this.application_remark = application_remark; + } + + public String getAttachments() { + return attachments; + } + + public void setAttachments(String attachments) { + this.attachments = attachments; + } + + public String getNotify_url() { + return notify_url; + } + + public void setNotify_url(String notify_url) { + this.notify_url = notify_url; + } + + public String getSpecial_invoice_mark() { + return special_invoice_mark; + } + + public void setSpecial_invoice_mark(String special_invoice_mark) { + this.special_invoice_mark = special_invoice_mark; + } + + public String getSeller_name() { + return seller_name; + } + + public void setSeller_name(String seller_name) { + this.seller_name = seller_name; + } + + public String getSeller_addr_phone() { + return seller_addr_phone; + } + + public void setSeller_addr_phone(String seller_addr_phone) { + this.seller_addr_phone = seller_addr_phone; + } + + public String getSeller_bank_account() { + return seller_bank_account; + } + + public void setSeller_bank_account(String seller_bank_account) { + this.seller_bank_account = seller_bank_account; + } + + public String getExtend_fields() { + return extend_fields; + } + + public void setExtend_fields(String extend_fields) { + this.extend_fields = extend_fields; + } + + public String getInvoice_type() { + return invoice_type; + } + + public void setInvoice_type(String invoice_type) { + this.invoice_type = invoice_type; + } + + public String getIs_person() { + return is_person; + } + + public void setIs_person(String is_person) { + this.is_person = is_person; + } + + public String getLevy_tax_type() { + return levy_tax_type; + } + + public void setLevy_tax_type(String levy_tax_type) { + this.levy_tax_type = levy_tax_type; + } + + public String getDeduction() { + return deduction; + } + + public void setDeduction(String deduction) { + this.deduction = deduction; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getPlace() { + return place; + } + + public void setPlace(String place) { + this.place = place; + } + + public String getPlace_of_detail() { + return place_of_detail; + } + + public void setPlace_of_detail(String place_of_detail) { + this.place_of_detail = place_of_detail; + } + + public String getConstruction_project_name() { + return construction_project_name; + } + + public void setConstruction_project_name(String construction_project_name) { + this.construction_project_name = construction_project_name; + } + + public String getKqysssxbgglbm() { + return kqysssxbgglbm; + } + + public void setKqysssxbgglbm(String kqysssxbgglbm) { + this.kqysssxbgglbm = kqysssxbgglbm; + } + + public String getProduct_no() { + return product_no; + } + + public void setProduct_no(String product_no) { + this.product_no = product_no; + } + + public String getCross_distinct_city_flag() { + return cross_distinct_city_flag; + } + + public void setCross_distinct_city_flag(String cross_distinct_city_flag) { + this.cross_distinct_city_flag = cross_distinct_city_flag; + } + + public String getCertificate_of_title() { + return certificate_of_title; + } + + public void setCertificate_of_title(String certificate_of_title) { + this.certificate_of_title = certificate_of_title; + } + + public String getArea_unit() { + return area_unit; + } + + public void setArea_unit(String area_unit) { + this.area_unit = area_unit; + } + + public String getStart_date() { + return start_date; + } + + public void setStart_date(String start_date) { + this.start_date = start_date; + } + + public String getEnd_date() { + return end_date; + } + + public void setEnd_date(String end_date) { + this.end_date = end_date; + } + + public String getOriginal_seller_name() { + return original_seller_name; + } + + public void setOriginal_seller_name(String original_seller_name) { + this.original_seller_name = original_seller_name; + } + + public String getOriginal_seller_tax_no() { + return original_seller_tax_no; + } + + public void setOriginal_seller_tax_no(String original_seller_tax_no) { + this.original_seller_tax_no = original_seller_tax_no; + } + + public String getApplicant() { + return applicant; + } + + public void setApplicant(String applicant) { + this.applicant = applicant; + } + + public String getDeduction_status() { + return deduction_status; + } + + public void setDeduction_status(String deduction_status) { + this.deduction_status = deduction_status; + } + + public String getOriginal_invoice_code() { + return original_invoice_code; + } + + public void setOriginal_invoice_code(String original_invoice_code) { + this.original_invoice_code = original_invoice_code; + } + + public String getOriginal_invoice_number() { + return original_invoice_number; + } + + public void setOriginal_invoice_number(String original_invoice_number) { + this.original_invoice_number = original_invoice_number; + } + + public String getOriginal_invoice_date() { + return original_invoice_date; + } + + public void setOriginal_invoice_date(String original_invoice_date) { + this.original_invoice_date = original_invoice_date; + } + + public String getOriginal_invoice_price() { + return original_invoice_price; + } + + public void setOriginal_invoice_price(String original_invoice_price) { + this.original_invoice_price = original_invoice_price; + } + + public String getRed_flush_reason() { + return red_flush_reason; + } + + public void setRed_flush_reason(String red_flush_reason) { + this.red_flush_reason = red_flush_reason; + } + + public String getOriginal_superior_business_no() { + return original_superior_business_no; + } + + public void setOriginal_superior_business_no(String original_superior_business_no) { + this.original_superior_business_no = original_superior_business_no; + } + + public String getRed_letter_info_sheet_no() { + return red_letter_info_sheet_no; + } + + public void setRed_letter_info_sheet_no(String red_letter_info_sheet_no) { + this.red_letter_info_sheet_no = red_letter_info_sheet_no; + } + + public String getOriginal_invoice_check_ode() { + return original_invoice_check_ode; + } + + public void setOriginal_invoice_check_ode(String original_invoice_check_ode) { + this.original_invoice_check_ode = original_invoice_check_ode; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml new file mode 100644 index 00000000..89fbf6c3 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * + + + + + + + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/IInvoiceService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/IInvoiceService.java new file mode 100644 index 00000000..45f34f2c --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/IInvoiceService.java @@ -0,0 +1,29 @@ +package com.hzya.frame.seeyon.invoice.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +public interface IInvoiceService extends IBaseService { + + /** + * + * @content 查询需要推送税务的数据 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-01 15:25 + * **/ + JsonResultEntity queryArchives(JSONObject jsonObject); + + /** + * + * @content 根据申请单查询开票结果 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-02 14:10 + * **/ + JsonResultEntity queryInvoiceResult(JSONObject json); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java new file mode 100644 index 00000000..f27b78c5 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -0,0 +1,246 @@ +package com.hzya.frame.seeyon.invoice.service.impl; + +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao; +import com.hzya.frame.seeyon.invoice.dao.IInvoiceDetailsDao; +import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity; +import com.hzya.frame.seeyon.invoice.service.IInvoiceService; +import com.hzya.frame.seeyon.util.YzfSignUtil; +import com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity; +import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.*; + +@Service(value = "InvoiceServiceImpl") +public class InvoiceServiceImpl extends BaseService implements IInvoiceService { + @Autowired + private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl; + + @Autowired + private IInvoiceDao invoiceDao; + @Autowired + private IInvoiceDetailsDao invoiceDetailsDao; + + @Autowired + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Autowired + private ComparisonServiceImpl comparisonServiceimpl; + + @Value("${zt.url}") + private String url; + + @Override + public JsonResultEntity queryArchives(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + //根据插件分类查询主数据来源表 + List list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType(); + if (CollectionUtils.isEmpty(list)) { + logger.info("没有类型为插件得数据,无法获取数据"); + return BaseResult.getFailureMessageEntity("数据来源表无插件类型"); + } + for (MdmModuleSourceEntity mdmModuleSourceEntity : list) { + String tableName = ""; + List object=new ArrayList<>(); + List listAll = new ArrayList<>(); + try { + String appTyp = mdmModuleSourceEntity.getAppType();//系统类型 1、致远OA 2、用友U8C 3、用友BIP + String dbCode = mdmModuleSourceEntity.getDbCode();//数据源编码 + String mdmCode = mdmModuleSourceEntity.getMdmCode();//主数据编码 + switch (appTyp){ + case "1": + switch (mdmCode){ + case "10049"://杭泰开票申请单 + tableName = "mdm_invoice_application"; + listAll = bindingInvoice(jsonObject, mdmModuleSourceEntity, dbCode); + break; + default: + break; + } + break; + default: + break; + } + //将查询出来的数据进行组装,调用通用方法新增或者更新 + if (null != listAll && listAll.size() > 0) { + object = ParametricDocument(listAll, mdmCode, tableName); + } else { + logger.info("三维单据视图数据没有需要同步中台的数据"); + } + }catch (Exception e){ + logger.info("杭泰付款单同步失败:{}",e.getMessage()); + saveTaskLivingDetails(JSONObject.parseObject(listAll.get(0).getString("mdm_invoice_application")).getString("data_id"),JSONObject.parseObject(listAll.get(0).getString("mdm_invoice_application")).getString("business_no"),listAll.get(0).toString(),JSON.parseObject(JSON.toJSONString(object)).getString("msg")==null?JSON.parseObject(JSON.toJSONString(object)).getString("list"):JSON.parseObject(JSON.toJSONString(object)).getString("msg"),false,"MakeInvoicePluginInitializer"); + e.printStackTrace(); + } + } + return BaseResult.getSuccessMessageEntity("开票申请单同步成功"); + } + + @Override + public JsonResultEntity queryInvoiceResult(JSONObject json) { + try { + InvoiceEntity invoiceEntity = json.toJavaObject(InvoiceEntity.class); + invoiceEntity.setDataSourceCode("HT-OA"); + logger.info("=======开始查询杭泰税务的开票申请单返回结果========="); + List invoiceEntities = invoiceDao.queryInvoiceResult(invoiceEntity); + if(CollectionUtils.isEmpty(invoiceEntities)){ + logger.info("=====杭泰税务中没有需要查询申请单详情得数据========"); + return BaseResult.getSuccessMessageEntity("查询成功"); + } + for (InvoiceEntity entity : invoiceEntities) { + long timestamp = System.currentTimeMillis(); + Map parametersMap = new HashMap<>(); + parametersMap.put("accessKey","6X3B526P5HqE6ums"); + parametersMap.put("timestamp",timestamp); + String sign = YzfSignUtil.signRequest(parametersMap,"34e5fc32ac894a2ba2ade8c3852c7a0a"); + JSONObject jsonObject=new JSONObject(); + jsonObject.put("serialNumber",entity.getBusiness_no()); + jsonObject.put("accessKey","6X3B526P5HqE6ums"); + jsonObject.put("sign",sign); + jsonObject.put("timestamp",timestamp); + logger.info("=======调用杭泰税务查询申请单详情的请求参数为:{}=======",jsonObject.toJSONString()); + //发送数据 + String result = HttpRequest.post(url). + header("appId", "800060"). + header("apiCode", "8000600003"). + header("publicKey", "ZJYAmRjjYEDgqw4UXWHZNicYclErG0hsrwKQcHukPlP0K1pCe7eDIk+3zDUT+v578prj"). + header("secretKey", "D6AHU3PL8UsNfK6A8I6mL4X1ma2NXckX/vM7AOzI/jmzJf+R1aY06Q6SBz7Y7drHj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(jsonObject.toJSONString()). + execute(). + body(); + logger.info("=====调用杭泰税务查询申请单详情的返回参数为:{}===========",result); + + } + }catch (Exception e){ + logger.info("======查询杭泰税务申请单详情失败====",e.getMessage()); + e.printStackTrace(); + } + return null; + } + + private List bindingInvoice(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { + List list = new ArrayList<>(); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("select * from v_hzya_invoice where push_status is null "); + mdmModuleSourceEntity.setDataSourceCode(dbCode); + List> hashMaps = invoiceDao.queryInvoice(stringBuffer.toString(), mdmModuleSourceEntity); + int i = 0; + if (CollectionUtils.isNotEmpty(hashMaps)) { + for (HashMap hashMap : hashMaps) { + JSONObject main = new JSONObject(); + JSONObject invoice = new JSONObject(); + for (String key : hashMap.keySet()) { + invoice.put(key.toLowerCase(), hashMap.get(key)); + } + //获取明细信息 + Long formmainId = (Long) hashMap.get("data_id"); + StringBuffer stringBufferDetails = new StringBuffer(); + stringBufferDetails.append("SELECT * FROM v_hzya_invoice_details WHERE f_id = '"+formmainId+"' " ); + List> hashMapsDetails = invoiceDetailsDao.queryInvoiceDetails(stringBufferDetails.toString(),mdmModuleSourceEntity); + JSONArray invoiceDetails = new JSONArray(); + if(CollectionUtils.isNotEmpty(hashMapsDetails)){ + for (HashMap detailsMap : hashMapsDetails) { + JSONObject details = new JSONObject(); + for (String key : detailsMap.keySet()) { + details.put(key.toLowerCase(), detailsMap.get(key)); + } + invoiceDetails.add(details); + } + } + main.put("mdm_invoice_application_details", invoiceDetails); + main.put("mdm_invoice_application", invoice); + list.add(main); + } + } + return list; + } + + private List ParametricDocument(List hashMaps,String mdmCode,String tableName){ + JSONObject jsonObjectUser = new JSONObject(); + List result=new ArrayList<>(); + try { + for (JSONObject hashMap : hashMaps) { + JSONObject main = hashMap.getJSONObject(tableName); + JSONObject jsonStr = new JSONObject(); + jsonObjectUser.put("data_id", main.get("data_id")); + jsonObjectUser.put("mdmCode", mdmCode); + jsonStr.put("jsonStr", jsonObjectUser); + //先查询编码和名称查询是否存在 + Object attribute = comparisonServiceimpl.queryEntityPage(jsonStr); + logger.info("得到的attribute值为:{}", jsonStr.toJSONString(attribute)); + JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute); + JSONObject pageInfo = jsonObjectAttribute.getJSONObject("pageInfo"); + JSONArray jsonArrayList = pageInfo.getJSONArray("list"); + //如果jsonArrayList为null,说明没有值,在表中不存在 + if (jsonArrayList == null || jsonArrayList.size() == 0) { + hashMap.put("appName","数智中台"); + hashMap.put("appCode","800004"); + hashMap.put("mdmCode", mdmCode); + hashMap.put("optionName", "数智中台"); + jsonStr.put("jsonStr", hashMap); + Object object = comparisonServiceimpl.saveEntity(jsonStr); + logger.info("应付单新增结果为:{}", JSON.toJSONString(object)); + result.add(object); + } else { + hashMap.put("appName","数智中台"); + hashMap.put("appCode","800004"); + hashMap.put("mdmCode", mdmCode); + hashMap.put("optionName", "数智中台"); + jsonStr.put("jsonStr", hashMap); + Object object = comparisonServiceimpl.updateEntity(jsonStr); + logger.info("应付单更新结果为:{}", JSON.toJSONString(result)); + result.add(object); + } + } + return result; + }catch (Exception e){ + logger.info("将数据查询之后进行组装调用通用方法错误:{}",e.getMessage()); + //保存业务数据日志 + saveTaskLivingDetails(jsonObjectUser.getString("data_id"),hashMaps.get(0).getString("business_no"),hashMaps.get(0).toString(),result.toString(),false,"MakeInvoicePluginInitializer"); + e.printStackTrace(); + } + return null; + } + + private void saveTaskLivingDetails(String rootAppPk,String rootAppBill,String rootAppNewData,String newTransmitInfo,boolean flag,String plugin) { + try { + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID()); + integrationTaskLivingDetailsEntity.setSts("Y"); + integrationTaskLivingDetailsEntity.setCreate_user_id("1"); + integrationTaskLivingDetailsEntity.setModify_user_id("1"); + integrationTaskLivingDetailsEntity.setCreate_time(new Date()); + integrationTaskLivingDetailsEntity.setModify_time(new Date()); + integrationTaskLivingDetailsEntity.setOrg_id("0"); + integrationTaskLivingDetailsEntity.setCompanyId("0"); + integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); + integrationTaskLivingDetailsEntity.setRootAppBill(rootAppBill); + integrationTaskLivingDetailsEntity.setPluginId(plugin); + integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(newTransmitInfo); + if(flag){ + taskLivingDetailsService.saveLogToSuccess(integrationTaskLivingDetailsEntity); + }else { + taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); + } + }catch (Exception e){ + logger.info("抽取杭泰付款单保存日志到集成任务日志明细中失败:{}",e.getMessage()); + e.printStackTrace(); + } + } + +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/IZxBankDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/IZxBankDao.java index ed0e0cec..ceb11fe5 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/IZxBankDao.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/IZxBankDao.java @@ -28,7 +28,7 @@ public interface IZxBankDao extends IBaseDao { * @Author hecan * @Date 2024-12-05 17:58 * **/ - Integer updatePushStatus(ZxBankEntity entity); + Integer updatePushStatusZX(ZxBankEntity entity); /** * @@ -38,7 +38,7 @@ public interface IZxBankDao extends IBaseDao { * @Author hecan * @Date 2025-03-18 17:44 * **/ - List queryResultIsNull(ZxBankEntity zxBankEntity); + List queryResultIsNullZX(ZxBankEntity zxBankEntity); /** * @@ -58,5 +58,15 @@ public interface IZxBankDao extends IBaseDao { * @Author hecan * @Date 2025-03-19 14:15 * **/ - List queryElecIsNull(ZxBankEntity entity); + List queryElecIsNullZX(ZxBankEntity entity); + + /** + * + * @content 更新电子回单 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-07 17:06 + * **/ + Integer updateElecStatusZX(ZxBankEntity entity); } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/impl/ZxBankDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/impl/ZxBankDaoImpl.java index 192305c1..bb092c8c 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/impl/ZxBankDaoImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/impl/ZxBankDaoImpl.java @@ -36,14 +36,14 @@ public class ZxBankDaoImpl extends MybatisGenericDao implem @DS("#entity.dataSourceCode") @Override - public Integer updatePushStatus(ZxBankEntity entity) { - return super.update("updatePushStatus",entity); + public Integer updatePushStatusZX(ZxBankEntity entity) { + return super.update("updatePushStatusZX",entity); } @DS("#entity.dataSourceCode") @Override - public List queryResultIsNull(ZxBankEntity entity) { - return super.queryList(entity,"queryResultIsNull"); + public List queryResultIsNullZX(ZxBankEntity entity) { + return super.queryList(entity,"queryResultIsNullZX"); } @DS("#entity.dataSourceCode") @@ -54,7 +54,13 @@ public class ZxBankDaoImpl extends MybatisGenericDao implem @DS("#entity.dataSourceCode") @Override - public List queryElecIsNull(ZxBankEntity entity) { - return super.queryList(entity,"queryElecIsNull"); + public List queryElecIsNullZX(ZxBankEntity entity) { + return super.queryList(entity,"queryElecIsNullZX"); + } + + @DS("#entity.dataSourceCode") + @Override + public Integer updateElecStatusZX(ZxBankEntity entity) { + return super.update("updateElecStatusZX",entity); } } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.java index 160af0b7..e648cac2 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.java @@ -30,7 +30,15 @@ public class ZxBankEntity extends BaseEntity { private String payResult;//支付结果 private String receipt;//电子回单 private String pushStatus;//推送标识 + private String summaryId;// + public String getSummaryId() { + return summaryId; + } + + public void setSummaryId(String summaryId) { + this.summaryId = summaryId; + } public String getTabName() { return tabName; diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml index 4087d5c5..b8c383c8 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml @@ -29,6 +29,7 @@ + @@ -60,6 +61,7 @@ ,pay_result as payResult ,receipt as receipt ,push_status as pushStatus + ,summary_id as summaryId @@ -71,20 +73,20 @@ from v_hzya_pay where push_status is null - select from v_hzya_pay where push_status is not null and pay_result is null - select from v_hzya_pay where pay_result='已支付' and receipt is null - + update ${tabName} set ${pushStatusField} =#{pushStatus} where id=#{id} @@ -93,6 +95,11 @@ update ${tabName} set ${payResultField} =#{payResult} where id=#{id} + + + update ${tabName} set ${receiptFiled} =#{receipt} where id=#{id} + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java index 9cb5bcc7..6be14686 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java @@ -2,17 +2,26 @@ package com.hzya.frame.seeyon.zxbank.service.impl; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; +import cn.hutool.log.Log; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.basedao.service.impl.BaseService; import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl; import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.dao.ICtpAttachmentDao; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; +import com.hzya.frame.seeyon.util.OARestUtil; import com.hzya.frame.seeyon.util.SM2Util; import com.hzya.frame.seeyon.zxbank.dao.IZxBankDao; import com.hzya.frame.seeyon.zxbank.entity.PayState; import com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity; import com.hzya.frame.seeyon.zxbank.service.IZxBankService; +import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao; +import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; @@ -20,15 +29,21 @@ import com.hzya.frame.uuid.UUIDLong; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; +import com.hzya.frame.web.exception.BaseSystemException; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; @Service("ZxBankServiceImpl") public class ZxBankServiceImpl extends BaseService implements IZxBankService { @@ -36,12 +51,17 @@ public class ZxBankServiceImpl extends BaseService impleme @Autowired private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl; - @Autowired - private IZxBankDao zxBankDao; + @Autowired + private IZxBankDao zxBankDao; @Autowired private IIntegrationTaskLivingDetailsService taskLivingDetailsService; @Autowired private ComparisonServiceImpl comparisonServiceimpl; + @Autowired + private ICtpAttachmentDao ctpAttachmentDao; + + @Autowired + private ISysApplicationDatabaseDao sysApplicationDatabaseDao; @Value("${zt.url}") private String url; @@ -108,7 +128,7 @@ public class ZxBankServiceImpl extends BaseService impleme zxBankEntity.setPushStatus("1"); zxBankEntity.setId(dataId); zxBankEntity.setDataSourceCode(mdmModuleSourceEntity.getDataSourceCode()); - zxBankDao.updatePushStatus(zxBankEntity); + zxBankDao.updatePushStatusZX(zxBankEntity); //保存业务数据日志 saveTaskLivingDetails(dataId, jsonObjectCmpApply.getString("document_no"), listAll.get(0).toString(), object.toString(), true,"ZxBankPluginInitializer"); } @@ -134,11 +154,10 @@ public class ZxBankServiceImpl extends BaseService impleme @Override public JsonResultEntity queryArchivesResult(JSONObject json) { try { - JSONObject jsonObject = json.getJSONObject("jsonStr"); - ZxBankEntity zxBankEntity = jsonObject.toJavaObject(ZxBankEntity.class); + ZxBankEntity zxBankEntity = json.toJavaObject(ZxBankEntity.class); zxBankEntity.setDataSourceCode("HT-OA"); logger.info("======开始查询中信返回的支付结果====="); - List zxBankEntities = zxBankDao.queryResultIsNull(zxBankEntity); + List zxBankEntities = zxBankDao.queryResultIsNullZX(zxBankEntity); if(CollectionUtils.isEmpty(zxBankEntities)){ logger.info("=====杭泰付款单中没有已推送并且支付结果为空的数据========"); return BaseResult.getSuccessMessageEntity("查询成功"); @@ -146,8 +165,15 @@ public class ZxBankServiceImpl extends BaseService impleme for (ZxBankEntity bankEntity : zxBankEntities) { List list = new ArrayList<>(); list.add(bankEntity.getDocumentNo()); - String params = String.join(", ", list); - logger.info("=======杭泰付款单调用中信支付结果查询请求参数为:{}", params); + JSONObject jsonObject=new JSONObject(); + jsonObject.put("documentNoList",list); + JSONObject objectData=new JSONObject(); + objectData.put("data",jsonObject); + logger.info("=======杭泰付款单调用中信支付结果查询请求参数明文为:{}", objectData.toJSONString()); + String encrypt = SM2Util.encrypt(objectData.toJSONString(), publicKey); + JSONObject jsonData=new JSONObject(); + jsonData.put("data",encrypt); + logger.info("=======杭泰付款单调用中信支付结果查询请求参数密文为:{}", jsonData.toJSONString()); //发送数据 String result = HttpRequest.post(url). header("appId", "800058"). @@ -155,16 +181,19 @@ public class ZxBankServiceImpl extends BaseService impleme //header("access_token", tokenBody). header("publicKey", "ZJYALA1PchEI1s2D5vaapO9RZ6CiDFv/pJAV88lRYg0oBwBCe7eDIk+3zDUT+v578prj"). header("secretKey", "jcoATYyty05KgDwL4O0xD+Ulq5ExYWkGvZGf2bhKrMaCehb3NIm5DUnJSK/r2SUaj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). - body(params). + body(jsonData.toJSONString()). execute(). body(); logger.info("========杭泰付款单调用中信支付结果查询返回参数为:{}==========", result); JSONObject resultJson = JSONObject.parseObject(result); if (!resultJson.getBoolean("flag")) { - saveTaskLivingDetails(bankEntity.getDataId(), bankEntity.getDocumentNo(), params, resultJson.toJSONString(), false,"ZxBankResultPluginInitializer"); + saveTaskLivingDetails(bankEntity.getDataId(), bankEntity.getDocumentNo(), jsonData.toJSONString(), resultJson.toJSONString(), false,"ZxBankResultPluginInitializer"); } else { - String data = resultJson.getString("data"); - JSONObject jsonObjectData = JSONObject.parseObject(data); + JSONObject attribute = resultJson.getJSONObject("attribute"); + String data = attribute.getString("data"); + logger.info("=======杭泰付款单调用中信支付结果查询返回参数密文为:{}", data); + String decrypt = SM2Util.decrypt(data, privateKey); + JSONObject jsonObjectData = JSONObject.parseObject(decrypt); JSONArray jsonArray = jsonObjectData.getJSONArray("list"); if(CollectionUtils.isNotEmpty(jsonArray)){ for (Object o : jsonArray) { @@ -176,8 +205,10 @@ public class ZxBankServiceImpl extends BaseService impleme if(documentNo.equals(bankEntity.getDocumentNo())){ //修改支付状态 bankEntity.setPayResult(PayState.payStateGetValue(payStatus)); + bankEntity.setDataSourceCode("HT-OA"); + bankEntity.setId(bankEntity.getDataId()); zxBankDao.updateResultStatus(bankEntity); - saveTaskLivingDetails(bankEntity.getDataId(), bankEntity.getDocumentNo(), params, resultJson.toJSONString(), true,"ZxBankResultPluginInitializer"); + saveTaskLivingDetails(bankEntity.getDataId(), bankEntity.getDocumentNo(), jsonData.toJSONString(), resultJson.toJSONString(), true,"ZxBankResultPluginInitializer"); } } }else{ @@ -194,14 +225,15 @@ public class ZxBankServiceImpl extends BaseService impleme return BaseResult.getFailureMessageEntity("支付结果查询失败"); } + + @Override public JsonResultEntity queryArchivesElec(JSONObject json) { try { - JSONObject jsonObject = json.getJSONObject("jsonStr"); - ZxBankEntity zxBankEntity = jsonObject.toJavaObject(ZxBankEntity.class); + ZxBankEntity zxBankEntity = json.toJavaObject(ZxBankEntity.class); zxBankEntity.setDataSourceCode("HT-OA"); logger.info("======开始查询中信电子回单====="); - List zxBankEntities = zxBankDao.queryElecIsNull(zxBankEntity); + List zxBankEntities = zxBankDao.queryElecIsNullZX(zxBankEntity); if(CollectionUtils.isEmpty(zxBankEntities)){ logger.info("=====杭泰付款单中没有已支付并且电子回单为空的数据========"); return BaseResult.getSuccessMessageEntity("查询成功"); @@ -210,8 +242,14 @@ public class ZxBankServiceImpl extends BaseService impleme JSONObject jsonParam=new JSONObject(); jsonParam.put("companyCode",bankEntity.getCompanyCode());//公司编码 jsonParam.put("documentNo",bankEntity.getDocumentNo());//单据号 - String params = jsonParam.toJSONString(); - logger.info("======杭泰付款单调用中信电子回单查询请求参数为:{}========",params); + JSONObject jsonData=new JSONObject(); + jsonData.put("data",jsonParam); + String params = jsonData.toJSONString(); + logger.info("======杭泰付款单调用中信电子回单查询请求参数明文为:{}========",params); + String encrypt = SM2Util.encrypt(params, publicKey); + JSONObject objectData=new JSONObject(); + objectData.put("data",encrypt); + logger.info("======杭泰付款单调用中信电子回单查询请求参数密文为:{}========",objectData.toJSONString()); //发送数据 String result = HttpRequest.post(url). header("appId", "800058"). @@ -219,7 +257,7 @@ public class ZxBankServiceImpl extends BaseService impleme //header("access_token", tokenBody). header("publicKey", "ZJYALA1PchEI1s2D5vaapO9RZ6CiDFv/pJAV88lRYg0oBwBCe7eDIk+3zDUT+v578prj"). header("secretKey", "jcoATYyty05KgDwL4O0xD+Ulq5ExYWkGvZGf2bhKrMaCehb3NIm5DUnJSK/r2SUaj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). - body(params). + body(objectData.toJSONString()). execute(). body(); logger.info("======杭泰付款单调用中信电子回单查询返回参数为:{}========",result); @@ -227,16 +265,22 @@ public class ZxBankServiceImpl extends BaseService impleme if (!resultJson.getBoolean("flag")) { saveTaskLivingDetails(bankEntity.getDataId(), bankEntity.getDocumentNo(), params, resultJson.toJSONString(), false,"ZxBankElecPluginInitializer"); } else { - String data = resultJson.getString("data"); - JSONObject jsonObjectData = JSONObject.parseObject(data); + JSONObject attribute = resultJson.getJSONObject("attribute"); + String data = attribute.getString("data"); + logger.info("=======杭泰付款单调用中信支付结果查询返回参数密文为:{}", data); + String decrypt = SM2Util.decrypt(data, privateKey); + JSONObject jsonObjectData = JSONObject.parseObject(decrypt); String billId = jsonObjectData.getString("billId"); //电子回单id 电子回单下载需要 logger.info("======中信电子回单返回的电子回单id为:{}====",billId); if(StrUtil.isNotEmpty(billId)){ List list=new ArrayList<>(); list.add(billId); - String paramList = String.join(", ", list); - logger.info("====调用中信电子回单下载得请求参数为:{}=======",paramList); - elecDownlod(paramList); + JSONObject billIds=new JSONObject(); + billIds.put("billIds",list); + JSONObject elecdata=new JSONObject(); + elecdata.put("data",billIds); + logger.info("====调用中信电子回单下载得请求参数明文为:{}=======",elecdata.toJSONString()); + elecDownlod(elecdata.toJSONString(),bankEntity); } } } @@ -247,19 +291,121 @@ public class ZxBankServiceImpl extends BaseService impleme return null; } - private JsonResultEntity elecDownlod(String params){ + private JsonResultEntity elecDownlod(String params,ZxBankEntity zxBankEntity){ try { - //发送数据 - String result = HttpRequest.post(url). - header("appId", ""). - header("apiCode", ""). - //header("access_token", tokenBody). - header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj"). - header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). - body(params). - execute(). - body(); - logger.info("======杭泰付款单调用中信电子回单下载返回参数为:{}========",result); + String encrypt = SM2Util.encrypt(params, publicKey); + JSONObject objectData=new JSONObject(); + objectData.put("data",encrypt); + logger.info("====调用中信电子回单下载得请求参数密文为:{}=======",objectData.toJSONString()); + //因为电子回单下载返回的只有文件流,所以无法在中台上注册接口,只能代码中调用第三方接口 + //将文件流的zip下载到文件夹中,之后解压该文件夹,得到pdf文件,上传OA + String downloadFolder ="D:\\yongansystem\\pdf\\"; + String destinationFolder ="D:\\yongansystem\\pdf\\"; + + URL url = new URL("http://202.108.57.65:11370/access/treasury/hangtai/bill/down"); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("POST"); + connection.setRequestProperty("Content-Type", "application/json"); + connection.setDoOutput(true); + + // 写入 JSON 请求体 + try (OutputStream os = connection.getOutputStream(); + OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8")) { + osw.write(objectData.toJSONString()); + osw.flush(); + } + + // 获取响应状态码 + int responseCode = connection.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + // 获取响应头中的 Content-Disposition + String contentDisposition = connection.getHeaderField("Content-Disposition"); + String fileName = parseFileName(contentDisposition); + // 拼接指定文件夹和文件名 + File outputFile = new File(downloadFolder, fileName); + // 确保文件夹存在 + File parentDir = outputFile.getParentFile(); + if (!parentDir.exists()) { + if (!parentDir.mkdirs()) { + logger.info("无法创建目录: {}" , parentDir); + return null; + } + } + + // 获取响应的输入流 + try (InputStream inputStream = connection.getInputStream(); + FileOutputStream outputStream = new FileOutputStream(outputFile)) { + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + logger.info("文件下载成功,保存路径: {}" ,outputFile.getAbsolutePath()); + //开始解压得到的zip文件 + File sourceFolder = new File(outputFile.getAbsolutePath()); + if (!sourceFolder.exists()) { + logger.info("源文件夹不存在或不是一个有效的文件夹"); + return null; + } + + if (sourceFolder.isFile() && sourceFolder.getName().endsWith(".zip")) { + unzipFile(sourceFolder.getAbsolutePath(), destinationFolder); + + //将pdf文件上传OA + File fileOut = new File(sourceFolder.getAbsolutePath()); + if (fileOut.exists()) { + logger.info("=====开始上传中信司库回单到杭泰OA======"); + JSONObject jsonObject = fileUpload(fileOut); + if (jsonObject.getString("fileUrl") != null) { + //表单的附件字段=ctpAttachment的Sub_reference,表单的Summary_id=ctpAttachment的att_reference + String sub_reference = String.valueOf(UUIDLong.longUUID()); + zxBankEntity.setReceipt(sub_reference); + zxBankEntity.setDataSourceCode("HT-OA"); + zxBankDao.updateElecStatusZX(zxBankEntity); + //根据附件id查询附件业务数据 + String file_url = jsonObject.getString("fileUrl"); + CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity(); + ctpAttachmentEntity.setFile_url(file_url); + String att_reference = zxBankEntity.getSummaryId();//Summary_id + ctpAttachmentEntity.setSub_reference(sub_reference); + ctpAttachmentEntity.setAtt_reference(att_reference); + ctpAttachmentEntity.setDataSourceCode("HT-OA"); + List ctpAttachmentEntities = ctpAttachmentDao.queryCtpAttachment(ctpAttachmentEntity); + //如果没有查询到数据,就新增附件业务,否则更新 + if (ctpAttachmentEntities.size() == 0) { + String category = jsonObject.getString("category"); + String type = jsonObject.getString("type"); + String filename = jsonObject.getString("filename"); + String mime_type = jsonObject.getString("mimeType"); + String attachment_size = jsonObject.getString("size"); + String id = String.valueOf(UUIDLong.longUUID()); + ctpAttachmentEntity.setCategory(category); + ctpAttachmentEntity.setFilename(filename); + ctpAttachmentEntity.setType(type); + ctpAttachmentEntity.setMime_type(mime_type); + ctpAttachmentEntity.setAttachment_size(attachment_size); + ctpAttachmentEntity.setId(id); + ctpAttachmentEntity.setCategory("66"); + ctpAttachmentEntity.setCreatedate(new Date()); + ctpAttachmentEntity.setDataSourceCode("HT-OA"); + ctpAttachmentDao.saveCtpAttachment(ctpAttachmentEntity); + } else { + if (ctpAttachmentEntities.size() > 1) { + throw new BaseSystemException("OA附件业务表中查到多条记录"); + } + //更新数据到OA附件业务表中 + ctpAttachmentDao.updateCtpAttachment(ctpAttachmentEntity); + } + logger.info("=====电子回单执行完毕======="); + } + fileOut.delete(); + } + } + } + } else { + logger.info("请求失败,响应状态码:{} " , responseCode); + } + connection.disconnect(); }catch (Exception e){ logger.info("=======中信电子回单下载失败:{}======",e.getMessage()); e.printStackTrace(); @@ -267,26 +413,108 @@ public class ZxBankServiceImpl extends BaseService impleme return null; } + public JSONObject fileUpload(File file) { + if (null != file) { + try { + HashMap paramMap = new HashMap<>(); + paramMap.put("file", file); + String url = "/seeyon/rest/attachment?token=@token@";//如果后面加上applicationCategory=1&extensions=&firstSave=true,附件业务自动生成一条记录 + url = url.replaceAll("@token@", getToken()); + String result = HttpUtil.post("http://60.204.152.210" + url, paramMap); + if (StrUtil.isNotBlank(result)) { + logger.info("附件上传结果"+result); + JSONObject jsonObject = JSONObject.parseObject(result); + String atts = jsonObject.get("atts").toString(); + if (StrUtil.isNotEmpty(atts)) { + JSONArray jsonArray = JSONArray.parseArray(atts); + JSONObject res = (JSONObject) jsonArray.get(0); + String fileUrl = res.getString("fileUrl"); + logger.info("附件id:" + fileUrl); + return res; + } + } + }catch (Exception e){ + logger.error("附件上传失败"+e.getMessage()); + } + } + return null; + } + + private String getToken() { + //获取oatoken + HashMap hashMap = new HashMap<>(); + hashMap.put("userName", "hzyaRest"); + hashMap.put("password", "a5ce21b8-91db-4cec-b3e3-3e44719655fd"); + hashMap.put("loginName","bdmanager"); + String result = HttpUtil.post("http://60.204.152.210" + "/seeyon/rest/token", JSON.toJSONString(hashMap)); + JSONObject jsonObject = JSONObject.parseObject(result); + if (null != jsonObject) { + logger.info(result); + logger.info("======token:{}======" + jsonObject.getString("id")); + return jsonObject.getString("id"); + } + return null; + } + + private static String parseFileName(String contentDisposition) { + if (contentDisposition == null) { + return "unknown.zip"; + } + // 匹配 filename*=utf-8'' 后面的文件名 + Pattern pattern = Pattern.compile("filename\\*=utf-8''([^;]+)"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + return matcher.group(1); + } + return "unknown.zip"; + } + + private void unzipFile(String zipFilePath, String destinationFolderPath) { + try (FileInputStream fis = new FileInputStream(zipFilePath); + ZipInputStream zis = new ZipInputStream(fis)) { + + ZipEntry zipEntry = zis.getNextEntry(); + while (zipEntry != null) { + if (zipEntry.getName().endsWith(".pdf")) { + String pdfFilePath = destinationFolderPath + zipEntry.getName();//File.separator:文件路径中增加一个斜杠 + try (FileOutputStream fos = new FileOutputStream(pdfFilePath)) { + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = zis.read(buffer)) != -1) { + fos.write(buffer, 0, bytesRead); + } + } + logger.info("已提取 PDF 文件:{} " ,pdfFilePath); + } + zis.closeEntry(); + zipEntry = zis.getNextEntry(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + private List bindingZxBank(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { List list = new ArrayList<>(); - StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("select * from v_hzya_pay where 1=1 and push_status is null "); - mdmModuleSourceEntity.setDataSourceCode(dbCode); - List> hashMaps = zxBankDao.queryListByBank(stringBuffer.toString(), mdmModuleSourceEntity); - int i = 0; - if (CollectionUtils.isNotEmpty(hashMaps)) { - for (HashMap hashMap : hashMaps) { - JSONObject main = new JSONObject(); - JSONObject bank = new JSONObject(); - for (String key : hashMap.keySet()) { - bank.put(key.toLowerCase(), hashMap.get(key)); - } - main.put("mdm_zxbank", bank); - list.add(main); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("select * from v_hzya_pay where 1=1 and push_status is null "); + mdmModuleSourceEntity.setDataSourceCode(dbCode); + List> hashMaps = zxBankDao.queryListByBank(stringBuffer.toString(), mdmModuleSourceEntity); + int i = 0; + if (CollectionUtils.isNotEmpty(hashMaps)) { + for (HashMap hashMap : hashMaps) { + JSONObject main = new JSONObject(); + JSONObject bank = new JSONObject(); + for (String key : hashMap.keySet()) { + bank.put(key.toLowerCase(), hashMap.get(key)); } + main.put("mdm_zxbank", bank); + list.add(main); } - return list; + } + return list; } From e243a78e22d5f8b203a72c90c2385886257bb85d Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 9 Apr 2025 15:27:27 +0800 Subject: [PATCH 12/42] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index b252f4db..eb7f9414 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk ./idea/ +/.idea/ /buildpackage/src/main/resources/banner.txt /webapp/target/ /service/target/ @@ -66,3 +67,4 @@ $RECYCLE.BIN/ /base-webapp/target/classes/com/hzya/frame/ /fw-weixin/target/ /E:/yongansystem/log/2024-10-15/ +/D:/ From a287f6e30e9af4866126f56d9ba88a69f8bf8e22 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 10 Apr 2025 09:15:23 +0800 Subject: [PATCH 13/42] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=88=B0=E4=B8=9A=E5=8A=A1=E6=95=B0=E6=8D=AE=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-buildpackage/pom.xml | 6 + .../dao/IIncomeInvoiceDao.java | 24 + .../dao/impl/IncomeInvoiceDaoImpl.java | 32 ++ .../entity/IncomeInvoiceEntity.java | 14 + .../entity/IncomeInvoiceEntity.xml | 106 ++++ .../IncomeInvoicePluginInitializer.java | 63 +++ .../service/IIncomeInvoiceService.java | 17 + .../impl/IncomeInvoiceServiceImpl.java | 526 ++++++++++++++++++ .../src/main/resources/application-llg.yml | 82 +++ .../plugin/incomeInvoiceData/pluginCfg.xml | 6 + .../spring/spring-buildpackage-dao.xml | 5 + .../spring/spring-buildpackage-plugin.xml | 5 + .../spring/spring-buildpackage-service.xml | 5 + .../service/impl/ZxBankServiceImpl.java | 4 +- 14 files changed, 893 insertions(+), 2 deletions(-) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/IncomeInvoicePluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java create mode 100644 base-buildpackage/src/main/resources/application-llg.yml create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/pluginCfg.xml create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-dao.xml create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-service.xml diff --git a/base-buildpackage/pom.xml b/base-buildpackage/pom.xml index 92fa0ece..1a6c915a 100644 --- a/base-buildpackage/pom.xml +++ b/base-buildpackage/pom.xml @@ -43,6 +43,12 @@ httest + + llg + + llg + + kangarooDataCenterV3 diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java new file mode 100644 index 00000000..54190fe9 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java @@ -0,0 +1,24 @@ +package com.hzya.frame.plugin.incomeInvoiceData.dao; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity; + +import java.util.List; + +/** + * 客户档案(mdm_customer: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public interface IIncomeInvoiceDao extends IBaseDao { + + + List queryData(JSONObject saveData); + + int saveDetailData(JSONObject saveDetailData); + + int saveData(JSONObject saveData); +} + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java new file mode 100644 index 00000000..fa68e930 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java @@ -0,0 +1,32 @@ +package com.hzya.frame.plugin.incomeInvoiceData.dao.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.incomeInvoiceData.dao.IIncomeInvoiceDao; +import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity; + +import java.util.List; + + +/** + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class IncomeInvoiceDaoImpl extends MybatisGenericDao implements IIncomeInvoiceDao { + + @Override + public List queryData(JSONObject saveData) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryData", saveData); + return o; + } + @Override + public int saveData(JSONObject saveData) { + return super.insert(getSqlIdPrifx() + "saveData", saveData); + } + @Override + public int saveDetailData(JSONObject saveData) { + return super.insert(getSqlIdPrifx() + "saveDetailData", saveData); + } +} + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java new file mode 100644 index 00000000..a4d160c0 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java @@ -0,0 +1,14 @@ +package com.hzya.frame.plugin.incomeInvoiceData.entity; + +import com.hzya.frame.web.entity.BaseEntity; +/** + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class IncomeInvoiceEntity extends BaseEntity { + + + +} + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml new file mode 100644 index 00000000..219ac58a --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml @@ -0,0 +1,106 @@ + + + + + + + + insert into mdm_fp( + + id , + document_rule , + document_rule_num , + data_status , + add_status , + update_status , + delete_status , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + + fphm , + + + + )values + ( + + #{id} , + #{document_rule} , + #{document_rule_num} , + #{data_status} , + #{add_status} , + #{update_status} , + #{delete_status} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{company_id} , + + #{fphm} , + + + + ) + + + insert into mdm_fp_detail( + + id , + formmain_id , + data_status , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + remark , + + + + + )values + ( + + #{id} , + #{formmain_id} , + #{data_status}, + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{company_id} , + #{remark} , + + + + + + ) + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/IncomeInvoicePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/IncomeInvoicePluginInitializer.java new file mode 100644 index 00000000..8c966920 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/IncomeInvoicePluginInitializer.java @@ -0,0 +1,63 @@ +package com.hzya.frame.plugin.incomeInvoiceData.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 主数据同步 + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class IncomeInvoicePluginInitializer extends PluginBaseEntity{ + Logger logger = LoggerFactory.getLogger(IncomeInvoicePluginInitializer.class); + + @Autowired + private IIncomeInvoiceService incomeInvoiceService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "执行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "执行销毁方法destroy()"); + } + + @Override + public String getPluginId() { + return "IncomeInvoicePlugin"; + } + + @Override + public String getPluginName() { + return "IncomeInvoicePlugin插件"; + } + + @Override + public String getPluginLabel() { + return "IncomeInvoicePlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行进项全量发票主数据信息同步========"); + return incomeInvoiceService.getIncomeInvoiceData(requestJson); + }catch (Exception e){ + logger.info("======执行进项全量发票主数据同步失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java new file mode 100644 index 00000000..08ca551f --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.incomeInvoiceData.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public interface IIncomeInvoiceService extends IBaseService { + JsonResultEntity getIncomeInvoiceData(JSONObject requestJson); + SysExtensionApiEntity setData(SysExtensionApiEntity entity) throws Exception; +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java new file mode 100644 index 00000000..01861c17 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -0,0 +1,526 @@ +package com.hzya.frame.plugin.incomeInvoiceData.service.impl; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.incomeInvoiceData.dao.IIncomeInvoiceDao; +import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity; +import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService; +import com.hzya.frame.seeyon.util.YzfSignUtil; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.sysnew.comparison.controlsLog.dao.impl.ControlsLogDaoImpl; +import com.hzya.frame.sysnew.comparison.controlsLog.entity.ControlsLogEntity; +import com.hzya.frame.sysnew.comparison.dao.IComparisonDao; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; +import com.hzya.frame.uuid.UUIDLong; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.http.HttpEntity; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.TrustAllStrategy; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.ssl.SSLContextBuilder; +import org.apache.http.util.EntityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import com.hzya.frame.basedao.service.impl.BaseService; + +import javax.net.ssl.SSLContext; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class IncomeInvoiceServiceImpl extends BaseService implements IIncomeInvoiceService { + + private IIncomeInvoiceDao incomeInvoiceDao; + @Autowired + private ControlsLogDaoImpl controlsLogDaoimpl; + @Autowired + private IComparisonDao comparisonDao; + @Autowired + public void setIncomeInvoiceDao(IIncomeInvoiceDao dao) { + this.incomeInvoiceDao = dao; + this.dao = dao; + } + String dataUrl = "http://oapi.nanofintax.com/api/invoice_receive/fp/v1/query?accessToken="; + String tokenUrl = "http://oapi.nanofintax.com/api/getToken"; + String accessKey = "6X3B526P5HqE6ums"; + String accessSecret = "34e5fc32ac894a2ba2ade8c3852c7a0a"; + String taxNo = "91330110MAC5FPUY2U"; + Integer size = 50; + + @Override + public JsonResultEntity getIncomeInvoiceData(JSONObject requestJson) { + //1、调用token + String access_token = getToken(); + if (access_token == null) { + return BaseResult.getFailureMessageEntity("token获取失败"); + } + Date date = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String times = sdf.format(date); + times = "2025-03-25"; + //2、调用接口获取数据 + Integer queryCursor = 1; + JSONArray datalist = new JSONArray(); + sendBusinessData(datalist, access_token, queryCursor,times); + + if(datalist != null && datalist.size() > 0){ + for (int i = 0; i < datalist.size(); i++) { + JSONObject saveData = new JSONObject(); + //3、对照数据 + JSONObject jsonObject = datalist.getJSONObject(i); + //发票号码 + String fphm = jsonObject.getString("fphm"); + if(fphm == null || "".equals(fphm) ){ + continue; + } + saveData.put("fphm",fphm); + //判断是否有这个数据 + List checkData = incomeInvoiceDao.queryData(saveData); + if(checkData != null && checkData.size() > 0){ + continue; + } + saveData.put("id", String.valueOf(UUIDLong.longUUID())); + saveData.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + saveData.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + saveData.put("org_id", "0"); + saveData.put("create_time", new Date()); + saveData.put("modify_time", new Date()); + saveData.put("sts", "Y"); + saveData.put("data_status", "Y");//新增状态 + saveData.put("add_status", "0");//新增状态 + saveData.put("update_status", "1");//修改状态 + saveData.put("delete_status", "1");//删除状态 + ComparisonEntity comparisonEntityRule = new ComparisonEntity(); + comparisonEntityRule.setRulePrefix("FP"); + comparisonEntityRule.setRuleMiddle("%Y-%m-%d"); + comparisonEntityRule.setRuleSuffix(5); + comparisonEntityRule.setDbName("mdm_fp"); + ComparisonEntity comparisonEntityRuleGz = comparisonDao.queryComparisonRule(comparisonEntityRule); + saveData.put("document_rule", comparisonEntityRuleGz.getDocumentRule());//单据规则 + saveData.put("document_rule_num", comparisonEntityRuleGz.getDocumentRuleNum());//单据规则流水号 + + JSONObject content = jsonObject.getJSONObject("content"); + JSONArray detaildata = content.getJSONArray("items"); + if(detaildata != null && detaildata.size() > 0){ + for (int i1 = 0; i1 < detaildata.size(); i1++) { + JSONObject saveDetailData = new JSONObject(); + + saveDetailData.put("id", String.valueOf(UUIDLong.longUUID())); + saveDetailData.put("formmain_id", saveData.getString("id")); + saveDetailData.put("data_status", "Y");//新增状态 + + saveDetailData.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + saveDetailData.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + saveDetailData.put("org_id", "0"); + saveDetailData.put("create_time", new Date()); + saveDetailData.put("modify_time", new Date()); + saveDetailData.put("sts", "Y"); + saveDetailData.put("remark", detaildata.getJSONObject(i1).getString("xmmc")); + incomeInvoiceDao.saveDetailData(saveDetailData); + } + } + incomeInvoiceDao.saveData(saveData); + + //5、保存写入日志 + ControlsLogEntity controlsLogEntity=new ControlsLogEntity(); + controlsLogEntity.setId(UUIDUtils.getUUID()); + controlsLogEntity.setFormmainId(saveData.getString("id")); + controlsLogEntity.setSourceName("数智中台"); + controlsLogEntity.setCode("800004"); + controlsLogEntity.setSourceData(jsonObject.toString()); + controlsLogEntity.setOptionType("接口新增"); + controlsLogEntity.setOptionName("数智中台"); + controlsLogEntity.setDbName("mdm_fp_option_log"); + controlsLogEntity.setDataType("1"); + controlsLogEntity.setCreate_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + controlsLogEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + controlsLogEntity.setOrg_id("0"); + controlsLogEntity.setRemark("插件新增"); + controlsLogDaoimpl.saveControlsLog(saveData.getString("id"), "数智中台", "800004", jsonObject.toJSONString(), "接口新增", "数智中台", "mdm_fp_option_log", "1"); + } + } + return BaseResult.getSuccessMessageEntity("处理成功"); + } + + + /** + * @Author lvleigang + * @Description 获取业务数据 + * @Date 4:31 下午 2025/4/9 + * @param datalist + * @param access_token + * @param queryCursor + * @param dataTime + * @return void + **/ + private void sendBusinessData(JSONArray datalist, String access_token, Integer queryCursor, String dataTime) { + String url = dataUrl+access_token; + JSONObject dayabody = new JSONObject(); + dayabody.put("accessKey",accessKey); + long timestamp = System.currentTimeMillis(); + dayabody.put("timestamp",timestamp); + JSONObject queryParams = new JSONObject(); + queryParams.put("page",queryCursor); + queryParams.put("size",size); + queryParams.put("kprqq",dataTime); + queryParams.put("kprqz",dataTime); + queryParams.put("taxNo",taxNo); + dayabody.put("queryParams",queryParams); + Map parametersMap = new HashMap<>(); + parametersMap.put("accessKey",accessKey); + parametersMap.put("timestamp",timestamp); + String a = YzfSignUtil.signRequest(parametersMap,accessSecret); + dayabody.put("sign",a); + Map headers = new HashMap<>(); + headers.put("Content-Type", "application/json; charset=utf-8"); + String returndata = sendPost(url, headers, dayabody.toJSONString()); + + if (returndata != null && JSONObject.isValidObject(returndata)) { + JSONObject dataJson = JSONObject.parseObject(returndata); + if(dataJson != null && dataJson.getString("code") != null && "0".equals( dataJson.getString("code"))){ + JSONObject data = dataJson.getJSONObject("result"); + if(data != null ){ + JSONArray businessList = data.getJSONArray("data"); + if(data.getInteger("total") > queryCursor*size){ + queryCursor = queryCursor+1; + sendBusinessData(datalist, access_token, queryCursor, dataTime); + } + if(businessList != null && businessList.size() > 0){ + datalist.addAll(businessList); + } + } + } + } + } + private JSONObject getUser(String usercode,String access_token) { + JSONObject jsonObject = new JSONObject(); + String url = "https://swoa.sunwave.com.cn:9999/seeyon/rest/orgMembers/code/"+usercode+"?pageNo=0&pageSize=100"; + Map headers = new HashMap<>(); + headers.put("token",access_token); + + String returndata = sendGet(url, headers); + if (returndata != null && JSONArray.isValidArray(returndata)) { + JSONArray dataJson = JSONObject.parseArray(returndata); + if(dataJson != null && dataJson.size() > 0){ + for (int i = 0; i < dataJson.size(); i++) { + if(dataJson.getJSONObject(i).getString("code") != null && !"".equals(dataJson.getJSONObject(i).getString("code")) + && usercode.toLowerCase().equals(dataJson.getJSONObject(i).getString("code").toLowerCase())){ + jsonObject.put("telNumber",dataJson.getJSONObject(i).getString("telNumber")); + jsonObject.put("orgDepartmentName",dataJson.getJSONObject(i).getString("orgDepartmentName")); + jsonObject.put("orgPostName",dataJson.getJSONObject(i).getString("orgPostName")); + jsonObject.put("name",dataJson.getJSONObject(i).getString("name")); + break; + } + } + } + } + return jsonObject; + } + private String getOAToken(String name) { + String url = "https://swoa.sunwave.com.cn:9999/seeyon/rest/token"; + Map headers = null; + String bodys = "{\"password\":\"64de4de7-23ce-4946-ac91-dd9e322d86e5\",\"userName\":\"beis\",\"loginName\":\""+name+"\"}"; + String tokenData = sendPost(url, headers, bodys); + String access_token = null; + if (tokenData != null && JSONObject.isValidObject(tokenData)) { + JSONObject tokendataJson = JSONObject.parseObject(tokenData); + if (tokendataJson != null && tokendataJson.getString("id") != null) { + access_token = tokendataJson.getString("id"); + } + } + return access_token; + } + /** + * @Author lvleigang + * @Description 获取token + * @Date 4:18 下午 2025/4/9 + * @param + * @return java.lang.String + **/ + private String getToken() { + String url = tokenUrl; + JSONObject tokenJson = new JSONObject(); + tokenJson.put("accessKey",accessKey); + tokenJson.put("accessSecret",accessSecret); + String bodys = tokenJson.toJSONString(); + StringBuilder body = new StringBuilder(); + SSLContext sslContext = null; + try { + sslContext = new SSLContextBuilder() + .loadTrustMaterial(null, TrustAllStrategy.INSTANCE) + .build(); + } catch (Exception e) { + return null; + } + CloseableHttpClient closeableHttpClient = HttpClients.custom() + .setSSLContext(sslContext) + .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + .build(); + + HttpPost post = new HttpPost(url); + CloseableHttpResponse response = null; + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(6000).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + post.setHeader("Content-Type", "application/json; charset=utf-8"); + try { + if (bodys != null && !"".equals(bodys)) { + ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + + HttpEntity entity = response.getEntity(); + body.append(EntityUtils.toString(entity, "UTF-8")); + } catch (Exception e) { + body.append(e.getMessage()); + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + logger.info("token返回结果{}",body); + JSONObject bodyJson = JSONObject.parseObject(body.toString()); + if(bodyJson.getString("code") == null || !"0".equals(bodyJson.getString("code"))){ + return null; + } + JSONObject resultJson = bodyJson.getJSONObject("result"); + if(resultJson == null){ + return null; + } + if(resultJson.getString("accessToken") != null && !"".equals(resultJson.getString("accessToken"))){ + return resultJson.getString("accessToken"); + } + return null; + } + + private String sendPost(String url, Map headers, String bodys) { + logger.info("url:"+url+"。bodys:"+bodys); + + SSLContext sslContext = null; + try { + sslContext = new SSLContextBuilder() + .loadTrustMaterial(null, TrustAllStrategy.INSTANCE) + .build(); + } catch (Exception e) { + + } + CloseableHttpClient closeableHttpClient = HttpClients.custom() + .setSSLContext(sslContext) + .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + .build(); + HttpPost post = new HttpPost(url); + CloseableHttpResponse response = null; + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + try { + if (bodys != null && !"".equals(bodys)) { + ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + HttpEntity entity = response.getEntity(); + body.append(EntityUtils.toString(entity, "UTF-8")); + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body = new StringBuilder(); + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + logger.info("url:"+url+"。bodys:"+bodys+"。body"+body); + + return body.toString(); + } + private String sendGet(String url, Map headers) { + SSLContext sslContext = null; + try { + sslContext = new SSLContextBuilder() + .loadTrustMaterial(null, TrustAllStrategy.INSTANCE) + .build(); + } catch (Exception e) { + + } + CloseableHttpClient closeableHttpClient = HttpClients.custom() + .setSSLContext(sslContext) + .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + .build(); + // HttpClient + HttpGet get = new HttpGet(url); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build(); + get.setConfig(requestConfig);//设置请求参数【超时时间】 + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + get.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + + try { + response = closeableHttpClient.execute(get); + HttpEntity entity = response.getEntity(); + body.append(EntityUtils.toString(entity,"UTF-8")); + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + return body.toString(); + } + + + /** + * seeyon流程事件监听前置方法,绑定数据源 + * @param entity + * @return + * @throws Exception + */ + @Override + public SysExtensionApiEntity setData(SysExtensionApiEntity entity) throws Exception { + try { + JSONObject sendBody = new JSONObject(); + String bodys = entity.getBodys(); + Map headers = entity.getHeaders(); + JSONObject jsonObject = JSONObject.parseObject(bodys); + String loginName = jsonObject.getString("field0002"); + String dataXml = getXml(jsonObject); + //处理xml数据 + String oaToken = getOAToken(loginName); + headers.put("token",oaToken); + sendBody.put("token",oaToken); + sendBody.put("loginName",loginName); + sendBody.put("dataXml",dataXml); + entity.setBodys(sendBody.toJSONString()); + } catch (Exception e) { + e.printStackTrace(); + } + return entity; + } + + private String getXml(JSONObject jsonObject) { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0011") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0001") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0002") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0012") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0013") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0014") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0003") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0015") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0016") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0017") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0018") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0019") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0020") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(jsonObject.getString("field0021") != null?"":""); + stringBuffer.append(""); + stringBuffer.append(""); + //处理明细 + JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("mdm_ccd_detail")); + if(jsonArray != null&& jsonArray.size() > 0){ + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject detailObject = jsonArray.getJSONObject(i); + stringBuffer.append(""); + stringBuffer.append("").append(detailObject.getString("field0004") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("field0005") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("field0022") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("field0006") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("field0007") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("field0008") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("field0009") != null?"":"").append(""); + stringBuffer.append(""); + } + } + stringBuffer.append(""); + return stringBuffer.toString(); + } + + + +} diff --git a/base-buildpackage/src/main/resources/application-llg.yml b/base-buildpackage/src/main/resources/application-llg.yml new file mode 100644 index 00000000..03cdf7ee --- /dev/null +++ b/base-buildpackage/src/main/resources/application-llg.yml @@ -0,0 +1,82 @@ +#######################本地环境####################### +logging: + #日志级别 指定目录级别 + level: + root: info + encodings: UTF-8 + file: + # 日志保存路径 + path: /Users/apple/Desktop/log/local +spring: + data: + mongodb: +# host: 192.168.2.237 +# port: 27017 +# database: businesscenter +# auto-index-creation: true +# password: hzya1314 +# username: hzya + flyway: + # 启动flyway migration, 默认为true + enabled: false + datasource: + dynamic: + druid: + filters: stat,log4j2 + datasource: + master: +# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle +# username: hzyazt +# password: 62e4295b615a30dbf3b8ee96f41c820b +# driver-class-name: dm.jdbc.driver.DmDriver +# type: com.alibaba.druid.pool.DruidDataSource + url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + username: root + password: bd993088e8a7c3dc5f44441617f9b4bf + driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 +# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle +# username: hzyazt +# password: 62e4295b615a30dbf3b8ee96f41c820b +# driver-class-name: dm.jdbc.driver.DmDriver +savefile: + # 文件保存路径 + path: /Users/apple/Desktop/log/local + tomcatpath: /Users/apple/Desktop/log/local + pluginpath: /Users/apple/Desktop/log/local +zt: + url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface +cbs8: + appId: 1P4AGrpz + appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a + url: https://cbs8-openapi-reprd.csuat.cmburl.cn + # 测试用这个 这个是银行给的,和下面的公钥不是一对密钥 + ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44 + # 这个私钥到时候上传到cbs,和下面到是同一对 + #ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46 + ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde + cbs_public_key: 0469146F06BF3B01236E84632441E826 + #电子回单下载临时存放位置 + elec_path: /Users/xiangerlin/Downloads/ +OA: + data_source_code: yc_oa +server: + port: 10086 + +# mysqldump -d mylm -hhzya.ufyct.com -p9096 -uroot -phzya1314 >%dirName%\table_view.sql + + +database: + databaseName: businesscenter + host: 192.168.2.237 + port: 3306 + username: root + password: hzya@1314 + filePase: /Users/apple/Desktop/log + fileName: data.sql +#sftp: +# host: 192.168.2.237 +# port: 9091 +# username: cs237 +# password: hzya@1314 +# filePase: /databaseBack diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/pluginCfg.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/pluginCfg.xml new file mode 100644 index 00000000..4fe837f2 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/pluginCfg.xml @@ -0,0 +1,6 @@ + + +IncomeInvoicePlugin +IncomeInvoicePlugin插件 +202404080001 + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-dao.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-dao.xml new file mode 100644 index 00000000..52a288d1 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-dao.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..07ee22b0 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-service.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..68ce3bce --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java index 6be14686..8761e1ca 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java @@ -66,10 +66,10 @@ public class ZxBankServiceImpl extends BaseService impleme @Value("${zt.url}") private String url; - @Value("${zx.privateKey}") + @Value("${zx.privateKey:}") private String privateKey; - @Value("${zx.publicKey}") + @Value("${zx.publicKey:}") private String publicKey; @Override public JsonResultEntity queryArchives(JSONObject json) { From d748cf982533f176010600e56d4933bf4280df5c Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Thu, 10 Apr 2025 12:19:24 +0800 Subject: [PATCH 14/42] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=8D=95=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-ht.yml | 8 ++ .../src/main/resources/application.yml | 2 +- .../seeyon/invoice/entity/InvoiceState.java | 44 ++++++ .../service/impl/InvoiceServiceImpl.java | 91 ++++++++++++- .../service/impl/ZxBankServiceImpl.java | 127 +++++++++--------- 5 files changed, 210 insertions(+), 62 deletions(-) create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceState.java diff --git a/base-buildpackage/src/main/resources/application-ht.yml b/base-buildpackage/src/main/resources/application-ht.yml index 85d1b848..e56d9538 100644 --- a/base-buildpackage/src/main/resources/application-ht.yml +++ b/base-buildpackage/src/main/resources/application-ht.yml @@ -40,6 +40,14 @@ OA: data_source_code: yc_oa zt: url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface +file_oa: + url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfacefileUpload +#税务pdf附件下载存放路径 +invoice_pdf: + url: D:\yongansystem\invoice\pdf\ +#税务ofd附件下载存放路径 +invoice_ofd: + url: D:\yongansystem\invoice\ofd\ zx: # 测试用这个 这个是银行给的 privateKey: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgtzMo2o6THK3yLIm+83Ch/560+02l2hjjBSFGieWY/Z6gCgYIKoEcz1UBgi2hRANCAATKhwZX4P3XI8vYTKeCOLMVbanUNbaXjrIEZynshwdOzRVgzRQSiPNWo6OBBkAPvqE+2RS+5ABpS82DSlKl81z0 diff --git a/base-buildpackage/src/main/resources/application.yml b/base-buildpackage/src/main/resources/application.yml index b87e5bf7..a0bbeaae 100644 --- a/base-buildpackage/src/main/resources/application.yml +++ b/base-buildpackage/src/main/resources/application.yml @@ -1,5 +1,5 @@ server: - port: 10086 + port: 9999 servlet: context-path: /kangarooDataCenterV3 localIP: 127.0.0.1 diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceState.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceState.java new file mode 100644 index 00000000..38a119ba --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceState.java @@ -0,0 +1,44 @@ +package com.hzya.frame.seeyon.invoice.entity; + +import com.hzya.frame.seeyon.zxbank.entity.PayState; + +public enum InvoiceState { + zero("0","申请单被关闭"), + one("1","申请单开票成功"), + two("2","申请单处理中"), + three("3","申请单开具异常"); + + private String type; + //值 + private String value; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + InvoiceState(String type, String value){ + this.type=type; + this.value=value; + } + + public static String invoiceStateGetValue(String type){ + for (InvoiceState invoiceState : InvoiceState.values()){ + if(invoiceState.getType()==type||invoiceState.getType().equals(type)){ + return invoiceState.getValue().toString(); + } + } + return null; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java index f27b78c5..d176df54 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -10,6 +10,7 @@ import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao; import com.hzya.frame.seeyon.invoice.dao.IInvoiceDetailsDao; import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity; +import com.hzya.frame.seeyon.invoice.entity.InvoiceState; import com.hzya.frame.seeyon.invoice.service.IInvoiceService; import com.hzya.frame.seeyon.util.YzfSignUtil; import com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity; @@ -24,6 +25,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URL; import java.util.*; @Service(value = "InvoiceServiceImpl") @@ -44,6 +50,11 @@ public class InvoiceServiceImpl extends BaseService imple @Value("${zt.url}") private String url; + @Value("${invoice_pdf.url}") + private String invoicePdfUrl; + @Value("${invoice_ofd.url}") + private String invoiceOfdUrl; + @Override public JsonResultEntity queryArchives(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -108,7 +119,7 @@ public class InvoiceServiceImpl extends BaseService imple parametersMap.put("timestamp",timestamp); String sign = YzfSignUtil.signRequest(parametersMap,"34e5fc32ac894a2ba2ade8c3852c7a0a"); JSONObject jsonObject=new JSONObject(); - jsonObject.put("serialNumber",entity.getBusiness_no()); + jsonObject.put("serialNumber",entity.getId()); jsonObject.put("accessKey","6X3B526P5HqE6ums"); jsonObject.put("sign",sign); jsonObject.put("timestamp",timestamp); @@ -123,6 +134,43 @@ public class InvoiceServiceImpl extends BaseService imple execute(). body(); logger.info("=====调用杭泰税务查询申请单详情的返回参数为:{}===========",result); + JSONObject resultJson = JSONObject.parseObject(result); + if (!resultJson.getBoolean("flag")) { + saveTaskLivingDetails(entity.getId(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false,""); + } else { + JSONObject attribute = resultJson.getJSONObject("attribute"); + if("0".equals(attribute.getString("code"))){ + JSONObject jsonResult=JSONObject.parseObject(attribute.getString("result")); + if(null !=jsonResult){ + JSONArray jsonArray = jsonResult.getJSONArray("invoiceInfoVOList"); + if(CollectionUtils.isNotEmpty(jsonArray)){ + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject invoiceInfo = jsonArray.getJSONObject(i); + String invoiceCode = invoiceInfo.getString("invoiceCode");//发票代码 + String invoiceNumber = invoiceInfo.getString("invoiceNumber");//发票号码 + String resultStatus = InvoiceState.invoiceStateGetValue(jsonResult.getString("resultStatus"));//开票结果 + String pdfUrl = invoiceInfo.getString("url");//pdf文件 + String ofdUrl = invoiceInfo.getString("ofdUrl");//ofd文件 + String xmlUrl = invoiceInfo.getString("xmlUrl");//xml文件 + //获取pdf文件到本地 并为pdf取名,否则会报无法访问错误 + logger.info("========开始将pdf文件保存到本地========"); + String pdfFileName = generateFileName(pdfUrl,"pdf"); + String pdfSavePath=invoicePdfUrl+pdfFileName; + downloadPdf(pdfUrl,pdfSavePath); + logger.info("========pdf文件保存到本地完成========"); + File filePdf=new File(pdfSavePath); + //获取ofd文件到本地 + logger.info("========开始将ofd文件保存到本地========"); + String ofdFileName = generateFileName(ofdUrl, "ofd"); + String ofdSavePath = ofdUrl + ofdFileName; + downloadPdf(ofdUrl,ofdSavePath); + logger.info("========ofd文件保存到本地完成========"); + File fileOfd=new File(ofdSavePath); + } + } + } + } + } } }catch (Exception e){ @@ -132,6 +180,47 @@ public class InvoiceServiceImpl extends BaseService imple return null; } + private void downloadPdf(String pdfUrl, String savePath) { + try { + URL url = new URL(pdfUrl); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("Post"); + int responseCode = connection.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + InputStream inputStream = connection.getInputStream(); + FileOutputStream outputStream = new FileOutputStream(savePath); + + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + + outputStream.close(); + inputStream.close(); + } else { + logger.info("下载失败,响应码: {}" , responseCode); + } + connection.disconnect(); + }catch (Exception e){ + logger.info("====查询申请单详情获取税务pdf或ofd文件失败:{}========",e.getMessage()); + e.printStackTrace(); + } + } + + private String generateFileName(String url, String extension) { + // 这里简单根据 URL 的参数生成文件名,你可以根据实际需求调整 + String[] parts = url.split("&"); + String fphm = ""; + for (String part : parts) { + if (part.startsWith("fphm=")) { + fphm = part.substring(5); + break; + } + } + return fphm + "." + extension; + } + private List bindingInvoice(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { List list = new ArrayList<>(); StringBuffer stringBuffer = new StringBuffer(); diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java index 6be14686..6646129b 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java @@ -42,6 +42,7 @@ import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; @@ -66,6 +67,7 @@ public class ZxBankServiceImpl extends BaseService impleme @Value("${zt.url}") private String url; + @Value("${zx.privateKey}") private String privateKey; @@ -349,56 +351,57 @@ public class ZxBankServiceImpl extends BaseService impleme } if (sourceFolder.isFile() && sourceFolder.getName().endsWith(".zip")) { - unzipFile(sourceFolder.getAbsolutePath(), destinationFolder); - - //将pdf文件上传OA - File fileOut = new File(sourceFolder.getAbsolutePath()); - if (fileOut.exists()) { - logger.info("=====开始上传中信司库回单到杭泰OA======"); - JSONObject jsonObject = fileUpload(fileOut); - if (jsonObject.getString("fileUrl") != null) { - //表单的附件字段=ctpAttachment的Sub_reference,表单的Summary_id=ctpAttachment的att_reference - String sub_reference = String.valueOf(UUIDLong.longUUID()); - zxBankEntity.setReceipt(sub_reference); - zxBankEntity.setDataSourceCode("HT-OA"); - zxBankDao.updateElecStatusZX(zxBankEntity); - //根据附件id查询附件业务数据 - String file_url = jsonObject.getString("fileUrl"); - CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity(); - ctpAttachmentEntity.setFile_url(file_url); - String att_reference = zxBankEntity.getSummaryId();//Summary_id - ctpAttachmentEntity.setSub_reference(sub_reference); - ctpAttachmentEntity.setAtt_reference(att_reference); - ctpAttachmentEntity.setDataSourceCode("HT-OA"); - List ctpAttachmentEntities = ctpAttachmentDao.queryCtpAttachment(ctpAttachmentEntity); - //如果没有查询到数据,就新增附件业务,否则更新 - if (ctpAttachmentEntities.size() == 0) { - String category = jsonObject.getString("category"); - String type = jsonObject.getString("type"); - String filename = jsonObject.getString("filename"); - String mime_type = jsonObject.getString("mimeType"); - String attachment_size = jsonObject.getString("size"); - String id = String.valueOf(UUIDLong.longUUID()); - ctpAttachmentEntity.setCategory(category); - ctpAttachmentEntity.setFilename(filename); - ctpAttachmentEntity.setType(type); - ctpAttachmentEntity.setMime_type(mime_type); - ctpAttachmentEntity.setAttachment_size(attachment_size); - ctpAttachmentEntity.setId(id); - ctpAttachmentEntity.setCategory("66"); - ctpAttachmentEntity.setCreatedate(new Date()); + List files = unzipFile(sourceFolder.getAbsolutePath(), destinationFolder); + // 上传 PDF 文件 + for (File pdfFile : files) { + logger.info("pdf文件名称为:{}",pdfFile.getName()); + if (pdfFile.exists()) { + logger.info("=====开始上传中信司库回单到杭泰OA======"); + JSONObject jsonObject = fileUpload(pdfFile); + if (jsonObject.getString("fileUrl") != null) { + //表单的附件字段=ctpAttachment的Sub_reference,表单的Summary_id=ctpAttachment的att_reference + String sub_reference = String.valueOf(UUIDLong.longUUID()); + zxBankEntity.setReceipt(sub_reference); + zxBankEntity.setDataSourceCode("HT-OA"); + zxBankDao.updateElecStatusZX(zxBankEntity); + //根据附件id查询附件业务数据 + String file_url = jsonObject.getString("fileUrl"); + CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity(); + ctpAttachmentEntity.setFile_url(file_url); + String att_reference = zxBankEntity.getSummaryId();//Summary_id + ctpAttachmentEntity.setSub_reference(sub_reference); + ctpAttachmentEntity.setAtt_reference(att_reference); ctpAttachmentEntity.setDataSourceCode("HT-OA"); - ctpAttachmentDao.saveCtpAttachment(ctpAttachmentEntity); - } else { - if (ctpAttachmentEntities.size() > 1) { - throw new BaseSystemException("OA附件业务表中查到多条记录"); + List ctpAttachmentEntities = ctpAttachmentDao.queryCtpAttachment(ctpAttachmentEntity); + //如果没有查询到数据,就新增附件业务,否则更新 + if (ctpAttachmentEntities.size() == 0) { + String category = jsonObject.getString("category"); + String type = jsonObject.getString("type"); + String filename = jsonObject.getString("filename"); + String mime_type = jsonObject.getString("mimeType"); + String attachment_size = jsonObject.getString("size"); + String id = String.valueOf(UUIDLong.longUUID()); + ctpAttachmentEntity.setCategory(category); + ctpAttachmentEntity.setFilename(filename); + ctpAttachmentEntity.setType(type); + ctpAttachmentEntity.setMime_type(mime_type); + ctpAttachmentEntity.setAttachment_size(attachment_size); + ctpAttachmentEntity.setId(id); + ctpAttachmentEntity.setCategory("66"); + ctpAttachmentEntity.setCreatedate(new Date()); + ctpAttachmentEntity.setDataSourceCode("HT-OA"); + ctpAttachmentDao.saveCtpAttachment(ctpAttachmentEntity); + } else { + if (ctpAttachmentEntities.size() > 1) { + throw new BaseSystemException("OA附件业务表中查到多条记录"); + } + //更新数据到OA附件业务表中 + ctpAttachmentDao.updateCtpAttachment(ctpAttachmentEntity); } - //更新数据到OA附件业务表中 - ctpAttachmentDao.updateCtpAttachment(ctpAttachmentEntity); + logger.info("=====电子回单执行完毕======="); } - logger.info("=====电子回单执行完毕======="); + pdfFile.delete(); } - fileOut.delete(); } } } @@ -469,29 +472,33 @@ public class ZxBankServiceImpl extends BaseService impleme return "unknown.zip"; } - private void unzipFile(String zipFilePath, String destinationFolderPath) { - try (FileInputStream fis = new FileInputStream(zipFilePath); - ZipInputStream zis = new ZipInputStream(fis)) { - - ZipEntry zipEntry = zis.getNextEntry(); - while (zipEntry != null) { - if (zipEntry.getName().endsWith(".pdf")) { - String pdfFilePath = destinationFolderPath + zipEntry.getName();//File.separator:文件路径中增加一个斜杠 - try (FileOutputStream fos = new FileOutputStream(pdfFilePath)) { + private List unzipFile(String zipFilePath, String destinationFolderPath) { + List pdfFiles = new ArrayList<>(); + try (ZipFile zipFile = new ZipFile(zipFilePath)) { + Enumeration entries = zipFile.entries(); + while (entries.hasMoreElements()) { + ZipEntry entry = entries.nextElement(); + File outputFile = new File(destinationFolderPath, entry.getName()); + if (entry.isDirectory()) { + outputFile.mkdirs(); + } else { + try (InputStream inputStream = zipFile.getInputStream(entry); + OutputStream outputStream = new FileOutputStream(outputFile)) { byte[] buffer = new byte[4096]; int bytesRead; - while ((bytesRead = zis.read(buffer)) != -1) { - fos.write(buffer, 0, bytesRead); + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); } } - logger.info("已提取 PDF 文件:{} " ,pdfFilePath); + if (outputFile.getName().endsWith(".pdf")) { + pdfFiles.add(outputFile); + } } - zis.closeEntry(); - zipEntry = zis.getNextEntry(); } } catch (IOException e) { e.printStackTrace(); } + return pdfFiles; } From dd600042c057607eec44f023bf8de9277c727560 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 10 Apr 2025 17:04:00 +0800 Subject: [PATCH 15/42] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E6=96=99?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/IncomeInvoiceEntity.xml | 65 ++++++++++++++++++- .../impl/IncomeInvoiceServiceImpl.java | 34 +++++++++- 2 files changed, 96 insertions(+), 3 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml index 219ac58a..76c3f17e 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml @@ -32,6 +32,27 @@ company_id , fphm , + fpdm , + kprq , + xfsh , + xfmc , + gfsh , + gfmc , + hjje , + hjse , + jshj , + jym , + xfdzdh , + xfyhzh , + gfdzdh , + gfyhzh , + mmq , + bz , + jqbh , + jdhm , + kpr , + skr , + fhr , @@ -55,6 +76,27 @@ #{company_id} , #{fphm} , + #{fpdm} , + #{kprq} , + #{xfsh} , + #{xfmc} , + #{gfsh} , + #{gfmc} , + #{hjje} , + #{hjse} , + #{jshj} , + #{jym} , + #{xfdzdh} , + #{xfyhzh} , + #{gfdzdh} , + #{gfyhzh} , + #{mmq} , + #{bz} , + #{jqbh} , + #{jdhm} , + #{kpr} , + #{skr} , + #{fhr} , @@ -76,6 +118,17 @@ company_id , remark , + xh , + ssflbm , + xmmc , + ggxh , + dw , + sl , + dj , + je , + slv , + se , + @@ -95,8 +148,16 @@ #{company_id} , #{remark} , - - + #{xh} , + #{ssflbm} , + #{xmmc} , + #{ggxh} , + #{dw} , + #{sl} , + #{dj} , + #{je} , + #{slv} , + #{se} , ) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index 01861c17..2d4c6c0e 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -113,6 +113,28 @@ public class IncomeInvoiceServiceImpl extends BaseService 0){ @@ -129,7 +151,17 @@ public class IncomeInvoiceServiceImpl extends BaseService Date: Fri, 11 Apr 2025 11:25:40 +0800 Subject: [PATCH 16/42] =?UTF-8?q?=E8=B5=84=E9=87=91=E5=BD=92=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/plugin/zxBank/dao/IZjgjDao.java | 12 +++ .../plugin/zxBank/dao/impl/ZjgjDaoImpl.java | 15 +++ .../plugin/zxBank/entity/ZjgjEntity.java | 11 +++ .../frame/plugin/zxBank/entity/ZjgjEntity.xml | 0 .../zxBank/plugin/ZjgjPluginInitializer.java | 97 +++++++++++++++++++ .../plugin/zxBank/service/IZjgjService.java | 12 +++ .../zxBank/service/impl/ZjgjServiceImpl.java | 19 ++++ 7 files changed, 166 insertions(+) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/IZjgjDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/impl/ZjgjDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZjgjPluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/IZjgjService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/impl/ZjgjServiceImpl.java diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/IZjgjDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/IZjgjDao.java new file mode 100644 index 00000000..4dc50e3a --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/IZjgjDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.zxBank.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.zxBank.entity.ZjgjEntity; + +/** + * @Description 资金归集 + * @Author xiangerlin + * @Date 2025/4/11 11:07 + **/ +public interface IZjgjDao extends IBaseDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/impl/ZjgjDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/impl/ZjgjDaoImpl.java new file mode 100644 index 00000000..71655a29 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/impl/ZjgjDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.zxBank.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.zxBank.dao.IZjgjDao; +import com.hzya.frame.plugin.zxBank.entity.ZjgjEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description 资金归集 + * @Author xiangerlin + * @Date 2025/4/11 11:07 + **/ +@Repository() +public class ZjgjDaoImpl extends MybatisGenericDao implements IZjgjDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.java new file mode 100644 index 00000000..3df95f41 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.java @@ -0,0 +1,11 @@ +package com.hzya.frame.plugin.zxBank.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description 资金归集 + * @Author xiangerlin + * @Date 2025/4/11 11:04 + **/ +public class ZjgjEntity extends BaseEntity { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.xml new file mode 100644 index 00000000..e69de29b diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZjgjPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZjgjPluginInitializer.java new file mode 100644 index 00000000..80ff4468 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZjgjPluginInitializer.java @@ -0,0 +1,97 @@ +package com.hzya.frame.plugin.zxBank.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @Description 资金归集审批结果通知司库 + * @Author xiangerlin + * @Date 2025/4/11 09:48 + **/ +public class ZjgjPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + /**** + * 插件销毁方法 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + /**** + * 插件的ID + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginId() { + return "ZjgjPluginInitializer"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "OA资金归集审批结果回传司库"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "OA资金归集审批结果回传司库"; + } + + /*** + * 插件类型 1、场景插件 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 14:01 + * @Param [] + * @return java.lang.String + **/ + @Override + public String getPluginType() { + return "1"; + } + + /*** + * 执行业务代码 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-07 11:20 + * @param requestJson 执行业务代码的参数 + * @return void + **/ + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + logger.info("======开始执OA资金归集审批结果回传司库插件======"); + + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/IZjgjService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/IZjgjService.java new file mode 100644 index 00000000..a42a2557 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/IZjgjService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.zxBank.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.zxBank.entity.ZjgjEntity; + +/** + * @Description 资金归集 + * @Author xiangerlin + * @Date 2025/4/11 11:03 + **/ +public interface IZjgjService extends IBaseService { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/impl/ZjgjServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/impl/ZjgjServiceImpl.java new file mode 100644 index 00000000..a257f567 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/impl/ZjgjServiceImpl.java @@ -0,0 +1,19 @@ +package com.hzya.frame.plugin.zxBank.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.zxBank.entity.ZjgjEntity; +import com.hzya.frame.plugin.zxBank.service.IZjgjService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.stereotype.Service; + +/** + * @Description + * @Author xiangerlin + * @Date 2025/4/11 11:04 + **/ +@Service +public class ZjgjServiceImpl extends BaseService implements IZjgjService { + Logger logger = LogManager.getLogger(getClass()); + +} From 4cdd7a2625b7d85f86a85da8c56f4c12ef7f00d6 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 11 Apr 2025 11:26:02 +0800 Subject: [PATCH 17/42] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=9B=91=E5=90=AC=E8=B0=83=E7=94=A8=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SeeYonInterFaceImpl.java | 65 +++++++------------ 1 file changed, 25 insertions(+), 40 deletions(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java index b2e196b3..619d0eca 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java @@ -23,6 +23,7 @@ import com.hzya.frame.util.PluginUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -495,64 +496,48 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { throw new BaseSystemException("根据formID:" + formAppId + "eventType:"+eventType+"未查询到API配置"); } SysApplicationApiEntity sysApp = applist.get(0); + //数据源配置 + SysApplicationDatabaseEntity sysApiDatabase = new SysApplicationDatabaseEntity(); + sysApiDatabase.setAppId(sysApp.getAppId()); + List apiDataBaseList = sysApplicationDatabaseDao.queryDSBase(sysApiDatabase); + if (CollectionUtils.isNotEmpty(apiDataBaseList) && apiDataBaseList.size() == 1){ + sysApiDatabase = apiDataBaseList.get(0); + } JSONArray headerArray = JSONArray.parseArray(sysApp.getHeaderIn()); + Map headerMap = new HashMap<>(); if (null != headerArray && headerArray.size() > 0) { - String plugId = null; for (int i = 0; i < headerArray.size(); i++) { JSONObject querys = headerArray.getJSONObject(i); //query 只有基本类型,不用循环判断下级 //判断参数是否有值 //获取对象下面的层级数据 String parameterName = querys.getString("parameterName"); - if (null != parameterName && "plugId".equals(parameterName)) { - plugId = querys.getString("example"); - break; - } + String example = querys.getString("example"); + headerMap.put(parameterName,example); } - if (null == plugId) { + if (headerMap.isEmpty()){ throw new BaseSystemException("根据formID:" + formAppId + "未获取到head参数"); - } else { - PluginBaseEntity pluginBaseEntity = null; - JsonResultEntity result; - pluginBaseEntity = PluginUtils.getPluginsById(plugId); - if (null == pluginBaseEntity) { - throw new BaseSystemException("根据ID获取插件错误!请传入正确的 pluginId"); - } else { - //执行业务逻辑代码 - JSONObject reqJson = new JSONObject(); - reqJson.put("jsonStr",jsonStr); - reqJson.put("formAppId",formAppId); - reqJson.put("eventType",eventType); - result = pluginBaseEntity.executeBusiness(reqJson); - return result; - } } - - + PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(headerMap.get("plugId")); + if (null == pluginBaseEntity) { + throw new BaseSystemException("根据ID获取插件错误!请传入正确的 pluginId"); + } + //执行业务逻辑代码 + JSONObject reqJson = new JSONObject(); + reqJson.put("jsonStr",jsonStr); + reqJson.put("formAppId",formAppId); + reqJson.put("eventType",eventType); + reqJson.put("headers",JSON.toJSONString(headerMap)); + reqJson.put("apiDataSourceCode",sysApiDatabase.getSourceCode()); + JsonResultEntity result = pluginBaseEntity.executeBusiness(reqJson); + return result; } else { throw new BaseSystemException("根据formID:" + formAppId + "未获取到head参数"); } - - -// Map headerMap = MapBuilder.create(true) -// .put("apiCode", String.valueOf(sysApp.getApiCode())) -// //这里用中台做为发送方 -// .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") -// .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") -// .put("appId",String.valueOf(sysApp.getAppCode())) -// .build(); -// String body = HttpRequest.post("http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body(); -// logger.info("调用中台返回的参数:{}",body); -// return body; } - }else{ - // StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType) - logger.info("jsonStr,formAppId,eventType为空!执行错误"+jsonStr+formAppId+eventType); - throw new BaseSystemException("jsonStr,formAppId,eventType为空!执行错误"); } return null; } - @Override public JsonResultEntity chengeBody(JSONObject object) throws Exception { JSONObject jsonstr = object.getJSONObject("jsonStr"); From 8487a73d450765227497f0b34e0774e20bf593bc Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 11 Apr 2025 14:25:24 +0800 Subject: [PATCH 18/42] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E6=96=99?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IncomeInvoiceServiceImpl.java | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index 2d4c6c0e..dfbdb947 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -82,6 +82,8 @@ public class IncomeInvoiceServiceImpl extends BaseService 0){ for (int i1 = 0; i1 < detaildata.size(); i1++) { @@ -208,8 +210,8 @@ public class IncomeInvoiceServiceImpl extends BaseService parametersMap = new HashMap<>(); From 3eee98f14216d2b794ee2ff9e7fe624bfe687f0c Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 11 Apr 2025 15:33:30 +0800 Subject: [PATCH 19/42] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E6=96=99?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IncomeInvoiceServiceImpl.java | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index dfbdb947..d950e050 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -240,30 +240,7 @@ public class IncomeInvoiceServiceImpl extends BaseService headers = new HashMap<>(); - headers.put("token",access_token); - String returndata = sendGet(url, headers); - if (returndata != null && JSONArray.isValidArray(returndata)) { - JSONArray dataJson = JSONObject.parseArray(returndata); - if(dataJson != null && dataJson.size() > 0){ - for (int i = 0; i < dataJson.size(); i++) { - if(dataJson.getJSONObject(i).getString("code") != null && !"".equals(dataJson.getJSONObject(i).getString("code")) - && usercode.toLowerCase().equals(dataJson.getJSONObject(i).getString("code").toLowerCase())){ - jsonObject.put("telNumber",dataJson.getJSONObject(i).getString("telNumber")); - jsonObject.put("orgDepartmentName",dataJson.getJSONObject(i).getString("orgDepartmentName")); - jsonObject.put("orgPostName",dataJson.getJSONObject(i).getString("orgPostName")); - jsonObject.put("name",dataJson.getJSONObject(i).getString("name")); - break; - } - } - } - } - return jsonObject; - } private String getOAToken(String name) { String url = "https://swoa.sunwave.com.cn:9999/seeyon/rest/token"; Map headers = null; From c0125b7903c0c22456211a4b89a4b43ecf59a2ef Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 15 Apr 2025 09:15:52 +0800 Subject: [PATCH 20/42] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E6=96=99?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IncomeInvoiceServiceImpl.java | 217 +++++++++++++----- 1 file changed, 160 insertions(+), 57 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index d950e050..6b45519c 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -242,9 +242,9 @@ public class IncomeInvoiceServiceImpl extends BaseService headers = null; - String bodys = "{\"password\":\"64de4de7-23ce-4946-ac91-dd9e322d86e5\",\"userName\":\"beis\",\"loginName\":\""+name+"\"}"; + String bodys = "{\"password\":\"a5ce21b8-91db-4cec-b3e3-3e44719655fd\",\"userName\":\"hzyaRest\",\"loginName\":\""+name+"\"}"; String tokenData = sendPost(url, headers, bodys); String access_token = null; if (tokenData != null && JSONObject.isValidObject(tokenData)) { @@ -451,7 +451,7 @@ public class IncomeInvoiceServiceImpl extends BaseService headers = entity.getHeaders(); JSONObject jsonObject = JSONObject.parseObject(bodys); - String loginName = jsonObject.getString("field0002"); + String loginName = "hzya"; String dataXml = getXml(jsonObject); //处理xml数据 String oaToken = getOAToken(loginName); @@ -468,67 +468,170 @@ public class IncomeInvoiceServiceImpl extends BaseService"); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0011") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0001") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0002") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0012") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0013") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0014") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0003") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0015") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0016") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0017") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0018") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0019") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0020") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - stringBuffer.append(jsonObject.getString("field0021") != null?"":""); - stringBuffer.append(""); - stringBuffer.append(""); - //处理明细 - JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("mdm_ccd_detail")); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("fpdm") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("fphm") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("kprq") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("xfsh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("xfmc") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("gfsh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("gfmc") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("hjje") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("hjse") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("jshj") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("jym") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("xfdzdh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("xfyhzh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("gfdzdh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("gfyhzh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("bz") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("jqbh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("jdhm") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("kpr") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("skr") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("fhr") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("htbm") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("fpwj") != null?"":""); + stringBuffer.append("").append(""); + + + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + + JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("mdm_fp_detail")); if(jsonArray != null&& jsonArray.size() > 0){ for (int i = 0; i < jsonArray.size(); i++) { JSONObject detailObject = jsonArray.getJSONObject(i); stringBuffer.append(""); - stringBuffer.append("").append(detailObject.getString("field0004") != null?"":"").append(""); - stringBuffer.append("").append(detailObject.getString("field0005") != null?"":"").append(""); - stringBuffer.append("").append(detailObject.getString("field0022") != null?"":"").append(""); - stringBuffer.append("").append(detailObject.getString("field0006") != null?"":"").append(""); - stringBuffer.append("").append(detailObject.getString("field0007") != null?"":"").append(""); - stringBuffer.append("").append(detailObject.getString("field0008") != null?"":"").append(""); - stringBuffer.append("").append(detailObject.getString("field0009") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("xh") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("ssflbm") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("xmmc") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("ggxh") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("dw") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("sl") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("dj") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("je") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("slv") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("se") != null?"":"").append(""); stringBuffer.append(""); } } - stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + return stringBuffer.toString(); } From b6334bba1a80245d14fa7b2fc4bd2ddf3505e0ec Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 15 Apr 2025 14:24:43 +0800 Subject: [PATCH 21/42] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E6=96=99?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index beb4c48e..1171b1c2 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -473,6 +473,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { //查询主数据 MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity(); + queryMdmModuleEntity.setMdmCode(10050L); queryMdmModuleEntity.setSts("Y"); List mdmModuleEntities = mdmModuleDao.queryBase(queryMdmModuleEntity); if(mdmModuleEntities == null || mdmModuleEntities.size() == 0){ From 75bb5f87ad6b55c742c77fae63855a5a7db6b612 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 15 Apr 2025 14:48:09 +0800 Subject: [PATCH 22/42] =?UTF-8?q?=E5=A2=9E=E5=8A=A0xml=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/plugin/zxBank/entity/ZjgjEntity.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.xml index e69de29b..fc6e9287 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.xml +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + From 103b9c29813da9cf3b2a9be1e12186dbeb3e3d1b Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 15 Apr 2025 16:37:23 +0800 Subject: [PATCH 23/42] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/IIncomeInvoiceDao.java | 8 +++ .../dao/impl/IncomeInvoiceDaoImpl.java | 24 +++++++ .../entity/IncomeInvoiceEntity.java | 64 ++++++++++++++++++- .../entity/IncomeInvoiceEntity.xml | 51 +++++++++++++++ .../impl/IncomeInvoiceServiceImpl.java | 21 ++++++ .../plugin/MdmModulePluginInitializer.java | 45 +++++++++---- .../impl/SysApplicationServiceImpl.java | 10 ++- 7 files changed, 207 insertions(+), 16 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java index 54190fe9..512d1a80 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java @@ -20,5 +20,13 @@ public interface IIncomeInvoiceDao extends IBaseDao int saveDetailData(JSONObject saveDetailData); int saveData(JSONObject saveData); + + List queryOaZb(IncomeInvoiceEntity incomeInvoiceEntity); + + List queryOaMx(IncomeInvoiceEntity incomeInvoiceEntity); + + int updateMx(IncomeInvoiceEntity incomeInvoiceEntity); + + int saveMx(IncomeInvoiceEntity incomeInvoiceEntity); } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java index fa68e930..cc17e4a1 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java @@ -1,6 +1,7 @@ package com.hzya.frame.plugin.incomeInvoiceData.dao.impl; import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; import com.hzya.frame.basedao.dao.MybatisGenericDao; import com.hzya.frame.plugin.incomeInvoiceData.dao.IIncomeInvoiceDao; import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity; @@ -28,5 +29,28 @@ public class IncomeInvoiceDaoImpl extends MybatisGenericDao queryOaZb(IncomeInvoiceEntity entity) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryOaZb", entity); + return o; + } + @DS("#entity.dataSourceCode") + @Override + public List queryOaMx(IncomeInvoiceEntity entity) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryOaMx", entity); + return o; + } + @DS("#entity.dataSourceCode") + @Override + public int updateMx(IncomeInvoiceEntity entity) { + return super.update(getSqlIdPrifx() + "updateMx", entity); + } + @DS("#entity.dataSourceCode") + @Override + public int saveMx(IncomeInvoiceEntity entity) { + return super.insert(getSqlIdPrifx() + "saveMx", entity); + } } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java index a4d160c0..71fb1e71 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java @@ -7,8 +7,70 @@ import com.hzya.frame.web.entity.BaseEntity; * @since 2024-06-21 13:52:35 */ public class IncomeInvoiceEntity extends BaseEntity { - + + private Integer data_id; + private Integer formmain_id; + private String field0127; + private String field0128; + private String field0129; + private String field0130; + private String field0003; + public Integer getData_id() { + return data_id; + } + + public void setData_id(Integer data_id) { + this.data_id = data_id; + } + + public Integer getFormmain_id() { + return formmain_id; + } + + public void setFormmain_id(Integer formmain_id) { + this.formmain_id = formmain_id; + } + + public String getField0127() { + return field0127; + } + + public void setField0127(String field0127) { + this.field0127 = field0127; + } + + public String getField0128() { + return field0128; + } + + public void setField0128(String field0128) { + this.field0128 = field0128; + } + + public String getField0129() { + return field0129; + } + + public void setField0129(String field0129) { + this.field0129 = field0129; + } + + public String getField0130() { + return field0130; + } + + public void setField0130(String field0130) { + this.field0130 = field0130; + } + + public String getField0003() { + return field0003; + } + + public void setField0003(String field0003) { + this.field0003 = field0003; + } } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml index 76c3f17e..7cde37a3 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml @@ -162,6 +162,57 @@ ) + + + + + update formson_0702 set + + field0127 = #{field0127}, + field0128 = #{field0128}, + field0129 = #{field0129}, + field0130 = #{field0130}, + + where id = #{data_id} + + + + insert into formson_0702( + + id , + formmain_id , + field0127 , + field0128 , + field0129 , + field0130 , + + + )values( + + #{data_id} , + #{formmain_id} , + #{field0127} , + #{field0128} , + #{field0129} , + #{field0130} , + + ) + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index 6b45519c..f7dc1424 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -460,6 +460,27 @@ public class IncomeInvoiceServiceImpl extends BaseService list = incomeInvoiceDao.queryOaZb(incomeInvoiceEntity); + if(list != null && list.size() == 1){ + incomeInvoiceEntity.setFormmain_id(list.get(0).getData_id()); + } + List mxlist = incomeInvoiceDao.queryOaMx(incomeInvoiceEntity); + if(mxlist != null && mxlist.size() == 1){ + incomeInvoiceEntity.setData_id(mxlist.get(0).getData_id()); + incomeInvoiceDao.updateMx(incomeInvoiceEntity); + } + if(mxlist == null || mxlist.size() == 0){ + incomeInvoiceEntity.setData_id(1); + incomeInvoiceDao.saveMx(incomeInvoiceEntity); + } } catch (Exception e) { e.printStackTrace(); } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index 1171b1c2..f79b7098 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -470,7 +470,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { } } }else {//执行正常下发 - + logger.info("==========开始执行正常主数据下发============="); //查询主数据 MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity(); queryMdmModuleEntity.setMdmCode(10050L); @@ -510,13 +510,17 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { queryFildRule.setRuleCode("service"); List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule); - //新增 - doAdd(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); - //修改 - doUpdate(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); - //删除 - doDelete(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); - + if(mdmModuleEntities.get(i).getMdmCode()!= 10045L){ + //新增 + doAdd(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + //修改 + doUpdate(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + //删除 + doDelete(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + }else{ + logger.info("主数据编码为10045,已经在业务数据下发执行,主数据下发不执行"); + continue; + } } } @@ -740,7 +744,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map1.put("tableName",mainDb); //map1.put("dataStatus", "F"); map1.put("updateStatus", "0"); - map1.put("size", 50); + //map1.put("size", 50); objects = mdmModuleDao.queryMdmSTs(map1); objects = toLowerCaseKeys(objects); @@ -828,6 +832,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { /** body */ String bodys = doObjects.get(i).toJSONString(); if(scriptEntity != null && scriptEntity.getId() != null ){ + logger.info("=========开始执行正常主数据修改下发脚本,第一次=============="); groovy.put("code",scriptEntity.getScriptCode()); groovy.put("className",scriptEntity.getClassName()); groovy.put("name",scriptEntity.getScriptName()); @@ -855,6 +860,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { headers.putAll(header); } if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) { + logger.info("=========正常主数据修改开始执行登录接口=============="); //找到登陆接口 SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); if (null == loginApi) { @@ -875,12 +881,15 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { continue; } JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + logger.info("=======主数据正常修改下发登录返回数据:{}========",attritube.toJSONString()); querys = getQuery(apiEntity,querys,attritube); headers = getHeaders(apiEntity,headers,attritube); bodys = getBodys(apiEntity,bodys,attritube); } //组装数据发送 + logger.info("=========开始执行主业务修改数据下发脚本,第二次=============="); JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + logger.info("=====主数据修改下发返回结果为:{}",JSONObject.parseObject(jsonResultEntity.getAttribute().toString()).toJSONString()); if(jsonResultEntity.isFlag()){ //保存日志 saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); @@ -912,7 +921,8 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { * @param mdmModuleDistributeEntities * @return void **/ - private void doAdd(String mdmId,Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities,List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities ) throws Exception { + private void + doAdd(String mdmId,Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities,List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities ) throws Exception { //查询一千条数据 String mainDb = null; List objects = new ArrayList<>(); @@ -928,7 +938,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map1.put("tableName",mainDb); //map1.put("dataStatus", "Y"); map1.put("addStatus", "0"); - map1.put("size", 50); + //map1.put("size", 50); objects = mdmModuleDao.queryMdmSTs(map1); objects = toLowerCaseKeys(objects); @@ -1000,6 +1010,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { mdmModuleSendLogEntity.setOptionType("1"); Integer num = mdmModuleSendLogDao.getCount(mdmModuleSendLogEntity); if(num > 0){//已经新增过不发送 + objects.get(i).put("sendsanfzt123",true); continue; } getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); @@ -1030,6 +1041,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { /** body */ String bodys = doObjects.get(i).toJSONString(); if(scriptEntity != null && scriptEntity.getId() != null ){ + logger.info("=========开始执行正常主数据新增下发脚本,第一次=============="); groovy.put("code",scriptEntity.getScriptCode()); groovy.put("className",scriptEntity.getClassName()); groovy.put("name",scriptEntity.getScriptName()); @@ -1057,6 +1069,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { headers.putAll(header); } if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) { + logger.info("=========正常主数据新增开始执行登录接口=============="); //找到登陆接口 SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); if (null == loginApi) { @@ -1077,15 +1090,19 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { continue; } JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + logger.info("=======主数据正常新增下发登录返回数据:{}========",attritube.toJSONString()); querys = getQuery(apiEntity,querys,attritube); headers = getHeaders(apiEntity,headers,attritube); bodys = getBodys(apiEntity,bodys,attritube); } //组装数据发送 + logger.info("=========开始执行主业务新增数据下发脚本,第二次=============="); JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + logger.info("=====主数据新增下发返回结果为:{}",JSONObject.parseObject(jsonResultEntity.getAttribute().toString()).toJSONString()); if(jsonResultEntity.isFlag()){ if (scriptEntity != null && scriptEntity.getId() != null && scriptEntity.getBackScriptData() != null ) { + logger.info("=========开始执行主数据新增返回脚本=============="); JSONObject backScriptJson = new JSONObject(); backScriptJson.put("data", jsonResultEntity.getAttribute()); groovy.put("code", scriptEntity.getScriptCode()+"back"); @@ -1125,11 +1142,13 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { //保存日志 saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); objects.get(i).put("sendsanfzt123",true); + logger.info("========主数据新增下发完成,日志保存为成功============"); continue; }else { //保存日志 saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); objects.get(i).put("sendsanfzt123",false); + logger.info("========主数据新增下发完成,日志保存为失败============"); continue; } } @@ -1137,7 +1156,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { //所有下发发送完成,修改数据状态 for (int i = 0; i < objects.size(); i++) { - if(objects.get(i).getBoolean("sendsanfzt123")){ + if(objects.get(i).getString("sendsanfzt123") != null && objects.get(i).getBoolean("sendsanfzt123")){ Map updateMap = new HashMap<>(); updateMap.put("tableName",mainDb); //updateMap.put("dataStatus", "Y"); @@ -1491,4 +1510,4 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { } return jsonObjects; } -} +} \ No newline at end of file diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index ad9976a0..caf670cc 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -3055,8 +3055,13 @@ public class SysApplicationServiceImpl extends BaseService Date: Wed, 16 Apr 2025 09:23:54 +0800 Subject: [PATCH 24/42] =?UTF-8?q?=E7=A8=8E=E5=8A=A1=E5=BC=80=E7=A5=A8?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=92=8C=E6=9F=A5=E8=AF=A2=E5=BC=80=E7=A5=A8?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InvoiceDistributePluginInitializer.java | 1550 +++++++++++++++++ .../QueryInvoiceResultPluginInitializer.java | 58 + .../ht/spring/spring-buildpackage-plugin.xml | 4 +- .../frame/seeyon/invoice/dao/IInvoiceDao.java | 30 + .../invoice/dao/impl/InvoiceDaoImpl.java | 18 + .../seeyon/invoice/entity/InvoiceEntity.java | 10 + .../seeyon/invoice/entity/InvoiceEntity.xml | 21 + .../service/impl/InvoiceServiceImpl.java | 132 +- .../hzya/frame/seeyon/util/OARestUtil.java | 18 +- .../service/impl/ZxBankServiceImpl.java | 6 +- 10 files changed, 1817 insertions(+), 30 deletions(-) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInvoiceResultPluginInitializer.java diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java new file mode 100644 index 00000000..14fc3fe7 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java @@ -0,0 +1,1550 @@ +package com.hzya.frame.plugin.ht.plugin; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; +import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; +import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao; +import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; +import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; +import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.mdm.mdmModuleDistributeTripartite.dao.IMdmModuleDistributeTripartiteDao; +import com.hzya.frame.mdm.mdmModuleDistributeTripartite.entity.MdmModuleDistributeTripartiteEntity; +import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao; +import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; +import com.hzya.frame.mdm.service.IMdmServiceCache; +import com.hzya.frame.sys.sysenum.SysEnum; +import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; +import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; +import com.hzya.frame.sysnew.application.dao.ISysApplicationDao; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.application.script.dao.ISysApplicationScriptDao; +import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity; +import com.hzya.frame.sysnew.grovy.service.IGroovyIntegrationService; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.http.HttpEntity; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.*; + +public class InvoiceDistributePluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + + @Resource + private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao; + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Resource + private ISysApplicationApiDao sysApplicationApiDao; + @Resource + private ISysApplicationDao sysApplicationDao; + @Resource + private ISysApplicationScriptDao sysApplicationScriptDao; + @Resource + private IMdmModuleDistributeDao mdmModuleDistributeDao; + @Resource + private IGroovyIntegrationService groovyIntegrationService; + @Resource + private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao; + @Resource + private IMdmModuleDao mdmModuleDao; + @Resource + private IMdmServiceCache mdmServiceCache; + @Resource + private IMdmModuleSendLogDao mdmModuleSendLogDao; + @Resource + private IMdmModuleDistributeTripartiteDao mdmModuleDistributeTripartiteDao; + @Value("${zt.url}") + private String url ; + + private final Object lock = new Object(); + + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + /**** + * 插件销毁方法 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + /**** + * 插件的ID + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginId() { + return "InvoiceDistributePluginInitializer"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "蓝字发票申请单申请下发"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "蓝字发票申请单申请下发"; + } + + /*** + * 插件类型 1、场景插件 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 14:01 + * @Param [] + * @return java.lang.String + **/ + @Override + public String getPluginType() { + return "1"; + } + + /*** + * 执行业务代码 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-07 11:20 + * @param requestJson 执行业务代码的参数 + * @return void + **/ + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + try{ + //重试方法 + if (null != requestJson) { + //如果这个id不为空,说明是重试的 + String id = requestJson.getString("integration_task_living_details_id"); + //执行重新发送 + if (StrUtil.isNotEmpty(id)) { + //查询日志表 + IntegrationTaskLivingDetailsEntity taskDetailEntity = taskLivingDetailsService.get(id); + if (null != taskDetailEntity && JSONUtil.isTypeJSON(taskDetailEntity.getRootAppPk())){ + //拿到这张表的源系统ID + JSONObject jsonObject = JSONObject.parseObject(taskDetailEntity.getRootAppPk()); + Long mdmCode = jsonObject.getLong("mdmCode");//主数据编码 + String documentRule = jsonObject.getString("documentRule");//行数据的单据规则编码 + String distributeId = jsonObject.getString("distributeId");//发送表id + String type = jsonObject.getString("type");//发送类型,1、新增2、修改3、删除 + if(mdmCode == null || documentRule == null || distributeId == null || type == null + || "".equals(mdmCode) || "".equals(documentRule) || "".equals(distributeId) || "".equals(type)){ + taskDetailEntity.setResult("系统保存参数错误"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("系统保存参数错误"); + } + String apiId = null; + String scriptId = null; + //查找对应数据,组装数据发送 + + //获取主数据信息 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(mdmCode); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null ){ + taskDetailEntity.setResult("主数据不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("主数据不存在"); + + } + + //获取主数据db + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0){ + taskDetailEntity.setResult("主数据数据源不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("主数据数据源不存在"); + + } + + //获取分发表 + //获取分发的接口 + MdmModuleDistributeEntity mdmModuleDistributeEntity = mdmModuleDistributeDao.get(distributeId); + if(mdmModuleDistributeEntity == null || mdmModuleDistributeEntity.getId() == null ){ + taskDetailEntity.setResult("分发不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("分发不存在"); + + } + // 启用停用 0、停用 + if("0".equals(mdmModuleDistributeEntity.getEnabledState())){ + taskDetailEntity.setResult("分发已停用"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("分发已停用"); + + } + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(distributeId); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + + // 启用停用 0、停用 + //if("1".equals(mdmModuleDistributeEntity.getEnabledType())){ + // taskDetailEntity.setResult("分发为手动下发"); + // taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + // return BaseResult.getFailureMessageEntity("分发为手动下发"); + //} + //1、新增2、修改3、删除 + if("1".equals(type)){ + apiId = mdmModuleDistributeEntity.getAddApi(); + scriptId = mdmModuleDistributeEntity.getAddScript(); + }else if("2".equals(type)){ + apiId = mdmModuleDistributeEntity.getUpdateApi(); + scriptId = mdmModuleDistributeEntity.getUpdateScript(); + + }else if("3".equals(type)){ + apiId = mdmModuleDistributeEntity.getDeleteApi(); + scriptId = mdmModuleDistributeEntity.getDeleteScript(); + } + if(apiId == null || "".equals(apiId)){ + taskDetailEntity.setResult("分发接口未选择,请先选择"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("分发接口未选择,请先选择"); + + } + SysApplicationScriptEntity scriptEntity = null; + if(scriptId != null && !"".equals(scriptId)){ + scriptEntity = sysApplicationScriptDao.get(scriptId); + if(scriptEntity == null || scriptEntity.getId() == null ){ + taskDetailEntity.setResult("分发接口脚本不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("分发接口脚本不存在"); + } + } + SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(apiId); + if(apiEntity == null || apiEntity.getId() == null ){ + taskDetailEntity.setResult("分发接口不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("分发接口不存在"); + + } + SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); + if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ + taskDetailEntity.setResult("应用不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("应用不存在"); + } + + //获取主数据db字段,以及字段的规则 + MdmModuleDbFiledsEntity queryFild = new MdmModuleDbFiledsEntity(); + queryFild.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryFild); + MdmModuleDbFiledsRuleEntity queryFildRule = new MdmModuleDbFiledsRuleEntity(); + queryFildRule.setMdmId(mdmModuleEntity.getId()); + queryFildRule.setRuleCode("service"); + List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule); + + //获取主数据db对应的实体表的数据 + JSONObject object = new JSONObject(); + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + Map map = new HashMap<>(); + map.put("tableName",mdmModuleDbEntities.get(i).getDbName()); + map.put("documentRule",documentRule); + object = mdmModuleDao.queryMdmST(map); + object = toLowerCaseKeys(object); + if(object.getString("id") == null || "".equals(object.getString("id")) ){ + taskDetailEntity.setResult("当前数据不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("当前数据不存在"); + } + if(mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0){ + Map checkData = new HashMap<>(); + checkData.put("tableName",mdmModuleDbEntities.get(i).getDbName()); + checkData.put("documentRule",documentRule); + checkData.put("mdmModuleDistributeDetailEntities",mdmModuleDistributeDetailEntities); + JSONObject object1 = mdmModuleDao.queryMdmST(checkData); + object1 = toLowerCaseKeys(object1); + + if(object1.getString("id") == null || "".equals(object1.getString("id")) ){ + taskDetailEntity.setResult("当前数据不符合规则不发送"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("当前数据不符合规则不发送"); + } + } + //查看主表是否有字段是关联的 + if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ + for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())){ + if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ + for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){ + if(object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){ + Map mapDetail = new HashMap<>(); + mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); + String ids = object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()); + String[] idss = ids.split(","); + mapDetail.put("id", idss[idss.length-1]); + JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + objectDetail = toLowerCaseKeys(objectDetail); + object.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail); + } + } + } + } + } + } + } + } + } + + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("2".equals(mdmModuleDbEntities.get(i).getDbType())){ + Map map = new HashMap<>(); + map.put("tableName",mdmModuleDbEntities.get(i).getDbName()); + map.put("formmainId",object.getString("id")); + List detail = mdmModuleDao.queryMdmSTDetail(map); + detail = toLowerCaseKeys(detail); + + //查看主表是否有字段是关联的 + if(detail != null && detail.size() > 0){ + if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ + for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())){ + if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ + for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){ + for (int i3 = 0; i3 < detail.size(); i3++) { + if(detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){ + Map mapDetail = new HashMap<>(); + mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); + String ids = detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()); + String[] idss = ids.split(","); + mapDetail.put("id", idss[idss.length-1]); + + JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + objectDetail = toLowerCaseKeys(objectDetail); + + detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail); + } + + } + } + } + } + } + } + } + } + object.put(mdmModuleDbEntities.get(i).getDbName(),detail); + } + } + //执行脚本 + JSONObject groovy = new JSONObject(); + JSONObject parameterJson = new JSONObject(); + parameterJson.put("header",apiEntity.getHeaderIn()); + parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("query",apiEntity.getQueryIn()); + parameterJson.put("data",object); + + if (!"1".equals(type)) {//删除或者修改情况,查询三方id,有就设置,没有就设置空 + //1、根据主数据id、数据id、应用ID默认查询主数据应用下发三方id表,只查询最新的一条数据 + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity.setSts("Y"); + mdmModuleDistributeTripartiteEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDistributeTripartiteEntity.setDataId(object.getString("id")); + mdmModuleDistributeTripartiteEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity = mdmModuleDistributeTripartiteDao.queryOneTripartite(mdmModuleDistributeTripartiteEntity); + String tripartiteId = ""; + if(mdmModuleDistributeTripartiteEntity != null && mdmModuleDistributeTripartiteEntity.getTripartiteId() != null ){ + tripartiteId = mdmModuleDistributeTripartiteEntity.getTripartiteId(); + } + parameterJson.put("tripartiteId", tripartiteId); + } + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = object.toJSONString(); + if(scriptEntity != null && scriptEntity.getId() != null ){ + groovy.put("code",scriptEntity.getScriptCode()); + groovy.put("className",scriptEntity.getClassName()); + groovy.put("name",scriptEntity.getScriptName()); + groovy.put("methodStr",scriptEntity.getScriptData()); + groovy.put("parameterJson",parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr",groovy); + try { + Object str = groovyIntegrationService.groovyScriptExecution(groovyStr); + JSONObject jsonResultEntity = JSONObject.parseObject(str.toString()); + header = (Map) jsonResultEntity.get("header"); + querys = jsonResultEntity.getString("querys"); + bodys = jsonResultEntity.getString("bodys"); + }catch (Exception e){ + taskDetailEntity.setResult("分发脚本转换错误"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("分发脚本转换错误"); + } + } + Map headers = new HashMap<>(); + headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headers.put("appId",sysApplicationEntity.getAppId().toString()); + headers.put("apiCode",apiEntity.getApiCode().toString()); + if(header != null){ + headers.putAll(header); + } + if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) { + //找到登陆接口 + SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); + if (null == loginApi) { + taskDetailEntity.setResult("发送错误,认证接口不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("发送错误,认证接口不存在"); + } + String rzquerys = getQuery(loginApi,null,null); + Map headersa = new HashMap<>(); + headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headersa.put("appId", sysApplicationEntity.getAppId().toString()); + headersa.put("apiCode", loginApi.getApiCode().toString()); + Map rzheaders = getHeaders(loginApi,headersa,null); + String rzbodys = getBodys(loginApi,null,null); + JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); + if (!rzjsonResultEntity.isFlag()) { + taskDetailEntity.setResult("发送错误,认证接口错误"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("发送错误:"+rzjsonResultEntity.getMsg()); + } + JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + logger.info("认证接口返回信息:"+ attritube.toJSONString()); + querys = getQuery(apiEntity,querys,attritube); + headers = getHeaders(apiEntity,headers,attritube); + + bodys = getBodys(apiEntity,bodys,attritube); + } + //组装数据发送 + JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + if(jsonResultEntity.isFlag()){ + if ("1".equals(type)) {//保存三方返回id + if (scriptEntity != null && scriptEntity.getId() != null && scriptEntity.getBackScriptData() != null ) { + JSONObject backScriptJson = new JSONObject(); + backScriptJson.put("data", jsonResultEntity.getAttribute()); + groovy.put("code", scriptEntity.getScriptCode()+"back"); + groovy.put("className", scriptEntity.getClassName()+"back"); + groovy.put("name", scriptEntity.getScriptName()+"back"); + groovy.put("methodStr", scriptEntity.getBackScriptData()); + groovy.put("parameterJson", backScriptJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr", groovy); + try { + Object str = groovyIntegrationService.groovyScriptExecution(groovyStr); + if(str != null){ + JSONObject backJsonResultEntity = JSONObject.parseObject(str.toString()); + if(backJsonResultEntity != null && backJsonResultEntity.getString("success") != null && "true".equals(backJsonResultEntity.getString("success"))){ + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity.setCreate(); + mdmModuleDistributeTripartiteEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDistributeTripartiteEntity.setDataId(object.getString("id")); + mdmModuleDistributeTripartiteEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity.setTripartiteId(backJsonResultEntity.getString("tripartiteId")); + mdmModuleDistributeTripartiteDao.save(mdmModuleDistributeTripartiteEntity); + } + } + } catch (Exception e) { + logger.info("执行异常错误原因:"+e); + logger.error("新增返回脚本解析保存三方id错误"+jsonResultEntity.getAttribute()); + taskDetailEntity.setResult("新增返回脚本解析保存三方id错误"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("发送错误"); + } + } + } + taskDetailEntity.setResult("发送成功"); + taskLivingDetailsService.saveLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("发送成功"); + }else { + taskDetailEntity.setResult("发送错误"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("发送错误"); + } + } + }else {//执行正常下发 + logger.info("==========开始执行正常蓝字发票申请单申请数据下发============="); + //查询主数据 + MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity(); + queryMdmModuleEntity.setSts("Y"); + queryMdmModuleEntity.setMdmCode(Long.valueOf("10049")); + List mdmModuleEntities = mdmModuleDao.queryBase(queryMdmModuleEntity); + if(mdmModuleEntities == null || mdmModuleEntities.size() == 0){ + return BaseResult.getSuccessMessageEntity("蓝字发票申请单申请数据未设置,不需要下发"); + } + //查询下发的配置 没有直接跳过 + for (int i = 0; i < mdmModuleEntities.size(); i++) { + Long mdmCode = mdmModuleEntities.get(i).getMdmCode(); + MdmModuleDistributeEntity queryMdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + queryMdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(i).getId()); + queryMdmModuleDistributeEntity.setEnabledType("1"); + queryMdmModuleDistributeEntity.setEnabledState("1"); + List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(queryMdmModuleDistributeEntity); + if(mdmModuleDistributeEntities == null || mdmModuleDistributeEntities.size() == 0){ + continue; + } + //查询主数据db + MdmModuleDbEntity queryMdmModuleDbEntity = new MdmModuleDbEntity(); + queryMdmModuleDbEntity.setMdmId(mdmModuleEntities.get(i).getId()); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(queryMdmModuleDbEntity); + if(mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0){ + continue; + } + //查询主数据字段 + MdmModuleDbFiledsEntity queryFild = new MdmModuleDbFiledsEntity(); + queryFild.setMdmId(mdmModuleEntities.get(i).getId()); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryFild); + if(mdmModuleDbFiledsEntities == null || mdmModuleDbFiledsEntities.size() == 0){ + continue; + } + //字段的规则 + MdmModuleDbFiledsRuleEntity queryFildRule = new MdmModuleDbFiledsRuleEntity(); + queryFildRule.setMdmId(mdmModuleEntities.get(i).getId()); + queryFildRule.setRuleCode("service"); + List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule); + //新增 + doAdd(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + //修改 + doUpdate(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + //删除 + doDelete(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + } + + } + } + logger.info("执行成功"); + return BaseResult.getSuccessMessageEntity("执行成功"); + } catch (Exception e) { + logger.error("执行失败{}",e.getMessage()); + } + return BaseResult.getSuccessMessageEntity("执行成功"); + } + + private void doDelete(String mdmId,Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities, List mdmModuleDbFiledsRuleEntities, List mdmModuleDbFiledsEntities) throws Exception { + //查询一千条数据 + String mainDb = null; + List objects = new ArrayList<>(); + for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) { + if("1".equals(mdmModuleDbEntities.get(i2).getDbType())) { + mainDb = mdmModuleDbEntities.get(i2).getDbName(); + } + } + if(mainDb == null){ + return; + } + Map map1 = new HashMap<>(); + map1.put("tableName",mainDb); + map1.put("dataStatus", "N"); + map1.put("deleteStatus", "0"); + map1.put("size", 50); + objects = mdmModuleDao.queryMdmSTs(map1); + objects = toLowerCaseKeys(objects); + + if(objects == null || objects.size() == 0){ + return; + } + for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) { + //查询下发的配置 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + //查询这一千条数据是否符合规则 + Map map = new HashMap<>(); + map.put("tableName", mainDb); + map.put("dataStatus", "N"); + map.put("deleteStatus", "0"); + map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); + map.put("ids", objects); + List doObjects = mdmModuleDao.queryMdmSTs(map); + doObjects = toLowerCaseKeys(doObjects); + + if(doObjects == null || doObjects.size() == 0){ + continue; + } + if(mdmModuleDistributeEntities.get(i1).getDeleteApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getDeleteApi())){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","删除接口未设置",mainDb,objects.get(i).getString("id"),null,null,null,null,doObjects.get(i).toJSONString(),"3"); + } + return ; + } + SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getDeleteApi()); + if(apiEntity == null || apiEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","删除接口未找到",mainDb,objects.get(i).getString("id"),null,null,null,null,doObjects.get(i).toJSONString(),"3"); + } + return ; + } + SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); + if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","删除接口的应用未找到",mainDb,objects.get(i).getString("id"),null,null,apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3"); + } + return ; + } + + SysApplicationScriptEntity scriptEntity = null; + if(mdmModuleDistributeEntities.get(i1).getDeleteScript() != null && !"".equals(mdmModuleDistributeEntities.get(i1).getDeleteScript())){ + scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getDeleteScript()); + if(scriptEntity == null || scriptEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","删除接口脚本未找到",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3"); + } + return ; + } + } + + for (int i = 0; i < doObjects.size(); i++) { + //查询发送日志是否已经有这条数据 + MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity(); + mdmModuleSendLogEntity.setTableName(mainDb+"_send_log"); + mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id")); + mdmModuleSendLogEntity.setSts("Y"); + mdmModuleSendLogEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleSendLogEntity.setApiId(apiEntity.getId()); + //mdmModuleSendLogEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleSendLogEntity.setOptionType("3"); + Integer num = mdmModuleSendLogDao.getCount(mdmModuleSendLogEntity); + if(num > 0){//已经过不发送 + continue; + } + getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + + //执行脚本 + JSONObject groovy = new JSONObject(); + JSONObject parameterJson = new JSONObject(); + parameterJson.put("header",apiEntity.getHeaderIn()); + parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("query",apiEntity.getQueryIn()); + parameterJson.put("data",doObjects.get(i)); + + //1、根据主数据id、数据id、应用ID默认查询主数据应用下发三方id表,只查询最新的一条数据 + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity.setSts("Y"); + mdmModuleDistributeTripartiteEntity.setMdmId(mdmId); + mdmModuleDistributeTripartiteEntity.setDataId(objects.get(i).getString("id")); + mdmModuleDistributeTripartiteEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity = mdmModuleDistributeTripartiteDao.queryOneTripartite(mdmModuleDistributeTripartiteEntity); + String tripartiteId = ""; + if(mdmModuleDistributeTripartiteEntity != null && mdmModuleDistributeTripartiteEntity.getTripartiteId() != null ){ + tripartiteId = mdmModuleDistributeTripartiteEntity.getTripartiteId(); + } + parameterJson.put("tripartiteId", tripartiteId); + + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = doObjects.get(i).toJSONString(); + if(scriptEntity != null && scriptEntity.getId() != null ){ + groovy.put("code",scriptEntity.getScriptCode()); + groovy.put("className",scriptEntity.getClassName()); + groovy.put("name",scriptEntity.getScriptName()); + groovy.put("methodStr",scriptEntity.getScriptData()); + groovy.put("parameterJson",parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr",groovy); + try { + Object str = groovyIntegrationService.groovyScriptExecution(groovyStr); + JSONObject jsonResultEntity = JSONObject.parseObject(str.toString()); + header = (Map) jsonResultEntity.get("header"); + querys = jsonResultEntity.getString("querys"); + bodys = jsonResultEntity.getString("bodys"); + }catch (Exception e){ + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3"); + continue; + } + } + Map headers = new HashMap<>(); + headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headers.put("appId",sysApplicationEntity.getAppId().toString()); + headers.put("apiCode",apiEntity.getApiCode().toString()); + if(header != null){ + headers.putAll(header); + } + if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) { + //找到登陆接口 + SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); + if (null == loginApi) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + String rzquerys = getQuery(loginApi,null,null); + Map headersa = new HashMap<>(); + headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headersa.put("appId", sysApplicationEntity.getAppId().toString()); + headersa.put("apiCode", loginApi.getApiCode().toString()); + Map rzheaders = getHeaders(loginApi,headersa,null); + String rzbodys = getBodys(loginApi,null,null); + JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); + if (!rzjsonResultEntity.isFlag()) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + querys = getQuery(apiEntity,querys,attritube); + headers = getHeaders(apiEntity,headers,attritube); + bodys = getBodys(apiEntity,bodys,attritube); + } + //组装数据发送 + JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + if(jsonResultEntity.isFlag()){ + //保存日志 + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3"); + continue; + }else { + //保存日志 + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3"); + continue; + } + } + + } + + //所有下发发送完成,修改数据状态 + for (int i = 0; i < objects.size(); i++) { + Map updateMap = new HashMap<>(); + updateMap.put("tableName",mainDb); + updateMap.put("dataStatus", "N"); + updateMap.put("deleteStatus", "1"); + updateMap.put("id", objects.get(i).getString("id")); + mdmModuleDao.updateMdmSTs(updateMap); + } + } + + private void doUpdate(String mdmId,Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities, List mdmModuleDbFiledsRuleEntities, List mdmModuleDbFiledsEntities) throws Exception { + //查询一千条数据 + String mainDb = null; + List objects = new ArrayList<>(); + for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) { + if("1".equals(mdmModuleDbEntities.get(i2).getDbType())) { + mainDb = mdmModuleDbEntities.get(i2).getDbName(); + } + } + if(mainDb == null){ + return; + } + Map map1 = new HashMap<>(); + map1.put("tableName",mainDb); + //map1.put("dataStatus", "F"); + map1.put("updateStatus", "0"); + map1.put("size", 50); + objects = mdmModuleDao.queryMdmSTs(map1); + objects = toLowerCaseKeys(objects); + + if(objects == null || objects.size() == 0){ + return; + } + for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) { + //查询下发的配置 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + //查询这一千条数据是否符合规则 + Map map = new HashMap<>(); + map.put("tableName", mainDb); + //map.put("dataStatus", "F"); + map.put("updateStatus", "0"); + map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); + map.put("ids", objects); + List doObjects = mdmModuleDao.queryMdmSTs(map); + doObjects = toLowerCaseKeys(doObjects); + + if(doObjects == null || doObjects.size() == 0){ + continue; + } + if(mdmModuleDistributeEntities.get(i1).getUpdateApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getUpdateApi())){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","修改接口未设置",mainDb,objects.get(i).getString("id"),null,null,null,null,doObjects.get(i).toJSONString(),"2"); + } + return ; + } + SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getUpdateApi()); + if(apiEntity == null || apiEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","修改接口未查找到",mainDb,objects.get(i).getString("id"),null,null,null,null,doObjects.get(i).toJSONString(),"2"); + } + return ; + } + SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); + if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","应用未查找到",mainDb,objects.get(i).getString("id"),null,null,apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); + } + return ; + } + + SysApplicationScriptEntity scriptEntity = null; + if(mdmModuleDistributeEntities.get(i1).getUpdateScript() != null && !"".equals(mdmModuleDistributeEntities.get(i1).getUpdateScript())){ + scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getUpdateScript()); + if(scriptEntity == null || scriptEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本未查找到",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); + } + return ; + } + } + + for (int i = 0; i < doObjects.size(); i++) { + + getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + + //执行脚本 + JSONObject groovy = new JSONObject(); + JSONObject parameterJson = new JSONObject(); + parameterJson.put("header",apiEntity.getHeaderIn()); + parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("query",apiEntity.getQueryIn()); + parameterJson.put("data",doObjects.get(i)); + //1、根据主数据id、数据id、应用ID默认查询主数据应用下发三方id表,只查询最新的一条数据 + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity.setSts("Y"); + mdmModuleDistributeTripartiteEntity.setMdmId(mdmId); + mdmModuleDistributeTripartiteEntity.setDataId(objects.get(i).getString("id")); + mdmModuleDistributeTripartiteEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity = mdmModuleDistributeTripartiteDao.queryOneTripartite(mdmModuleDistributeTripartiteEntity); + String tripartiteId = ""; + if(mdmModuleDistributeTripartiteEntity != null && mdmModuleDistributeTripartiteEntity.getTripartiteId() != null ){ + tripartiteId = mdmModuleDistributeTripartiteEntity.getTripartiteId(); + } + parameterJson.put("tripartiteId", tripartiteId); + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = doObjects.get(i).toJSONString(); + if(scriptEntity != null && scriptEntity.getId() != null ){ + logger.info("=========开始执行正常开票申请单申请数据修改下发脚本,第一次=============="); + groovy.put("code",scriptEntity.getScriptCode()); + groovy.put("className",scriptEntity.getClassName()); + groovy.put("name",scriptEntity.getScriptName()); + groovy.put("methodStr",scriptEntity.getScriptData()); + groovy.put("parameterJson",parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr",groovy); + try { + Object str = groovyIntegrationService.groovyScriptExecution(groovyStr); + JSONObject jsonResultEntity = JSONObject.parseObject(str.toString()); + header = (Map) jsonResultEntity.get("header"); + querys = jsonResultEntity.getString("querys"); + bodys = jsonResultEntity.getString("bodys"); + }catch (Exception e){ + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); + continue; + } + } + Map headers = new HashMap<>(); + headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headers.put("appId",sysApplicationEntity.getAppId().toString()); + headers.put("apiCode",apiEntity.getApiCode().toString()); + if(header != null){ + headers.putAll(header); + } + if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) { + logger.info("=========正常开票申请单申请数据修改开始执行登录接口=============="); + //找到登陆接口 + SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); + if (null == loginApi) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + String rzquerys = getQuery(loginApi,null,null); + Map headersa = new HashMap<>(); + headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headersa.put("appId", sysApplicationEntity.getAppId().toString()); + headersa.put("apiCode", loginApi.getApiCode().toString()); + Map rzheaders = getHeaders(loginApi,headersa,null); + String rzbodys = getBodys(loginApi,null,null); + JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); + if (!rzjsonResultEntity.isFlag()) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + logger.info("=======开票申请单申请数据正常修改下发登录返回数据:{}========",attritube.toJSONString()); + querys = getQuery(apiEntity,querys,attritube); + headers = getHeaders(apiEntity,headers,attritube); + bodys = getBodys(apiEntity,bodys,attritube); + } + //组装数据发送 + logger.info("=========开始执行开票申请单申请业务修改数据下发脚本,第二次=============="); + JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + logger.info("=====开票申请单申请数据修改下发返回结果为:{}",JSONObject.parseObject(jsonResultEntity.getAttribute().toString()).toJSONString()); + if(jsonResultEntity.isFlag()){ + //保存日志 + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); + continue; + }else { + //保存日志 + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); + continue; + } + } + } + + //所有下发发送完成,修改数据状态 + for (int i = 0; i < objects.size(); i++) { + Map updateMap = new HashMap<>(); + updateMap.put("tableName",mainDb); + //updateMap.put("dataStatus", "F"); + updateMap.put("updateStatus", "1"); + updateMap.put("id", objects.get(i).getString("id")); + mdmModuleDao.updateMdmSTs(updateMap); + } + } + + private void doAdd(String mdmId,Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities,List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities ) throws Exception { + //查询一千条数据 + String mainDb = null; + List objects = new ArrayList<>(); + for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) { + if("1".equals(mdmModuleDbEntities.get(i2).getDbType())) { + mainDb = mdmModuleDbEntities.get(i2).getDbName(); + } + } + if(mainDb == null){ + return; + } + Map map1 = new HashMap<>(); + map1.put("tableName",mainDb); + //map1.put("dataStatus", "Y"); + map1.put("addStatus", "0"); + objects = mdmModuleDao.queryMdmSTs(map1); + objects = toLowerCaseKeys(objects); + + if(objects == null || objects.size() == 0){ + return; + } + for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) { + //查询下发的配置 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + //查询这一千条数据是否符合规则 + Map map = new HashMap<>(); + map.put("tableName", mainDb); + //map.put("dataStatus", "Y"); + map.put("addStatus", "0"); + map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); + map.put("ids", objects); + List doObjects = mdmModuleDao.queryMdmSTs(map); + doObjects = toLowerCaseKeys(doObjects); + + if(doObjects == null || doObjects.size() == 0){ + continue; + } + if(mdmModuleDistributeEntities.get(i1).getAddApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getAddApi())){ + for (int i = 0; i < doObjects.size(); i++) { + //taskLivingDetailsService.saveLogToSuccess(); + saveMdmModuleSendLogEntity( mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","新增接口未设置",mainDb,objects.get(i).getString("id"),null,null,null,null,doObjects.get(i).toJSONString(),"1"); + } + return ; + } + SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getAddApi()); + if(apiEntity == null || apiEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","新增接口未查找到",mainDb,objects.get(i).getString("id"),null,null,null,null,doObjects.get(i).toJSONString(),"1"); + } + return ; + } + SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); + if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","应用未查找到",mainDb,objects.get(i).getString("id"),null,null,apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + } + return ; + } + + SysApplicationScriptEntity scriptEntity = null; + if(mdmModuleDistributeEntities.get(i1).getAddScript() != null && !"".equals(mdmModuleDistributeEntities.get(i1).getAddScript())){ + scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getAddScript()); + if(scriptEntity == null || scriptEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本未查找到",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + } + return ; + } + } + + for (int i = 0; i < doObjects.size(); i++) { + //查询是否已经手动发送过。只有新增校验,查询发送日志是否已经有这条数据 + MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity(); + mdmModuleSendLogEntity.setTableName(mainDb+"_send_log"); + mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id")); + mdmModuleSendLogEntity.setSts("Y"); + mdmModuleSendLogEntity.setDataType("1"); + mdmModuleSendLogEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleSendLogEntity.setApiId(apiEntity.getId()); + //mdmModuleSendLogEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleSendLogEntity.setOptionType("1"); + Integer num = mdmModuleSendLogDao.getCount(mdmModuleSendLogEntity); + if(num > 0){//已经新增过不发送 + continue; + } + getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + + //执行脚本 + JSONObject groovy = new JSONObject(); + JSONObject parameterJson = new JSONObject(); + parameterJson.put("header",apiEntity.getHeaderIn()); + parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("query",apiEntity.getQueryIn()); + parameterJson.put("data",doObjects.get(i)); + //1、根据主数据id、数据id、应用ID默认查询主数据应用下发三方id表,只查询最新的一条数据 + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity1 = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity1.setSts("Y"); + mdmModuleDistributeTripartiteEntity1.setMdmId(mdmId); + mdmModuleDistributeTripartiteEntity1.setDataId(objects.get(i).getString("id")); + mdmModuleDistributeTripartiteEntity1.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity1 = mdmModuleDistributeTripartiteDao.queryOneTripartite(mdmModuleDistributeTripartiteEntity1); + String tripartiteId = ""; + if(mdmModuleDistributeTripartiteEntity1 != null && mdmModuleDistributeTripartiteEntity1.getTripartiteId() != null ){ + tripartiteId = mdmModuleDistributeTripartiteEntity1.getTripartiteId(); + } + parameterJson.put("tripartiteId", tripartiteId); + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = doObjects.get(i).toJSONString(); + if(scriptEntity != null && scriptEntity.getId() != null ){ + logger.info("=========开始执行正常开票申请单申请数据新增下发脚本,第一次=============="); + groovy.put("code",scriptEntity.getScriptCode()); + groovy.put("className",scriptEntity.getClassName()); + groovy.put("name",scriptEntity.getScriptName()); + groovy.put("methodStr",scriptEntity.getScriptData()); + groovy.put("parameterJson",parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr",groovy); + try { + Object str = groovyIntegrationService.groovyScriptExecution(groovyStr); + JSONObject jsonResultEntity = JSONObject.parseObject(str.toString()); + header = (Map) jsonResultEntity.get("header"); + querys = jsonResultEntity.getString("querys"); + bodys = jsonResultEntity.getString("bodys"); + }catch (Exception e){ + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + } + Map headers = new HashMap<>(); + headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headers.put("appId",sysApplicationEntity.getAppId().toString()); + headers.put("apiCode",apiEntity.getApiCode().toString()); + if(header != null){ + headers.putAll(header); + } + if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) { + /* logger.info("=========正常开票申请单申请数据新增开始执行登录接口=============="); + //找到登陆接口 + SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); + if (null == loginApi) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + String rzquerys = getQuery(loginApi,null,null); + Map headersa = new HashMap<>(); + headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headersa.put("appId", sysApplicationEntity.getAppId().toString()); + headersa.put("apiCode", loginApi.getApiCode().toString()); + Map rzheaders = getHeaders(loginApi,headersa,null); + String rzbodys = getBodys(loginApi,null,null); + JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); + if (!rzjsonResultEntity.isFlag()) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + }*/ + JSONObject jsonObject=new JSONObject(); + jsonObject.put("accessKey","6X3B526P5HqE6ums"); + jsonObject.put("accessSecret","34e5fc32ac894a2ba2ade8c3852c7a0a"); + //获取TOKEN + String tokenResult = HttpRequest.post(url). + header("appId", "800060"). + header("apiCode", "8000600004"). + header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"). + header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(jsonObject.toJSONString()). + execute(). + body(); + logger.error("开票申请推送BIPtoken返回结果:"+tokenResult); + JSONObject attritube = JSONObject.parseObject(JSONObject.parseObject(tokenResult).getString("attribute")); + logger.info("=======开票申请单申请数据正常新增下发登录返回数据:{}========",attritube.toJSONString()); + querys = getQuery(apiEntity,querys,attritube); + headers = getHeaders(apiEntity,headers,attritube); + headers.remove(""); + bodys = getBodys(apiEntity,bodys,attritube); + } + + //组装数据发送 + logger.info("=========开始执行开票申请单申请新增数据下发脚本,第二次=============="); + JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + logger.info("=====开票申请单申请数据新增下发返回结果为:{}",JSONObject.parseObject(jsonResultEntity.getAttribute().toString()).toJSONString()); + if(jsonResultEntity.isFlag()){ + if (scriptEntity != null && scriptEntity.getId() != null && scriptEntity.getBackScriptData() != null ) { + logger.info("=========开始执行开票申请单申请数据新增返回脚本=============="); + JSONObject backScriptJson = new JSONObject(); + backScriptJson.put("data", jsonResultEntity.getAttribute()); + groovy.put("code", scriptEntity.getScriptCode()+"back"); + groovy.put("className", scriptEntity.getClassName()+"back"); + groovy.put("name", scriptEntity.getScriptName()+"back"); + groovy.put("methodStr", scriptEntity.getBackScriptData()); + groovy.put("parameterJson", backScriptJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr", groovy); + try { + Object str = groovyIntegrationService.groovyScriptExecution(groovyStr); + if(str != null){ + JSONObject backJsonResultEntity = JSONObject.parseObject(str.toString()); + if(backJsonResultEntity != null && backJsonResultEntity.getString("success") != null && "true".equals(backJsonResultEntity.getString("success"))){ + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity.setId(UUIDUtils.getUUID()); + mdmModuleDistributeTripartiteEntity.setSts("Y"); + mdmModuleDistributeTripartiteEntity.setCreate_user_id("1"); + mdmModuleDistributeTripartiteEntity.setModify_user_id("1"); + mdmModuleDistributeTripartiteEntity.setCreate_time(new Date()); + mdmModuleDistributeTripartiteEntity.setModify_time(new Date()); + mdmModuleDistributeTripartiteEntity.setOrg_id("0"); + mdmModuleDistributeTripartiteEntity.setCompanyId("0"); + mdmModuleDistributeTripartiteEntity.setMdmId(mdmId); + mdmModuleDistributeTripartiteEntity.setDataId(objects.get(i).getString("id")); + mdmModuleDistributeTripartiteEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity.setTripartiteId(backJsonResultEntity.getString("tripartiteId")); + mdmModuleDistributeTripartiteDao.save(mdmModuleDistributeTripartiteEntity); + } + } + } catch (Exception e) { + logger.error("开票申请单申请下发新增返回脚本解析保存三方id错误"+jsonResultEntity.getAttribute()); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","新增返回脚本解析保存三方id错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + } + //保存日志 + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + objects.get(i).put("sendsanfzt123",true); + logger.info("========开票申请单申请数据新增下发完成,日志保存为成功============"); + continue; + }else { + //保存日志 + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + objects.get(i).put("sendsanfzt123",false); + logger.info("========开票申请单申请数据新增下发完成,日志保存为失败============"); + continue; + } + } + } + + //所有下发发送完成,修改数据状态 + for (int i = 0; i < objects.size(); i++) { + if(objects.get(i).getBoolean("sendsanfzt123")){ + Map updateMap = new HashMap<>(); + updateMap.put("tableName",mainDb); + //updateMap.put("dataStatus", "Y"); + updateMap.put("addStatus", "1"); + updateMap.put("id", objects.get(i).getString("id")); + mdmModuleDao.updateMdmSTs(updateMap); + } + } + } + + private void saveMdmModuleSendLogEntity(Long mdmCode,String distributeId,String dataType,String remark,String dbname,String formmain_id, String target_app, String appId, String target_api,String apiID, String source_data, String option_type) throws Exception { + MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity(); + mdmModuleSendLogEntity.setTableName(dbname+"_send_log"); + mdmModuleSendLogEntity.setId(UUIDUtils.getUUID()); + mdmModuleSendLogEntity.setSts("Y"); + mdmModuleSendLogEntity.setDistributeId(distributeId); + mdmModuleSendLogEntity.setAppId(appId); + mdmModuleSendLogEntity.setApiId(apiID); + mdmModuleSendLogEntity.setCreate_user_id("1"); + mdmModuleSendLogEntity.setModify_user_id("1"); + mdmModuleSendLogEntity.setCreate_time(new Date()); + mdmModuleSendLogEntity.setModify_time(new Date()); + mdmModuleSendLogEntity.setOrg_id("0"); + mdmModuleSendLogEntity.setCompanyId("0"); + mdmModuleSendLogEntity.setFormmainId(formmain_id); + mdmModuleSendLogEntity.setTargetApp(target_app); + mdmModuleSendLogEntity.setTargetApi(target_api); + mdmModuleSendLogEntity.setSourceData(source_data); + mdmModuleSendLogEntity.setOptionType(option_type); + mdmModuleSendLogEntity.setDataType(dataType); + mdmModuleSendLogEntity.setRemark(remark); + mdmModuleSendLogDao.save(mdmModuleSendLogEntity); + + + JSONObject jsonObject = JSONObject.parseObject(source_data); + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID()); + integrationTaskLivingDetailsEntity.setSts("Y"); + integrationTaskLivingDetailsEntity.setCreate_user_id("1"); + integrationTaskLivingDetailsEntity.setModify_user_id("1"); + integrationTaskLivingDetailsEntity.setCreate_time(new Date()); + integrationTaskLivingDetailsEntity.setModify_time(new Date()); + integrationTaskLivingDetailsEntity.setOrg_id("0"); + integrationTaskLivingDetailsEntity.setCompanyId("0"); + JSONObject aa = new JSONObject(); + aa.put("mdmCode",mdmCode);//主数据编码 + aa.put("documentRule",jsonObject.getString("document_rule"));//行数据的单据规则编码 + aa.put("distributeId",distributeId);//发送表id + aa.put("type",option_type);//发送类型,1、新增2、修改3、删除 + integrationTaskLivingDetailsEntity.setRootAppPk(aa.toJSONString()); + integrationTaskLivingDetailsEntity.setRootAppBill(jsonObject.getString("document_rule")); + integrationTaskLivingDetailsEntity.setPluginId("MdmModulePlugin"); + integrationTaskLivingDetailsEntity.setRootAppNewData(source_data); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(remark); + if("1".equals(dataType)){ + taskLivingDetailsService.saveLogToSuccess(integrationTaskLivingDetailsEntity); + }else { + taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); + + } + + } + + private JSONObject getDetailData(List mdmModuleDbEntities, JSONObject object, List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities) { + + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("2".equals(mdmModuleDbEntities.get(i).getDbType())){ + Map map = new HashMap<>(); + map.put("tableName",mdmModuleDbEntities.get(i).getDbName()); + map.put("formmainId",object.getString("id")); + List detail = mdmModuleDao.queryMdmSTDetail(map); + detail = toLowerCaseKeys(detail); + + //查看主表是否有字段是关联的 + if(detail != null && detail.size() > 0){ + if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ + for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())){ + if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ + for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){ + for (int i3 = 0; i3 < detail.size(); i3++) { + if(detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){ + Map mapDetail = new HashMap<>(); + mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); + String ids = detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()); + String[] idss = ids.split(","); + mapDetail.put("id", idss[idss.length-1]); + JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + objectDetail = toLowerCaseKeys(objectDetail); + + detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail); + } + } + } + } + } + } + } + } + } + object.put(mdmModuleDbEntities.get(i).getDbName(),detail); + } + } + + return object; + } + + + private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map headers ,String bodys ,String querys) { + StringBuffer urls = new StringBuffer(url); + if (querys != null) { + urls.append("?"); + urls.append(querys); + } + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpPost post = new HttpPost(urls.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(Integer.valueOf(applicationApiEntity.getTimeoutPeriod())).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + boolean flag = true; + try { + if (bodys != null && !"".equals(bodys)) { + ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + + HttpEntity entity = response.getEntity(); + synchronized (lock) { + body.append(EntityUtils.toString(entity,"UTF-8")); + } + flag = true; + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + flag = false; + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + if (flag) { + if (JSONUtil.isTypeJSON(body.toString())) { + JsonResultEntity jsonResultEntity = JSONObject.parseObject(body.toString(),JsonResultEntity.class); + if(jsonResultEntity.isFlag()){ + return BaseResult.getSuccessMessageEntity("转发成功", body); + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + + + private Map getHeaders(SysApplicationApiEntity loginApi,Map map,JSONObject loginData) { + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getHeaderIn() != null && !"".equals(loginApi.getHeaderIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getHeaderIn())) { + JSONArray headerArray = JSON.parseArray(loginApi.getHeaderIn()); + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + JSONArray example = JSONArray.parseArray(query); + String logValue = getObjectValue(loginData, example); + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue); + } + } else { + if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue())); + } + } else {//没有值直接拼接 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), ""); + } + } + } + } + } + } + return map; + + + + + } + + + private String getQuery(SysApplicationApiEntity loginApi,String sendDatastr,JSONObject loginData) { + Map map = new HashMap<>(); + if(sendDatastr != null){ + String[] parts = sendDatastr.split("&"); + if(parts != null && parts.length > 0){ + for (int i = 0; i < parts.length; i++) { + String[] part = parts[i].split("="); + if(part != null && part.length >=2 ){ + for (int a = 0; a < part.length; a++) { + map.put(part[0],part[1]); + } + } + } + } + } + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getQueryIn() != null && !"".equals(loginApi.getQueryIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getQueryIn())) { + JSONArray headerArray = JSON.parseArray(loginApi.getQueryIn()); + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + JSONArray example = JSONArray.parseArray(query); + String logValue = getObjectValue(loginData, example); + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue); + } + } else { + //不是认证类型直接取值 + if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue())); + } + } else {//没有值直接拼接 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), ""); + } + } + } + } + } + } + StringBuffer returnStr = new StringBuffer(); + if(map != null && map.size() > 0){ + for (String key : map.keySet()) { + if("".equals(returnStr)){ + returnStr.append(key).append("=").append(map.get(key)); + }else { + returnStr.append("&").append(key).append("=").append(map.get(key)); + } + } + } + return returnStr.toString(); + } + /** + * @param loginData + * @param example + * @return java.lang.String + * @Author lvleigang + * @Description 根据jsonArray 获取jsonobject中的值 + * @Date 11:47 上午 2023/8/31 + **/ + private String getObjectValue(JSONObject loginData, JSONArray example) { + String values = ""; + if (example != null && example.size() > 0) { + for (int i = 0; i < example.size(); i++) { + if (loginData.getString(example.getString(i)) != null && !"".equals(loginData.getString(example.getString(i)))) { + if (i == (example.size() - 1)) { + values = loginData.getString(example.getString(i)); + } else { + loginData = JSONObject.parseObject(loginData.getString(example.getString(i))); + } + } else { + return values; + } + } + } + return values; + } + private String getBodys(SysApplicationApiEntity loginApi,String sendDatastr, JSONObject loginData) { + JSONObject sendData = new JSONObject(); + if(sendDatastr != null ){ + sendData = JSONObject.parseObject(sendDatastr); + } + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getBodyIn() != null && !"".equals(loginApi.getBodyIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getBodyIn())) { + JSONArray headerArray = JSON.parseArray(loginApi.getBodyIn()); + for (int i = 0; i < headerArray.size(); i++) { + //获取到第一个数据 + JSONObject querys = headerArray.getJSONObject(i); + if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + JSONArray example = JSONArray.parseArray(query); + String logValue = getObjectValue(loginData, example); + sendData.put(querys.getString(SysEnum.PARAMETERNAME.getValue()),logValue); + } + } + } + } + } + return sendData.toString(); + } + public JSONObject toLowerCaseKeys(JSONObject jsonObject) { + JSONObject lowerCaseJson = new JSONObject(); + if (jsonObject != null) { + for (String key : jsonObject.keySet()) { + Object value = jsonObject.get(key); + lowerCaseJson.put(key.toLowerCase(), value); + } + } + return lowerCaseJson; + } + public List toLowerCaseKeys(List list) { + List jsonObjects = new ArrayList<>(); + if (list != null && list.size() > 0) { + for (int i = 0; i < list.size(); i++) { + jsonObjects.add(toLowerCaseKeys(list.get(i))); + } + } + return jsonObjects; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInvoiceResultPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInvoiceResultPluginInitializer.java new file mode 100644 index 00000000..f688f5be --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInvoiceResultPluginInitializer.java @@ -0,0 +1,58 @@ +package com.hzya.frame.plugin.ht.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.zxBank.plugin.ZxBankResultPluginInitializer; +import com.hzya.frame.seeyon.invoice.service.impl.InvoiceServiceImpl; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +public class QueryInvoiceResultPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(ZxBankResultPluginInitializer.class); + + @Autowired + private InvoiceServiceImpl invoiceService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "QueryInvoiceResultPluginInitializer"; + } + + @Override + public String getPluginName() { + return "查询开票申请详情插件"; + } + + @Override + public String getPluginLabel() { + return "QueryInvoiceResultPluginInitializer"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行查询税务开票申请详情返回结果========"); + return invoiceService.queryInvoiceResult(requestJson); + }catch (Exception e){ + logger.info("======执行查询税务开票申请详情返回结果失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml index 53c83b62..cfef96a4 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml @@ -1,6 +1,8 @@ - + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java index 50747bc2..57c91c0c 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java @@ -29,4 +29,34 @@ public interface IInvoiceDao extends IBaseDao { * @Date 2025-04-07 14:05 * **/ List queryInvoiceResult(InvoiceEntity entity); + + /** + * + * @content 更新推送标识 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-15 15:37 + * **/ + Integer updateInvoicePush(InvoiceEntity entity); + + /** + * + * @content 更新pdf和ofd附件到OA + * @Param + * @Return + * @Author hecan + * @Date 2025-04-14 10:27 + * **/ + Integer updateInvoiceUrl(InvoiceEntity entity); + + /** + * + * @content 更新发票代码,发票号码以及开票结果 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-14 16:35 + * **/ + Integer updateInvoiceResult(InvoiceEntity entity); } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java index 92743132..24f56359 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java @@ -38,4 +38,22 @@ public class InvoiceDaoImpl extends MybatisGenericDao impl public List queryInvoiceResult(InvoiceEntity entity) { return (List) super.selectList("queryInvoiceResult",entity); } + + @DS("#entity.dataSourceCode") + @Override + public Integer updateInvoicePush(InvoiceEntity entity) { + return super.update("updateInvoicePush",entity); + } + + @DS("#entity.dataSourceCode") + @Override + public Integer updateInvoiceUrl(InvoiceEntity entity) { + return super.update("updateInvoiceUrl",entity); + } + + @DS("#entity.dataSourceCode") + @Override + public Integer updateInvoiceResult(InvoiceEntity entity) { + return super.update("updateInvoiceResult",entity); + } } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java index c3afa017..b2d700af 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java @@ -72,6 +72,16 @@ public class InvoiceEntity extends BaseEntity { private String url;// 发票文件 private String result_status;// 开票结果 + private String summaryId;// + + public String getSummaryId() { + return summaryId; + } + + public void setSummaryId(String summaryId) { + this.summaryId = summaryId; + } + public String getPush_status_filed() { return push_status_filed; } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml index 89fbf6c3..2247a385 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml @@ -87,6 +87,27 @@ from v_hzya_invoice where push_status is not null and url is null and (result_status is null or result_status='申请单处理中') + + + update ${tabName} set ${url_field} =#{url} where id=#{id} + + + + + update formmain_0331 set field0206 =#{push_status} where id=#{id} + + + + + update ${tabName} set + + invoice_code_field = #{invoiceCode}, + invoice_number_field = #{invoiceNumber}, + result_status_field = #{resultStatus}, + + where id=#{id} + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java index d176df54..af842b00 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -7,19 +7,24 @@ import com.alibaba.fastjson.JSONObject; import com.hzya.frame.basedao.service.impl.BaseService; import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl; import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.dao.ICtpAttachmentDao; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao; import com.hzya.frame.seeyon.invoice.dao.IInvoiceDetailsDao; import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity; import com.hzya.frame.seeyon.invoice.entity.InvoiceState; import com.hzya.frame.seeyon.invoice.service.IInvoiceService; +import com.hzya.frame.seeyon.util.OARestUtil; import com.hzya.frame.seeyon.util.YzfSignUtil; import com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity; import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.uuid.UUIDLong; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; +import com.hzya.frame.web.exception.BaseSystemException; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -46,6 +51,8 @@ public class InvoiceServiceImpl extends BaseService imple private IIntegrationTaskLivingDetailsService taskLivingDetailsService; @Autowired private ComparisonServiceImpl comparisonServiceimpl; + @Autowired + private ICtpAttachmentDao ctpAttachmentDao; @Value("${zt.url}") private String url; @@ -89,6 +96,37 @@ public class InvoiceServiceImpl extends BaseService imple //将查询出来的数据进行组装,调用通用方法新增或者更新 if (null != listAll && listAll.size() > 0) { object = ParametricDocument(listAll, mdmCode, tableName); + if (CollectionUtils.isNotEmpty(object)) { + for (Object obj : object) { + //更新单据视图推送标识,不再抽取 + JSONObject attributeResult = (JSONObject) JSON.toJSON(obj); + if (attributeResult.getString("status").equals("200")) { + String resultString = attributeResult.getString("list"); + if ("10049".equals(mdmCode)) { + JSONArray jsonArray = JSONArray.parseArray(resultString); + if (CollectionUtils.isNotEmpty(jsonArray)) { + for (Object o : jsonArray) { + JSONObject attributeArray = (JSONObject) JSON.toJSON(o); + String cmpApply = attributeArray.getString(tableName); + JSONObject jsonObjectCmpApply = JSONObject.parseObject(cmpApply); + String id = jsonObjectCmpApply.getString("data_id");//主表id + String vdef1 = jsonObjectCmpApply.getString("business_no");//主表id + logger.info("=====开始根据单据id:{},单据号:{},更新表:formmain_0331的推送标识", id, vdef1); + InvoiceEntity invoiceEntity = new InvoiceEntity(); + invoiceEntity.setPush_status("1"); + invoiceEntity.setId(id); + invoiceEntity.setDataSourceCode(mdmModuleSourceEntity.getDataSourceCode()); + invoiceDao.updateInvoicePush(invoiceEntity); + //保存业务数据日志 + saveTaskLivingDetails(id, jsonObjectCmpApply.getString("business_no"), listAll.get(0).toString(), object.toString(), true,"MakeInvoicePluginInitializer"); + } + } + } + } else { + saveTaskLivingDetails(JSONObject.parseObject(listAll.get(0).getString("mdm_invoice_application")).getString("data_id"), JSONObject.parseObject(listAll.get(0).getString("mdm_invoice_application")).getString("business_no"), listAll.get(0).toString(), JSON.parseObject(JSON.toJSONString(object)).getString("msg"), false,"MakeInvoicePluginInitializer"); + } + } + } } else { logger.info("三维单据视图数据没有需要同步中台的数据"); } @@ -145,27 +183,43 @@ public class InvoiceServiceImpl extends BaseService imple JSONArray jsonArray = jsonResult.getJSONArray("invoiceInfoVOList"); if(CollectionUtils.isNotEmpty(jsonArray)){ for (int i = 0; i < jsonArray.size(); i++) { + //表单的附件字段=ctpAttachment的Sub_reference,表单的Summary_id=ctpAttachment的att_reference + String sub_reference = String.valueOf(UUIDLong.longUUID()); + String att_reference = entity.getSummaryId();//Summary_id JSONObject invoiceInfo = jsonArray.getJSONObject(i); String invoiceCode = invoiceInfo.getString("invoiceCode");//发票代码 String invoiceNumber = invoiceInfo.getString("invoiceNumber");//发票号码 String resultStatus = InvoiceState.invoiceStateGetValue(jsonResult.getString("resultStatus"));//开票结果 - String pdfUrl = invoiceInfo.getString("url");//pdf文件 - String ofdUrl = invoiceInfo.getString("ofdUrl");//ofd文件 - String xmlUrl = invoiceInfo.getString("xmlUrl");//xml文件 - //获取pdf文件到本地 并为pdf取名,否则会报无法访问错误 - logger.info("========开始将pdf文件保存到本地========"); - String pdfFileName = generateFileName(pdfUrl,"pdf"); - String pdfSavePath=invoicePdfUrl+pdfFileName; - downloadPdf(pdfUrl,pdfSavePath); - logger.info("========pdf文件保存到本地完成========"); - File filePdf=new File(pdfSavePath); - //获取ofd文件到本地 - logger.info("========开始将ofd文件保存到本地========"); - String ofdFileName = generateFileName(ofdUrl, "ofd"); - String ofdSavePath = ofdUrl + ofdFileName; - downloadPdf(ofdUrl,ofdSavePath); - logger.info("========ofd文件保存到本地完成========"); - File fileOfd=new File(ofdSavePath); + entity.setInvoice_code(invoiceCode); + entity.setInvoice_number(invoiceNumber); + entity.setResult_status(resultStatus); + //将开票结果,发票号码,发票代码,回写OA + invoiceDao.updateInvoiceResult(entity); + if (null != invoiceInfo.getString("url") || null != invoiceInfo.getString("ofdUrl")) { + String pdfUrl = invoiceInfo.getString("url");//pdf文件 + String ofdUrl = invoiceInfo.getString("ofdUrl");//ofd文件 + String xmlUrl = invoiceInfo.getString("xmlUrl");//xml文件 + //获取pdf文件到本地 并为pdf取名,否则会报无法访问错误 + logger.info("========开始将pdf文件保存到本地========"); + String pdfFileName = generateFileName(pdfUrl, "pdf"); + String pdfSavePath = invoicePdfUrl + pdfFileName; + downloadPdf(pdfUrl, pdfSavePath); + logger.info("========pdf文件保存到本地完成========"); + File filePdf = new File(pdfSavePath); + logger.info("========开始将pdf文件上传OA========"); + ManyfileUpload(filePdf, entity, sub_reference, att_reference, jsonObject); + logger.info("========pdf文件上传OA完成========"); + //获取ofd文件到本地 + logger.info("========开始将ofd文件保存到本地========"); + String ofdFileName = generateFileName(ofdUrl, "ofd"); + String ofdSavePath = ofdUrl + ofdFileName; + downloadPdf(ofdUrl, ofdSavePath); + logger.info("========ofd文件保存到本地完成========"); + File fileOfd = new File(ofdSavePath); + logger.info("========开始将ofd文件上传OA========"); + ManyfileUpload(fileOfd, entity, sub_reference, att_reference, jsonObject); + logger.info("========ofd文件上传OA完成========"); + } } } } @@ -180,6 +234,50 @@ public class InvoiceServiceImpl extends BaseService imple return null; } + private void ManyfileUpload(File file,InvoiceEntity entity,String sub_reference,String att_reference,JSONObject jsonObject){ + JSONObject jsonObjectOfd = OARestUtil.fileUpload(file,"8000590003","8000590001"); + if (jsonObjectOfd.getString("fileUrl") != null) { + entity.setUrl(sub_reference); + entity.setDataSourceCode("HT-OA"); + invoiceDao.updateInvoiceUrl(entity); + //根据附件id查询附件业务数据 + String file_url = jsonObjectOfd.getString("fileUrl"); + CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity(); + ctpAttachmentEntity.setFile_url(file_url); + ctpAttachmentEntity.setSub_reference(sub_reference); + ctpAttachmentEntity.setAtt_reference(att_reference); + ctpAttachmentEntity.setDataSourceCode("HT-OA"); + List ctpAttachmentEntities = ctpAttachmentDao.queryCtpAttachment(ctpAttachmentEntity); + //如果没有查询到数据,就新增附件业务,否则更新 + if (ctpAttachmentEntities.size() == 0) { + String category = jsonObject.getString("category"); + String type = jsonObject.getString("type"); + String filename = jsonObject.getString("filename"); + String mime_type = jsonObject.getString("mimeType"); + String attachment_size = jsonObject.getString("size"); + String id = String.valueOf(UUIDLong.longUUID()); + ctpAttachmentEntity.setCategory(category); + ctpAttachmentEntity.setFilename(filename); + ctpAttachmentEntity.setType(type); + ctpAttachmentEntity.setMime_type(mime_type); + ctpAttachmentEntity.setAttachment_size(attachment_size); + ctpAttachmentEntity.setId(id); + ctpAttachmentEntity.setCategory("66"); + ctpAttachmentEntity.setCreatedate(new Date()); + ctpAttachmentEntity.setDataSourceCode("HT-OA"); + ctpAttachmentDao.saveCtpAttachment(ctpAttachmentEntity); + } else { + if (ctpAttachmentEntities.size() > 1) { + throw new BaseSystemException("OA附件业务表中查到多条记录"); + } + //更新数据到OA附件业务表中 + ctpAttachmentDao.updateCtpAttachment(ctpAttachmentEntity); + } + logger.info("=====电子回单执行完毕======="); + } + file.delete(); + } + private void downloadPdf(String pdfUrl, String savePath) { try { URL url = new URL(pdfUrl); diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java index 84b42102..73b2d0dc 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java @@ -26,9 +26,9 @@ import java.util.List; * @Date 2024/6/17 15:49 **/ @Component -public class OARestUtil { +public class OARestUtil { @Autowired - private ISysApplicationApiService sysApplicationApiService; + private static ISysApplicationApiService sysApplicationApiService; static Logger logger = LoggerFactory.getLogger(OARestUtil.class); private OARestUtil() { @@ -41,14 +41,14 @@ public class OARestUtil { * @param api_code 接口编码 * @return */ - public JSONObject fileUpload(File file,String api_code) { - if (StrUtil.isNotEmpty(api_code)){ + public static JSONObject fileUpload(File file,String api_code_upload,String api_code_token) { + if (StrUtil.isNotEmpty(api_code_upload)){ //1、查询附件上传api接口信息 - SysApplicationApiEntity sysApp = getByCode(api_code); + SysApplicationApiEntity sysApp = getByCode(api_code_upload); if (null != sysApp){ String app_url = sysApp.getAppUrl(); String url = app_url+"/seeyon/rest/attachment?token=@token@"; - String token = getToken(null,"8000240000"); + String token = getToken(null,api_code_token); url = url.replaceAll("@token@",token); HashMap paramMap = new HashMap<>(); paramMap.put("file", file); @@ -147,7 +147,7 @@ public class OARestUtil { * @param api_code * @return */ - public String getToken(String login_name,String api_code){ + public static String getToken(String login_name,String api_code){ if (StrUtil.isNotEmpty(api_code)){ SysApplicationApiEntity sysApp = getByCode(api_code); return getToken(login_name,sysApp); @@ -162,7 +162,7 @@ public class OARestUtil { * @param sysApp 应用信息 * @return */ - public String getToken(String login_name,SysApplicationApiEntity sysApp){ + public static String getToken(String login_name,SysApplicationApiEntity sysApp){ if (null != sysApp){ HashMap hashMap = new HashMap<>(); String app_url = StrUtil.removeSuffix(sysApp.getAppUrl(), "/"); @@ -190,7 +190,7 @@ public class OARestUtil { } return null; } - private SysApplicationApiEntity getByCode(String api_code){ + private static SysApplicationApiEntity getByCode(String api_code){ if (StrUtil.isNotEmpty(api_code)){ SysApplicationApiEntity sysApp = new SysApplicationApiEntity(); sysApp.setApiCode(Long.valueOf(api_code)); diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java index 6646129b..bac70193 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java @@ -142,7 +142,7 @@ public class ZxBankServiceImpl extends BaseService impleme } } } else { - logger.info("三维单据视图数据没有需要同步中台的数据"); + logger.info("杭泰付款单没有需要同步中信的数据"); } }catch (Exception e){ logger.info("杭泰付款单同步失败:{}",e.getMessage()); @@ -301,8 +301,8 @@ public class ZxBankServiceImpl extends BaseService impleme logger.info("====调用中信电子回单下载得请求参数密文为:{}=======",objectData.toJSONString()); //因为电子回单下载返回的只有文件流,所以无法在中台上注册接口,只能代码中调用第三方接口 //将文件流的zip下载到文件夹中,之后解压该文件夹,得到pdf文件,上传OA - String downloadFolder ="D:\\yongansystem\\pdf\\"; - String destinationFolder ="D:\\yongansystem\\pdf\\"; + String downloadFolder ="D:\\yongansystem\\zxbank\\pdf\\"; + String destinationFolder ="D:\\yongansystem\\zxbank\\pdf\\"; URL url = new URL("http://202.108.57.65:11370/access/treasury/hangtai/bill/down"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); From ab0be7eb2854a0550bb642f1792c3c5ee1046fa8 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 16 Apr 2025 14:29:19 +0800 Subject: [PATCH 25/42] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/IncomeInvoiceEntity.java | 20 +++++++++---------- .../entity/IncomeInvoiceEntity.xml | 14 ++++++------- .../impl/IncomeInvoiceServiceImpl.java | 13 ++++++------ .../spring/spring-buildpackage-plugin.xml | 2 +- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java index 71fb1e71..51c2e8e3 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java @@ -8,8 +8,8 @@ import com.hzya.frame.web.entity.BaseEntity; */ public class IncomeInvoiceEntity extends BaseEntity { - private Integer data_id; - private Integer formmain_id; + private Integer dataId; + private Integer formmainId; private String field0127; private String field0128; private String field0129; @@ -17,20 +17,20 @@ public class IncomeInvoiceEntity extends BaseEntity { private String field0003; - public Integer getData_id() { - return data_id; + public Integer getDataId() { + return dataId; } - public void setData_id(Integer data_id) { - this.data_id = data_id; + public void setDataId(Integer dataId) { + this.dataId = dataId; } - public Integer getFormmain_id() { - return formmain_id; + public Integer getFormmainId() { + return formmainId; } - public void setFormmain_id(Integer formmain_id) { - this.formmain_id = formmain_id; + public void setFormmainId(Integer formmainId) { + this.formmainId = formmainId; } public String getField0127() { diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml index 7cde37a3..5ecedcf9 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml @@ -164,7 +164,7 @@ select - id as data_id + id as dataId from formson_0702 and field0128 = #{field0128} @@ -189,14 +189,14 @@ field0129 = #{field0129}, field0130 = #{field0130}, - where id = #{data_id} + where id = #{dataId} insert into formson_0702( - id , - formmain_id , + id , + formmain_id , field0127 , field0128 , field0129 , @@ -205,8 +205,8 @@ )values( - #{data_id} , - #{formmain_id} , + #{dataId} , + #{formmainId} , #{field0127} , #{field0128} , #{field0129} , diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index f7dc1424..b9d23461 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -462,23 +462,24 @@ public class IncomeInvoiceServiceImpl extends BaseService list = incomeInvoiceDao.queryOaZb(incomeInvoiceEntity); if(list != null && list.size() == 1){ - incomeInvoiceEntity.setFormmain_id(list.get(0).getData_id()); + incomeInvoiceEntity.setFormmainId(list.get(0).getDataId()); } List mxlist = incomeInvoiceDao.queryOaMx(incomeInvoiceEntity); if(mxlist != null && mxlist.size() == 1){ - incomeInvoiceEntity.setData_id(mxlist.get(0).getData_id()); + incomeInvoiceEntity.setDataId(mxlist.get(0).getDataId()); incomeInvoiceDao.updateMx(incomeInvoiceEntity); } if(mxlist == null || mxlist.size() == 0){ - incomeInvoiceEntity.setData_id(1); + incomeInvoiceEntity.setDataId(1); incomeInvoiceDao.saveMx(incomeInvoiceEntity); } } catch (Exception e) { diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml index 07ee22b0..2b9e4438 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml @@ -1,5 +1,5 @@ - + From d7518643be081615d7839039afe53c15e95fc6d1 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 17 Apr 2025 16:05:51 +0800 Subject: [PATCH 26/42] =?UTF-8?q?=E8=B4=A2=E6=8A=A5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/IIncomeInvoiceDao.java | 2 + .../dao/impl/IncomeInvoiceDaoImpl.java | 9 ++ .../entity/IncomeInvoiceEntity.java | 49 ++++++++ .../entity/IncomeInvoiceEntity.xml | 23 +++- .../FinancialReportPluginInitializer.java | 63 ++++++++++ .../service/IIncomeInvoiceService.java | 9 ++ .../impl/IncomeInvoiceServiceImpl.java | 115 ++++++++++++++---- .../spring/spring-buildpackage-plugin.xml | 1 + 8 files changed, 249 insertions(+), 22 deletions(-) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java index 512d1a80..0ed7033f 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java @@ -28,5 +28,7 @@ public interface IIncomeInvoiceDao extends IBaseDao int updateMx(IncomeInvoiceEntity incomeInvoiceEntity); int saveMx(IncomeInvoiceEntity incomeInvoiceEntity); + + List queryZtzz(IncomeInvoiceEntity entity); } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java index cc17e4a1..d5a438f6 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java @@ -52,5 +52,14 @@ public class IncomeInvoiceDaoImpl extends MybatisGenericDao queryZtzz(IncomeInvoiceEntity entity) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryZtzz", entity); + return o; + } + + } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java index 51c2e8e3..27f90943 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java @@ -8,6 +8,7 @@ import com.hzya.frame.web.entity.BaseEntity; */ public class IncomeInvoiceEntity extends BaseEntity { + //发票字段 private Integer dataId; private Integer formmainId; private String field0127; @@ -17,6 +18,54 @@ public class IncomeInvoiceEntity extends BaseEntity { private String field0003; + //财报数据 字段 + private String aloneId; + private String sysData; + private String orgCode; + private String orgName; + private String iufoVer; + + + public String getAloneId() { + return aloneId; + } + + public void setAloneId(String aloneId) { + this.aloneId = aloneId; + } + + public String getSysData() { + return sysData; + } + + public void setSysData(String sysData) { + this.sysData = sysData; + } + + public String getOrgCode() { + return orgCode; + } + + public void setOrgCode(String orgCode) { + this.orgCode = orgCode; + } + + public String getOrgName() { + return orgName; + } + + public void setOrgName(String orgName) { + this.orgName = orgName; + } + + public String getIufoVer() { + return iufoVer; + } + + public void setIufoVer(String iufoVer) { + this.iufoVer = iufoVer; + } + public Integer getDataId() { return dataId; } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml index 5ecedcf9..d923d284 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml @@ -53,6 +53,10 @@ kpr , skr , fhr , + url , + ofdurl , + xmlurl , + htbh , @@ -97,7 +101,10 @@ #{kpr} , #{skr} , #{fhr} , - + #{url} , + #{ofdurl} , + #{xmlurl} , + #{htbh} , ) @@ -214,5 +221,19 @@ ) + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java new file mode 100644 index 00000000..0c603f6f --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java @@ -0,0 +1,63 @@ +package com.hzya.frame.plugin.incomeInvoiceData.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 主数据同步 + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class FinancialReportPluginInitializer extends PluginBaseEntity{ + Logger logger = LoggerFactory.getLogger(FinancialReportPluginInitializer.class); + + @Autowired + private IIncomeInvoiceService incomeInvoiceService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "执行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "执行销毁方法destroy()"); + } + + @Override + public String getPluginId() { + return "FinancialReportPlugin"; + } + + @Override + public String getPluginName() { + return "FinancialReportPlugin插件"; + } + + @Override + public String getPluginLabel() { + return "FinancialReportPlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行进项全量发票主数据信息同步========"); + return incomeInvoiceService.sendFinancialReportPlugin(requestJson); + }catch (Exception e){ + logger.info("======执行进项全量发票主数据同步失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java index 08ca551f..2276deeb 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java @@ -12,6 +12,15 @@ import com.hzya.frame.web.entity.JsonResultEntity; * @since 2024-06-21 13:52:35 */ public interface IIncomeInvoiceService extends IBaseService { + /** + * @Author lvleigang + * @Description 全量发票数据 + * @Date 4:28 下午 2025/4/16 + * @param requestJson + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ JsonResultEntity getIncomeInvoiceData(JSONObject requestJson); SysExtensionApiEntity setData(SysExtensionApiEntity entity) throws Exception; + + JsonResultEntity sendFinancialReportPlugin(JSONObject requestJson); } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index b9d23461..ac801897 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -1,7 +1,9 @@ package com.hzya.frame.plugin.incomeInvoiceData.service.impl; +import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; import com.hzya.frame.plugin.incomeInvoiceData.dao.IIncomeInvoiceDao; import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity; import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService; @@ -15,6 +17,7 @@ import com.hzya.frame.uuid.UUIDLong; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; import org.apache.http.HttpEntity; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; @@ -33,6 +36,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; import javax.net.ssl.SSLContext; import java.io.IOException; import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -61,6 +65,13 @@ public class IncomeInvoiceServiceImpl extends BaseService 0){ @@ -461,26 +476,28 @@ public class IncomeInvoiceServiceImpl extends BaseService list = incomeInvoiceDao.queryOaZb(incomeInvoiceEntity); - if(list != null && list.size() == 1){ - incomeInvoiceEntity.setFormmainId(list.get(0).getDataId()); - } - List mxlist = incomeInvoiceDao.queryOaMx(incomeInvoiceEntity); - if(mxlist != null && mxlist.size() == 1){ - incomeInvoiceEntity.setDataId(mxlist.get(0).getDataId()); - incomeInvoiceDao.updateMx(incomeInvoiceEntity); - } - if(mxlist == null || mxlist.size() == 0){ - incomeInvoiceEntity.setDataId(1); - incomeInvoiceDao.saveMx(incomeInvoiceEntity); + if(jsonObject.getString("htbh") != null){ + IncomeInvoiceEntity incomeInvoiceEntity = new IncomeInvoiceEntity(); + incomeInvoiceEntity.setDataSourceCode("master");//todo + //incomeInvoiceEntity.setDataSourceCode("HT-OA");//todo + incomeInvoiceEntity.setField0003(jsonObject.getString("htbh"));//合同号 + incomeInvoiceEntity.setField0127(jsonObject.getString("fpdm"));//发票代码 + incomeInvoiceEntity.setField0128(jsonObject.getString("fphm"));//发票号码 + incomeInvoiceEntity.setField0129(jsonObject.getString("jshj"));//发票总额 + incomeInvoiceEntity.setField0130(jsonObject.getString("fpwj"));//发票文件 todo + List list = incomeInvoiceDao.queryOaZb(incomeInvoiceEntity); + if(list != null && list.size() == 1){ + incomeInvoiceEntity.setFormmainId(list.get(0).getDataId()); + } + List mxlist = incomeInvoiceDao.queryOaMx(incomeInvoiceEntity); + if(mxlist != null && mxlist.size() == 1){ + incomeInvoiceEntity.setDataId(mxlist.get(0).getDataId()); + incomeInvoiceDao.updateMx(incomeInvoiceEntity); + } + if(mxlist == null || mxlist.size() == 0){ + incomeInvoiceEntity.setDataId(1); + incomeInvoiceDao.saveMx(incomeInvoiceEntity); + } } } catch (Exception e) { e.printStackTrace(); @@ -488,6 +505,8 @@ public class IncomeInvoiceServiceImpl extends BaseService"); @@ -609,7 +628,7 @@ public class IncomeInvoiceServiceImpl extends BaseService").append(""); stringBuffer.append("").append(""); - stringBuffer.append(jsonObject.getString("fpwj") != null?"":""); + stringBuffer.append(jsonObject.getString("fpwj") != null?"":""); stringBuffer.append("").append(""); @@ -658,5 +677,59 @@ public class IncomeInvoiceServiceImpl extends BaseService list = incomeInvoiceDao.queryZtzz(entity); + if(list != null && list.size() > 0){ + for (int i = 0; i < list.size(); i++) { + //查询数据 + + + + + + + + + } + } + + return BaseResult.getSuccessMessageEntity("执行成功"); + } } diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml index 2b9e4438..2c2856fe 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml @@ -2,4 +2,5 @@ + From 203953ad8e3cf19eadc13e60dda89d88b749e8ba Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Thu, 17 Apr 2025 17:16:45 +0800 Subject: [PATCH 27/42] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E6=9F=A5=E8=AF=A2=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ryInputInvoiceResultPluginInitializer.java | 58 +++++++++++++++++ .../ht/spring/spring-buildpackage-plugin.xml | 1 + .../frame/seeyon/invoice/dao/IInvoiceDao.java | 10 +++ .../invoice/dao/impl/InvoiceDaoImpl.java | 6 ++ .../seeyon/invoice/entity/InvoiceEntity.java | 18 +++++ .../seeyon/invoice/entity/InvoiceEntity.xml | 13 +++- .../seeyon/invoice/entity/InvoiceState.java | 9 ++- .../invoice/service/IInvoiceService.java | 10 +++ .../service/impl/InvoiceServiceImpl.java | 65 +++++++++++++++++++ .../seeyon/zxbank/entity/ZxBankEntity.xml | 2 +- .../service/impl/ZxBankServiceImpl.java | 3 +- 11 files changed, 189 insertions(+), 6 deletions(-) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInputInvoiceResultPluginInitializer.java diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInputInvoiceResultPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInputInvoiceResultPluginInitializer.java new file mode 100644 index 00000000..52cd42ca --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInputInvoiceResultPluginInitializer.java @@ -0,0 +1,58 @@ +package com.hzya.frame.plugin.ht.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.zxBank.plugin.ZxBankResultPluginInitializer; +import com.hzya.frame.seeyon.invoice.service.impl.InvoiceServiceImpl; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +public class QueryInputInvoiceResultPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(QueryInputInvoiceResultPluginInitializer.class); + + @Autowired + private InvoiceServiceImpl invoiceService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "QueryInputInvoiceResultPluginInitializer"; + } + + @Override + public String getPluginName() { + return "查询发票批量录入返回结果插件"; + } + + @Override + public String getPluginLabel() { + return "QueryInputInvoiceResultPluginInitializer"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行查询税务进项发票批量录入返回结果========"); + return invoiceService.queryInputInvoiceResult(requestJson); + }catch (Exception e){ + logger.info("======执行查询税务进项发票批量录入返回结果失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml index cfef96a4..6758f61b 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml @@ -4,5 +4,6 @@ + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java index 57c91c0c..e8304591 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java @@ -59,4 +59,14 @@ public interface IInvoiceDao extends IBaseDao { * @Date 2025-04-14 16:35 * **/ Integer updateInvoiceResult(InvoiceEntity entity); + + /** + * + * @content 进项发票推送结果查询(查询发票批量录入结果) + * @Param + * @Return + * @Author hecan + * @Date 2025-04-17 15:19 + * **/ + List queryInputInvoiceResult(InvoiceEntity entity); } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java index 24f56359..1d189240 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java @@ -56,4 +56,10 @@ public class InvoiceDaoImpl extends MybatisGenericDao impl public Integer updateInvoiceResult(InvoiceEntity entity) { return super.update("updateInvoiceResult",entity); } + + @DS("#entity.dataSourceCode") + @Override + public List queryInputInvoiceResult(InvoiceEntity entity) { + return (List)super.selectList("queryInputInvoiceResult",entity); + } } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java index b2d700af..239b0659 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java @@ -73,6 +73,24 @@ public class InvoiceEntity extends BaseEntity { private String result_status;// 开票结果 private String summaryId;// + private String input_result_status_filed;//进项发票结果字段 + private String input_result_status;//进项发票结果 + + public String getInput_result_status_filed() { + return input_result_status_filed; + } + + public void setInput_result_status_filed(String input_result_status_filed) { + this.input_result_status_filed = input_result_status_filed; + } + + public String getInput_result_status() { + return input_result_status; + } + + public void setInput_result_status(String input_result_status) { + this.input_result_status = input_result_status; + } public String getSummaryId() { return summaryId; diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml index 2247a385..10213540 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml @@ -87,6 +87,12 @@ from v_hzya_invoice where push_status is not null and url is null and (result_status is null or result_status='申请单处理中') + + update ${tabName} set ${url_field} =#{url} where id=#{id} @@ -101,9 +107,10 @@ update ${tabName} set - invoice_code_field = #{invoiceCode}, - invoice_number_field = #{invoiceNumber}, - result_status_field = #{resultStatus}, + ${input_result_status_filed} = #{input_result_status}, + ${invoice_code_field} = #{invoice_code}, + ${invoice_number_field} = #{invoice_number}, + ${result_status_field} = #{result_status}, where id=#{id} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceState.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceState.java index 38a119ba..cf584ee3 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceState.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceState.java @@ -6,7 +6,14 @@ public enum InvoiceState { zero("0","申请单被关闭"), one("1","申请单开票成功"), two("2","申请单处理中"), - three("3","申请单开具异常"); + three("3","申请单开具异常"), + inputZero("0","进行中"), + inputOne("1","全部成功"), + inputTwo("2","部分失败"), + inputThree("3","全部失败"); + + + private String type; //值 diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/IInvoiceService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/IInvoiceService.java index 45f34f2c..05d18405 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/IInvoiceService.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/IInvoiceService.java @@ -26,4 +26,14 @@ public interface IInvoiceService extends IBaseService { * @Date 2025-04-02 14:10 * **/ JsonResultEntity queryInvoiceResult(JSONObject json); + + /** + * + * @content 进项发票推送结果查询(查询发票批量录入结果) + * @Param + * @Return + * @Author hecan + * @Date 2025-04-17 15:11 + * **/ + JsonResultEntity queryInputInvoiceResult(JSONObject json); } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java index af842b00..199745c8 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -16,6 +16,7 @@ import com.hzya.frame.seeyon.invoice.entity.InvoiceState; import com.hzya.frame.seeyon.invoice.service.IInvoiceService; import com.hzya.frame.seeyon.util.OARestUtil; import com.hzya.frame.seeyon.util.YzfSignUtil; +import com.hzya.frame.seeyon.zxbank.entity.PayState; import com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity; import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; @@ -234,6 +235,70 @@ public class InvoiceServiceImpl extends BaseService imple return null; } + //进项发票推送结果查询(查询发票批量录入结果) + @Override + public JsonResultEntity queryInputInvoiceResult(JSONObject json) { + try { + InvoiceEntity invoiceEntity = json.toJavaObject(InvoiceEntity.class); + invoiceEntity.setDataSourceCode("HT-OA"); + logger.info("=======开始查询杭泰税务的发票批量录入返回结果========="); + List invoiceEntities = invoiceDao.queryInputInvoiceResult(invoiceEntity); + if(CollectionUtils.isEmpty(invoiceEntities)){ + logger.info("=====杭泰税务中没有需要查询发票批量录入返回结果的数据========"); + return BaseResult.getSuccessMessageEntity("查询成功"); + } + for (InvoiceEntity entity : invoiceEntities) { + long timestamp = System.currentTimeMillis(); + Map parametersMap = new HashMap<>(); + parametersMap.put("accessKey","6X3B526P5HqE6ums"); + parametersMap.put("timestamp",timestamp); + String sign = YzfSignUtil.signRequest(parametersMap,"34e5fc32ac894a2ba2ade8c3852c7a0a"); + JSONObject jsonObject=new JSONObject(); + jsonObject.put("serialNumber",entity.getId()); + jsonObject.put("accessKey","6X3B526P5HqE6ums"); + jsonObject.put("sign",sign); + jsonObject.put("timestamp",timestamp); + logger.info("=======调用杭泰税务查询发票批量录入结果的请求参数为:{}=======",jsonObject.toJSONString()); + //发送数据 + String result = HttpRequest.post(url). + header("appId", "800060"). + header("apiCode", "8000600006"). + header("publicKey", "ZJYAmRjjYEDgqw4UXWHZNicYclErG0hsrwKQcHukPlP0K1pCe7eDIk+3zDUT+v578prj"). + header("secretKey", "D6AHU3PL8UsNfK6A8I6mL4X1ma2NXckX/vM7AOzI/jmzJf+R1aY06Q6SBz7Y7drHj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(jsonObject.toJSONString()). + execute(). + body(); + logger.info("=====调用杭泰税务查询发票批量录入结果的返回参数为:{}===========",result); + JSONObject resultJson = JSONObject.parseObject(result); + if (!resultJson.getBoolean("flag")) { + saveTaskLivingDetails(entity.getId(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false,""); + } else { + JSONObject attribute = resultJson.getJSONObject("attribute"); + if("0".equals(attribute.getString("code"))) { + JSONObject jsonResult = JSONObject.parseObject(attribute.getString("result")); + if (null != jsonResult) { + String serialNumber = jsonResult.getString("serialNumber");//流水号 + String status = jsonResult.getString("status");//发票批量录入返回结果状态 + if(serialNumber.equals(entity.getId())){ + //修改发票批量录入结果状态 + logger.info("=========开始更新进项发票的结果=========="); + entity.setInput_result_status(InvoiceState.invoiceStateGetValue(status)); + entity.setDataSourceCode("HT-OA"); + invoiceDao.updateInvoiceResult(entity); + logger.info("=========更新进项发票的结果完成=========="); + saveTaskLivingDetails(entity.getId(),entity.getBusiness_no(),jsonObject.toJSONString(), resultJson.toJSONString(), true,""); + } + } + } + } + } + }catch (Exception e){ + logger.info("======查询杭泰税务发票批量录入结果失败====",e.getMessage()); + e.printStackTrace(); + } + return null; + } + private void ManyfileUpload(File file,InvoiceEntity entity,String sub_reference,String att_reference,JSONObject jsonObject){ JSONObject jsonObjectOfd = OARestUtil.fileUpload(file,"8000590003","8000590001"); if (jsonObjectOfd.getString("fileUrl") != null) { diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml index b8c383c8..74f290c8 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml @@ -76,7 +76,7 @@ - select - alone_id as aloneId, - keyword2 as sysData, - orgs.code as orgCode, - orgs.name as orgName, - iufo.ver as iufoVer - from IUFO_MEASPUB_VIOU iufo - LEFT JOIN org_orgs orgs on iufo.keyword1 = orgs.pk_org - where iufo.keyword2 = #{sysData} - and ver = '0' + SELECT + * + FROM + ( + SELECT + iufo.alone_id AS aloneId, + iufo.keyword2 AS sysData, + orgs.code AS orgCode, + orgs.name AS orgName, + iufo.ver AS iufoVer + FROM + IUFO_MEASPUB_VIOU iufo + LEFT JOIN org_orgs orgs ON iufo.keyword1 = orgs.pk_org + + + and orgs.code = #{orgCode} + and ver = '0' + and iufo.keyword2 LIKE CONCAT(#{sysData}, '%') + + ORDER BY + iufo.keyword2 DESC + ) + WHERE + ROWNUM = 1 + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index ac801897..29eef34c 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -690,6 +690,14 @@ public class IncomeInvoiceServiceImpl extends BaseService list = incomeInvoiceDao.queryZtzz(entity); - if(list != null && list.size() > 0){ - for (int i = 0; i < list.size(); i++) { - //查询数据 - - - - - - - - - } + IncomeInvoiceEntity jnentity = new IncomeInvoiceEntity(); + jnentity.setDataSourceCode(""); + jnentity.setSysData(jnDate); + jnentity.setOrgCode(orgCode); + List jnlist = incomeInvoiceDao.queryZtzz(jnentity); + if(jnlist != null && jnlist.size() == 1){ + dyAloneId = jnlist.get(0); + }else { + return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送"); } + //查询帐套组织 + IncomeInvoiceEntity qnentity = new IncomeInvoiceEntity(); + qnentity.setDataSourceCode(""); + qnentity.setSysData(jnDate); + qnentity.setOrgCode(orgCode); + List qnlist = incomeInvoiceDao.queryZtzz(qnentity); + if(qnlist != null && qnlist.size() == 1){ + qnAloneId = qnlist.get(0); + }else { + logger.info("未查询到当月的财报数据"); + } + + //查找今年数据 + IncomeInvoiceEntity jnquerydata = new IncomeInvoiceEntity(); + jnquerydata.setDataSourceCode(""); + jnquerydata.setAloneId(dyAloneId.getAloneId()); + List dydataList = incomeInvoiceDao.queryByAloneId(jnquerydata); + if(dydataList != null && dydataList.size() == 1){ + dydata = dydataList.get(0); + }else { + return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送"); + } + + //查找去年数据 + IncomeInvoiceEntity qnquerydata = new IncomeInvoiceEntity(); + qnquerydata.setDataSourceCode(""); + qnquerydata.setAloneId(qnAloneId.getAloneId()); + List qndataList = incomeInvoiceDao.queryByAloneId(qnquerydata); + if(qndataList != null && qndataList.size() == 1){ + qndata = qndataList.get(0); + } + //拼接数据 + + + return BaseResult.getSuccessMessageEntity("执行成功"); } From 182994104da4b8ac8a73105970454af5f6cfa0fe Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 22 Apr 2025 13:35:03 +0800 Subject: [PATCH 30/42] =?UTF-8?q?=E8=B4=A2=E6=8A=A5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IncomeInvoiceServiceImpl.java | 170 ++++++++++-------- 1 file changed, 96 insertions(+), 74 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index 29eef34c..ac0e2b82 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -36,6 +36,7 @@ import com.hzya.frame.basedao.service.impl.BaseService; import javax.net.ssl.SSLContext; import java.io.IOException; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; @@ -686,85 +687,106 @@ public class IncomeInvoiceServiceImpl extends BaseService jnlist = incomeInvoiceDao.queryZtzz(jnentity); - if(jnlist != null && jnlist.size() == 1){ - dyAloneId = jnlist.get(0); - }else { - return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送"); - } - //查询帐套组织 - IncomeInvoiceEntity qnentity = new IncomeInvoiceEntity(); - qnentity.setDataSourceCode(""); - qnentity.setSysData(jnDate); - qnentity.setOrgCode(orgCode); - List qnlist = incomeInvoiceDao.queryZtzz(qnentity); - if(qnlist != null && qnlist.size() == 1){ - qnAloneId = qnlist.get(0); - }else { - logger.info("未查询到当月的财报数据"); - } - - //查找今年数据 - IncomeInvoiceEntity jnquerydata = new IncomeInvoiceEntity(); - jnquerydata.setDataSourceCode(""); - jnquerydata.setAloneId(dyAloneId.getAloneId()); - List dydataList = incomeInvoiceDao.queryByAloneId(jnquerydata); - if(dydataList != null && dydataList.size() == 1){ - dydata = dydataList.get(0); - }else { - return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送"); - } - - //查找去年数据 - IncomeInvoiceEntity qnquerydata = new IncomeInvoiceEntity(); - qnquerydata.setDataSourceCode(""); - qnquerydata.setAloneId(qnAloneId.getAloneId()); - List qndataList = incomeInvoiceDao.queryByAloneId(qnquerydata); - if(qndataList != null && qndataList.size() == 1){ - qndata = qndataList.get(0); - } - //拼接数据 - return BaseResult.getSuccessMessageEntity("执行成功"); + + //JSONObject jsonObject = requestJson.getJSONObject("jsonStr"); + //String cdDate = null; + //String jnDate = null; + //String qnDate = null; + //String orgCode = "X0644"; + //IncomeInvoiceEntity dyAloneId = null; + //JSONObject dydata = null; + //JSONObject qndata = null; + //IncomeInvoiceEntity qnAloneId = null; + //if(requestJson.getString("orgCode") != null){ + // orgCode = requestJson.getString("orgCode"); + //} + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + //if(requestJson.getString("year") != null && requestJson.getString("month") != null){ + // cdDate = requestJson.getString("year") + "-" + requestJson.getString("month"); + // if("13".equals(requestJson.getString("month"))){ + // cdDate = requestJson.getString("year") + "-12"; + // qnDate = (requestJson.getInteger("year")-1) + "-12"; + // }else { + // cdDate = requestJson.getString("year") + "-" + requestJson.getString("month"); + // qnDate = (requestJson.getInteger("year")-1) + "-" + requestJson.getString("month"); + // } + //}else { + // cdDate = sdf.format(new Date()); + // jnDate = sdf.format(new Date()); + // Calendar calendar = Calendar.getInstance(); + // calendar.setTime(new Date()); + // calendar.add(Calendar.YEAR, -1); + // Date qn = calendar.getTime(); + // qnDate = sdf.format(qn); + //} + // + ////查询帐套组织 + //IncomeInvoiceEntity jnentity = new IncomeInvoiceEntity(); + //jnentity.setDataSourceCode(""); + //jnentity.setSysData(jnDate); + //jnentity.setOrgCode(orgCode); + //List jnlist = incomeInvoiceDao.queryZtzz(jnentity); + //if(jnlist != null && jnlist.size() == 1){ + // dyAloneId = jnlist.get(0); + //}else { + // return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送"); + //} + ////查询帐套组织 + //IncomeInvoiceEntity qnentity = new IncomeInvoiceEntity(); + //qnentity.setDataSourceCode(""); + //qnentity.setSysData(jnDate); + //qnentity.setOrgCode(orgCode); + //List qnlist = incomeInvoiceDao.queryZtzz(qnentity); + //if(qnlist != null && qnlist.size() == 1){ + // qnAloneId = qnlist.get(0); + //}else { + // logger.info("未查询到当月的财报数据"); + //} + // + ////查找今年数据 + //IncomeInvoiceEntity jnquerydata = new IncomeInvoiceEntity(); + //jnquerydata.setDataSourceCode(""); + //jnquerydata.setAloneId(dyAloneId.getAloneId()); + //List dydataList = incomeInvoiceDao.queryByAloneId(jnquerydata); + //if(dydataList != null && dydataList.size() == 1){ + // dydata = dydataList.get(0); + //}else { + // return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送"); + //} + // + // //查找去年数据 + //IncomeInvoiceEntity qnquerydata = new IncomeInvoiceEntity(); + //qnquerydata.setDataSourceCode(""); + //qnquerydata.setAloneId(qnAloneId.getAloneId()); + //List qndataList = incomeInvoiceDao.queryByAloneId(qnquerydata); + //if(qndataList != null && qndataList.size() == 1){ + // qndata = qndataList.get(0); + //} + ////拼接数据 + // + // + // + // + //return BaseResult.getSuccessMessageEntity("执行成功"); } } From 56008918facb4c230ff4ca2314c5622909701765 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 22 Apr 2025 15:48:32 +0800 Subject: [PATCH 31/42] =?UTF-8?q?=E7=89=A9=E6=96=99=E5=AF=B9=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IncomeInvoiceServiceImpl.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index ac0e2b82..0abd1310 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -694,10 +694,22 @@ public class IncomeInvoiceServiceImpl extends BaseService Date: Wed, 23 Apr 2025 09:16:02 +0800 Subject: [PATCH 32/42] =?UTF-8?q?=E7=89=A9=E6=96=99=E5=AF=B9=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinancialReportPluginInitializer.java | 4 +- .../impl/IncomeInvoiceServiceImpl.java | 23 +- .../service/impl/ApplicationCache.java | 4 + .../seeyon/service/ISeeYonInterFace.java | 7 + .../service/impl/SeeYonInterFaceImpl.java | 278 ++++++++++++++++++ 5 files changed, 311 insertions(+), 5 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java index 0c603f6f..81153779 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java @@ -52,10 +52,10 @@ public class FinancialReportPluginInitializer extends PluginBaseEntity{ @Override public JsonResultEntity executeBusiness(JSONObject requestJson) { try { - logger.info("======开始执行进项全量发票主数据信息同步========"); + logger.info("======开始执行财务信息同步========"); return incomeInvoiceService.sendFinancialReportPlugin(requestJson); }catch (Exception e){ - logger.info("======执行进项全量发票主数据同步失败:{}========",e.getMessage()); + logger.info("======执行财务同步失败:{}========",e.getMessage()); e.printStackTrace(); } return null; diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index 0abd1310..1432ba2a 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -702,13 +702,13 @@ public class IncomeInvoiceServiceImpl extends BaseService 0){ for (int i = 0; i < receiveApiList.size(); i++) { applicationApiMap.put("appId"+receiveApiList.get(i).getAppId()+"apiCode"+receiveApiList.get(i).getApiCode(), receiveApiList.get(i)); + applicationApiMap.put("apiId"+receiveApiList.get(i).getId(), receiveApiList.get(i)); } } break; diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java index 762023b7..a8566a2b 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java @@ -64,6 +64,13 @@ public interface ISeeYonInterFace { * @throws Exception */ SysExtensionApiEntity colEventPre(SysExtensionApiEntity sysExtensionApi)throws Exception; + /** + * seeyon流程事件监听前置方法,绑定数据源 + * @param entity + * @return + * @throws Exception + */ + SysExtensionApiEntity getToken(SysExtensionApiEntity entity) throws Exception; /** * seeyon流程事件监听 * @param jsonObject diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java index 8e8be89e..1ad93a9e 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java @@ -6,6 +6,7 @@ import cn.hutool.core.map.MapBuilder; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -13,22 +14,34 @@ import com.hzya.frame.seeyon.dao.ISeeYonInterFaceDao; import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; import com.hzya.frame.seeyon.service.ISeeYonInterFace; +import com.hzya.frame.sys.sysenum.SysEnum; import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; import com.hzya.frame.sysnew.application.api.service.ISysApplicationApiService; import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao; import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.sysnew.application.service.impl.ApplicationCache; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import com.hzya.frame.web.exception.BaseSystemException; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpEntity; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -54,6 +67,10 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { private ISysApplicationDatabaseDao sysApplicationDatabaseDao; @Autowired private ISysApplicationApiService sysApplicationApiService; + @Value("${zt.url}") + private String url ; + @Resource + private ApplicationCache applicationCache; /** * 定义所支持的事件静态代码块 */ @@ -504,4 +521,265 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { } return null; } + + @Override + public SysExtensionApiEntity getToken(SysExtensionApiEntity entity) { + Map headers = entity.getHeaders(); + SysApplicationApiEntity sysApplicationEntity = entity.getReceiveApi(); + SysApplicationEntity sendApp = entity.getSendApp(); + SysApplicationEntity receiveApp = entity.getReceiveApp(); + if("1".equals(sysApplicationEntity.getNeedLogin()) && sysApplicationEntity.getAuthenticationPort() != null){ + SysApplicationApiEntity loginApi = getApiByAppIdApiCode(sysApplicationEntity.getAuthenticationPort()); + if (null == loginApi) { + return entity; + } + String rzquerys = getQuery(loginApi,null,null); + Map headersa = new HashMap<>(); + headersa.put("publicKey", sendApp.getPublicKey()); + headersa.put("secretKey", sendApp.getSecretKey()); + headersa.put("appId", receiveApp.getAppId().toString()); + headersa.put("apiCode", loginApi.getApiCode().toString()); + Map rzheaders = getHeaders(loginApi,headersa,null); + String rzbodys = getBodys(loginApi,null,null); + JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); + if (!rzjsonResultEntity.isFlag()) { + return entity; + } + JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + headers.put("token",attritube.getJSONObject("attribute").getString("id")); + } + entity.setHeaders(headers); + return entity; + } + private SysApplicationApiEntity getApiByAppIdApiCode(String apiId) { + + String str = "apiId" + apiId ; + Object o = applicationCache.get("5", str); + if (o != null) { + return (SysApplicationApiEntity) o; + } + return null; + } + private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map headers ,String bodys ,String querys) { + StringBuffer urls = new StringBuffer(url); + if (querys != null) { + urls.append("?"); + urls.append(querys); + } + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpPost post = new HttpPost(urls.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(Integer.valueOf(applicationApiEntity.getTimeoutPeriod())).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + boolean flag = true; + try { + if (bodys != null && !"".equals(bodys)) { + ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + + HttpEntity entity = response.getEntity(); + body.append(EntityUtils.toString(entity,"UTF-8")); + flag = true; + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + flag = false; + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + if (flag) { + if (JSONUtil.isTypeJSON(body.toString())) { + JsonResultEntity jsonResultEntity = JSONObject.parseObject(body.toString(),JsonResultEntity.class); + if(jsonResultEntity.isFlag()){ + return BaseResult.getSuccessMessageEntity("转发成功", body); + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + + private String getBodys(SysApplicationApiEntity loginApi,String sendDatastr, JSONObject loginData) { + JSONObject sendData = new JSONObject(); + if(sendDatastr != null ){ + sendData = JSONObject.parseObject(sendDatastr); + } + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getBodyIn() != null && !"".equals(loginApi.getBodyIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getBodyIn())) { + JSONArray headerbodyArray = JSON.parseArray(loginApi.getBodyIn()); + JSONObject bodyjson = headerbodyArray.getJSONObject(0); + JSONArray headerArray = bodyjson.getJSONArray("children"); + for (int i = 0; i < headerArray.size(); i++) { + //获取到第一个数据 + JSONObject querys = headerArray.getJSONObject(i); + if (SysEnum.FUNDAMENTAL.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + sendData.put(querys.getString(SysEnum.PARAMETERNAME.getValue()),query); + } + } + } + } + } + return sendData.toString(); + } + + private Map getHeaders(SysApplicationApiEntity loginApi,Map map,JSONObject loginData) { + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getHeaderIn() != null && !"".equals(loginApi.getHeaderIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getHeaderIn())) { + JSONArray headerArray = JSON.parseArray(loginApi.getHeaderIn()); + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + JSONArray example = JSONArray.parseArray(query); + String logValue = getObjectValue(loginData, example); + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue); + } + } else { + if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue())); + } + } else {//没有值直接拼接 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), ""); + } + } + } + } + } + } + return map; + + + + + } + + /** + * @param loginData + * @param example + * @return java.lang.String + * @Author lvleigang + * @Description 根据jsonArray 获取jsonobject中的值 + * @Date 11:47 上午 2023/8/31 + **/ + private String getObjectValue(JSONObject loginData, JSONArray example) { + String values = ""; + if (example != null && example.size() > 0) { + for (int i = 0; i < example.size(); i++) { + if (loginData.getString(example.getString(i)) != null && !"".equals(loginData.getString(example.getString(i)))) { + if (i == (example.size() - 1)) { + values = loginData.getString(example.getString(i)); + } else { + loginData = JSONObject.parseObject(loginData.getString(example.getString(i))); + } + } else { + return values; + } + } + } + return values; + } + private String getQuery(SysApplicationApiEntity loginApi,String sendDatastr,JSONObject loginData) { + Map map = new HashMap<>(); + if(sendDatastr != null){ + String[] parts = sendDatastr.split("&"); + if(parts != null && parts.length > 0){ + for (int i = 0; i < parts.length; i++) { + String[] part = parts[i].split("="); + if(part != null && part.length >=2 ){ + for (int a = 0; a < part.length; a++) { + map.put(part[0],part[1]); + } + } + } + } + } + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getQueryIn() != null && !"".equals(loginApi.getQueryIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getQueryIn())) { + JSONArray headerArray = JSON.parseArray(loginApi.getQueryIn()); + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + JSONArray example = JSONArray.parseArray(query); + String logValue = getObjectValue(loginData, example); + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue); + } + } else { + //不是认证类型直接取值 + if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue())); + } + } else {//没有值直接拼接 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), ""); + } + } + } + } + } + } + StringBuffer returnStr = new StringBuffer(); + if(map != null && map.size() > 0){ + for (String key : map.keySet()) { + if("".equals(returnStr)){ + returnStr.append(key).append("=").append(map.get(key)); + }else { + returnStr.append("&").append(key).append("=").append(map.get(key)); + } + } + } + return returnStr.toString(); + } } From e3aee87674fd7aa01468ecf6c86bd4fdfde52365 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 23 Apr 2025 11:14:26 +0800 Subject: [PATCH 33/42] =?UTF-8?q?=E7=89=A9=E6=96=99=E5=AF=B9=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SeeYonInterFaceImpl.java | 277 ++++++++++++++++++ 1 file changed, 277 insertions(+) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java index 619d0eca..d8c718ce 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java @@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -13,12 +14,14 @@ import com.hzya.frame.seeyon.dao.ISeeYonInterFaceDao; import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; import com.hzya.frame.seeyon.service.ISeeYonInterFace; +import com.hzya.frame.sys.sysenum.SysEnum; import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; import com.hzya.frame.sysnew.application.api.service.ISysApplicationApiService; import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao; import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.sysnew.application.service.impl.ApplicationCache; import com.hzya.frame.util.PluginUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; @@ -26,12 +29,22 @@ import com.hzya.frame.web.exception.BaseSystemException; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpEntity; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.util.EntityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -77,6 +90,10 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { private ISeeYonInterFaceDao seeYonInterFaceDao; //上一次同步时间 private final String LAST_SYNCHRONISED_TIME = ""; + @Value("${zt.url}") + private String url ; + @Resource + private ApplicationCache applicationCache; { eventTypeBuffer.append("发起前事件 onBeforeStart ,"); @@ -564,4 +581,264 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { } + @Override + public SysExtensionApiEntity getToken(SysExtensionApiEntity entity) { + Map headers = entity.getHeaders(); + SysApplicationApiEntity sysApplicationEntity = entity.getReceiveApi(); + SysApplicationEntity sendApp = entity.getSendApp(); + SysApplicationEntity receiveApp = entity.getReceiveApp(); + if("1".equals(sysApplicationEntity.getNeedLogin()) && sysApplicationEntity.getAuthenticationPort() != null){ + SysApplicationApiEntity loginApi = getApiByAppIdApiCode(sysApplicationEntity.getAuthenticationPort()); + if (null == loginApi) { + return entity; + } + String rzquerys = getQuery(loginApi,null,null); + Map headersa = new HashMap<>(); + headersa.put("publicKey", sendApp.getPublicKey()); + headersa.put("secretKey", sendApp.getSecretKey()); + headersa.put("appId", receiveApp.getAppId().toString()); + headersa.put("apiCode", loginApi.getApiCode().toString()); + Map rzheaders = getHeaders(loginApi,headersa,null); + String rzbodys = getBodys(loginApi,null,null); + JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); + if (!rzjsonResultEntity.isFlag()) { + return entity; + } + JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + headers.put("token",attritube.getJSONObject("attribute").getString("id")); + } + entity.setHeaders(headers); + return entity; + } + private SysApplicationApiEntity getApiByAppIdApiCode(String apiId) { + + String str = "apiId" + apiId ; + Object o = applicationCache.get("5", str); + if (o != null) { + return (SysApplicationApiEntity) o; + } + return null; + } + private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map headers ,String bodys ,String querys) { + StringBuffer urls = new StringBuffer(url); + if (querys != null) { + urls.append("?"); + urls.append(querys); + } + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpPost post = new HttpPost(urls.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(Integer.valueOf(applicationApiEntity.getTimeoutPeriod())).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + boolean flag = true; + try { + if (bodys != null && !"".equals(bodys)) { + ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + + HttpEntity entity = response.getEntity(); + body.append(EntityUtils.toString(entity,"UTF-8")); + flag = true; + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + flag = false; + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + if (flag) { + if (JSONUtil.isTypeJSON(body.toString())) { + JsonResultEntity jsonResultEntity = JSONObject.parseObject(body.toString(),JsonResultEntity.class); + if(jsonResultEntity.isFlag()){ + return BaseResult.getSuccessMessageEntity("转发成功", body); + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + + private String getBodys(SysApplicationApiEntity loginApi,String sendDatastr, JSONObject loginData) { + JSONObject sendData = new JSONObject(); + if(sendDatastr != null ){ + sendData = JSONObject.parseObject(sendDatastr); + } + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getBodyIn() != null && !"".equals(loginApi.getBodyIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getBodyIn())) { + JSONArray headerbodyArray = JSON.parseArray(loginApi.getBodyIn()); + JSONObject bodyjson = headerbodyArray.getJSONObject(0); + JSONArray headerArray = bodyjson.getJSONArray("children"); + for (int i = 0; i < headerArray.size(); i++) { + //获取到第一个数据 + JSONObject querys = headerArray.getJSONObject(i); + if (SysEnum.FUNDAMENTAL.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + sendData.put(querys.getString(SysEnum.PARAMETERNAME.getValue()),query); + } + } + } + } + } + return sendData.toString(); + } + + private Map getHeaders(SysApplicationApiEntity loginApi,Map map,JSONObject loginData) { + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getHeaderIn() != null && !"".equals(loginApi.getHeaderIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getHeaderIn())) { + JSONArray headerArray = JSON.parseArray(loginApi.getHeaderIn()); + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + JSONArray example = JSONArray.parseArray(query); + String logValue = getObjectValue(loginData, example); + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue); + } + } else { + if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue())); + } + } else {//没有值直接拼接 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), ""); + } + } + } + } + } + } + return map; + + + + + } + + /** + * @param loginData + * @param example + * @return java.lang.String + * @Author lvleigang + * @Description 根据jsonArray 获取jsonobject中的值 + * @Date 11:47 上午 2023/8/31 + **/ + private String getObjectValue(JSONObject loginData, JSONArray example) { + String values = ""; + if (example != null && example.size() > 0) { + for (int i = 0; i < example.size(); i++) { + if (loginData.getString(example.getString(i)) != null && !"".equals(loginData.getString(example.getString(i)))) { + if (i == (example.size() - 1)) { + values = loginData.getString(example.getString(i)); + } else { + loginData = JSONObject.parseObject(loginData.getString(example.getString(i))); + } + } else { + return values; + } + } + } + return values; + } + private String getQuery(SysApplicationApiEntity loginApi,String sendDatastr,JSONObject loginData) { + Map map = new HashMap<>(); + if(sendDatastr != null){ + String[] parts = sendDatastr.split("&"); + if(parts != null && parts.length > 0){ + for (int i = 0; i < parts.length; i++) { + String[] part = parts[i].split("="); + if(part != null && part.length >=2 ){ + for (int a = 0; a < part.length; a++) { + map.put(part[0],part[1]); + } + } + } + } + } + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getQueryIn() != null && !"".equals(loginApi.getQueryIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getQueryIn())) { + JSONArray headerArray = JSON.parseArray(loginApi.getQueryIn()); + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + JSONArray example = JSONArray.parseArray(query); + String logValue = getObjectValue(loginData, example); + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue); + } + } else { + //不是认证类型直接取值 + if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue())); + } + } else {//没有值直接拼接 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), ""); + } + } + } + } + } + } + StringBuffer returnStr = new StringBuffer(); + if(map != null && map.size() > 0){ + for (String key : map.keySet()) { + if("".equals(returnStr)){ + returnStr.append(key).append("=").append(map.get(key)); + }else { + returnStr.append("&").append(key).append("=").append(map.get(key)); + } + } + } + return returnStr.toString(); + } } From 3e0f30bcc0f14d97083c4a8c219fb2eea2bd2882 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 23 Apr 2025 14:06:02 +0800 Subject: [PATCH 34/42] =?UTF-8?q?=E7=89=A9=E6=96=99=E5=AF=B9=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IncomeInvoiceServiceImpl.java | 237 ++++++++++++------ 1 file changed, 155 insertions(+), 82 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index 1432ba2a..916c69a3 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -30,11 +30,14 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.ssl.SSLContextBuilder; import org.apache.http.util.EntityUtils; +import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import com.hzya.frame.basedao.service.impl.BaseService; import javax.net.ssl.SSLContext; import java.io.IOException; +import java.math.BigDecimal; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; @@ -59,6 +62,7 @@ public class IncomeInvoiceServiceImpl extends BaseService jnlist = incomeInvoiceDao.queryZtzz(jnentity); + if(jnlist != null && jnlist.size() == 1){ + dyAloneId = jnlist.get(0); + }else { + return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送"); + } + //查询去年当帐套组织 + IncomeInvoiceEntity qnentity = new IncomeInvoiceEntity(); + qnentity.setDataSourceCode(""); + qnentity.setSysData(qncjzq); + qnentity.setOrgCode(ztbm); + List qnlist = incomeInvoiceDao.queryZtzz(qnentity); + if(qnlist != null && qnlist.size() == 1){ + qnAloneId = qnlist.get(0); + }else { + logger.info("未查询到去年当期的财报数据"); + } + + //查询当月的财报数据 + IncomeInvoiceEntity jnquerydata = new IncomeInvoiceEntity(); + jnquerydata.setDataSourceCode(""); + jnquerydata.setAloneId(dyAloneId.getAloneId()); + List dydataList = incomeInvoiceDao.queryByAloneId(jnquerydata); + if(dydataList != null && dydataList.size() == 1){ + dydata = dydataList.get(0); + }else { + return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送"); + } + //查询去年当期的财报数据 + if(qnAloneId != null){ + //查找去年数据 + IncomeInvoiceEntity qnquerydata = new IncomeInvoiceEntity(); + qnquerydata.setDataSourceCode(""); + qnquerydata.setAloneId(qnAloneId.getAloneId()); + List qndataList = incomeInvoiceDao.queryByAloneId(qnquerydata); + if(qndataList != null && qndataList.size() == 1){ + qndata = qndataList.get(0); + } + } + //拼接数据 + JSONObject sendData = new JSONObject(); + sendData.put("accessKey",accessKey); + long timestamp = System.currentTimeMillis(); + sendData.put("timestamp",timestamp); + sendData.put("taskNo",rwbm); + sendData.put("period",cjzq); + + JSONArray reportList = new JSONArray(); + + JSONObject zcfzb = new JSONObject();//资产负债表 + zcfzb.put("period",cjzq); + zcfzb.put("reportType",1); + JSONArray reportSubjects1 = new JSONArray(); + setDataToArray("subjectName","12312",1,reportSubjects1); + zcfzb.put("reportSubjects",reportSubjects1); + + JSONObject llb = new JSONObject();//利润表 + llb.put("period",cjzq); + llb.put("reportType",2); + JSONArray reportSubjects2 = new JSONArray(); + llb.put("reportSubjects",reportSubjects2); + + JSONObject xjll = new JSONObject();//现金流量表 + xjll.put("period",cjzq); + xjll.put("reportType",3); + JSONArray reportSubjects3 = new JSONArray(); + xjll.put("reportSubjects",reportSubjects3); + reportList.add(zcfzb); + reportList.add(llb); + reportList.add(xjll); + sendData.put("reportList",reportList); + String a = YzfSignUtil.signRequest(sendData,accessSecret); + sendData.put("sign",a); - //JSONObject jsonObject = requestJson.getJSONObject("jsonStr"); - //String cdDate = null; - //String jnDate = null; - //String qnDate = null; - //String orgCode = "X0644"; - //IncomeInvoiceEntity dyAloneId = null; - //JSONObject dydata = null; - //JSONObject qndata = null; - //IncomeInvoiceEntity qnAloneId = null; - //if(requestJson.getString("orgCode") != null){ - // orgCode = requestJson.getString("orgCode"); - //} - //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); - //if(requestJson.getString("year") != null && requestJson.getString("month") != null){ - // cdDate = requestJson.getString("year") + "-" + requestJson.getString("month"); - // if("13".equals(requestJson.getString("month"))){ - // cdDate = requestJson.getString("year") + "-12"; - // qnDate = (requestJson.getInteger("year")-1) + "-12"; - // }else { - // cdDate = requestJson.getString("year") + "-" + requestJson.getString("month"); - // qnDate = (requestJson.getInteger("year")-1) + "-" + requestJson.getString("month"); - // } - //}else { - // cdDate = sdf.format(new Date()); - // jnDate = sdf.format(new Date()); - // Calendar calendar = Calendar.getInstance(); - // calendar.setTime(new Date()); - // calendar.add(Calendar.YEAR, -1); - // Date qn = calendar.getTime(); - // qnDate = sdf.format(qn); - //} - // - ////查询帐套组织 - //IncomeInvoiceEntity jnentity = new IncomeInvoiceEntity(); - //jnentity.setDataSourceCode(""); - //jnentity.setSysData(jnDate); - //jnentity.setOrgCode(orgCode); - //List jnlist = incomeInvoiceDao.queryZtzz(jnentity); - //if(jnlist != null && jnlist.size() == 1){ - // dyAloneId = jnlist.get(0); - //}else { - // return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送"); - //} - ////查询帐套组织 - //IncomeInvoiceEntity qnentity = new IncomeInvoiceEntity(); - //qnentity.setDataSourceCode(""); - //qnentity.setSysData(jnDate); - //qnentity.setOrgCode(orgCode); - //List qnlist = incomeInvoiceDao.queryZtzz(qnentity); - //if(qnlist != null && qnlist.size() == 1){ - // qnAloneId = qnlist.get(0); - //}else { - // logger.info("未查询到当月的财报数据"); - //} - // - ////查找今年数据 - //IncomeInvoiceEntity jnquerydata = new IncomeInvoiceEntity(); - //jnquerydata.setDataSourceCode(""); - //jnquerydata.setAloneId(dyAloneId.getAloneId()); - //List dydataList = incomeInvoiceDao.queryByAloneId(jnquerydata); - //if(dydataList != null && dydataList.size() == 1){ - // dydata = dydataList.get(0); - //}else { - // return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送"); - //} - // - // //查找去年数据 - //IncomeInvoiceEntity qnquerydata = new IncomeInvoiceEntity(); - //qnquerydata.setDataSourceCode(""); - //qnquerydata.setAloneId(qnAloneId.getAloneId()); - //List qndataList = incomeInvoiceDao.queryByAloneId(qnquerydata); - //if(qndataList != null && qndataList.size() == 1){ - // qndata = qndataList.get(0); - //} - ////拼接数据 - // - // - // - // - //return BaseResult.getSuccessMessageEntity("执行成功"); + Map headers = new HashMap<>(); + headers.put("Content-Type", "application/json; charset=utf-8"); + String returndata = sendPost(url, headers, sendData.toJSONString()); + if (returndata != null && JSONObject.isValidObject(returndata)) { + JSONObject dataJson = JSONObject.parseObject(returndata); + if(dataJson != null && dataJson.getString("code") != null && "0".equals( dataJson.getString("code"))){ + JSONObject data = dataJson.getJSONObject("result"); + if(data != null ){ + if(data != null && data.getString("resultCode") != null && "0".equals( data.getString("resultCode"))){ + return BaseResult.getSuccessMessageEntity("执行成功"); + }else { + return BaseResult.getFailureMessageEntity("发送失败:"+returndata); + } + }else { + return BaseResult.getFailureMessageEntity("发送失败:"+returndata); + } + }else { + return BaseResult.getFailureMessageEntity("发送失败:"+returndata); + } + }else { + return BaseResult.getFailureMessageEntity("发送失败:"+returndata); + } + } - return null; + private void setDataToArray(String subjectName, String value, Integer valueType, JSONArray reportSubjects) { + if(value != null && !"".equals(value)){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("subjectName",subjectName); + jsonObject.put("value",new BigDecimal(value)); + jsonObject.put("valueType",valueType); + reportSubjects.add(jsonObject); + } } } From 472fb7d7f815e2b09a8d874f1f59dafc5dd4ea3e Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 23 Apr 2025 16:13:30 +0800 Subject: [PATCH 35/42] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-buildpackage/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/base-buildpackage/pom.xml b/base-buildpackage/pom.xml index 92fa0ece..70760ee0 100644 --- a/base-buildpackage/pom.xml +++ b/base-buildpackage/pom.xml @@ -43,6 +43,12 @@ httest + + xel + + xel + + kangarooDataCenterV3 From e5a6499efe1f4c2158a7bfd284ddb5c34af10f92 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Wed, 23 Apr 2025 16:24:30 +0800 Subject: [PATCH 36/42] =?UTF-8?q?=E8=B7=AF=E5=BE=84=E5=90=8E=E9=9D=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java index 199745c8..dfbdd22f 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -58,9 +58,9 @@ public class InvoiceServiceImpl extends BaseService imple @Value("${zt.url}") private String url; - @Value("${invoice_pdf.url}") + @Value("${invoice_pdf.url:}") private String invoicePdfUrl; - @Value("${invoice_ofd.url}") + @Value("${invoice_ofd.url:}") private String invoiceOfdUrl; @Override From 74cc73bab385a406e9b46c35361a76d0e232568b Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 24 Apr 2025 13:37:29 +0800 Subject: [PATCH 37/42] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=A8=8E=E5=8A=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assembler/BusInvoiceAssembler.java | 48 + .../assembler/ElecFlightInvoiceAssembler.java | 119 + .../assembler/ElecTrainInvoiceAssembler.java | 109 + .../assembler/FlightInvoiceAssembler.java | 73 + .../cinvoice/assembler/ParamAssembler.java | 17 + .../assembler/ParamAssemblerContext.java | 20 + .../assembler/TrainInvoiceAssembler.java | 48 + .../assembler/ZzsInvoiceAssembler.java | 88 + .../cinvoice/dao/ICInvoiceImportBDao.java | 12 + .../cinvoice/dao/ICInvoiceImportHDao.java | 12 + .../dao/impl/CInvoiceImportBDaoImpl.java | 16 + .../dao/impl/CInvoiceImportHDaoImpl.java | 15 + .../plugin/cinvoice/dto/FlightItemInfo.java | 154 ++ .../plugin/cinvoice/dto/ZzsItemInfo.java | 99 + .../entity/CInvoiceImportBEntity.java | 81 + .../cinvoice/entity/CInvoiceImportBEntity.xml | 26 + .../entity/CInvoiceImportHEntity.java | 41 + .../cinvoice/entity/CInvoiceImportHEntity.xml | 41 + .../lexmis/dao/ILexmisPublicinfoDao.java | 13 + .../dao/ILexmiscivInvoicedetailDao.java | 13 + .../lexmis/dao/ILexmiscivInvoicemainDao.java | 13 + .../lexmis/dao/ILexmiscivPlaneticketDao.java | 13 + .../lexmis/dao/ILexmiscivPlaneticketsDao.java | 13 + .../lexmis/dao/ILexmiscivTrainticketDao.java | 13 + .../dao/impl/LexmisPublicinfoDaoImpl.java | 17 + .../impl/LexmiscivInvoicedetailDaoImpl.java | 17 + .../dao/impl/LexmiscivInvoicemainDaoImpl.java | 17 + .../dao/impl/LexmiscivPlaneticketDaoImpl.java | 17 + .../impl/LexmiscivPlaneticketsDaoImpl.java | 17 + .../dao/impl/LexmiscivTrainticketDaoImpl.java | 17 + .../lexmis/entity/LexmisPublicinfoEntity.java | 2080 +++++++++++++++++ .../lexmis/entity/LexmisPublicinfoEntity.xml | 432 ++++ .../entity/LexmiscivInvoicedetailEntity.java | 170 ++ .../entity/LexmiscivInvoicedetailEntity.xml | 147 ++ .../entity/LexmiscivInvoicemainEntity.java | 651 ++++++ .../entity/LexmiscivInvoicemainEntity.xml | 427 ++++ .../entity/LexmiscivPlaneticketEntity.java | 575 +++++ .../entity/LexmiscivPlaneticketEntity.xml | 385 +++ .../entity/LexmiscivPlaneticketsEntity.java | 219 ++ .../entity/LexmiscivPlaneticketsEntity.xml | 175 ++ .../entity/LexmiscivTrainticketEntity.java | 388 +++ .../entity/LexmiscivTrainticketEntity.xml | 273 +++ .../service/ILexmisPublicinfoService.java | 13 + .../ILexmiscivInvoicedetailService.java | 13 + .../service/ILexmiscivInvoicemainService.java | 19 + .../service/ILexmiscivPlaneticketService.java | 13 + .../ILexmiscivPlaneticketsService.java | 13 + .../service/ILexmiscivTrainticketService.java | 13 + .../impl/LexmisPublicinfoServiceImpl.java | 26 + .../LexmiscivInvoicedetailServiceImpl.java | 25 + .../impl/LexmiscivInvoicemainServiceImpl.java | 39 + .../impl/LexmiscivPlaneticketServiceImpl.java | 25 + .../LexmiscivPlaneticketsServiceImpl.java | 25 + .../impl/LexmiscivTrainticketServiceImpl.java | 25 + .../CInvoiceImportPluginInitializer.java | 101 + .../service/ICInvoiceImportBService.java | 21 + .../service/ICInvoiceImportHService.java | 22 + .../service/ICInvoiceImportPluginService.java | 18 + .../impl/CInvoiceImportBServiceImpl.java | 43 + .../impl/CInvoiceImportHServiceImpl.java | 45 + .../impl/CInvoiceImportPluginServiceImpl.java | 327 +++ .../frame/plugin/cinvoice/util/YzfUtils.java | 99 + 62 files changed, 8046 insertions(+) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/BusInvoiceAssembler.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecFlightInvoiceAssembler.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecTrainInvoiceAssembler.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/FlightInvoiceAssembler.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssembler.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssemblerContext.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/TrainInvoiceAssembler.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ZzsInvoiceAssembler.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportBDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportHDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportBDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportHDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/FlightItemInfo.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/ZzsItemInfo.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmisPublicinfoDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicedetailDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicemainDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketsDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivTrainticketDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmisPublicinfoDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicedetailDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicemainDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketsDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivTrainticketDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmisPublicinfoService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicedetailService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicemainService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketsService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivTrainticketService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmisPublicinfoServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicedetailServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicemainServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketsServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivTrainticketServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/plugin/CInvoiceImportPluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportBService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportPluginService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportBServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportHServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/util/YzfUtils.java diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/BusInvoiceAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/BusInvoiceAssembler.java new file mode 100644 index 00000000..348651ca --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/BusInvoiceAssembler.java @@ -0,0 +1,48 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import com.alibaba.fastjson.JSONObject; + +/** + * @Description 客运汽车(a3) + * @Author xiangerlin + * @Date 2025/4/21 11:41 + **/ +public class BusInvoiceAssembler implements ParamAssembler{ + + private JSONObject jsonObject; + + public BusInvoiceAssembler(JSONObject jsonObject) { + this.jsonObject = jsonObject; + } + + /** + * 组装参数 + * + * @return + */ + @Override + public JSONObject assembleParam() { + JSONObject param = new JSONObject(); + // 发票代码,必填 + param.put("fpdm", ""); + // 发票号码,必填 + param.put("fphm", ""); + // 乘车日期/开票时间,格式为 yyyy-MM-dd,必填 + param.put("ccrq", ""); + // 乘车时间,格式为 HH:mm,非必填 + param.put("ccsj", ""); + // 出发地,非必填 + param.put("cfd", ""); + // 到达地,非必填 + param.put("ddd", ""); + // 乘车人姓名,非必填 + param.put("ccrxm", ""); + // 身份证号,非必填 + param.put("sfzh", ""); + // 金额,必填 + param.put("je", ""); + // 发票消费类型,非必填 + param.put("fpxflx", ""); + return param; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecFlightInvoiceAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecFlightInvoiceAssembler.java new file mode 100644 index 00000000..83e06759 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecFlightInvoiceAssembler.java @@ -0,0 +1,119 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.dto.FlightItemInfo; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity; +import org.apache.commons.collections.CollectionUtils; + +import java.util.LinkedList; +import java.util.List; + +/** + * @Description 400-电子发票(航空运输客票电子行程单) + * @Author xiangerlin + * @Date 2025/4/21 14:30 + **/ +public class ElecFlightInvoiceAssembler implements ParamAssembler{ + + private JSONObject jsonObject; + + public ElecFlightInvoiceAssembler(JSONObject jsonObject) { + this.jsonObject = jsonObject; + } + + /** + * 组装参数 + * + * @return + */ + @Override + public JSONObject assembleParam() { + JSONObject param = new JSONObject(); + String planeticketHStr = jsonObject.getString("planeticketH"); + String planeticketBListStr = jsonObject.getString("planeticketBList"); + if (StrUtil.isNotEmpty(planeticketHStr)){ + LexmiscivPlaneticketEntity planeticketH = JSONObject.parseObject(planeticketHStr, LexmiscivPlaneticketEntity.class); + List planeticketBList = JSONObject.parseArray(planeticketBListStr, LexmiscivPlaneticketsEntity.class); + // 1. 单据号码/电子客票号码,必填 + param.put("djhm", planeticketH.getPT_ETICKETNO()); + // 2. 验证码,非必填 + param.put("yzm", planeticketH.getPT_VALIDCODE()); + // 3. 开票日期,格式为 yyyy-MM-dd,必填 + param.put("kprq", planeticketH.getPT_DATE()); + // 4. 销售单位代号,非必填 + param.put("xsdwdh", planeticketH.getPT_SALERCODE()); + // 5. 填开单位,非必填 + param.put("tkdw", planeticketH.getPT_SALERNAME()); + // 6. 乘车人姓名,非必填 + param.put("cjrxm", planeticketH.getPT_CUSTOMER()); + // 7. 身份证号,非必填 + param.put("sfzh", planeticketH.getPT_IDNO()); + // 8. 票价,必填 + param.put("pj", planeticketH.getPT_PRICE()); + // 9. 民航发展基金,非必填 + param.put("mhfzjj", planeticketH.getPT_FUNDSAMOUNT()); + // 10. 保险费,非必填 + param.put("bxf", planeticketH.getPT_INSURANCE()); + // 11. 总额,必填 + param.put("ze", planeticketH.getPT_AMOUNT()); + // 12. 发票消费类型,非必填 + param.put("fpxflx", ""); + // 13. 国内国际标签,非必填 + param.put("gngjbq", planeticketH.getPT_INTERNATIONALFLAG()); + // 14. 印刷序号,非必填 + param.put("ysxh", planeticketH.getPT_SERIALNO()); + // 15. 燃油附加费,非必填 + param.put("ryfjf", planeticketH.getPT_FUELAMOUNT()); + if ("1".equals(planeticketH.getPT_ELECTRONICMARK())){ + //电子票需要的字段 + // 16. 购方税号,非必填 + param.put("gfsh", planeticketH.getPT_BUYERTAXNO()); + // 17. 购方名称,非必填 + param.put("gfmc", planeticketH.getPT_BUYERNAME()); + // 18. 签注,非必填 + param.put("xcdqz", planeticketH.getPT_MARKDESC()); + // 19. 开票状态,非必填 + param.put("kpzt", planeticketH.getPT_ISSUINGSTATE()); + // 20. 行程单提示信息,非必填 + param.put("xcdtsxx", planeticketH.getPT_PROMPTINFO()); + // 21. 增值税税率,非必填 + param.put("zzssl", planeticketH.getPT_TAXRATE()); + // 22. 增值税税额,非必填 + param.put("zzsse", planeticketH.getPT_TAXRATEAMOUNT()); + // 23. 合计,非必填 + param.put("hj", planeticketH.getPT_NOTAXAMOUNT()); + } + List filightItemList = new LinkedList<>(); + param.put("flightInfos",filightItemList); + if (CollectionUtils.isNotEmpty(planeticketBList)){ + for (LexmiscivPlaneticketsEntity b : planeticketBList) { + //for循环 + FlightItemInfo flightItem = new FlightItemInfo(); + flightItem.setCfz(b.getPTS_FSTATION());//出发站 + flightItem.setDdz(b.getPTS_TSTATION());//到达站 + flightItem.setHbh(b.getPTS_NO());//航班号 + flightItem.setCjsj(b.getPTS_TIME());//乘机时间 + flightItem.setZwdj(b.getPTS_CLASS());//座位等级 + flightItem.setCyr(b.getPTS_CARRIER());//承运人 + flightItem.setCwdj(b.getPTS_CLASSNAME());//舱位等级 + if ("1".equals(planeticketH.getPT_ELECTRONICMARK())){ + //电子票需要的字段 + flightItem.setSsflbm("");//税收分类编码 + flightItem.setXmmc("");//项目名称 + flightItem.setGgxh("");//规格型号 + flightItem.setDw("");//单位 + flightItem.setSl("");//数量 + flightItem.setDj("");//单价 + flightItem.setJe(String.valueOf(planeticketH.getPT_PRICE()));//金额 + flightItem.setSlv(planeticketH.getPT_TAXRATE());//税率 + flightItem.setSe(planeticketH.getPT_TAXAMOUNT());//税额 + } + filightItemList.add(flightItem); + } + } + } + return param; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecTrainInvoiceAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecTrainInvoiceAssembler.java new file mode 100644 index 00000000..a1ca24d5 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecTrainInvoiceAssembler.java @@ -0,0 +1,109 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivTrainticketEntity; + +/** + * @Description 200-电子发票(铁路电子客票) + * @Author xiangerlin + * @Date 2025/4/21 14:08 + **/ +public class ElecTrainInvoiceAssembler implements ParamAssembler{ + + private JSONObject jsonObject; + + public ElecTrainInvoiceAssembler(JSONObject jsonObject) { + this.jsonObject = jsonObject; + } + + /** + * 组装参数 + * + * @return + */ + @Override + public JSONObject assembleParam() { + JSONObject param = new JSONObject(); + String trainInvoice = jsonObject.getString("trainInvoice"); + if (StrUtil.isNotEmpty(trainInvoice)){ + LexmiscivTrainticketEntity trainticketEntity = JSONObject.parseObject(trainInvoice, LexmiscivTrainticketEntity.class); + if (null != trainticketEntity){ + // 1. 火车票号,必填 + param.put("hcph", trainticketEntity.getTT_CODE()); + // 2. 乘车日期,格式为 yyyy-MM-dd,必填 + param.put("ccrq", trainticketEntity.getTT_DATE()); + // 3. 乘车时间,格式为 HH:mm,非必填 + param.put("ccsj", trainticketEntity.getTT_TIME()); + // 4. 出发地,非必填 + param.put("cfd", trainticketEntity.getTT_FSTATION()); + // 5. 到达地,非必填 + param.put("ddd", trainticketEntity.getTT_TSTATION()); + // 6. 车次,非必填 + param.put("cc", trainticketEntity.getTT_NO()); + // 7. 乘车人姓名,非必填 + param.put("ccrxm", trainticketEntity.getTT_CUSTOMER()); + // 8. 身份证号,非必填 + param.put("sfzh", trainticketEntity.getTT_IDNO()); + // 9. 座位类型,非必填 + param.put("zwlx", trainticketEntity.getTT_CLASS()); + // 10. 金额,必填 + param.put("je", trainticketEntity.getTT_AMOUNT()); + // 11. 发票消费类型,非必填 + param.put("fpxflx", ""); + // 12. 序列号,非必填 + param.put("xlh", trainticketEntity.getTT_SERIALNO()); + // 13. 开票日期,格式为 yyyy-MM-dd,必填 + param.put("kprq", trainticketEntity.getTT_OUTDATE()); + // 14. 不含税金额,非必填 + param.put("bhsje", trainticketEntity.getTT_NOTAXAMOUNT()); + // 15. 税额,非必填 + param.put("se", trainticketEntity.getTT_TAXRATEAMOUNT()); + // 16. 税率,非必填 + param.put("slv", trainticketEntity.getTT_TAXRATE()); + // 17. 销方税号,非必填 + param.put("xfsh", ""); + // 18. 销方名称,非必填 + param.put("xfmc", ""); + // 19. 购方税号,非必填 + param.put("gfsh", trainticketEntity.getTT_BUYERTAXNO()); + // 20. 购方名称,非必填 + param.put("gfmc", trainticketEntity.getTT_BUYERNAME()); + // 21. 出发站拼音,非必填 + param.put("cfzpy", ""); + // 22. 到达站拼音,非必填 + param.put("ddzpy", ""); + // 23. 车厢,非必填 + param.put("cx", trainticketEntity.getTT_CARRIAGE()); + // 24. 厢位,非必填 + param.put("xw", trainticketEntity.getTT_SEAT()); + // 25. 电子客票号,非必填 + param.put("dzkph", trainticketEntity.getTT_SERIALNO()); + // 26. 发票明细信息,非必填,这里先创建一个空的 JSONArray + JSONArray qdHcpInfosArray = new JSONArray(); + param.put("qdHcpInfos", qdHcpInfosArray); + JSONObject qdHcpInfo = new JSONObject(); + // 27. 税收分类编码,非必填 + qdHcpInfo.put("ssflbm", ""); + // 28. 项目名称,非必填 + qdHcpInfo.put("xmmc", ""); + // 29. 规格型号,非必填 + qdHcpInfo.put("ggxh", ""); + // 30. 单位,非必填 + qdHcpInfo.put("dw", ""); + // 31. 数量,非必填 + qdHcpInfo.put("sl", ""); + // 32. 单价,非必填 + qdHcpInfo.put("dj", ""); + // 33. 金额,非必填 + qdHcpInfo.put("je", trainticketEntity.getTT_AMOUNT()); + // 34. 税率,非必填 + qdHcpInfo.put("slv", trainticketEntity.getTT_TAXRATE()); + // 35. 税额,非必填 + qdHcpInfo.put("se", trainticketEntity.getTT_TAXRATEAMOUNT()); + } + } + return param; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/FlightInvoiceAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/FlightInvoiceAssembler.java new file mode 100644 index 00000000..b21165e2 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/FlightInvoiceAssembler.java @@ -0,0 +1,73 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.dto.FlightItemInfo; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity; +import org.apache.commons.collections.CollectionUtils; + +import java.util.LinkedList; +import java.util.List; + +/** + * @Description 航空运输电子客票行程单(a4) 参数组装 + * @Author xiangerlin + * @Date 2025/4/21 10:57 + **/ +public class FlightInvoiceAssembler implements ParamAssembler{ + + private JSONObject jsonObject; + + public FlightInvoiceAssembler(JSONObject jsonObject) { + this.jsonObject = jsonObject; + } + + /** + * 组装参数 + * + * @return + */ + @Override + public JSONObject assembleParam() { + JSONObject params = new JSONObject(); + String planeticketHStr = jsonObject.getString("planeticketH"); + String planeticketBListStr = jsonObject.getString("planeticketBList"); + if (StrUtil.isNotEmpty(planeticketHStr)){ + LexmiscivPlaneticketEntity planeticketH = JSONObject.parseObject(planeticketHStr, LexmiscivPlaneticketEntity.class); + List planeticketBList = JSONObject.parseArray(planeticketBListStr, LexmiscivPlaneticketsEntity.class); + params.put("djhm", planeticketH.getPT_ETICKETNO()); // 单据号码/电子客票号码 + params.put("yzm", planeticketH.getPT_VALIDCODE()); // 验证码 + params.put("kprq", planeticketH.getPT_DATE()); // 开票日期,yyyy-MM-dd + params.put("xsdwdh", planeticketH.getPT_SALERCODE()); // 销售单位代号 + params.put("tkdw", planeticketH.getPT_SALERNAME()); // 填开单位 + params.put("cjrxm", planeticketH.getPT_CUSTOMER()); // 乘车人姓名 + params.put("sfzh", planeticketH.getPT_IDNO()); // 身份证号 + params.put("pj", planeticketH.getPT_PRICE()); // 票价 + params.put("mhfzjj", planeticketH.getPT_FUNDSAMOUNT()); // 民航发展基金 + params.put("bxf", planeticketH.getPT_INSURANCE()); // 保险费 + params.put("ze", planeticketH.getPT_AMOUNT()); // 总额 + params.put("fpxflx", ""); // 发票消费类型 + params.put("gngjbq", planeticketH.getPT_INTERNATIONALFLAG()); // 国内国际标签 + params.put("ysxh", planeticketH.getPT_SERIALNO()); // 印刷序号 + params.put("ryfjf", planeticketH.getPT_FUELAMOUNT()); // 燃油附加费 + List filightItemList = new LinkedList<>(); + params.put("flightInfos",filightItemList); + //for循环 + if (CollectionUtils.isNotEmpty(planeticketBList)){ + for (LexmiscivPlaneticketsEntity b : planeticketBList) { + FlightItemInfo flightItem = new FlightItemInfo(); + flightItem.setCfz(b.getPTS_FSTATION());//出发站 + flightItem.setDdz(b.getPTS_TSTATION());//到达站 + flightItem.setHbh(b.getPTS_NO());//航班号 + flightItem.setCjsj(b.getPTS_TIME());//乘机时间 + flightItem.setZwdj(b.getPTS_CLASS());//座位等级 + flightItem.setCyr(b.getPTS_CARRIER());//承运人 + flightItem.setCwdj(b.getPTS_CLASSNAME());//舱位等级 + filightItemList.add(flightItem); + } + } + } + return params; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssembler.java new file mode 100644 index 00000000..73739c1d --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssembler.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import com.alibaba.fastjson.JSONObject; + +/** + * @Description 定义组装参数的接口 + * @Author xiangerlin + * @Date 2025/4/21 09:22 + **/ +public interface ParamAssembler { + + /** + * 组装参数 + * @return + */ + JSONObject assembleParam(); +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssemblerContext.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssemblerContext.java new file mode 100644 index 00000000..3b664946 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssemblerContext.java @@ -0,0 +1,20 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import com.alibaba.fastjson.JSONObject; + +/** + * @Description 上下文类,根据发票类型选择相应的组装策略 + * @Author xiangerlin + * @Date 2025/4/21 14:51 + **/ +public class ParamAssemblerContext { + + private ParamAssembler assembler; + + public ParamAssemblerContext(ParamAssembler assembler) { + this.assembler = assembler; + } + public JSONObject assemble(){ + return assembler.assembleParam(); + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/TrainInvoiceAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/TrainInvoiceAssembler.java new file mode 100644 index 00000000..cb516f2a --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/TrainInvoiceAssembler.java @@ -0,0 +1,48 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivTrainticketEntity; + +/** + * @Description a2 纸质火车票参数组装 + * @Author xiangerlin + * @Date 2025/4/21 10:20 + **/ +public class TrainInvoiceAssembler implements ParamAssembler{ + + private JSONObject jsonObject; + + public TrainInvoiceAssembler(JSONObject jsonObject) { + this.jsonObject = jsonObject; + } + + /** + * 组装参数 + * + * @return + */ + @Override + public JSONObject assembleParam() { + JSONObject param = new JSONObject(); + String trainInvoice = jsonObject.getString("trainInvoice"); + if (StrUtil.isNotEmpty(trainInvoice)){ + LexmiscivTrainticketEntity trainticketEntity = JSONObject.parseObject(trainInvoice, LexmiscivTrainticketEntity.class); + if (null != trainticketEntity){ + param.put("hcph", trainticketEntity.getTT_CODE()); // 火车票号 + param.put("ccrq", trainticketEntity.getTT_DATE()); // 乘车日期,yyyy-MM-dd + param.put("ccsj", trainticketEntity.getTT_TIME()); // 乘车时间,HH:mm + param.put("cfd", trainticketEntity.getTT_FSTATION()); // 出发地 + param.put("ddd", trainticketEntity.getTT_TSTATION()); // 到达地 + param.put("cc", trainticketEntity.getTT_NO()); // 车次 + param.put("ccrxm", trainticketEntity.getTT_CUSTOMER()); // 乘车人姓名 + param.put("sfzh", trainticketEntity.getTT_IDNO()); // 身份证号 + param.put("zwlx", trainticketEntity.getTT_CLASS()); // 座位类型 + param.put("je", trainticketEntity.getTT_AMOUNT()); // 金额 + param.put("fpxflx", ""); // 发票消费类型 + param.put("xlh", trainticketEntity.getTT_SERIALNO()); // 序列号 + } + } + return param; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ZzsInvoiceAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ZzsInvoiceAssembler.java new file mode 100644 index 00000000..6949e750 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ZzsInvoiceAssembler.java @@ -0,0 +1,88 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.dto.ZzsItemInfo; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicedetailEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity; +import org.apache.commons.collections.CollectionUtils; + +import java.util.LinkedList; +import java.util.List; + +/** + * @Description 增值税类发票参数 + * 增值税类发票(01增值税专票,04增值税普票,08增值税电子专票,10增值税电子普票,11增值税普票(票卷),31电子发票(增值税专票),32电子发票(普票)) + * @Author xiangerlin + * @Date 2025/4/21 09:27 + **/ +public class ZzsInvoiceAssembler implements ParamAssembler{ + + private JSONObject jsonObject; + + public ZzsInvoiceAssembler(JSONObject jsonObject) { + this.jsonObject = jsonObject; + } + + /** + * 增值税类发票参数组装 + * + * @return + */ + @Override + public JSONObject assembleParam() { + JSONObject param = new JSONObject(); + String zzsInvoiceHStr = jsonObject.getString("zzsInvoiceH"); + String zzsInvoiceBListStr = jsonObject.getString("zzsInvoiceBList"); + if (StrUtil.isNotEmpty(zzsInvoiceHStr) && StrUtil.isNotEmpty(zzsInvoiceBListStr)){ + LexmiscivInvoicemainEntity zzsInvoiceH = JSONObject.parseObject(zzsInvoiceHStr, LexmiscivInvoicemainEntity.class); + List zzsInvoiceBList = JSONObject.parseArray(zzsInvoiceBListStr, LexmiscivInvoicedetailEntity.class); + if (null != zzsInvoiceH){ + param.put("fpdm", zzsInvoiceH.getIM_FPDM());//发票代码 + param.put("fphm", zzsInvoiceH.getIM_FPHM());//发票号码 + param.put("kprq", zzsInvoiceH.getIM_DATE());//开票日期 yyyy-MM-dd + param.put("xfsh", zzsInvoiceH.getIM_SALERTAXNO());//销方税号 + param.put("xfmc", zzsInvoiceH.getIM_SALERNAME());//销方名称 + param.put("gfsh", zzsInvoiceH.getIM_BUYERTAXNO());//购方税号 + param.put("gfmc", zzsInvoiceH.getIM_BUYERNAME());//购方名称 + param.put("hjje", zzsInvoiceH.getIM_NOTAXAMOUNT());//合计金额(不含税) + param.put("hjse", zzsInvoiceH.getIM_TAXAMOUNT());//合计税额 + param.put("jshj", zzsInvoiceH.getIM_TOTALAMOUNT());//价税合计,发票类型为31电子发票(增值税专票),32电子发票(普票) 时必填 + param.put("jym", zzsInvoiceH.getIM_CHECKCODE());//校验码,发票类型为04增值税普票、10增值税电子普票,11增值税普票(票卷) 时必填 + param.put("xfdzdh", zzsInvoiceH.getIM_SALERADDRESS());//销售方地址,电话 + param.put("xfyhzh", zzsInvoiceH.getIM_SALERBANKNO());//销售方开户行及账号 + param.put("gfdzdh", zzsInvoiceH.getIM_BUYERADDRESS());//购买方地址、电话 + param.put("gfyhzh", zzsInvoiceH.getIM_BUYERBANKNO());//购买方开户行及账号 + param.put("mmq", zzsInvoiceH.getIM_ENCRYPTIONCODE());//密码区 + param.put("bz", zzsInvoiceH.getIM_MEMO());//备注 + param.put("jqbh", zzsInvoiceH.getIM_MACHINENO());//机器编号 + param.put("jdhm", zzsInvoiceH.getIM_PRINTEDFPHM());//机打号码,发票类型为11增值税普票(票卷) 时必填 + param.put("kpr", zzsInvoiceH.getIM_MAKERNM());//开票人 + param.put("skr", zzsInvoiceH.getIM_PAYEE());//收款人 + param.put("fhr", zzsInvoiceH.getIM_AUDITOR());//复核人 + // 发票明细信息 + List zzsItemInfoList = new LinkedList<>(); + param.put("zzsItemInfos", zzsItemInfoList); + if (CollectionUtils.isNotEmpty(zzsInvoiceBList)){ + for (LexmiscivInvoicedetailEntity b : zzsInvoiceBList) { + ZzsItemInfo zzsItemInfo = new ZzsItemInfo(); + // 发票明细项 + zzsItemInfo.setXh(b.getID_ROWID());//序号 + zzsItemInfo.setSsflbm("");//税收分类编码 + zzsItemInfo.setXmmc(b.getID_SERVICENM());//项目名称 + zzsItemInfo.setGgxh(b.getID_SERVICETYPE());//规格型号 + zzsItemInfo.setDw(b.getID_UNIT());//单位 + zzsItemInfo.setSl(b.getID_NUM());//数量 + zzsItemInfo.setDj(b.getID_PRICE());//单价 + zzsItemInfo.setJe(b.getID_NOTAXAMOUNT());//金额 + zzsItemInfo.setSlv(b.getID_TAX());//税率 + zzsItemInfo.setSe(b.getID_TAXAMOUNT());//税额 + zzsItemInfoList.add(zzsItemInfo); + } + } + } + } + + return param; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportBDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportBDao.java new file mode 100644 index 00000000..0429933f --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportBDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.cinvoice.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportBEntity; + +/** + * @Description 发票批量导入有度税务 表体dao + * @Author xiangerlin + * @Date 2025/4/18 15:27 + **/ +public interface ICInvoiceImportBDao extends IBaseDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportHDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportHDao.java new file mode 100644 index 00000000..8251dd42 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportHDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.cinvoice.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportHEntity; + +/** + * @Description 发票批量导入有度税务 表头dao + * @Author xiangerlin + * @Date 2025/4/18 15:25 + **/ +public interface ICInvoiceImportHDao extends IBaseDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportBDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportBDaoImpl.java new file mode 100644 index 00000000..52992ce6 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportBDaoImpl.java @@ -0,0 +1,16 @@ +package com.hzya.frame.plugin.cinvoice.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.dao.ICInvoiceImportBDao; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportBEntity; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportHEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description 发票批量导入有度税务 表体dao + * @Author xiangerlin + * @Date 2025/4/18 15:32 + **/ +@Repository +public class CInvoiceImportBDaoImpl extends MybatisGenericDao implements ICInvoiceImportBDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportHDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportHDaoImpl.java new file mode 100644 index 00000000..e46fa21b --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportHDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.cinvoice.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.dao.ICInvoiceImportHDao; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportHEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description 发票批量导入有度税务 表头dao + * @Author xiangerlin + * @Date 2025/4/18 15:31 + **/ +@Repository +public class CInvoiceImportHDaoImpl extends MybatisGenericDao implements ICInvoiceImportHDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/FlightItemInfo.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/FlightItemInfo.java new file mode 100644 index 00000000..e0139e53 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/FlightItemInfo.java @@ -0,0 +1,154 @@ +package com.hzya.frame.plugin.cinvoice.dto; + +/** + * @Description 航空运输电子客票行程单明细 + * @Author xiangerlin + * @Date 2025/4/21 10:36 + **/ +public class FlightItemInfo { + private String cfz;//出发站 + private String ddz;//到达站 + private String hbh;//航班号 + private String cjsj;//乘机时间 + private String zwdj;//座位等级 + private String cyr;//承运人 + private String cwdj;//仓位等级 + + + private String ssflbm;//税收分类编码 + private String xmmc;//项目名称 + private String ggxh;//规格型号 + private String dw;//单位 + private String sl;//数量 + private String dj;//单价 + private String je;//金额 + private String slv;//税率 + private String se;//税额 + public String getCfz() { + return cfz; + } + + public void setCfz(String cfz) { + this.cfz = cfz; + } + + public String getDdz() { + return ddz; + } + + public void setDdz(String ddz) { + this.ddz = ddz; + } + + public String getHbh() { + return hbh; + } + + public void setHbh(String hbh) { + this.hbh = hbh; + } + + public String getCjsj() { + return cjsj; + } + + public void setCjsj(String cjsj) { + this.cjsj = cjsj; + } + + public String getZwdj() { + return zwdj; + } + + public void setZwdj(String zwdj) { + this.zwdj = zwdj; + } + + public String getCyr() { + return cyr; + } + + public void setCyr(String cyr) { + this.cyr = cyr; + } + + public String getCwdj() { + return cwdj; + } + + public void setCwdj(String cwdj) { + this.cwdj = cwdj; + } + + public String getSsflbm() { + return ssflbm; + } + + public void setSsflbm(String ssflbm) { + this.ssflbm = ssflbm; + } + + public String getXmmc() { + return xmmc; + } + + public void setXmmc(String xmmc) { + this.xmmc = xmmc; + } + + public String getGgxh() { + return ggxh; + } + + public void setGgxh(String ggxh) { + this.ggxh = ggxh; + } + + public String getDw() { + return dw; + } + + public void setDw(String dw) { + this.dw = dw; + } + + public String getSl() { + return sl; + } + + public void setSl(String sl) { + this.sl = sl; + } + + public String getDj() { + return dj; + } + + public void setDj(String dj) { + this.dj = dj; + } + + public String getJe() { + return je; + } + + public void setJe(String je) { + this.je = je; + } + + public String getSlv() { + return slv; + } + + public void setSlv(String slv) { + this.slv = slv; + } + + public String getSe() { + return se; + } + + public void setSe(String se) { + this.se = se; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/ZzsItemInfo.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/ZzsItemInfo.java new file mode 100644 index 00000000..aa3b26d4 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/ZzsItemInfo.java @@ -0,0 +1,99 @@ +package com.hzya.frame.plugin.cinvoice.dto; + +/** + * @Description 增值税发票明细表 + * @Author xiangerlin + * @Date 2025/4/21 09:56 + **/ +public class ZzsItemInfo { + private String xh;//序号 + private String ssflbm; // 税收分类编码 + private String xmmc; // 项目名称 + private String ggxh; // 规格型号 + private String dw; // 单位 + private String sl; // 数量 + private String dj; // 单价 + private String je; // 金额 + private String slv; // 税率 + private String se; // 税额 + + public String getXh() { + return xh; + } + + public void setXh(String xh) { + this.xh = xh; + } + + public String getSsflbm() { + return ssflbm; + } + + public void setSsflbm(String ssflbm) { + this.ssflbm = ssflbm; + } + + public String getXmmc() { + return xmmc; + } + + public void setXmmc(String xmmc) { + this.xmmc = xmmc; + } + + public String getGgxh() { + return ggxh; + } + + public void setGgxh(String ggxh) { + this.ggxh = ggxh; + } + + public String getDw() { + return dw; + } + + public void setDw(String dw) { + this.dw = dw; + } + + public String getSl() { + return sl; + } + + public void setSl(String sl) { + this.sl = sl; + } + + public String getDj() { + return dj; + } + + public void setDj(String dj) { + this.dj = dj; + } + + public String getJe() { + return je; + } + + public void setJe(String je) { + this.je = je; + } + + public String getSlv() { + return slv; + } + + public void setSlv(String slv) { + this.slv = slv; + } + + public String getSe() { + return se; + } + + public void setSe(String se) { + this.se = se; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.java new file mode 100644 index 00000000..6086433c --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.java @@ -0,0 +1,81 @@ +package com.hzya.frame.plugin.cinvoice.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description 发票批量导入有度税务表体 + * @Author xiangerlin + * @Date 2025/4/18 15:20 + **/ +public class CInvoiceImportBEntity extends BaseEntity { + //主表id + private String formmain_id; + //主表名称 + private String formmain_tab_name; + //发票号 + private String cinvoice_number; + //发票代码 + private String cinvoice_code; + //发票类型 + private String cinvoice_type; + //发票日期 + private String cinvoice_date; + //发票金额 + private String cinvoice_amount; + + public String getFormmain_id() { + return formmain_id; + } + + public void setFormmain_id(String formmain_id) { + this.formmain_id = formmain_id; + } + + public String getFormmain_tab_name() { + return formmain_tab_name; + } + + public void setFormmain_tab_name(String formmain_tab_name) { + this.formmain_tab_name = formmain_tab_name; + } + + public String getCinvoice_number() { + return cinvoice_number; + } + + public void setCinvoice_number(String cinvoice_number) { + this.cinvoice_number = cinvoice_number; + } + + public String getCinvoice_code() { + return cinvoice_code; + } + + public void setCinvoice_code(String cinvoice_code) { + this.cinvoice_code = cinvoice_code; + } + + public String getCinvoice_type() { + return cinvoice_type; + } + + public void setCinvoice_type(String cinvoice_type) { + this.cinvoice_type = cinvoice_type; + } + + public String getCinvoice_date() { + return cinvoice_date; + } + + public void setCinvoice_date(String cinvoice_date) { + this.cinvoice_date = cinvoice_date; + } + + public String getCinvoice_amount() { + return cinvoice_amount; + } + + public void setCinvoice_amount(String cinvoice_amount) { + this.cinvoice_amount = cinvoice_amount; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.xml new file mode 100644 index 00000000..85a66cdb --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.xml @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.java new file mode 100644 index 00000000..77da27ba --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.java @@ -0,0 +1,41 @@ +package com.hzya.frame.plugin.cinvoice.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description 发票批量导入有度税务表头 + * @Author xiangerlin + * @Date 2025/4/18 15:19 + **/ +public class CInvoiceImportHEntity extends BaseEntity { + //表名称 + private String tab_name; + //单据类型 + private String bill_type; + //单据编码 + private String bill_code; + + public String getTab_name() { + return tab_name; + } + + public void setTab_name(String tab_name) { + this.tab_name = tab_name; + } + + public String getBill_type() { + return bill_type; + } + + public void setBill_type(String bill_type) { + this.bill_type = bill_type; + } + + public String getBill_code() { + return bill_code; + } + + public void setBill_code(String bill_code) { + this.bill_code = bill_code; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml new file mode 100644 index 00000000..3a492e25 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmisPublicinfoDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmisPublicinfoDao.java new file mode 100644 index 00000000..50f8e5e2 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmisPublicinfoDao.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity; +/** + * @description: 迈锐思-公共信息表 dao + * @tableName: LEXMISCIV_PUBLICINFO + * @entityName: LexmisPublicinfoEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmisPublicinfoDao extends IBaseDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicedetailDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicedetailDao.java new file mode 100644 index 00000000..cb084086 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicedetailDao.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicedetailEntity; +/** + * @description: 迈锐思-增值税发票子表 dao + * @tableName: LEXMISCIV_INVOICEDETAIL + * @entityName: LexmiscivInvoicedetailEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivInvoicedetailDao extends IBaseDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicemainDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicemainDao.java new file mode 100644 index 00000000..ab5251be --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicemainDao.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity; +/** + * @description: 迈锐思-增值税发票主表 dao + * @tableName: LEXMISCIV_INVOICEMAIN + * @entityName: LexmiscivInvoicemainEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivInvoicemainDao extends IBaseDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketDao.java new file mode 100644 index 00000000..877ebd5e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketDao.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketEntity; +/** + * @description: 迈锐思-飞机行程单 dao + * @tableName: LEXMISCIV_PLANETICKET + * @entityName: LexmiscivPlaneticketEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivPlaneticketDao extends IBaseDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketsDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketsDao.java new file mode 100644 index 00000000..c562e89d --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketsDao.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity; +/** + * @description: 迈锐思-飞机行程单明细 dao + * @tableName: LEXMISCIV_PLANETICKETS + * @entityName: LexmiscivPlaneticketsEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivPlaneticketsDao extends IBaseDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivTrainticketDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivTrainticketDao.java new file mode 100644 index 00000000..caf1275d --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivTrainticketDao.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivTrainticketEntity; +/** + * @description: 迈锐思-火车票 dao + * @tableName: LEXMISCIV_TRAINTICKET + * @entityName: LexmiscivTrainticketEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivTrainticketDao extends IBaseDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmisPublicinfoDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmisPublicinfoDaoImpl.java new file mode 100644 index 00000000..101a3d35 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmisPublicinfoDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmisPublicinfoDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; + +/** + * @description: 迈锐思-公共信息表 dao + * @tableName: LEXMISCIV_PUBLICINFO + * @entityName: LexmisPublicinfoEntity + * @author: gjh + * @history:1.0 + */ +@Repository("LEXMISCIV_PUBLICINFOdao") +public class LexmisPublicinfoDaoImpl extends MybatisGenericDao implements ILexmisPublicinfoDao { + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicedetailDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicedetailDaoImpl.java new file mode 100644 index 00000000..14e78a7f --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicedetailDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicedetailEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivInvoicedetailDao; + +/** + * @description: 迈锐思-增值税发票子表 dao + * @tableName: LEXMISCIV_INVOICEDETAIL + * @entityName: LexmiscivInvoicedetailEntity + * @author: gjh + * @history:1.0 + */ +@Repository("LEXMISCIV_INVOICEDETAILdao") +public class LexmiscivInvoicedetailDaoImpl extends MybatisGenericDao implements ILexmiscivInvoicedetailDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicemainDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicemainDaoImpl.java new file mode 100644 index 00000000..d08812e1 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicemainDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivInvoicemainDao; + +/** + * @description: 迈锐思-增值税发票主表 dao + * @tableName: LEXMISCIV_INVOICEMAIN + * @entityName: LexmiscivInvoicemainEntity + * @author: gjh + * @history:1.0 + */ +@Repository("LEXMISCIV_INVOICEMAINdao") +public class LexmiscivInvoicemainDaoImpl extends MybatisGenericDao implements ILexmiscivInvoicemainDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketDaoImpl.java new file mode 100644 index 00000000..a962fcb0 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivPlaneticketDao; + +/** + * @description: 迈锐思-飞机行程单 dao + * @tableName: LEXMISCIV_PLANETICKET + * @entityName: LexmiscivPlaneticketEntity + * @author: gjh + * @history:1.0 + */ +@Repository("LEXMISCIV_PLANETICKETdao") +public class LexmiscivPlaneticketDaoImpl extends MybatisGenericDao implements ILexmiscivPlaneticketDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketsDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketsDaoImpl.java new file mode 100644 index 00000000..33546d45 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketsDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivPlaneticketsDao; + +/** + * @description: 迈锐思-飞机行程单明细 dao + * @tableName: LEXMISCIV_PLANETICKETS + * @entityName: LexmiscivPlaneticketsEntity + * @author: gjh + * @history:1.0 + */ +@Repository("LEXMISCIV_PLANETICKETSdao") +public class LexmiscivPlaneticketsDaoImpl extends MybatisGenericDao implements ILexmiscivPlaneticketsDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivTrainticketDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivTrainticketDaoImpl.java new file mode 100644 index 00000000..ab34b7cb --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivTrainticketDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivTrainticketEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivTrainticketDao; + +/** + * @description: 迈锐思-火车票 dao + * @tableName: LEXMISCIV_TRAINTICKET + * @entityName: LexmiscivTrainticketEntity + * @author: gjh + * @history:1.0 + */ +@Repository("LEXMISCIV_TRAINTICKETdao") +public class LexmiscivTrainticketDaoImpl extends MybatisGenericDao implements ILexmiscivTrainticketDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.java new file mode 100644 index 00000000..d21943e5 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.java @@ -0,0 +1,2080 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.entity; + +import java.util.Date; + +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; + + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @description: 迈锐思-公共信息表 + * @tableName: LEXMISCIV_PUBLICINFO + * @entityName: LexmisPublicinfoEntity + * @author: gjh + * @history: 1.0 + */ +public class LexmisPublicinfoEntity extends BaseEntity { + public LexmisPublicinfoEntity() { + + } + + public LexmisPublicinfoEntity(String PI_FORMDATAID,String dataSourceCode) { + this.PI_FORMDATAID = PI_FORMDATAID; + this.setDataSourceCode(dataSourceCode); + } + + private String PI_BELONGID; + /** + * 无备注 + */ + private String PI_ID; + /** + * 无备注 + */ + private String PI_KEY; + /** + * 无备注 + */ + private String PI_KEY_NEW; + /** + * 无备注 + */ + private String PI_DATAKEY; + /** + * 无备注 + */ + private String PI_MAINCONFIGID; + /** + * 无备注 + */ + private String PI_TAXNO; + /** + * 无备注 + */ + private String PI_TABLENAME; + /** + * 无备注 + */ + private String PI_BILLKIND; + /** + * 无备注 + */ + private String PI_BILLNAME; + /** + * 无备注 + */ + private String PI_AMOUNT; + /** + * 无备注 + */ + private String PI_STATE; + /** + * 无备注 + */ + private String PI_FILEID; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_FILEDATE; + /** + * 无备注 + */ + private String PI_IMAGEPATH; + /** + * 无备注 + */ + private String PI_UPDATEDATA; + /** + * 无备注 + */ + private String PI_TYPE; + /** + * 无备注 + */ + private String PI_MEMBERID; + /** + * 无备注 + */ + private String PI_MEMBERNM; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_MAKEDATE; + /** + * 无备注 + */ + private String PI_BEStringID; + /** + * 无备注 + */ + private String PI_BEStringNM; + /** + * 无备注 + */ + private String PI_USEACCOUNTID; + /** + * 无备注 + */ + private String PI_USEACCOUNTNM; + /** + * 无备注 + */ + private String PI_USEDEPARTMENTID; + /** + * 无备注 + */ + private String PI_USEDEPARTMENTNM; + /** + * 无备注 + */ + private String PI_USEID; + /** + * 无备注 + */ + private String PI_USENM; + /** + * 无备注 + */ + private String PI_USESTATE; + /** + * 无备注 + */ + private String PI_SUMMARYID; + /** + * 无备注 + */ + private String PI_SUBJECT; + /** + * 无备注 + */ + private String PI_FORMID; + /** + * 无备注 + */ + private String PI_FORMDATAID; + /** + * 无备注 + */ + private String PI_TEMPLATEID; + /** + * 无备注 + */ + private String PI_STARTACCOUNTID; + /** + * 无备注 + */ + private String PI_STARTDEPARTMENTID; + /** + * 无备注 + */ + private String PI_STARTMEMBERID; + /** + * 无备注 + */ + private String PI_STARTMEMBERNM; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_STARTDATE; + /** + * 无备注 + */ + private String PI_DEALACCOUNTID; + /** + * 无备注 + */ + private String PI_DEALDEPARTMENTID; + /** + * 无备注 + */ + private String PI_DEALMEMBERID; + /** + * 无备注 + */ + private String PI_DEALMEMBERNM; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_DEALDATE; + /** + * 无备注 + */ + private String PI_DEALSTATE; + /** + * 无备注 + */ + private String PI_DEALPOLICY; + /** + * 无备注 + */ + private String PI_DEALINFO; + /** + * 无备注 + */ + private String PI_SHAREID; + /** + * 无备注 + */ + private String PI_SHARENM; + /** + * 无备注 + */ + private String PI_APITYPE; + /** + * 无备注 + */ + private String PI_ISVALID; + /** + * 无备注 + */ + private String PI_VALIDRESULT; + /** + * 无备注 + */ + private String PI_RESULTNM; + /** + * 无备注 + */ + private String PI_VALIDSTATE; + /** + * 无备注 + */ + private String PI_CLASSTYPE; + /** + * 无备注 + */ + private String PI_CLASSNAME; + /** + * 无备注 + */ + private String PI_RECOVERSTATE; + /** + * 无备注 + */ + private String PI_RECOVERMEMBERID; + /** + * 无备注 + */ + private String PI_RECOVERMEMBERNM; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_RECOVERDATE; + /** + * 无备注 + */ + private String PI_ORGID; + /** + * 无备注 + */ + private String PI_ORGNM; + /** + * 无备注 + */ + private String PI_YEAR; + /** + * 无备注 + */ + private String PI_MONTH; + /** + * 无备注 + */ + private String PI_QUARTER; + /** + * 无备注 + */ + private String PI_HALFYEAR; + /** + * 无备注 + */ + private String PI_XMMC; + /** + * 无备注 + */ + private String PI_FPDM; + /** + * 无备注 + */ + private String PI_FPHM; + /** + * 无备注 + */ + private String PI_SALERTAXNO; + /** + * 无备注 + */ + private String PI_SALERNAME; + /** + * 无备注 + */ + private String PI_BUYERTAXNO; + /** + * 无备注 + */ + private String PI_BUYERNAME; + /** + * 无备注 + */ + private String PI_INVOICETYPE; + /** + * 无备注 + */ + private String PI_INVOICENAME; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_INVOICEDATE; + /** + * 无备注 + */ + private String PI_FSTATION; + /** + * 无备注 + */ + private String PI_TSTATION; + /** + * 无备注 + */ + private String PI_USERNAME; + /** + * 无备注 + */ + private String PI_TRAINNO; + /** + * 无备注 + */ + private String PI_TRAINCODE; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_STARTDATETIME; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_ENDDATETIME; + /** + * 无备注 + */ + private String PI_STARTTIME; + /** + * 无备注 + */ + private String PI_ENDTIME; + /** + * 无备注 + */ + private String PI_TAXRATE; + /** + * 无备注 + */ + private String PI_TAXAMOUNT; + /** + * 无备注 + */ + private String PI_NOTAXAMOUNT; + /** + * 无备注 + */ + private String PI_DEDUCTIONAMOUNT; + /** + * 无备注 + */ + private String PI_FILEURL; + /** + * 无备注 + */ + private String PI_MATTERID; + /** + * 无备注 + */ + private String PI_VOUCHER; + /** + * 无备注 + */ + private String PI_VOUCHERINFO; + /** + * 无备注 + */ + private String PI_FIELD0001; + /** + * 无备注 + */ + private String PI_FIELD0002; + /** + * 无备注 + */ + private String PI_FIELD0003; + /** + * 无备注 + */ + private String PI_FIELD0004; + /** + * 无备注 + */ + private String PI_FIELD0005; + /** + * 无备注 + */ + private String PI_INVOICEVALIDSTATE; + /** + * 无备注 + */ + private String PI_MODIFYSTATE; + /** + * 无备注 + */ + private String PI_USAGEAMOUNT; + /** + * 无备注 + */ + private String PI_VERIFYAMOUNT; + /** + * 无备注 + */ + private String PI_UNUSEDAMOUNT; + /** + * 无备注 + */ + private String PI_USECOUNT; + /** + * 无备注 + */ + private String PI_FILENAME; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_UPDATEDATE; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_VOUCHERDATE; + /** + * 无备注 + */ + private String PI_CPAY_STATE; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_CPAY_DATE; + + + /** + * 无备注 + */ + public void setPI_ID(String PI_ID) { + this.PI_ID = PI_ID; + } + + /** + * 无备注 + */ + public String getPI_ID() { + return PI_ID; + } + + + /** + * 无备注 + */ + public void setPI_KEY(String PI_KEY) { + this.PI_KEY = PI_KEY; + } + + /** + * 无备注 + */ + public String getPI_KEY() { + return PI_KEY; + } + + + /** + * 无备注 + */ + public void setPI_KEY_NEW(String PI_KEY_NEW) { + this.PI_KEY_NEW = PI_KEY_NEW; + } + + /** + * 无备注 + */ + public String getPI_KEY_NEW() { + return PI_KEY_NEW; + } + + + /** + * 无备注 + */ + public void setPI_DATAKEY(String PI_DATAKEY) { + this.PI_DATAKEY = PI_DATAKEY; + } + + /** + * 无备注 + */ + public String getPI_DATAKEY() { + return PI_DATAKEY; + } + + + /** + * 无备注 + */ + public void setPI_MAINCONFIGID(String PI_MAINCONFIGID) { + this.PI_MAINCONFIGID = PI_MAINCONFIGID; + } + + /** + * 无备注 + */ + public String getPI_MAINCONFIGID() { + return PI_MAINCONFIGID; + } + + + /** + * 无备注 + */ + public void setPI_TAXNO(String PI_TAXNO) { + this.PI_TAXNO = PI_TAXNO; + } + + /** + * 无备注 + */ + public String getPI_TAXNO() { + return PI_TAXNO; + } + + + /** + * 无备注 + */ + public void setPI_TABLENAME(String PI_TABLENAME) { + this.PI_TABLENAME = PI_TABLENAME; + } + + /** + * 无备注 + */ + public String getPI_TABLENAME() { + return PI_TABLENAME; + } + + + /** + * 无备注 + */ + public void setPI_BILLKIND(String PI_BILLKIND) { + this.PI_BILLKIND = PI_BILLKIND; + } + + /** + * 无备注 + */ + public String getPI_BILLKIND() { + return PI_BILLKIND; + } + + + /** + * 无备注 + */ + public void setPI_BILLNAME(String PI_BILLNAME) { + this.PI_BILLNAME = PI_BILLNAME; + } + + /** + * 无备注 + */ + public String getPI_BILLNAME() { + return PI_BILLNAME; + } + + + /** + * 无备注 + */ + public void setPI_AMOUNT(String PI_AMOUNT) { + this.PI_AMOUNT = PI_AMOUNT; + } + + /** + * 无备注 + */ + public String getPI_AMOUNT() { + return PI_AMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_STATE(String PI_STATE) { + this.PI_STATE = PI_STATE; + } + + /** + * 无备注 + */ + public String getPI_STATE() { + return PI_STATE; + } + + + /** + * 无备注 + */ + public void setPI_FILEID(String PI_FILEID) { + this.PI_FILEID = PI_FILEID; + } + + /** + * 无备注 + */ + public String getPI_FILEID() { + return PI_FILEID; + } + + + /** + * 无备注 + */ + public void setPI_FILEDATE(Date PI_FILEDATE) { + this.PI_FILEDATE = PI_FILEDATE; + } + + /** + * 无备注 + */ + public Date getPI_FILEDATE() { + return PI_FILEDATE; + } + + + /** + * 无备注 + */ + public void setPI_IMAGEPATH(String PI_IMAGEPATH) { + this.PI_IMAGEPATH = PI_IMAGEPATH; + } + + /** + * 无备注 + */ + public String getPI_IMAGEPATH() { + return PI_IMAGEPATH; + } + + + /** + * 无备注 + */ + public void setPI_UPDATEDATA(String PI_UPDATEDATA) { + this.PI_UPDATEDATA = PI_UPDATEDATA; + } + + /** + * 无备注 + */ + public String getPI_UPDATEDATA() { + return PI_UPDATEDATA; + } + + + /** + * 无备注 + */ + public void setPI_TYPE(String PI_TYPE) { + this.PI_TYPE = PI_TYPE; + } + + /** + * 无备注 + */ + public String getPI_TYPE() { + return PI_TYPE; + } + + + /** + * 无备注 + */ + public void setPI_MEMBERID(String PI_MEMBERID) { + this.PI_MEMBERID = PI_MEMBERID; + } + + /** + * 无备注 + */ + public String getPI_MEMBERID() { + return PI_MEMBERID; + } + + + /** + * 无备注 + */ + public void setPI_MEMBERNM(String PI_MEMBERNM) { + this.PI_MEMBERNM = PI_MEMBERNM; + } + + /** + * 无备注 + */ + public String getPI_MEMBERNM() { + return PI_MEMBERNM; + } + + + /** + * 无备注 + */ + public void setPI_MAKEDATE(Date PI_MAKEDATE) { + this.PI_MAKEDATE = PI_MAKEDATE; + } + + /** + * 无备注 + */ + public Date getPI_MAKEDATE() { + return PI_MAKEDATE; + } + + + /** + * 无备注 + */ + public void setPI_BEStringID(String PI_BEStringID) { + this.PI_BEStringID = PI_BEStringID; + } + + /** + * 无备注 + */ + public String getPI_BEStringID() { + return PI_BEStringID; + } + + + /** + * 无备注 + */ + public void setPI_BEStringNM(String PI_BEStringNM) { + this.PI_BEStringNM = PI_BEStringNM; + } + + /** + * 无备注 + */ + public String getPI_BEStringNM() { + return PI_BEStringNM; + } + + + /** + * 无备注 + */ + public void setPI_USEACCOUNTID(String PI_USEACCOUNTID) { + this.PI_USEACCOUNTID = PI_USEACCOUNTID; + } + + /** + * 无备注 + */ + public String getPI_USEACCOUNTID() { + return PI_USEACCOUNTID; + } + + + /** + * 无备注 + */ + public void setPI_USEACCOUNTNM(String PI_USEACCOUNTNM) { + this.PI_USEACCOUNTNM = PI_USEACCOUNTNM; + } + + /** + * 无备注 + */ + public String getPI_USEACCOUNTNM() { + return PI_USEACCOUNTNM; + } + + + /** + * 无备注 + */ + public void setPI_USEDEPARTMENTID(String PI_USEDEPARTMENTID) { + this.PI_USEDEPARTMENTID = PI_USEDEPARTMENTID; + } + + public String getPI_BELONGID() { + return PI_BELONGID; + } + + public void setPI_BELONGID(String PI_BELONGID) { + this.PI_BELONGID = PI_BELONGID; + } + + /** + * 无备注 + */ + public String getPI_USEDEPARTMENTID() { + return PI_USEDEPARTMENTID; + } + + + /** + * 无备注 + */ + public void setPI_USEDEPARTMENTNM(String PI_USEDEPARTMENTNM) { + this.PI_USEDEPARTMENTNM = PI_USEDEPARTMENTNM; + } + + /** + * 无备注 + */ + public String getPI_USEDEPARTMENTNM() { + return PI_USEDEPARTMENTNM; + } + + + /** + * 无备注 + */ + public void setPI_USEID(String PI_USEID) { + this.PI_USEID = PI_USEID; + } + + /** + * 无备注 + */ + public String getPI_USEID() { + return PI_USEID; + } + + + /** + * 无备注 + */ + public void setPI_USENM(String PI_USENM) { + this.PI_USENM = PI_USENM; + } + + /** + * 无备注 + */ + public String getPI_USENM() { + return PI_USENM; + } + + + /** + * 无备注 + */ + public void setPI_USESTATE(String PI_USESTATE) { + this.PI_USESTATE = PI_USESTATE; + } + + /** + * 无备注 + */ + public String getPI_USESTATE() { + return PI_USESTATE; + } + + + /** + * 无备注 + */ + public void setPI_SUMMARYID(String PI_SUMMARYID) { + this.PI_SUMMARYID = PI_SUMMARYID; + } + + /** + * 无备注 + */ + public String getPI_SUMMARYID() { + return PI_SUMMARYID; + } + + + /** + * 无备注 + */ + public void setPI_SUBJECT(String PI_SUBJECT) { + this.PI_SUBJECT = PI_SUBJECT; + } + + /** + * 无备注 + */ + public String getPI_SUBJECT() { + return PI_SUBJECT; + } + + + /** + * 无备注 + */ + public void setPI_FORMID(String PI_FORMID) { + this.PI_FORMID = PI_FORMID; + } + + /** + * 无备注 + */ + public String getPI_FORMID() { + return PI_FORMID; + } + + + /** + * 无备注 + */ + public void setPI_FORMDATAID(String PI_FORMDATAID) { + this.PI_FORMDATAID = PI_FORMDATAID; + } + + /** + * 无备注 + */ + public String getPI_FORMDATAID() { + return PI_FORMDATAID; + } + + + /** + * 无备注 + */ + public void setPI_TEMPLATEID(String PI_TEMPLATEID) { + this.PI_TEMPLATEID = PI_TEMPLATEID; + } + + /** + * 无备注 + */ + public String getPI_TEMPLATEID() { + return PI_TEMPLATEID; + } + + + /** + * 无备注 + */ + public void setPI_STARTACCOUNTID(String PI_STARTACCOUNTID) { + this.PI_STARTACCOUNTID = PI_STARTACCOUNTID; + } + + /** + * 无备注 + */ + public String getPI_STARTACCOUNTID() { + return PI_STARTACCOUNTID; + } + + + /** + * 无备注 + */ + public void setPI_STARTDEPARTMENTID(String PI_STARTDEPARTMENTID) { + this.PI_STARTDEPARTMENTID = PI_STARTDEPARTMENTID; + } + + /** + * 无备注 + */ + public String getPI_STARTDEPARTMENTID() { + return PI_STARTDEPARTMENTID; + } + + + /** + * 无备注 + */ + public void setPI_STARTMEMBERID(String PI_STARTMEMBERID) { + this.PI_STARTMEMBERID = PI_STARTMEMBERID; + } + + /** + * 无备注 + */ + public String getPI_STARTMEMBERID() { + return PI_STARTMEMBERID; + } + + + /** + * 无备注 + */ + public void setPI_STARTMEMBERNM(String PI_STARTMEMBERNM) { + this.PI_STARTMEMBERNM = PI_STARTMEMBERNM; + } + + /** + * 无备注 + */ + public String getPI_STARTMEMBERNM() { + return PI_STARTMEMBERNM; + } + + + /** + * 无备注 + */ + public void setPI_STARTDATE(Date PI_STARTDATE) { + this.PI_STARTDATE = PI_STARTDATE; + } + + /** + * 无备注 + */ + public Date getPI_STARTDATE() { + return PI_STARTDATE; + } + + + /** + * 无备注 + */ + public void setPI_DEALACCOUNTID(String PI_DEALACCOUNTID) { + this.PI_DEALACCOUNTID = PI_DEALACCOUNTID; + } + + /** + * 无备注 + */ + public String getPI_DEALACCOUNTID() { + return PI_DEALACCOUNTID; + } + + + /** + * 无备注 + */ + public void setPI_DEALDEPARTMENTID(String PI_DEALDEPARTMENTID) { + this.PI_DEALDEPARTMENTID = PI_DEALDEPARTMENTID; + } + + /** + * 无备注 + */ + public String getPI_DEALDEPARTMENTID() { + return PI_DEALDEPARTMENTID; + } + + + /** + * 无备注 + */ + public void setPI_DEALMEMBERID(String PI_DEALMEMBERID) { + this.PI_DEALMEMBERID = PI_DEALMEMBERID; + } + + /** + * 无备注 + */ + public String getPI_DEALMEMBERID() { + return PI_DEALMEMBERID; + } + + + /** + * 无备注 + */ + public void setPI_DEALMEMBERNM(String PI_DEALMEMBERNM) { + this.PI_DEALMEMBERNM = PI_DEALMEMBERNM; + } + + /** + * 无备注 + */ + public String getPI_DEALMEMBERNM() { + return PI_DEALMEMBERNM; + } + + + /** + * 无备注 + */ + public void setPI_DEALDATE(Date PI_DEALDATE) { + this.PI_DEALDATE = PI_DEALDATE; + } + + /** + * 无备注 + */ + public Date getPI_DEALDATE() { + return PI_DEALDATE; + } + + + /** + * 无备注 + */ + public void setPI_DEALSTATE(String PI_DEALSTATE) { + this.PI_DEALSTATE = PI_DEALSTATE; + } + + /** + * 无备注 + */ + public String getPI_DEALSTATE() { + return PI_DEALSTATE; + } + + + /** + * 无备注 + */ + public void setPI_DEALPOLICY(String PI_DEALPOLICY) { + this.PI_DEALPOLICY = PI_DEALPOLICY; + } + + /** + * 无备注 + */ + public String getPI_DEALPOLICY() { + return PI_DEALPOLICY; + } + + + /** + * 无备注 + */ + public void setPI_DEALINFO(String PI_DEALINFO) { + this.PI_DEALINFO = PI_DEALINFO; + } + + /** + * 无备注 + */ + public String getPI_DEALINFO() { + return PI_DEALINFO; + } + + + /** + * 无备注 + */ + public void setPI_SHAREID(String PI_SHAREID) { + this.PI_SHAREID = PI_SHAREID; + } + + /** + * 无备注 + */ + public String getPI_SHAREID() { + return PI_SHAREID; + } + + + /** + * 无备注 + */ + public void setPI_SHARENM(String PI_SHARENM) { + this.PI_SHARENM = PI_SHARENM; + } + + /** + * 无备注 + */ + public String getPI_SHARENM() { + return PI_SHARENM; + } + + + /** + * 无备注 + */ + public void setPI_APITYPE(String PI_APITYPE) { + this.PI_APITYPE = PI_APITYPE; + } + + /** + * 无备注 + */ + public String getPI_APITYPE() { + return PI_APITYPE; + } + + + /** + * 无备注 + */ + public void setPI_ISVALID(String PI_ISVALID) { + this.PI_ISVALID = PI_ISVALID; + } + + /** + * 无备注 + */ + public String getPI_ISVALID() { + return PI_ISVALID; + } + + + /** + * 无备注 + */ + public void setPI_VALIDRESULT(String PI_VALIDRESULT) { + this.PI_VALIDRESULT = PI_VALIDRESULT; + } + + /** + * 无备注 + */ + public String getPI_VALIDRESULT() { + return PI_VALIDRESULT; + } + + + /** + * 无备注 + */ + public void setPI_RESULTNM(String PI_RESULTNM) { + this.PI_RESULTNM = PI_RESULTNM; + } + + /** + * 无备注 + */ + public String getPI_RESULTNM() { + return PI_RESULTNM; + } + + + /** + * 无备注 + */ + public void setPI_VALIDSTATE(String PI_VALIDSTATE) { + this.PI_VALIDSTATE = PI_VALIDSTATE; + } + + /** + * 无备注 + */ + public String getPI_VALIDSTATE() { + return PI_VALIDSTATE; + } + + + /** + * 无备注 + */ + public void setPI_CLASSTYPE(String PI_CLASSTYPE) { + this.PI_CLASSTYPE = PI_CLASSTYPE; + } + + /** + * 无备注 + */ + public String getPI_CLASSTYPE() { + return PI_CLASSTYPE; + } + + + /** + * 无备注 + */ + public void setPI_CLASSNAME(String PI_CLASSNAME) { + this.PI_CLASSNAME = PI_CLASSNAME; + } + + /** + * 无备注 + */ + public String getPI_CLASSNAME() { + return PI_CLASSNAME; + } + + + /** + * 无备注 + */ + public void setPI_RECOVERSTATE(String PI_RECOVERSTATE) { + this.PI_RECOVERSTATE = PI_RECOVERSTATE; + } + + /** + * 无备注 + */ + public String getPI_RECOVERSTATE() { + return PI_RECOVERSTATE; + } + + + /** + * 无备注 + */ + public void setPI_RECOVERMEMBERID(String PI_RECOVERMEMBERID) { + this.PI_RECOVERMEMBERID = PI_RECOVERMEMBERID; + } + + /** + * 无备注 + */ + public String getPI_RECOVERMEMBERID() { + return PI_RECOVERMEMBERID; + } + + + /** + * 无备注 + */ + public void setPI_RECOVERMEMBERNM(String PI_RECOVERMEMBERNM) { + this.PI_RECOVERMEMBERNM = PI_RECOVERMEMBERNM; + } + + /** + * 无备注 + */ + public String getPI_RECOVERMEMBERNM() { + return PI_RECOVERMEMBERNM; + } + + + /** + * 无备注 + */ + public void setPI_RECOVERDATE(Date PI_RECOVERDATE) { + this.PI_RECOVERDATE = PI_RECOVERDATE; + } + + /** + * 无备注 + */ + public Date getPI_RECOVERDATE() { + return PI_RECOVERDATE; + } + + + /** + * 无备注 + */ + public void setPI_ORGID(String PI_ORGID) { + this.PI_ORGID = PI_ORGID; + } + + /** + * 无备注 + */ + public String getPI_ORGID() { + return PI_ORGID; + } + + + /** + * 无备注 + */ + public void setPI_ORGNM(String PI_ORGNM) { + this.PI_ORGNM = PI_ORGNM; + } + + /** + * 无备注 + */ + public String getPI_ORGNM() { + return PI_ORGNM; + } + + + /** + * 无备注 + */ + public void setPI_YEAR(String PI_YEAR) { + this.PI_YEAR = PI_YEAR; + } + + /** + * 无备注 + */ + public String getPI_YEAR() { + return PI_YEAR; + } + + + /** + * 无备注 + */ + public void setPI_MONTH(String PI_MONTH) { + this.PI_MONTH = PI_MONTH; + } + + /** + * 无备注 + */ + public String getPI_MONTH() { + return PI_MONTH; + } + + + /** + * 无备注 + */ + public void setPI_QUARTER(String PI_QUARTER) { + this.PI_QUARTER = PI_QUARTER; + } + + /** + * 无备注 + */ + public String getPI_QUARTER() { + return PI_QUARTER; + } + + + /** + * 无备注 + */ + public void setPI_HALFYEAR(String PI_HALFYEAR) { + this.PI_HALFYEAR = PI_HALFYEAR; + } + + /** + * 无备注 + */ + public String getPI_HALFYEAR() { + return PI_HALFYEAR; + } + + + /** + * 无备注 + */ + public void setPI_XMMC(String PI_XMMC) { + this.PI_XMMC = PI_XMMC; + } + + /** + * 无备注 + */ + public String getPI_XMMC() { + return PI_XMMC; + } + + + /** + * 无备注 + */ + public void setPI_FPDM(String PI_FPDM) { + this.PI_FPDM = PI_FPDM; + } + + /** + * 无备注 + */ + public String getPI_FPDM() { + return PI_FPDM; + } + + + /** + * 无备注 + */ + public void setPI_FPHM(String PI_FPHM) { + this.PI_FPHM = PI_FPHM; + } + + /** + * 无备注 + */ + public String getPI_FPHM() { + return PI_FPHM; + } + + + /** + * 无备注 + */ + public void setPI_SALERTAXNO(String PI_SALERTAXNO) { + this.PI_SALERTAXNO = PI_SALERTAXNO; + } + + /** + * 无备注 + */ + public String getPI_SALERTAXNO() { + return PI_SALERTAXNO; + } + + + /** + * 无备注 + */ + public void setPI_SALERNAME(String PI_SALERNAME) { + this.PI_SALERNAME = PI_SALERNAME; + } + + /** + * 无备注 + */ + public String getPI_SALERNAME() { + return PI_SALERNAME; + } + + + /** + * 无备注 + */ + public void setPI_BUYERTAXNO(String PI_BUYERTAXNO) { + this.PI_BUYERTAXNO = PI_BUYERTAXNO; + } + + /** + * 无备注 + */ + public String getPI_BUYERTAXNO() { + return PI_BUYERTAXNO; + } + + + /** + * 无备注 + */ + public void setPI_BUYERNAME(String PI_BUYERNAME) { + this.PI_BUYERNAME = PI_BUYERNAME; + } + + /** + * 无备注 + */ + public String getPI_BUYERNAME() { + return PI_BUYERNAME; + } + + + /** + * 无备注 + */ + public void setPI_INVOICETYPE(String PI_INVOICETYPE) { + this.PI_INVOICETYPE = PI_INVOICETYPE; + } + + /** + * 无备注 + */ + public String getPI_INVOICETYPE() { + return PI_INVOICETYPE; + } + + + /** + * 无备注 + */ + public void setPI_INVOICENAME(String PI_INVOICENAME) { + this.PI_INVOICENAME = PI_INVOICENAME; + } + + /** + * 无备注 + */ + public String getPI_INVOICENAME() { + return PI_INVOICENAME; + } + + + /** + * 无备注 + */ + public void setPI_INVOICEDATE(Date PI_INVOICEDATE) { + this.PI_INVOICEDATE = PI_INVOICEDATE; + } + + /** + * 无备注 + */ + public Date getPI_INVOICEDATE() { + return PI_INVOICEDATE; + } + + + /** + * 无备注 + */ + public void setPI_FSTATION(String PI_FSTATION) { + this.PI_FSTATION = PI_FSTATION; + } + + /** + * 无备注 + */ + public String getPI_FSTATION() { + return PI_FSTATION; + } + + + /** + * 无备注 + */ + public void setPI_TSTATION(String PI_TSTATION) { + this.PI_TSTATION = PI_TSTATION; + } + + /** + * 无备注 + */ + public String getPI_TSTATION() { + return PI_TSTATION; + } + + + /** + * 无备注 + */ + public void setPI_USERNAME(String PI_USERNAME) { + this.PI_USERNAME = PI_USERNAME; + } + + /** + * 无备注 + */ + public String getPI_USERNAME() { + return PI_USERNAME; + } + + + /** + * 无备注 + */ + public void setPI_TRAINNO(String PI_TRAINNO) { + this.PI_TRAINNO = PI_TRAINNO; + } + + /** + * 无备注 + */ + public String getPI_TRAINNO() { + return PI_TRAINNO; + } + + + /** + * 无备注 + */ + public void setPI_TRAINCODE(String PI_TRAINCODE) { + this.PI_TRAINCODE = PI_TRAINCODE; + } + + /** + * 无备注 + */ + public String getPI_TRAINCODE() { + return PI_TRAINCODE; + } + + + /** + * 无备注 + */ + public void setPI_STARTDATETIME(Date PI_STARTDATETIME) { + this.PI_STARTDATETIME = PI_STARTDATETIME; + } + + /** + * 无备注 + */ + public Date getPI_STARTDATETIME() { + return PI_STARTDATETIME; + } + + + /** + * 无备注 + */ + public void setPI_ENDDATETIME(Date PI_ENDDATETIME) { + this.PI_ENDDATETIME = PI_ENDDATETIME; + } + + /** + * 无备注 + */ + public Date getPI_ENDDATETIME() { + return PI_ENDDATETIME; + } + + + /** + * 无备注 + */ + public void setPI_STARTTIME(String PI_STARTTIME) { + this.PI_STARTTIME = PI_STARTTIME; + } + + /** + * 无备注 + */ + public String getPI_STARTTIME() { + return PI_STARTTIME; + } + + + /** + * 无备注 + */ + public void setPI_ENDTIME(String PI_ENDTIME) { + this.PI_ENDTIME = PI_ENDTIME; + } + + /** + * 无备注 + */ + public String getPI_ENDTIME() { + return PI_ENDTIME; + } + + + /** + * 无备注 + */ + public void setPI_TAXRATE(String PI_TAXRATE) { + this.PI_TAXRATE = PI_TAXRATE; + } + + /** + * 无备注 + */ + public String getPI_TAXRATE() { + return PI_TAXRATE; + } + + + /** + * 无备注 + */ + public void setPI_TAXAMOUNT(String PI_TAXAMOUNT) { + this.PI_TAXAMOUNT = PI_TAXAMOUNT; + } + + /** + * 无备注 + */ + public String getPI_TAXAMOUNT() { + return PI_TAXAMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_NOTAXAMOUNT(String PI_NOTAXAMOUNT) { + this.PI_NOTAXAMOUNT = PI_NOTAXAMOUNT; + } + + /** + * 无备注 + */ + public String getPI_NOTAXAMOUNT() { + return PI_NOTAXAMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_DEDUCTIONAMOUNT(String PI_DEDUCTIONAMOUNT) { + this.PI_DEDUCTIONAMOUNT = PI_DEDUCTIONAMOUNT; + } + + /** + * 无备注 + */ + public String getPI_DEDUCTIONAMOUNT() { + return PI_DEDUCTIONAMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_FILEURL(String PI_FILEURL) { + this.PI_FILEURL = PI_FILEURL; + } + + /** + * 无备注 + */ + public String getPI_FILEURL() { + return PI_FILEURL; + } + + + /** + * 无备注 + */ + public void setPI_MATTERID(String PI_MATTERID) { + this.PI_MATTERID = PI_MATTERID; + } + + /** + * 无备注 + */ + public String getPI_MATTERID() { + return PI_MATTERID; + } + + + /** + * 无备注 + */ + public void setPI_VOUCHER(String PI_VOUCHER) { + this.PI_VOUCHER = PI_VOUCHER; + } + + /** + * 无备注 + */ + public String getPI_VOUCHER() { + return PI_VOUCHER; + } + + + /** + * 无备注 + */ + public void setPI_VOUCHERINFO(String PI_VOUCHERINFO) { + this.PI_VOUCHERINFO = PI_VOUCHERINFO; + } + + /** + * 无备注 + */ + public String getPI_VOUCHERINFO() { + return PI_VOUCHERINFO; + } + + + /** + * 无备注 + */ + public void setPI_FIELD0001(String PI_FIELD0001) { + this.PI_FIELD0001 = PI_FIELD0001; + } + + /** + * 无备注 + */ + public String getPI_FIELD0001() { + return PI_FIELD0001; + } + + + /** + * 无备注 + */ + public void setPI_FIELD0002(String PI_FIELD0002) { + this.PI_FIELD0002 = PI_FIELD0002; + } + + /** + * 无备注 + */ + public String getPI_FIELD0002() { + return PI_FIELD0002; + } + + + /** + * 无备注 + */ + public void setPI_FIELD0003(String PI_FIELD0003) { + this.PI_FIELD0003 = PI_FIELD0003; + } + + /** + * 无备注 + */ + public String getPI_FIELD0003() { + return PI_FIELD0003; + } + + + /** + * 无备注 + */ + public void setPI_FIELD0004(String PI_FIELD0004) { + this.PI_FIELD0004 = PI_FIELD0004; + } + + /** + * 无备注 + */ + public String getPI_FIELD0004() { + return PI_FIELD0004; + } + + + /** + * 无备注 + */ + public void setPI_FIELD0005(String PI_FIELD0005) { + this.PI_FIELD0005 = PI_FIELD0005; + } + + /** + * 无备注 + */ + public String getPI_FIELD0005() { + return PI_FIELD0005; + } + + + /** + * 无备注 + */ + public void setPI_INVOICEVALIDSTATE(String PI_INVOICEVALIDSTATE) { + this.PI_INVOICEVALIDSTATE = PI_INVOICEVALIDSTATE; + } + + /** + * 无备注 + */ + public String getPI_INVOICEVALIDSTATE() { + return PI_INVOICEVALIDSTATE; + } + + + /** + * 无备注 + */ + public void setPI_MODIFYSTATE(String PI_MODIFYSTATE) { + this.PI_MODIFYSTATE = PI_MODIFYSTATE; + } + + /** + * 无备注 + */ + public String getPI_MODIFYSTATE() { + return PI_MODIFYSTATE; + } + + + /** + * 无备注 + */ + public void setPI_USAGEAMOUNT(String PI_USAGEAMOUNT) { + this.PI_USAGEAMOUNT = PI_USAGEAMOUNT; + } + + /** + * 无备注 + */ + public String getPI_USAGEAMOUNT() { + return PI_USAGEAMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_VERIFYAMOUNT(String PI_VERIFYAMOUNT) { + this.PI_VERIFYAMOUNT = PI_VERIFYAMOUNT; + } + + /** + * 无备注 + */ + public String getPI_VERIFYAMOUNT() { + return PI_VERIFYAMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_UNUSEDAMOUNT(String PI_UNUSEDAMOUNT) { + this.PI_UNUSEDAMOUNT = PI_UNUSEDAMOUNT; + } + + /** + * 无备注 + */ + public String getPI_UNUSEDAMOUNT() { + return PI_UNUSEDAMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_USECOUNT(String PI_USECOUNT) { + this.PI_USECOUNT = PI_USECOUNT; + } + + /** + * 无备注 + */ + public String getPI_USECOUNT() { + return PI_USECOUNT; + } + + + /** + * 无备注 + */ + public void setPI_FILENAME(String PI_FILENAME) { + this.PI_FILENAME = PI_FILENAME; + } + + /** + * 无备注 + */ + public String getPI_FILENAME() { + return PI_FILENAME; + } + + + /** + * 无备注 + */ + public void setPI_UPDATEDATE(Date PI_UPDATEDATE) { + this.PI_UPDATEDATE = PI_UPDATEDATE; + } + + /** + * 无备注 + */ + public Date getPI_UPDATEDATE() { + return PI_UPDATEDATE; + } + + + /** + * 无备注 + */ + public void setPI_VOUCHERDATE(Date PI_VOUCHERDATE) { + this.PI_VOUCHERDATE = PI_VOUCHERDATE; + } + + /** + * 无备注 + */ + public Date getPI_VOUCHERDATE() { + return PI_VOUCHERDATE; + } + + + /** + * 无备注 + */ + public void setPI_CPAY_STATE(String PI_CPAY_STATE) { + this.PI_CPAY_STATE = PI_CPAY_STATE; + } + + /** + * 无备注 + */ + public String getPI_CPAY_STATE() { + return PI_CPAY_STATE; + } + + + /** + * 无备注 + */ + public void setPI_CPAY_DATE(Date PI_CPAY_DATE) { + this.PI_CPAY_DATE = PI_CPAY_DATE; + } + + /** + * 无备注 + */ + public Date getPI_CPAY_DATE() { + return PI_CPAY_DATE; + } + + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.xml new file mode 100644 index 00000000..c997a976 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.xml @@ -0,0 +1,432 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + PI_ID, + PI_KEY, + PI_KEY_NEW, + PI_DATAKEY, + PI_MAINCONFIGID, + PI_TAXNO, + PI_TABLENAME, + PI_BILLKIND, + PI_AMOUNT, + PI_USESTATE, + PI_SUMMARYID, + PI_SUBJECT, + PI_FORMID, + PI_FORMDATAID + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.java new file mode 100644 index 00000000..4440c786 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.java @@ -0,0 +1,170 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.entity; +import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import com.hzya.frame.web.entity.BaseEntity; +/** + * @description: 迈锐思-增值税发票子表 + * @tableName: LEXMISCIV_INVOICEDETAIL + * @entityName: LexmiscivInvoicedetailEntity + * @author: gjh + * @history: 1.0 + */ +public class LexmiscivInvoicedetailEntity extends BaseEntity { + public LexmiscivInvoicedetailEntity() { + + } + + public LexmiscivInvoicedetailEntity(String ID_MAINID,String dataSourceCode) { + this.ID_MAINID = ID_MAINID; + this.setDataSourceCode(dataSourceCode); + } + + /** 无备注 */ +private String ID_ID; +/** 无备注 */ +private String ID_MAINID; +/** 无备注 */ +private String ID_ROWID; +/** 无备注 */ +private String ID_ACCOUNTNAME; +/** 无备注 */ +private String ID_SERVICENM; +/** 无备注 */ +private String ID_SERVICETYPE; +/** 无备注 */ +private String ID_PRICE; +/** 无备注 */ +private String ID_UNIT; +/** 无备注 */ +private String ID_NUM; +/** 无备注 */ +private String ID_NOTAXAMOUNT; +/** 无备注 */ +private String ID_TAX; +/** 无备注 */ +private String ID_TAXAMOUNT; + + +/** 无备注 */ +public void setID_ID(String ID_ID) { + this.ID_ID = ID_ID; + } +/** 无备注 */ +public String getID_ID() { + return ID_ID; + } + + +/** 无备注 */ +public void setID_MAINID(String ID_MAINID) { + this.ID_MAINID = ID_MAINID; + } +/** 无备注 */ +public String getID_MAINID() { + return ID_MAINID; + } + + +/** 无备注 */ +public void setID_ROWID(String ID_ROWID) { + this.ID_ROWID = ID_ROWID; + } +/** 无备注 */ +public String getID_ROWID() { + return ID_ROWID; + } + + +/** 无备注 */ +public void setID_ACCOUNTNAME(String ID_ACCOUNTNAME) { + this.ID_ACCOUNTNAME = ID_ACCOUNTNAME; + } +/** 无备注 */ +public String getID_ACCOUNTNAME() { + return ID_ACCOUNTNAME; + } + + +/** 无备注 */ +public void setID_SERVICENM(String ID_SERVICENM) { + this.ID_SERVICENM = ID_SERVICENM; + } +/** 无备注 */ +public String getID_SERVICENM() { + return ID_SERVICENM; + } + + +/** 无备注 */ +public void setID_SERVICETYPE(String ID_SERVICETYPE) { + this.ID_SERVICETYPE = ID_SERVICETYPE; + } +/** 无备注 */ +public String getID_SERVICETYPE() { + return ID_SERVICETYPE; + } + + +/** 无备注 */ +public void setID_PRICE(String ID_PRICE) { + this.ID_PRICE = ID_PRICE; + } +/** 无备注 */ +public String getID_PRICE() { + return ID_PRICE; + } + + +/** 无备注 */ +public void setID_UNIT(String ID_UNIT) { + this.ID_UNIT = ID_UNIT; + } +/** 无备注 */ +public String getID_UNIT() { + return ID_UNIT; + } + + +/** 无备注 */ +public void setID_NUM(String ID_NUM) { + this.ID_NUM = ID_NUM; + } +/** 无备注 */ +public String getID_NUM() { + return ID_NUM; + } + + +/** 无备注 */ +public void setID_NOTAXAMOUNT(String ID_NOTAXAMOUNT) { + this.ID_NOTAXAMOUNT = ID_NOTAXAMOUNT; + } +/** 无备注 */ +public String getID_NOTAXAMOUNT() { + return ID_NOTAXAMOUNT; + } + + +/** 无备注 */ +public void setID_TAX(String ID_TAX) { + this.ID_TAX = ID_TAX; + } +/** 无备注 */ +public String getID_TAX() { + return ID_TAX; + } + + +/** 无备注 */ +public void setID_TAXAMOUNT(String ID_TAXAMOUNT) { + this.ID_TAXAMOUNT = ID_TAXAMOUNT; + } +/** 无备注 */ +public String getID_TAXAMOUNT() { + return ID_TAXAMOUNT; + } + + + } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.xml new file mode 100644 index 00000000..e4e1aca9 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.xml @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ID_ID, + ID_MAINID, + ID_ROWID, + ID_ACCOUNTNAME, + ID_SERVICENM, + ID_SERVICETYPE, + ID_PRICE, + ID_UNIT, + ID_NUM, + ID_NOTAXAMOUNT, + ID_TAX, + ID_TAXAMOUNT + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.java new file mode 100644 index 00000000..fd42a97e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.java @@ -0,0 +1,651 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.entity; +import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import com.hzya.frame.web.entity.BaseEntity; +/** + * @description: 迈锐思-增值税发票主表 + * @tableName: LEXMISCIV_INVOICEMAIN + * @entityName: LexmiscivInvoicemainEntity + * @author: gjh + * @history: 1.0 + */ +public class LexmiscivInvoicemainEntity extends BaseEntity { + public LexmiscivInvoicemainEntity() { + + } + + public LexmiscivInvoicemainEntity(String IM_ID,String dataSourceCode) { + this.IM_ID = IM_ID; + this.setDataSourceCode(dataSourceCode); + } + + /** 无备注 */ +private String IM_ID; +/** 无备注 */ +private String IM_FPDM; +/** 无备注 */ +private String IM_FPHM; +@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") +@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") +private Date IM_DATE; +/** 无备注 */ +private String IM_CHECKCODE; +/** 无备注 */ +private String IM_SALERTAXNO; +/** 无备注 */ +private String IM_SALERNAME; +/** 无备注 */ +private String IM_SALERADDRESS; +/** 无备注 */ +private String IM_SALERBANKNO; +/** 无备注 */ +private String IM_SALERBANKNM; +/** 无备注 */ +private String IM_BUYERTAXNO; +/** 无备注 */ +private String IM_BUYERNAME; +/** 无备注 */ +private String IM_BUYERADDRESS; +/** 无备注 */ +private String IM_BUYERBANKNO; +/** 无备注 */ +private String IM_BUYERBANKNM; +/** 无备注 */ +private String IM_MAKERNM; +/** 无备注 */ +private String IM_PAYEE; +/** 无备注 */ +private String IM_AUDITOR; +/** 无备注 */ +private BigDecimal IM_NOTAXAMOUNT; +/** 无备注 */ +private BigDecimal IM_TAXAMOUNT; +/** 无备注 */ +private BigDecimal IM_TOTALAMOUNT; +/** 无备注 */ +private String IM_TAX; +/** 无备注 */ +private String IM_MACHINENO; +/** 无备注 */ +private String IM_MEMO; +/** 无备注 */ +private String IM_ENCRYPTIONCODE; +/** 无备注 */ +private String IM_TYPE; +/** 无备注 */ +private String IM_TYPENAME; +/** 无备注 */ +private String IM_XMMC; +/** 无备注 */ +private String IM_KEY; +/** 无备注 */ +private String IM_AREACODE; +/** 无备注 */ +private String IM_AREANAME; +/** 无备注 */ +private String IM_PRINTEDFPDM; +/** 无备注 */ +private String IM_PRINTEDFPHM; +/** 无备注 */ +private Integer IM_COUNT; +/** 无备注 */ +private Integer IM_AGENCY; +/** 无备注 */ +private Integer IM_BLOCKCHAIN; +/** 无备注 */ +private Integer IM_COMPANYSEAL; +/** 无备注 */ +private String IM_COMPANYSEALDEPT; +/** 无备注 */ +private String IM_COMPANYSEALNUM; +/** 无备注 */ +private String IM_SADDRESS; +/** 无备注 */ +private String IM_STEL; +/** 无备注 */ +private String IM_SBANKNM; +/** 无备注 */ +private String IM_SBANKNO; +/** 无备注 */ +private String IM_BADDRESS; +/** 无备注 */ +private String IM_BTEL; +/** 无备注 */ +private String IM_BBANKNM; +/** 无备注 */ +private String IM_BBANKNO; +/** 无备注 */ +private String IM_DATETIME; +/** 无备注 */ +private String IM_EDATETIME; +/** 无备注 */ +private BigDecimal IM_TOTALAMOUNTOCR; +/** 无备注 */ +private Integer IM_PAGER_ELECTRONIC; +/** 无备注 */ +private String IM_ELECTRONIC_NUMBER; + + +/** 无备注 */ +public void setIM_ID(String IM_ID) { + this.IM_ID = IM_ID; + } +/** 无备注 */ +public String getIM_ID() { + return IM_ID; + } + + +/** 无备注 */ +public void setIM_FPDM(String IM_FPDM) { + this.IM_FPDM = IM_FPDM; + } +/** 无备注 */ +public String getIM_FPDM() { + return IM_FPDM; + } + + +/** 无备注 */ +public void setIM_FPHM(String IM_FPHM) { + this.IM_FPHM = IM_FPHM; + } +/** 无备注 */ +public String getIM_FPHM() { + return IM_FPHM; + } + + +/** 无备注 */ +public void setIM_DATE(Date IM_DATE) { + this.IM_DATE = IM_DATE; + } +/** 无备注 */ +public Date getIM_DATE() { + return IM_DATE; + } + + +/** 无备注 */ +public void setIM_CHECKCODE(String IM_CHECKCODE) { + this.IM_CHECKCODE = IM_CHECKCODE; + } +/** 无备注 */ +public String getIM_CHECKCODE() { + return IM_CHECKCODE; + } + + +/** 无备注 */ +public void setIM_SALERTAXNO(String IM_SALERTAXNO) { + this.IM_SALERTAXNO = IM_SALERTAXNO; + } +/** 无备注 */ +public String getIM_SALERTAXNO() { + return IM_SALERTAXNO; + } + + +/** 无备注 */ +public void setIM_SALERNAME(String IM_SALERNAME) { + this.IM_SALERNAME = IM_SALERNAME; + } +/** 无备注 */ +public String getIM_SALERNAME() { + return IM_SALERNAME; + } + + +/** 无备注 */ +public void setIM_SALERADDRESS(String IM_SALERADDRESS) { + this.IM_SALERADDRESS = IM_SALERADDRESS; + } +/** 无备注 */ +public String getIM_SALERADDRESS() { + return IM_SALERADDRESS; + } + + +/** 无备注 */ +public void setIM_SALERBANKNO(String IM_SALERBANKNO) { + this.IM_SALERBANKNO = IM_SALERBANKNO; + } +/** 无备注 */ +public String getIM_SALERBANKNO() { + return IM_SALERBANKNO; + } + + +/** 无备注 */ +public void setIM_SALERBANKNM(String IM_SALERBANKNM) { + this.IM_SALERBANKNM = IM_SALERBANKNM; + } +/** 无备注 */ +public String getIM_SALERBANKNM() { + return IM_SALERBANKNM; + } + + +/** 无备注 */ +public void setIM_BUYERTAXNO(String IM_BUYERTAXNO) { + this.IM_BUYERTAXNO = IM_BUYERTAXNO; + } +/** 无备注 */ +public String getIM_BUYERTAXNO() { + return IM_BUYERTAXNO; + } + + +/** 无备注 */ +public void setIM_BUYERNAME(String IM_BUYERNAME) { + this.IM_BUYERNAME = IM_BUYERNAME; + } +/** 无备注 */ +public String getIM_BUYERNAME() { + return IM_BUYERNAME; + } + + +/** 无备注 */ +public void setIM_BUYERADDRESS(String IM_BUYERADDRESS) { + this.IM_BUYERADDRESS = IM_BUYERADDRESS; + } +/** 无备注 */ +public String getIM_BUYERADDRESS() { + return IM_BUYERADDRESS; + } + + +/** 无备注 */ +public void setIM_BUYERBANKNO(String IM_BUYERBANKNO) { + this.IM_BUYERBANKNO = IM_BUYERBANKNO; + } +/** 无备注 */ +public String getIM_BUYERBANKNO() { + return IM_BUYERBANKNO; + } + + +/** 无备注 */ +public void setIM_BUYERBANKNM(String IM_BUYERBANKNM) { + this.IM_BUYERBANKNM = IM_BUYERBANKNM; + } +/** 无备注 */ +public String getIM_BUYERBANKNM() { + return IM_BUYERBANKNM; + } + + +/** 无备注 */ +public void setIM_MAKERNM(String IM_MAKERNM) { + this.IM_MAKERNM = IM_MAKERNM; + } +/** 无备注 */ +public String getIM_MAKERNM() { + return IM_MAKERNM; + } + + +/** 无备注 */ +public void setIM_PAYEE(String IM_PAYEE) { + this.IM_PAYEE = IM_PAYEE; + } +/** 无备注 */ +public String getIM_PAYEE() { + return IM_PAYEE; + } + + +/** 无备注 */ +public void setIM_AUDITOR(String IM_AUDITOR) { + this.IM_AUDITOR = IM_AUDITOR; + } +/** 无备注 */ +public String getIM_AUDITOR() { + return IM_AUDITOR; + } + + +/** 无备注 */ +public void setIM_NOTAXAMOUNT(BigDecimal IM_NOTAXAMOUNT) { + this.IM_NOTAXAMOUNT = IM_NOTAXAMOUNT; + } +/** 无备注 */ +public BigDecimal getIM_NOTAXAMOUNT() { + return IM_NOTAXAMOUNT; + } + + +/** 无备注 */ +public void setIM_TAXAMOUNT(BigDecimal IM_TAXAMOUNT) { + this.IM_TAXAMOUNT = IM_TAXAMOUNT; + } +/** 无备注 */ +public BigDecimal getIM_TAXAMOUNT() { + return IM_TAXAMOUNT; + } + + +/** 无备注 */ +public void setIM_TOTALAMOUNT(BigDecimal IM_TOTALAMOUNT) { + this.IM_TOTALAMOUNT = IM_TOTALAMOUNT; + } +/** 无备注 */ +public BigDecimal getIM_TOTALAMOUNT() { + return IM_TOTALAMOUNT; + } + + +/** 无备注 */ +public void setIM_TAX(String IM_TAX) { + this.IM_TAX = IM_TAX; + } +/** 无备注 */ +public String getIM_TAX() { + return IM_TAX; + } + + +/** 无备注 */ +public void setIM_MACHINENO(String IM_MACHINENO) { + this.IM_MACHINENO = IM_MACHINENO; + } +/** 无备注 */ +public String getIM_MACHINENO() { + return IM_MACHINENO; + } + + +/** 无备注 */ +public void setIM_MEMO(String IM_MEMO) { + this.IM_MEMO = IM_MEMO; + } +/** 无备注 */ +public String getIM_MEMO() { + return IM_MEMO; + } + + +/** 无备注 */ +public void setIM_ENCRYPTIONCODE(String IM_ENCRYPTIONCODE) { + this.IM_ENCRYPTIONCODE = IM_ENCRYPTIONCODE; + } +/** 无备注 */ +public String getIM_ENCRYPTIONCODE() { + return IM_ENCRYPTIONCODE; + } + + +/** 无备注 */ +public void setIM_TYPE(String IM_TYPE) { + this.IM_TYPE = IM_TYPE; + } +/** 无备注 */ +public String getIM_TYPE() { + return IM_TYPE; + } + + +/** 无备注 */ +public void setIM_TYPENAME(String IM_TYPENAME) { + this.IM_TYPENAME = IM_TYPENAME; + } +/** 无备注 */ +public String getIM_TYPENAME() { + return IM_TYPENAME; + } + + +/** 无备注 */ +public void setIM_XMMC(String IM_XMMC) { + this.IM_XMMC = IM_XMMC; + } +/** 无备注 */ +public String getIM_XMMC() { + return IM_XMMC; + } + + +/** 无备注 */ +public void setIM_KEY(String IM_KEY) { + this.IM_KEY = IM_KEY; + } +/** 无备注 */ +public String getIM_KEY() { + return IM_KEY; + } + + +/** 无备注 */ +public void setIM_AREACODE(String IM_AREACODE) { + this.IM_AREACODE = IM_AREACODE; + } +/** 无备注 */ +public String getIM_AREACODE() { + return IM_AREACODE; + } + + +/** 无备注 */ +public void setIM_AREANAME(String IM_AREANAME) { + this.IM_AREANAME = IM_AREANAME; + } +/** 无备注 */ +public String getIM_AREANAME() { + return IM_AREANAME; + } + + +/** 无备注 */ +public void setIM_PRINTEDFPDM(String IM_PRINTEDFPDM) { + this.IM_PRINTEDFPDM = IM_PRINTEDFPDM; + } +/** 无备注 */ +public String getIM_PRINTEDFPDM() { + return IM_PRINTEDFPDM; + } + + +/** 无备注 */ +public void setIM_PRINTEDFPHM(String IM_PRINTEDFPHM) { + this.IM_PRINTEDFPHM = IM_PRINTEDFPHM; + } +/** 无备注 */ +public String getIM_PRINTEDFPHM() { + return IM_PRINTEDFPHM; + } + + +/** 无备注 */ +public void setIM_COUNT(Integer IM_COUNT) { + this.IM_COUNT = IM_COUNT; + } +/** 无备注 */ +public Integer getIM_COUNT() { + return IM_COUNT; + } + + +/** 无备注 */ +public void setIM_AGENCY(Integer IM_AGENCY) { + this.IM_AGENCY = IM_AGENCY; + } +/** 无备注 */ +public Integer getIM_AGENCY() { + return IM_AGENCY; + } + + +/** 无备注 */ +public void setIM_BLOCKCHAIN(Integer IM_BLOCKCHAIN) { + this.IM_BLOCKCHAIN = IM_BLOCKCHAIN; + } +/** 无备注 */ +public Integer getIM_BLOCKCHAIN() { + return IM_BLOCKCHAIN; + } + + +/** 无备注 */ +public void setIM_COMPANYSEAL(Integer IM_COMPANYSEAL) { + this.IM_COMPANYSEAL = IM_COMPANYSEAL; + } +/** 无备注 */ +public Integer getIM_COMPANYSEAL() { + return IM_COMPANYSEAL; + } + + +/** 无备注 */ +public void setIM_COMPANYSEALDEPT(String IM_COMPANYSEALDEPT) { + this.IM_COMPANYSEALDEPT = IM_COMPANYSEALDEPT; + } +/** 无备注 */ +public String getIM_COMPANYSEALDEPT() { + return IM_COMPANYSEALDEPT; + } + + +/** 无备注 */ +public void setIM_COMPANYSEALNUM(String IM_COMPANYSEALNUM) { + this.IM_COMPANYSEALNUM = IM_COMPANYSEALNUM; + } +/** 无备注 */ +public String getIM_COMPANYSEALNUM() { + return IM_COMPANYSEALNUM; + } + + +/** 无备注 */ +public void setIM_SADDRESS(String IM_SADDRESS) { + this.IM_SADDRESS = IM_SADDRESS; + } +/** 无备注 */ +public String getIM_SADDRESS() { + return IM_SADDRESS; + } + + +/** 无备注 */ +public void setIM_STEL(String IM_STEL) { + this.IM_STEL = IM_STEL; + } +/** 无备注 */ +public String getIM_STEL() { + return IM_STEL; + } + + +/** 无备注 */ +public void setIM_SBANKNM(String IM_SBANKNM) { + this.IM_SBANKNM = IM_SBANKNM; + } +/** 无备注 */ +public String getIM_SBANKNM() { + return IM_SBANKNM; + } + + +/** 无备注 */ +public void setIM_SBANKNO(String IM_SBANKNO) { + this.IM_SBANKNO = IM_SBANKNO; + } +/** 无备注 */ +public String getIM_SBANKNO() { + return IM_SBANKNO; + } + + +/** 无备注 */ +public void setIM_BADDRESS(String IM_BADDRESS) { + this.IM_BADDRESS = IM_BADDRESS; + } +/** 无备注 */ +public String getIM_BADDRESS() { + return IM_BADDRESS; + } + + +/** 无备注 */ +public void setIM_BTEL(String IM_BTEL) { + this.IM_BTEL = IM_BTEL; + } +/** 无备注 */ +public String getIM_BTEL() { + return IM_BTEL; + } + + +/** 无备注 */ +public void setIM_BBANKNM(String IM_BBANKNM) { + this.IM_BBANKNM = IM_BBANKNM; + } +/** 无备注 */ +public String getIM_BBANKNM() { + return IM_BBANKNM; + } + + +/** 无备注 */ +public void setIM_BBANKNO(String IM_BBANKNO) { + this.IM_BBANKNO = IM_BBANKNO; + } +/** 无备注 */ +public String getIM_BBANKNO() { + return IM_BBANKNO; + } + + +/** 无备注 */ +public void setIM_DATETIME(String IM_DATETIME) { + this.IM_DATETIME = IM_DATETIME; + } +/** 无备注 */ +public String getIM_DATETIME() { + return IM_DATETIME; + } + + +/** 无备注 */ +public void setIM_EDATETIME(String IM_EDATETIME) { + this.IM_EDATETIME = IM_EDATETIME; + } +/** 无备注 */ +public String getIM_EDATETIME() { + return IM_EDATETIME; + } + + +/** 无备注 */ +public void setIM_TOTALAMOUNTOCR(BigDecimal IM_TOTALAMOUNTOCR) { + this.IM_TOTALAMOUNTOCR = IM_TOTALAMOUNTOCR; + } +/** 无备注 */ +public BigDecimal getIM_TOTALAMOUNTOCR() { + return IM_TOTALAMOUNTOCR; + } + + +/** 无备注 */ +public void setIM_PAGER_ELECTRONIC(Integer IM_PAGER_ELECTRONIC) { + this.IM_PAGER_ELECTRONIC = IM_PAGER_ELECTRONIC; + } +/** 无备注 */ +public Integer getIM_PAGER_ELECTRONIC() { + return IM_PAGER_ELECTRONIC; + } + + +/** 无备注 */ +public void setIM_ELECTRONIC_NUMBER(String IM_ELECTRONIC_NUMBER) { + this.IM_ELECTRONIC_NUMBER = IM_ELECTRONIC_NUMBER; + } +/** 无备注 */ +public String getIM_ELECTRONIC_NUMBER() { + return IM_ELECTRONIC_NUMBER; + } + + + } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.xml new file mode 100644 index 00000000..398e3843 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.xml @@ -0,0 +1,427 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IM_ID, + IM_FPDM, + IM_FPHM, + IM_DATE, + IM_CHECKCODE, + IM_SALERTAXNO, + IM_SALERNAME, + IM_SALERADDRESS, + IM_SALERBANKNO, + IM_SALERBANKNM, + IM_BUYERTAXNO, + IM_BUYERNAME, + IM_BUYERADDRESS, + IM_BUYERBANKNO, + IM_BUYERBANKNM, + IM_MAKERNM, + IM_PAYEE, + IM_AUDITOR, + IM_NOTAXAMOUNT, + IM_TAXAMOUNT, + IM_TOTALAMOUNT, + IM_TAX, + IM_MACHINENO, + IM_MEMO, + IM_ENCRYPTIONCODE, + IM_TYPE, + IM_TYPENAME, + IM_XMMC, + IM_KEY, + IM_AREACODE, + IM_AREANAME, + IM_PRINTEDFPDM, + IM_PRINTEDFPHM, + IM_COUNT, + IM_AGENCY, + IM_BLOCKCHAIN, + IM_COMPANYSEAL, + IM_COMPANYSEALDEPT, + IM_COMPANYSEALNUM, + IM_SADDRESS, + IM_STEL, + IM_SBANKNM, + IM_SBANKNO, + IM_BADDRESS, + IM_BTEL, + IM_BBANKNM, + IM_BBANKNO, + IM_DATETIME, + IM_EDATETIME, + IM_TOTALAMOUNTOCR, + IM_PAGER_ELECTRONIC, + IM_ELECTRONIC_NUMBER + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.java new file mode 100644 index 00000000..aba49e43 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.java @@ -0,0 +1,575 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.entity; +import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import com.hzya.frame.web.entity.BaseEntity; +/** + * @description: 迈锐思-飞机行程单 + * @tableName: LEXMISCIV_PLANETICKET + * @entityName: LexmiscivPlaneticketEntity + * @author: gjh + * @history: 1.0 + */ +public class LexmiscivPlaneticketEntity extends BaseEntity { + public LexmiscivPlaneticketEntity(String PT_ID,String dataSourceCode) { + this.PT_ID = PT_ID; + this.setDataSourceCode(dataSourceCode); + } + + /** 无备注 */ +private String PT_ID; +/** 无备注 */ +private String PT_ETICKETNO; +/** 无备注 */ +private String PT_NO; +/** 无备注 */ +private String PT_FSTATION; +/** 无备注 */ +private String PT_TSTATION; +/** 无备注 */ +private String PT_TSTATION1; +/** 无备注 */ +private String PT_TSTATION2; +/** 无备注 */ +private String PT_TSTATION3; +/** 无备注 */ +private BigDecimal PT_PRICE; +/** 无备注 */ +private String PT_FUNDSAMOUNT; +/** 无备注 */ +private String PT_FUELAMOUNT; +/** 无备注 */ +private String PT_TAXAMOUNT; +/** 无备注 */ +private BigDecimal PT_AMOUNT; +/** 无备注 */ +private String PT_TAXRATE; +/** 无备注 */ +private BigDecimal PT_TAXRATEAMOUNT; +/** 无备注 */ +private BigDecimal PT_NOTAXAMOUNT; +@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") +@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") +private Date PT_DATE; +/** 无备注 */ +private String PT_TIME; +/** 无备注 */ +private String PT_SERIALNO; +/** 无备注 */ +private String PT_IDNO; +/** 无备注 */ +private String PT_CUSTOMER; +/** 无备注 */ +private String PT_CARRIER; +/** 无备注 */ +private String PT_CLASS; +/** 无备注 */ +private String PT_VALIDDATE; +/** 无备注 */ +private String PT_INVALIDDATE; +/** 无备注 */ +private String PT_ALLOW; +/** 无备注 */ +private String PT_VALIDCODE; +/** 无备注 */ +private String PT_INSURANCE; +/** 无备注 */ +private String PT_SALERCODE; +/** 无备注 */ +private String PT_SALERNAME; +/** 无备注 */ +private Date PT_MAKEDATE; +/** 无备注 */ +private String PT_KEY; +/** 无备注 */ +private Integer PT_COUNT; +/** 无备注 */ +private String PT_DATETIME; +/** 无备注 */ +private String PT_EDATETIME; +/** 无备注 */ +private String PT_INTERNATIONALFLAG; +/** 无备注 */ +private String PT_MARKDESC; +/** 无备注 */ +private String PT_GPNUMBER; +/** 无备注 */ +private String PT_ISSUINGSTATE; +/** 无备注 */ +private String PT_FPHM; +/** 无备注 */ +private String PT_PROMPTINFO; +/** 无备注 */ +private String PT_BUYERNAME; +/** 无备注 */ +private String PT_BUYERTAXNO; +/** 无备注 */ +private String PT_ORIGINALNUMBER; +/** 无备注 */ +private String PT_RUSHREDREASON; +/** 无备注 */ +private String PT_ELECTRONICMARK; + + +/** 无备注 */ +public void setPT_ID(String PT_ID) { + this.PT_ID = PT_ID; + } +/** 无备注 */ +public String getPT_ID() { + return PT_ID; + } + + +/** 无备注 */ +public void setPT_ETICKETNO(String PT_ETICKETNO) { + this.PT_ETICKETNO = PT_ETICKETNO; + } +/** 无备注 */ +public String getPT_ETICKETNO() { + return PT_ETICKETNO; + } + + +/** 无备注 */ +public void setPT_NO(String PT_NO) { + this.PT_NO = PT_NO; + } +/** 无备注 */ +public String getPT_NO() { + return PT_NO; + } + + +/** 无备注 */ +public void setPT_FSTATION(String PT_FSTATION) { + this.PT_FSTATION = PT_FSTATION; + } +/** 无备注 */ +public String getPT_FSTATION() { + return PT_FSTATION; + } + + +/** 无备注 */ +public void setPT_TSTATION(String PT_TSTATION) { + this.PT_TSTATION = PT_TSTATION; + } +/** 无备注 */ +public String getPT_TSTATION() { + return PT_TSTATION; + } + + +/** 无备注 */ +public void setPT_TSTATION1(String PT_TSTATION1) { + this.PT_TSTATION1 = PT_TSTATION1; + } +/** 无备注 */ +public String getPT_TSTATION1() { + return PT_TSTATION1; + } + + +/** 无备注 */ +public void setPT_TSTATION2(String PT_TSTATION2) { + this.PT_TSTATION2 = PT_TSTATION2; + } +/** 无备注 */ +public String getPT_TSTATION2() { + return PT_TSTATION2; + } + + +/** 无备注 */ +public void setPT_TSTATION3(String PT_TSTATION3) { + this.PT_TSTATION3 = PT_TSTATION3; + } +/** 无备注 */ +public String getPT_TSTATION3() { + return PT_TSTATION3; + } + + +/** 无备注 */ +public void setPT_PRICE(BigDecimal PT_PRICE) { + this.PT_PRICE = PT_PRICE; + } +/** 无备注 */ +public BigDecimal getPT_PRICE() { + return PT_PRICE; + } + + +/** 无备注 */ +public void setPT_FUNDSAMOUNT(String PT_FUNDSAMOUNT) { + this.PT_FUNDSAMOUNT = PT_FUNDSAMOUNT; + } +/** 无备注 */ +public String getPT_FUNDSAMOUNT() { + return PT_FUNDSAMOUNT; + } + + +/** 无备注 */ +public void setPT_FUELAMOUNT(String PT_FUELAMOUNT) { + this.PT_FUELAMOUNT = PT_FUELAMOUNT; + } +/** 无备注 */ +public String getPT_FUELAMOUNT() { + return PT_FUELAMOUNT; + } + + +/** 无备注 */ +public void setPT_TAXAMOUNT(String PT_TAXAMOUNT) { + this.PT_TAXAMOUNT = PT_TAXAMOUNT; + } +/** 无备注 */ +public String getPT_TAXAMOUNT() { + return PT_TAXAMOUNT; + } + + +/** 无备注 */ +public void setPT_AMOUNT(BigDecimal PT_AMOUNT) { + this.PT_AMOUNT = PT_AMOUNT; + } +/** 无备注 */ +public BigDecimal getPT_AMOUNT() { + return PT_AMOUNT; + } + + +/** 无备注 */ +public void setPT_TAXRATE(String PT_TAXRATE) { + this.PT_TAXRATE = PT_TAXRATE; + } +/** 无备注 */ +public String getPT_TAXRATE() { + return PT_TAXRATE; + } + + +/** 无备注 */ +public void setPT_TAXRATEAMOUNT(BigDecimal PT_TAXRATEAMOUNT) { + this.PT_TAXRATEAMOUNT = PT_TAXRATEAMOUNT; + } +/** 无备注 */ +public BigDecimal getPT_TAXRATEAMOUNT() { + return PT_TAXRATEAMOUNT; + } + + +/** 无备注 */ +public void setPT_NOTAXAMOUNT(BigDecimal PT_NOTAXAMOUNT) { + this.PT_NOTAXAMOUNT = PT_NOTAXAMOUNT; + } +/** 无备注 */ +public BigDecimal getPT_NOTAXAMOUNT() { + return PT_NOTAXAMOUNT; + } + + +/** 无备注 */ +public void setPT_DATE(Date PT_DATE) { + this.PT_DATE = PT_DATE; + } +/** 无备注 */ +public Date getPT_DATE() { + return PT_DATE; + } + + +/** 无备注 */ +public void setPT_TIME(String PT_TIME) { + this.PT_TIME = PT_TIME; + } +/** 无备注 */ +public String getPT_TIME() { + return PT_TIME; + } + + +/** 无备注 */ +public void setPT_SERIALNO(String PT_SERIALNO) { + this.PT_SERIALNO = PT_SERIALNO; + } +/** 无备注 */ +public String getPT_SERIALNO() { + return PT_SERIALNO; + } + + +/** 无备注 */ +public void setPT_IDNO(String PT_IDNO) { + this.PT_IDNO = PT_IDNO; + } +/** 无备注 */ +public String getPT_IDNO() { + return PT_IDNO; + } + + +/** 无备注 */ +public void setPT_CUSTOMER(String PT_CUSTOMER) { + this.PT_CUSTOMER = PT_CUSTOMER; + } +/** 无备注 */ +public String getPT_CUSTOMER() { + return PT_CUSTOMER; + } + + +/** 无备注 */ +public void setPT_CARRIER(String PT_CARRIER) { + this.PT_CARRIER = PT_CARRIER; + } +/** 无备注 */ +public String getPT_CARRIER() { + return PT_CARRIER; + } + + +/** 无备注 */ +public void setPT_CLASS(String PT_CLASS) { + this.PT_CLASS = PT_CLASS; + } +/** 无备注 */ +public String getPT_CLASS() { + return PT_CLASS; + } + + +/** 无备注 */ +public void setPT_VALIDDATE(String PT_VALIDDATE) { + this.PT_VALIDDATE = PT_VALIDDATE; + } +/** 无备注 */ +public String getPT_VALIDDATE() { + return PT_VALIDDATE; + } + + +/** 无备注 */ +public void setPT_INVALIDDATE(String PT_INVALIDDATE) { + this.PT_INVALIDDATE = PT_INVALIDDATE; + } +/** 无备注 */ +public String getPT_INVALIDDATE() { + return PT_INVALIDDATE; + } + + +/** 无备注 */ +public void setPT_ALLOW(String PT_ALLOW) { + this.PT_ALLOW = PT_ALLOW; + } +/** 无备注 */ +public String getPT_ALLOW() { + return PT_ALLOW; + } + + +/** 无备注 */ +public void setPT_VALIDCODE(String PT_VALIDCODE) { + this.PT_VALIDCODE = PT_VALIDCODE; + } +/** 无备注 */ +public String getPT_VALIDCODE() { + return PT_VALIDCODE; + } + + +/** 无备注 */ +public void setPT_INSURANCE(String PT_INSURANCE) { + this.PT_INSURANCE = PT_INSURANCE; + } +/** 无备注 */ +public String getPT_INSURANCE() { + return PT_INSURANCE; + } + + +/** 无备注 */ +public void setPT_SALERCODE(String PT_SALERCODE) { + this.PT_SALERCODE = PT_SALERCODE; + } +/** 无备注 */ +public String getPT_SALERCODE() { + return PT_SALERCODE; + } + + +/** 无备注 */ +public void setPT_SALERNAME(String PT_SALERNAME) { + this.PT_SALERNAME = PT_SALERNAME; + } +/** 无备注 */ +public String getPT_SALERNAME() { + return PT_SALERNAME; + } + + +/** 无备注 */ +public void setPT_MAKEDATE(Date PT_MAKEDATE) { + this.PT_MAKEDATE = PT_MAKEDATE; + } +/** 无备注 */ +public Date getPT_MAKEDATE() { + return PT_MAKEDATE; + } + + +/** 无备注 */ +public void setPT_KEY(String PT_KEY) { + this.PT_KEY = PT_KEY; + } +/** 无备注 */ +public String getPT_KEY() { + return PT_KEY; + } + + +/** 无备注 */ +public void setPT_COUNT(Integer PT_COUNT) { + this.PT_COUNT = PT_COUNT; + } +/** 无备注 */ +public Integer getPT_COUNT() { + return PT_COUNT; + } + + +/** 无备注 */ +public void setPT_DATETIME(String PT_DATETIME) { + this.PT_DATETIME = PT_DATETIME; + } +/** 无备注 */ +public String getPT_DATETIME() { + return PT_DATETIME; + } + + +/** 无备注 */ +public void setPT_EDATETIME(String PT_EDATETIME) { + this.PT_EDATETIME = PT_EDATETIME; + } +/** 无备注 */ +public String getPT_EDATETIME() { + return PT_EDATETIME; + } + + +/** 无备注 */ +public void setPT_INTERNATIONALFLAG(String PT_INTERNATIONALFLAG) { + this.PT_INTERNATIONALFLAG = PT_INTERNATIONALFLAG; + } +/** 无备注 */ +public String getPT_INTERNATIONALFLAG() { + return PT_INTERNATIONALFLAG; + } + + +/** 无备注 */ +public void setPT_MARKDESC(String PT_MARKDESC) { + this.PT_MARKDESC = PT_MARKDESC; + } +/** 无备注 */ +public String getPT_MARKDESC() { + return PT_MARKDESC; + } + + +/** 无备注 */ +public void setPT_GPNUMBER(String PT_GPNUMBER) { + this.PT_GPNUMBER = PT_GPNUMBER; + } +/** 无备注 */ +public String getPT_GPNUMBER() { + return PT_GPNUMBER; + } + + +/** 无备注 */ +public void setPT_ISSUINGSTATE(String PT_ISSUINGSTATE) { + this.PT_ISSUINGSTATE = PT_ISSUINGSTATE; + } +/** 无备注 */ +public String getPT_ISSUINGSTATE() { + return PT_ISSUINGSTATE; + } + + +/** 无备注 */ +public void setPT_FPHM(String PT_FPHM) { + this.PT_FPHM = PT_FPHM; + } +/** 无备注 */ +public String getPT_FPHM() { + return PT_FPHM; + } + + +/** 无备注 */ +public void setPT_PROMPTINFO(String PT_PROMPTINFO) { + this.PT_PROMPTINFO = PT_PROMPTINFO; + } +/** 无备注 */ +public String getPT_PROMPTINFO() { + return PT_PROMPTINFO; + } + + +/** 无备注 */ +public void setPT_BUYERNAME(String PT_BUYERNAME) { + this.PT_BUYERNAME = PT_BUYERNAME; + } +/** 无备注 */ +public String getPT_BUYERNAME() { + return PT_BUYERNAME; + } + + +/** 无备注 */ +public void setPT_BUYERTAXNO(String PT_BUYERTAXNO) { + this.PT_BUYERTAXNO = PT_BUYERTAXNO; + } +/** 无备注 */ +public String getPT_BUYERTAXNO() { + return PT_BUYERTAXNO; + } + + +/** 无备注 */ +public void setPT_ORIGINALNUMBER(String PT_ORIGINALNUMBER) { + this.PT_ORIGINALNUMBER = PT_ORIGINALNUMBER; + } +/** 无备注 */ +public String getPT_ORIGINALNUMBER() { + return PT_ORIGINALNUMBER; + } + + +/** 无备注 */ +public void setPT_RUSHREDREASON(String PT_RUSHREDREASON) { + this.PT_RUSHREDREASON = PT_RUSHREDREASON; + } +/** 无备注 */ +public String getPT_RUSHREDREASON() { + return PT_RUSHREDREASON; + } + + +/** 无备注 */ +public void setPT_ELECTRONICMARK(String PT_ELECTRONICMARK) { + this.PT_ELECTRONICMARK = PT_ELECTRONICMARK; + } +/** 无备注 */ +public String getPT_ELECTRONICMARK() { + return PT_ELECTRONICMARK; + } + + + } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.xml new file mode 100644 index 00000000..17956bbf --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.xml @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PT_ID, + PT_ETICKETNO, + PT_NO, + PT_FSTATION, + PT_TSTATION, + PT_TSTATION1, + PT_TSTATION2, + PT_TSTATION3, + PT_PRICE, + PT_FUNDSAMOUNT, + PT_FUELAMOUNT, + PT_TAXAMOUNT, + PT_AMOUNT, + PT_TAXRATE, + PT_TAXRATEAMOUNT, + PT_NOTAXAMOUNT, + PT_DATE, + PT_TIME, + PT_SERIALNO, + PT_IDNO, + PT_CUSTOMER, + PT_CARRIER, + PT_CLASS, + PT_VALIDDATE, + PT_INVALIDDATE, + PT_ALLOW, + PT_VALIDCODE, + PT_INSURANCE, + PT_SALERCODE, + PT_SALERNAME, + PT_MAKEDATE, + PT_KEY, + PT_COUNT, + PT_DATETIME, + PT_EDATETIME, + PT_INTERNATIONALFLAG, + PT_MARKDESC, + PT_GPNUMBER, + PT_ISSUINGSTATE, + PT_FPHM, + PT_PROMPTINFO, + PT_BUYERNAME, + PT_BUYERTAXNO, + PT_ORIGINALNUMBER, + PT_RUSHREDREASON, + PT_ELECTRONICMARK + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.java new file mode 100644 index 00000000..68a92a86 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.java @@ -0,0 +1,219 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.entity; +import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import com.hzya.frame.web.entity.BaseEntity; +/** + * @description: 迈锐思-飞机行程单明细 + * @tableName: LEXMISCIV_PLANETICKETS + * @entityName: LexmiscivPlaneticketsEntity + * @author: gjh + * @history: 1.0 + */ +public class LexmiscivPlaneticketsEntity extends BaseEntity { + public LexmiscivPlaneticketsEntity() { + + } + + public LexmiscivPlaneticketsEntity(String PTS_MAINID, String dataSourceCode) { + this.PTS_MAINID = PTS_MAINID; + this.setDataSourceCode(dataSourceCode); + } + + /** 无备注 */ +private String PTS_ID; +/** 无备注 */ +private String PTS_MAINID; +/** 无备注 */ +private Integer PTS_SORTNUM; +@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") +@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") +private Date PTS_DATE; +/** 无备注 */ +private String PTS_TIME; +/** 无备注 */ +private String PTS_CLASS; +/** 无备注 */ +private String PTS_CARRIER; +/** 无备注 */ +private String PTS_NO; +/** 无备注 */ +private String PTS_FSTATION; +/** 无备注 */ +private String PTS_TSTATION; +/** 无备注 */ +private String PTS_CLASSNAME; +/** 无备注 */ +private String PTS_FAREBASIS; +/** 无备注 */ +private String PTS_ALLOW; +/** 无备注 */ +private String PTS_DATETIME; +/** 无备注 */ +private String PTS_NOTVALIDAFTER; +/** 无备注 */ +private String PTS_NOTVALIDBEFORE; + + +/** 无备注 */ +public void setPTS_ID(String PTS_ID) { + this.PTS_ID = PTS_ID; + } +/** 无备注 */ +public String getPTS_ID() { + return PTS_ID; + } + + +/** 无备注 */ +public void setPTS_MAINID(String PTS_MAINID) { + this.PTS_MAINID = PTS_MAINID; + } +/** 无备注 */ +public String getPTS_MAINID() { + return PTS_MAINID; + } + + +/** 无备注 */ +public void setPTS_SORTNUM(Integer PTS_SORTNUM) { + this.PTS_SORTNUM = PTS_SORTNUM; + } +/** 无备注 */ +public Integer getPTS_SORTNUM() { + return PTS_SORTNUM; + } + + +/** 无备注 */ +public void setPTS_DATE(Date PTS_DATE) { + this.PTS_DATE = PTS_DATE; + } +/** 无备注 */ +public Date getPTS_DATE() { + return PTS_DATE; + } + + +/** 无备注 */ +public void setPTS_TIME(String PTS_TIME) { + this.PTS_TIME = PTS_TIME; + } +/** 无备注 */ +public String getPTS_TIME() { + return PTS_TIME; + } + + +/** 无备注 */ +public void setPTS_CLASS(String PTS_CLASS) { + this.PTS_CLASS = PTS_CLASS; + } +/** 无备注 */ +public String getPTS_CLASS() { + return PTS_CLASS; + } + + +/** 无备注 */ +public void setPTS_CARRIER(String PTS_CARRIER) { + this.PTS_CARRIER = PTS_CARRIER; + } +/** 无备注 */ +public String getPTS_CARRIER() { + return PTS_CARRIER; + } + + +/** 无备注 */ +public void setPTS_NO(String PTS_NO) { + this.PTS_NO = PTS_NO; + } +/** 无备注 */ +public String getPTS_NO() { + return PTS_NO; + } + + +/** 无备注 */ +public void setPTS_FSTATION(String PTS_FSTATION) { + this.PTS_FSTATION = PTS_FSTATION; + } +/** 无备注 */ +public String getPTS_FSTATION() { + return PTS_FSTATION; + } + + +/** 无备注 */ +public void setPTS_TSTATION(String PTS_TSTATION) { + this.PTS_TSTATION = PTS_TSTATION; + } +/** 无备注 */ +public String getPTS_TSTATION() { + return PTS_TSTATION; + } + + +/** 无备注 */ +public void setPTS_CLASSNAME(String PTS_CLASSNAME) { + this.PTS_CLASSNAME = PTS_CLASSNAME; + } +/** 无备注 */ +public String getPTS_CLASSNAME() { + return PTS_CLASSNAME; + } + + +/** 无备注 */ +public void setPTS_FAREBASIS(String PTS_FAREBASIS) { + this.PTS_FAREBASIS = PTS_FAREBASIS; + } +/** 无备注 */ +public String getPTS_FAREBASIS() { + return PTS_FAREBASIS; + } + + +/** 无备注 */ +public void setPTS_ALLOW(String PTS_ALLOW) { + this.PTS_ALLOW = PTS_ALLOW; + } +/** 无备注 */ +public String getPTS_ALLOW() { + return PTS_ALLOW; + } + + +/** 无备注 */ +public void setPTS_DATETIME(String PTS_DATETIME) { + this.PTS_DATETIME = PTS_DATETIME; + } +/** 无备注 */ +public String getPTS_DATETIME() { + return PTS_DATETIME; + } + + +/** 无备注 */ +public void setPTS_NOTVALIDAFTER(String PTS_NOTVALIDAFTER) { + this.PTS_NOTVALIDAFTER = PTS_NOTVALIDAFTER; + } +/** 无备注 */ +public String getPTS_NOTVALIDAFTER() { + return PTS_NOTVALIDAFTER; + } + + +/** 无备注 */ +public void setPTS_NOTVALIDBEFORE(String PTS_NOTVALIDBEFORE) { + this.PTS_NOTVALIDBEFORE = PTS_NOTVALIDBEFORE; + } +/** 无备注 */ +public String getPTS_NOTVALIDBEFORE() { + return PTS_NOTVALIDBEFORE; + } + + + } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.xml new file mode 100644 index 00000000..f0e0bf3f --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PTS_ID, + PTS_MAINID, + PTS_SORTNUM, + PTS_DATE, + PTS_TIME, + PTS_CLASS, + PTS_CARRIER, + PTS_NO, + PTS_FSTATION, + PTS_TSTATION, + PTS_CLASSNAME, + PTS_FAREBASIS, + PTS_ALLOW, + PTS_DATETIME, + PTS_NOTVALIDAFTER, + PTS_NOTVALIDBEFORE + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.java new file mode 100644 index 00000000..d87bc3b5 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.java @@ -0,0 +1,388 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.entity; +import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import com.hzya.frame.web.entity.BaseEntity; +/** + * @description: 迈锐思-火车票 + * @tableName: LEXMISCIV_TRAINTICKET + * @entityName: LexmiscivTrainticketEntity + * @author: gjh + * @history: 1.0 + */ +public class LexmiscivTrainticketEntity extends BaseEntity { + public LexmiscivTrainticketEntity() { + + } + + public LexmiscivTrainticketEntity(String TT_ID,String dataSourceCode) { + this.TT_ID = TT_ID; + this.setDataSourceCode(dataSourceCode); + } + + /** 无备注 */ +private String TT_ID; +/** 无备注 */ +private String TT_CODE; +/** 无备注 */ +private String TT_NO; +/** 无备注 */ +private String TT_FSTATION; +/** 无备注 */ +private String TT_TSTATION; +/** 无备注 */ +private BigDecimal TT_AMOUNT; +/** 无备注 */ +private String TT_TAXRATE; +/** 无备注 */ +private BigDecimal TT_TAXRATEAMOUNT; +/** 无备注 */ +private BigDecimal TT_NOTAXAMOUNT; +@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") +@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") +private Date TT_DATE; +/** 无备注 */ +private String TT_TIME; +/** 无备注 */ +private String TT_SERIALNO; +/** 无备注 */ +private String TT_IDNO; +/** 无备注 */ +private String TT_CUSTOMER; +/** 无备注 */ +private String TT_SALESTATION; +/** 无备注 */ +private String TT_SALETYPE; +/** 无备注 */ +private String TT_CARRIAGE; +/** 无备注 */ +private String TT_SEAT; +/** 无备注 */ +private String TT_CLASS; +/** 无备注 */ +private String TT_TICKETCHECKING; +/** 无备注 */ +private String TT_KEY; +/** 无备注 */ +private Integer TT_COUNT; +/** 无备注 */ +private String TT_DATETIME; +/** 无备注 */ +private String TT_EDATETIME; +@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") +@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") +private Date TT_OUTDATE; +/** 无备注 */ +private Integer TT_ELECTRONIC; +/** 无备注 */ +private Integer TT_BUSINESSTYPE; +/** 无备注 */ +private String TT_BUYERNAME; +/** 无备注 */ +private String TT_BUYERTAXNO; +/** 无备注 */ +private String TT_ORIGINALINVOICE; + + +/** 无备注 */ +public void setTT_ID(String TT_ID) { + this.TT_ID = TT_ID; + } +/** 无备注 */ +public String getTT_ID() { + return TT_ID; + } + + +/** 无备注 */ +public void setTT_CODE(String TT_CODE) { + this.TT_CODE = TT_CODE; + } +/** 无备注 */ +public String getTT_CODE() { + return TT_CODE; + } + + +/** 无备注 */ +public void setTT_NO(String TT_NO) { + this.TT_NO = TT_NO; + } +/** 无备注 */ +public String getTT_NO() { + return TT_NO; + } + + +/** 无备注 */ +public void setTT_FSTATION(String TT_FSTATION) { + this.TT_FSTATION = TT_FSTATION; + } +/** 无备注 */ +public String getTT_FSTATION() { + return TT_FSTATION; + } + + +/** 无备注 */ +public void setTT_TSTATION(String TT_TSTATION) { + this.TT_TSTATION = TT_TSTATION; + } +/** 无备注 */ +public String getTT_TSTATION() { + return TT_TSTATION; + } + + +/** 无备注 */ +public void setTT_AMOUNT(BigDecimal TT_AMOUNT) { + this.TT_AMOUNT = TT_AMOUNT; + } +/** 无备注 */ +public BigDecimal getTT_AMOUNT() { + return TT_AMOUNT; + } + + +/** 无备注 */ +public void setTT_TAXRATE(String TT_TAXRATE) { + this.TT_TAXRATE = TT_TAXRATE; + } +/** 无备注 */ +public String getTT_TAXRATE() { + return TT_TAXRATE; + } + + +/** 无备注 */ +public void setTT_TAXRATEAMOUNT(BigDecimal TT_TAXRATEAMOUNT) { + this.TT_TAXRATEAMOUNT = TT_TAXRATEAMOUNT; + } +/** 无备注 */ +public BigDecimal getTT_TAXRATEAMOUNT() { + return TT_TAXRATEAMOUNT; + } + + +/** 无备注 */ +public void setTT_NOTAXAMOUNT(BigDecimal TT_NOTAXAMOUNT) { + this.TT_NOTAXAMOUNT = TT_NOTAXAMOUNT; + } +/** 无备注 */ +public BigDecimal getTT_NOTAXAMOUNT() { + return TT_NOTAXAMOUNT; + } + + +/** 无备注 */ +public void setTT_DATE(Date TT_DATE) { + this.TT_DATE = TT_DATE; + } +/** 无备注 */ +public Date getTT_DATE() { + return TT_DATE; + } + + +/** 无备注 */ +public void setTT_TIME(String TT_TIME) { + this.TT_TIME = TT_TIME; + } +/** 无备注 */ +public String getTT_TIME() { + return TT_TIME; + } + + +/** 无备注 */ +public void setTT_SERIALNO(String TT_SERIALNO) { + this.TT_SERIALNO = TT_SERIALNO; + } +/** 无备注 */ +public String getTT_SERIALNO() { + return TT_SERIALNO; + } + + +/** 无备注 */ +public void setTT_IDNO(String TT_IDNO) { + this.TT_IDNO = TT_IDNO; + } +/** 无备注 */ +public String getTT_IDNO() { + return TT_IDNO; + } + + +/** 无备注 */ +public void setTT_CUSTOMER(String TT_CUSTOMER) { + this.TT_CUSTOMER = TT_CUSTOMER; + } +/** 无备注 */ +public String getTT_CUSTOMER() { + return TT_CUSTOMER; + } + + +/** 无备注 */ +public void setTT_SALESTATION(String TT_SALESTATION) { + this.TT_SALESTATION = TT_SALESTATION; + } +/** 无备注 */ +public String getTT_SALESTATION() { + return TT_SALESTATION; + } + + +/** 无备注 */ +public void setTT_SALETYPE(String TT_SALETYPE) { + this.TT_SALETYPE = TT_SALETYPE; + } +/** 无备注 */ +public String getTT_SALETYPE() { + return TT_SALETYPE; + } + + +/** 无备注 */ +public void setTT_CARRIAGE(String TT_CARRIAGE) { + this.TT_CARRIAGE = TT_CARRIAGE; + } +/** 无备注 */ +public String getTT_CARRIAGE() { + return TT_CARRIAGE; + } + + +/** 无备注 */ +public void setTT_SEAT(String TT_SEAT) { + this.TT_SEAT = TT_SEAT; + } +/** 无备注 */ +public String getTT_SEAT() { + return TT_SEAT; + } + + +/** 无备注 */ +public void setTT_CLASS(String TT_CLASS) { + this.TT_CLASS = TT_CLASS; + } +/** 无备注 */ +public String getTT_CLASS() { + return TT_CLASS; + } + + +/** 无备注 */ +public void setTT_TICKETCHECKING(String TT_TICKETCHECKING) { + this.TT_TICKETCHECKING = TT_TICKETCHECKING; + } +/** 无备注 */ +public String getTT_TICKETCHECKING() { + return TT_TICKETCHECKING; + } + + +/** 无备注 */ +public void setTT_KEY(String TT_KEY) { + this.TT_KEY = TT_KEY; + } +/** 无备注 */ +public String getTT_KEY() { + return TT_KEY; + } + + +/** 无备注 */ +public void setTT_COUNT(Integer TT_COUNT) { + this.TT_COUNT = TT_COUNT; + } +/** 无备注 */ +public Integer getTT_COUNT() { + return TT_COUNT; + } + + +/** 无备注 */ +public void setTT_DATETIME(String TT_DATETIME) { + this.TT_DATETIME = TT_DATETIME; + } +/** 无备注 */ +public String getTT_DATETIME() { + return TT_DATETIME; + } + + +/** 无备注 */ +public void setTT_EDATETIME(String TT_EDATETIME) { + this.TT_EDATETIME = TT_EDATETIME; + } +/** 无备注 */ +public String getTT_EDATETIME() { + return TT_EDATETIME; + } + + +/** 无备注 */ +public void setTT_OUTDATE(Date TT_OUTDATE) { + this.TT_OUTDATE = TT_OUTDATE; + } +/** 无备注 */ +public Date getTT_OUTDATE() { + return TT_OUTDATE; + } + + +/** 无备注 */ +public void setTT_ELECTRONIC(Integer TT_ELECTRONIC) { + this.TT_ELECTRONIC = TT_ELECTRONIC; + } +/** 无备注 */ +public Integer getTT_ELECTRONIC() { + return TT_ELECTRONIC; + } + + +/** 无备注 */ +public void setTT_BUSINESSTYPE(Integer TT_BUSINESSTYPE) { + this.TT_BUSINESSTYPE = TT_BUSINESSTYPE; + } +/** 无备注 */ +public Integer getTT_BUSINESSTYPE() { + return TT_BUSINESSTYPE; + } + + +/** 无备注 */ +public void setTT_BUYERNAME(String TT_BUYERNAME) { + this.TT_BUYERNAME = TT_BUYERNAME; + } +/** 无备注 */ +public String getTT_BUYERNAME() { + return TT_BUYERNAME; + } + + +/** 无备注 */ +public void setTT_BUYERTAXNO(String TT_BUYERTAXNO) { + this.TT_BUYERTAXNO = TT_BUYERTAXNO; + } +/** 无备注 */ +public String getTT_BUYERTAXNO() { + return TT_BUYERTAXNO; + } + + +/** 无备注 */ +public void setTT_ORIGINALINVOICE(String TT_ORIGINALINVOICE) { + this.TT_ORIGINALINVOICE = TT_ORIGINALINVOICE; + } +/** 无备注 */ +public String getTT_ORIGINALINVOICE() { + return TT_ORIGINALINVOICE; + } + + + } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.xml new file mode 100644 index 00000000..105b4b75 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.xml @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TT_ID, + TT_CODE, + TT_NO, + TT_FSTATION, + TT_TSTATION, + TT_AMOUNT, + TT_TAXRATE, + TT_TAXRATEAMOUNT, + TT_NOTAXAMOUNT, + TT_DATE, + TT_TIME, + TT_SERIALNO, + TT_IDNO, + TT_CUSTOMER, + TT_SALESTATION, + TT_SALETYPE, + TT_CARRIAGE, + TT_SEAT, + TT_CLASS, + TT_TICKETCHECKING, + TT_KEY, + TT_COUNT, + TT_DATETIME, + TT_EDATETIME, + TT_OUTDATE, + TT_ELECTRONIC, + TT_BUSINESSTYPE, + TT_BUYERNAME, + TT_BUYERTAXNO, + TT_ORIGINALINVOICE + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmisPublicinfoService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmisPublicinfoService.java new file mode 100644 index 00000000..21eb3c4e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmisPublicinfoService.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity; +/** + * @description: 迈锐思-公共信息表 service + * @tableName: LEXMISCIV_PUBLICINFO + * @entityName: LexmisPublicinfoEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmisPublicinfoService extends IBaseService { + +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicedetailService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicedetailService.java new file mode 100644 index 00000000..79b54882 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicedetailService.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicedetailEntity; +/** + * @description: 迈锐思-增值税发票子表 service + * @tableName: LEXMISCIV_INVOICEDETAIL + * @entityName: LexmiscivInvoicedetailEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivInvoicedetailService extends IBaseService { + +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicemainService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicemainService.java new file mode 100644 index 00000000..6f9b4abe --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicemainService.java @@ -0,0 +1,19 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity; +/** + * @description: 迈锐思-增值税发票主表 service + * @tableName: LEXMISCIV_INVOICEMAIN + * @entityName: LexmiscivInvoicemainEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivInvoicemainService extends IBaseService { + + /** + * 根据主键查查增值税发票主表信息 + * @param entity + * @return + */ + LexmiscivInvoicemainEntity getByImId(LexmiscivInvoicemainEntity entity); +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketService.java new file mode 100644 index 00000000..e6d3b0ee --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketService.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketEntity; +/** + * @description: 迈锐思-飞机行程单 service + * @tableName: LEXMISCIV_PLANETICKET + * @entityName: LexmiscivPlaneticketEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivPlaneticketService extends IBaseService { + +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketsService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketsService.java new file mode 100644 index 00000000..011c8e9e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketsService.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity; +/** + * @description: 迈锐思-飞机行程单明细 service + * @tableName: LEXMISCIV_PLANETICKETS + * @entityName: LexmiscivPlaneticketsEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivPlaneticketsService extends IBaseService { + +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivTrainticketService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivTrainticketService.java new file mode 100644 index 00000000..2b88b128 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivTrainticketService.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivTrainticketEntity; +/** + * @description: 迈锐思-火车票 service + * @tableName: LEXMISCIV_TRAINTICKET + * @entityName: LexmiscivTrainticketEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivTrainticketService extends IBaseService { + +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmisPublicinfoServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmisPublicinfoServiceImpl.java new file mode 100644 index 00000000..76ff2d22 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmisPublicinfoServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmisPublicinfoDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.service.ILexmisPublicinfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * @description: 迈锐思-公共信息表 service + * @tableName: LEXMISCIV_PUBLICINFO + * @entityName: LexmisPublicinfoEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="LEXMISCIV_PUBLICINFOService") +public class LexmisPublicinfoServiceImpl extends BaseService implements ILexmisPublicinfoService { + + protected ILexmisPublicinfoDao lexmispublicinfoDao; + + @Autowired + public void setLexmisPublicinfoDao(ILexmisPublicinfoDao dao) { + this.lexmispublicinfoDao = dao; + this.dao=dao; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicedetailServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicedetailServiceImpl.java new file mode 100644 index 00000000..469eb285 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicedetailServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service.impl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicedetailEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.service.ILexmiscivInvoicedetailService; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivInvoicedetailDao; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * @description: 迈锐思-增值税发票子表 service + * @tableName: LEXMISCIV_INVOICEDETAIL + * @entityName: LexmiscivInvoicedetailEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="LEXMISCIV_INVOICEDETAILService") +public class LexmiscivInvoicedetailServiceImpl extends BaseService< LexmiscivInvoicedetailEntity,String> implements ILexmiscivInvoicedetailService{ + + protected ILexmiscivInvoicedetailDao lexmiscivinvoicedetailDao; + + @Autowired + public void setLexmiscivInvoicedetailDao(ILexmiscivInvoicedetailDao dao) { + this.lexmiscivinvoicedetailDao = dao; + this.dao=dao; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicemainServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicemainServiceImpl.java new file mode 100644 index 00000000..9b2507f0 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicemainServiceImpl.java @@ -0,0 +1,39 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service.impl; +import com.baomidou.dynamic.datasource.annotation.DS; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.service.ILexmiscivInvoicemainService; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivInvoicemainDao; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * @description: 迈锐思-增值税发票主表 service + * @tableName: LEXMISCIV_INVOICEMAIN + * @entityName: LexmiscivInvoicemainEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="LEXMISCIV_INVOICEMAINService") +public class LexmiscivInvoicemainServiceImpl extends BaseService< LexmiscivInvoicemainEntity,String> implements ILexmiscivInvoicemainService{ + + protected ILexmiscivInvoicemainDao lexmiscivinvoicemainDao; + + @Autowired + public void setLexmiscivInvoicemainDao(ILexmiscivInvoicemainDao dao) { + this.lexmiscivinvoicemainDao = dao; + this.dao=dao; + } + + /** + * 根据主键查查增值税发票主表信息 + * + * @param entity + * @return + */ + @DS("#entity.dataSourceCode") + @Override + public LexmiscivInvoicemainEntity getByImId(LexmiscivInvoicemainEntity entity) { + LexmiscivInvoicemainEntity lexmiscivInvoicemainEntity = lexmiscivinvoicemainDao.queryOne(entity); + return lexmiscivInvoicemainEntity; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketServiceImpl.java new file mode 100644 index 00000000..a1e7fb1a --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service.impl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.service.ILexmiscivPlaneticketService; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivPlaneticketDao; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * @description: 迈锐思-飞机行程单 service + * @tableName: LEXMISCIV_PLANETICKET + * @entityName: LexmiscivPlaneticketEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="LEXMISCIV_PLANETICKETService") +public class LexmiscivPlaneticketServiceImpl extends BaseService< LexmiscivPlaneticketEntity,String> implements ILexmiscivPlaneticketService{ + + protected ILexmiscivPlaneticketDao lexmiscivplaneticketDao; + + @Autowired + public void setLexmiscivPlaneticketDao(ILexmiscivPlaneticketDao dao) { + this.lexmiscivplaneticketDao = dao; + this.dao=dao; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketsServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketsServiceImpl.java new file mode 100644 index 00000000..18531a6b --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketsServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service.impl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.service.ILexmiscivPlaneticketsService; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivPlaneticketsDao; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * @description: 迈锐思-飞机行程单明细 service + * @tableName: LEXMISCIV_PLANETICKETS + * @entityName: LexmiscivPlaneticketsEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="LEXMISCIV_PLANETICKETSService") +public class LexmiscivPlaneticketsServiceImpl extends BaseService< LexmiscivPlaneticketsEntity,String> implements ILexmiscivPlaneticketsService{ + + protected ILexmiscivPlaneticketsDao lexmiscivplaneticketsDao; + + @Autowired + public void setLexmiscivPlaneticketsDao(ILexmiscivPlaneticketsDao dao) { + this.lexmiscivplaneticketsDao = dao; + this.dao=dao; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivTrainticketServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivTrainticketServiceImpl.java new file mode 100644 index 00000000..d95c8562 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivTrainticketServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service.impl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivTrainticketEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.service.ILexmiscivTrainticketService; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivTrainticketDao; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * @description: 迈锐思-火车票 service + * @tableName: LEXMISCIV_TRAINTICKET + * @entityName: LexmiscivTrainticketEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="LEXMISCIV_TRAINTICKETService") +public class LexmiscivTrainticketServiceImpl extends BaseService< LexmiscivTrainticketEntity,String> implements ILexmiscivTrainticketService{ + + protected ILexmiscivTrainticketDao lexmiscivtrainticketDao; + + @Autowired + public void setLexmiscivTrainticketDao(ILexmiscivTrainticketDao dao) { + this.lexmiscivtrainticketDao = dao; + this.dao=dao; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/plugin/CInvoiceImportPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/plugin/CInvoiceImportPluginInitializer.java new file mode 100644 index 00000000..65865947 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/plugin/CInvoiceImportPluginInitializer.java @@ -0,0 +1,101 @@ +package com.hzya.frame.plugin.cinvoice.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.cinvoice.service.ICInvoiceImportPluginService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Description 发票批量导入有度税务 + * @Author xiangerlin + * @Date 2025/4/18 15:12 + **/ +public class CInvoiceImportPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private ICInvoiceImportPluginService pluginService; + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + /**** + * 插件销毁方法 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + /**** + * 插件的ID + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginId() { + return "CInvoiceImportPluginInitializer"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "OA发票导入有度税务"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "OA发票导入有度税务"; + } + + /*** + * 插件类型 1、场景插件 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 14:01 + * @Param [] + * @return java.lang.String + **/ + @Override + public String getPluginType() { + return "1"; + } + + /*** + * 执行业务代码 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-07 11:20 + * @param requestJson 执行业务代码的参数 + * @return void + **/ + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + logger.info("======开始执OA发票批量导入有度税务插件======"); + pluginService.importInvoice(requestJson); + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportBService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportBService.java new file mode 100644 index 00000000..1a1d5445 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportBService.java @@ -0,0 +1,21 @@ +package com.hzya.frame.plugin.cinvoice.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportBEntity; + +import java.util.List; + +/** + * @Description 发票批量导入有度税务 表体service + * @Author xiangerlin + * @Date 2025/4/18 15:35 + **/ +public interface ICInvoiceImportBService extends IBaseService { + + /*** + * 查询子表数据 + * @param entity + * @return + */ + List queryInvoiceDetails(CInvoiceImportBEntity entity)throws Exception; +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java new file mode 100644 index 00000000..5ce1a532 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java @@ -0,0 +1,22 @@ +package com.hzya.frame.plugin.cinvoice.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportHEntity; + +import java.util.List; + +/** + * @Description 发票批量导入有度税务 表头service + * @Author xiangerlin + * @Date 2025/4/18 15:34 + **/ +public interface ICInvoiceImportHService extends IBaseService { + + /** + * 查询发票列表 + * @param entity + * @return + * @throws Exception + */ + List queryInvoiceList(CInvoiceImportHEntity entity) throws Exception; +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportPluginService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportPluginService.java new file mode 100644 index 00000000..be268219 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportPluginService.java @@ -0,0 +1,18 @@ +package com.hzya.frame.plugin.cinvoice.service; + +import com.alibaba.fastjson.JSONObject; + +/** + * @Description 税务发票批量导入 + * @Author xiangerlin + * @Date 2025/4/21 17:29 + **/ +public interface ICInvoiceImportPluginService { + /** + * 发票导入 + * @param requestJson + * @return + * @throws Exception + */ + String importInvoice(JSONObject requestJson)throws Exception; +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportBServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportBServiceImpl.java new file mode 100644 index 00000000..6f33923b --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportBServiceImpl.java @@ -0,0 +1,43 @@ +package com.hzya.frame.plugin.cinvoice.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.cinvoice.dao.ICInvoiceImportBDao; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportBEntity; +import com.hzya.frame.plugin.cinvoice.service.ICInvoiceImportBService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description 发票批量导入有度税务 表体service + * @Author xiangerlin + * @Date 2025/4/18 15:39 + **/ +@Service() +public class CInvoiceImportBServiceImpl extends BaseService implements ICInvoiceImportBService { + Logger logger = LogManager.getLogger(getClass()); + + private ICInvoiceImportBDao cInvoiceImportBDao; + + @Autowired + public void setcInvoiceImportBDao(ICInvoiceImportBDao dao) { + this.cInvoiceImportBDao = dao; + this.dao = dao; + } + + /*** + * 查询子表数据 + * @param entity + * @return + */ + @DS("#entity.dataSourceCode") + @Override + public List queryInvoiceDetails(CInvoiceImportBEntity entity) throws Exception { + List list = cInvoiceImportBDao.queryList(entity, "com.hzya.frame.plugin.cinvoice.dao.impl.CInvoiceImportBDaoImpl.entity_list_base"); + return list; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportHServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportHServiceImpl.java new file mode 100644 index 00000000..c6edb605 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportHServiceImpl.java @@ -0,0 +1,45 @@ +package com.hzya.frame.plugin.cinvoice.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.cinvoice.dao.ICInvoiceImportHDao; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportHEntity; +import com.hzya.frame.plugin.cinvoice.service.ICInvoiceImportHService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description 发票批量导入有度税务 表头service + * @Author xiangerlin + * @Date 2025/4/18 15:38 + **/ +@Service() +public class CInvoiceImportHServiceImpl extends BaseService implements ICInvoiceImportHService { + Logger logger = LogManager.getLogger(getClass()); + + private ICInvoiceImportHDao cInvoiceImportHDao; + + @Autowired + public void setcInvoiceImportHDao(ICInvoiceImportHDao dao) { + this.cInvoiceImportHDao = dao; + this.dao = dao; + } + + /** + * 查询发票列表 + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List queryInvoiceList(CInvoiceImportHEntity entity) throws Exception { + List list = cInvoiceImportHDao.queryList(entity, "com.hzya.frame.plugin.cinvoice.dao.impl.CInvoiceImportHDaoImpl.entity_list_base"); + return list; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java new file mode 100644 index 00000000..dcc9d89d --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java @@ -0,0 +1,327 @@ +package com.hzya.frame.plugin.cinvoice.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.Assert; +import cn.hutool.core.map.MapBuilder; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.assembler.*; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportHEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.*; +import com.hzya.frame.plugin.cinvoice.lexmis.service.*; +import com.hzya.frame.plugin.cinvoice.service.ICInvoiceImportHService; +import com.hzya.frame.plugin.cinvoice.service.ICInvoiceImportPluginService; +import com.hzya.frame.seeyon.util.YzfSignUtil; +import org.apache.commons.collections.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Description 有度税务发票批量导入 + * @Author xiangerlin + * @Date 2025/4/21 17:30 + **/ +@Service() +public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginService { + Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private ILexmisPublicinfoService lexmisPublicinfoService; + @Autowired + private ICInvoiceImportHService cInvoiceImportHService; + @Autowired + private ILexmiscivInvoicemainService lexmiscivInvoicemainService; + @Autowired + private ILexmiscivInvoicedetailService lexmiscivInvoicedetailService; + @Autowired + private ILexmiscivTrainticketService lexmiscivTrainticketService; + @Autowired + private ILexmiscivPlaneticketService lexmiscivPlaneticketService; + @Autowired + ILexmiscivPlaneticketsService lexmiscivPlaneticketsService; + + @Value("${zt.url:}") + private String url; + @Value("${yzf.accessSecret:}") + private String accessSecret; + @Value("${yzf.accesskey:}") + private String accesskey; + /** + * 发票导入 + * + * @param requestJson + * @return + * @throws Exception + */ + @Override + public String importInvoice(JSONObject requestJson) throws Exception { + + + //1、 查OA主表 + requestJson.get(""); + String dataSourceCode = "HT-OA"; + CInvoiceImportHEntity importHEntity = new CInvoiceImportHEntity(); + importHEntity.setDataSourceCode(dataSourceCode); + importHEntity.setId("3922481031277596479"); + List cInvoiceImportHList = cInvoiceImportHService.queryInvoiceList(importHEntity); + if (CollectionUtils.isNotEmpty(cInvoiceImportHList)){ + ParamAssembler assembler = null; + CInvoiceImportHEntity cInvoiceH = cInvoiceImportHList.get(0); + //2、 查OA明细表 + //3、 查迈瑞思发票表 + //迈锐思发票公共信息表 + List lexmisPublicinfoEntityList = lexmisPublicinfoService.query(new LexmisPublicinfoEntity(cInvoiceH.getId(),dataSourceCode)); + if (CollectionUtils.isNotEmpty(lexmisPublicinfoEntityList)){ + //税务接口每次最多传50张发票 + int size = lexmisPublicinfoEntityList.size(); + int batchSize = 50; + for (int i = 0; i < size; i += batchSize){ + int no = 1;//序号 + //4、 根据发票类型,组装不同参数 + long timestamp = System.currentTimeMillis(); + Map parametersMap = new HashMap<>(); + parametersMap.put("accessKey",accesskey); + parametersMap.put("timestamp",timestamp); + String sign = YzfSignUtil.signRequest(parametersMap, accessSecret); + JSONObject head = new JSONObject(); + head.put("accessKey","6X3B526P5HqE6ums");//密钥 + head.put("sign",sign);//签名 + head.put("timestamp",timestamp);//时间戳 + head.put("taxNo","91330110MAC5FPUY2U");//当前企业税号 + JSONArray inputInfos = new JSONArray(); + head.put("inputInfos",inputInfos);//发票录入信息,单次最大50张 + + // 获取当前批次的子列表 + List batchList = lexmisPublicinfoEntityList.subList(i, Math.min(i + batchSize, size)); + //使用stream方式 publicinfoList 按 PI_TABLENAME分组 + Map> groupedByPiTablename = batchList.stream() + .collect(Collectors.groupingBy(LexmisPublicinfoEntity::getPI_TABLENAME)); + for (Map.Entry> entry : groupedByPiTablename.entrySet()){ + String key = entry.getKey();//对应发票类型的表名 + List publicinfoList = entry.getValue(); + ParamAssemblerContext context = null;//策略上下文类 + for (LexmisPublicinfoEntity info : publicinfoList){ + + JSONObject inputInfo = new JSONObject(); + inputInfos.add(inputInfo); + inputInfo.put("no",no);//编号 + inputInfo.put("systemName","4");//来源系统 默认写4 代表OA + inputInfo.put("businessNo",cInvoiceH.getBill_code());//业务单据号 + inputInfo.put("bookkeepingStatus","1");//记账状态,默认传1 + inputInfo.put("customFlag","2");//业务流转状态,默认传2 + JSONObject invoiceInfo = new JSONObject();//票面信息 + inputInfo.put("invoiceInfo", invoiceInfo); + JSONObject baseInfo = new JSONObject();//发票基本信息 + JSONObject contentInfo = new JSONObject();//发票内容 + JSONArray taxturnsInfos = new JSONArray();//进项转出信息 + invoiceInfo.put("taxturnsInfos",taxturnsInfos); + + switch (key){ + case "LEXMISCIV_INVOICEMAIN"://增值税发票 + zzsInvoice(dataSourceCode, info, invoiceInfo, baseInfo); + //} + break; + case "LEXMISCIV_TRAINTICKET"://火车票 + trainInvoice(dataSourceCode, inputInfos, info, inputInfo, invoiceInfo, baseInfo); + break; + case "LEXMISCIV_PLANETICKET"://飞机行程单 + planeInvoice(dataSourceCode, info, invoiceInfo, baseInfo); + break; + default: + System.out.println("没有匹配到类型"); + break; + } + no++; + } + } + logger.info("调用有度发票批量导入接口请求参数:{}",head.toString()); + //调用税务接口 + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000600005")//有度发票导入接口 + .put("publicKey","ZJYA7f8FzV219otH8zhkReiyyWpXswpbY/+StvC2em0hf59Ce7eDIk+3zDUT+v578prj") + .put("secretKey","xJ9J1Ev2F0faiJ/nQnCNklskAgtQp3QSm+ihO21uY/H0UADj0tSDPxmIhFfC4v6Fj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800060") + .build(); + String body = HttpRequest.post(url).addHeaders(headerMap).body(head.toString()).timeout(60000).execute().body(); + logger.info("调用有度发票批量导入接口响应参数:{}",body); + } + } + } + + + return null; + } + + /** + * 机票 + * @param dataSourceCode + * @param info + * @param invoiceInfo + * @param baseInfo + */ + private void planeInvoice(String dataSourceCode, LexmisPublicinfoEntity info, JSONObject invoiceInfo, JSONObject baseInfo) { + ParamAssemblerContext context; + JSONObject contentInfo; + ParamAssembler assembler; + LexmiscivPlaneticketEntity planeticketH = lexmiscivPlaneticketService.queryOne(new LexmiscivPlaneticketEntity(info.getPI_DATAKEY(), dataSourceCode)); + if (null != planeticketH){ + String fplx = "a4"; + LexmiscivPlaneticketsEntity planeticketB = new LexmiscivPlaneticketsEntity(planeticketH.getPT_ID(), dataSourceCode); + //飞机行程单子表 + List planeticketBList = lexmiscivPlaneticketsService.query(planeticketB); + JSONObject planeObj = new JSONObject(); + planeObj.put("planeticketH",JSONObject.toJSONString(planeticketH)); + planeObj.put("planeticketBList",JSONObject.toJSONString(planeticketBList)); + //1表示电子行程单 先不区分试试,策略类内部判断来实现区分 + if ("1".equals(planeticketH.getPT_ELECTRONICMARK())){ + //assembler = new ElecFlightInvoiceAssembler(planeObj); + fplx = "400"; + } +// else { +// assembler = new FlightInvoiceAssembler(planeObj); +// } + assembler = new ElecFlightInvoiceAssembler(planeObj); + context = new ParamAssemblerContext(assembler); + contentInfo = context.assemble(); + baseInfo.put("fphm",planeticketH.getPT_FPHM());//发票号码 + baseInfo.put("fpdm","");//发票代码 + baseInfo.put("fplx",fplx);//发票类型 + baseInfo.put("kprq",DateUtil.format(planeticketH.getPT_MAKEDATE(),"yyyy-MM-dd"));//开票日期 + baseInfo.put("bhszje",planeticketH.getPT_NOTAXAMOUNT());//不含税总金额 + baseInfo.put("jym","");//校验码 + baseInfo.put("bxje",planeticketH.getPT_NOTAXAMOUNT());//不含税实际报销金额 + baseInfo.put("jsse","");//有效计算税额 + baseInfo.put("jsdkzq","");//计算抵扣账期 + baseInfo.put("signPerson","");//签收人 + baseInfo.put("signStatus","1");//签收状态,默认传1 + invoiceInfo.put("baseInfo", baseInfo); + invoiceInfo.put("contentInfo",contentInfo); + } + } + + /** + * 火车票发票 + * @param dataSourceCode + * @param inputInfos + * @param info + * @param inputInfo + * @param invoiceInfo + * @param baseInfo + */ + private void trainInvoice(String dataSourceCode, JSONArray inputInfos, LexmisPublicinfoEntity info, JSONObject inputInfo, JSONObject invoiceInfo, JSONObject baseInfo) { + JSONObject contentInfo; + ParamAssembler assembler; + ParamAssemblerContext context; + LexmiscivTrainticketEntity trainticketEntity = new LexmiscivTrainticketEntity(info.getPI_DATAKEY(), dataSourceCode); + trainticketEntity.setTT_BUSINESSTYPE(1);//1售票 2退票 3售票换开 4退票换开,3和4没遇到过,先查1 + LexmiscivTrainticketEntity trainticket = lexmiscivTrainticketService.queryOne(trainticketEntity); + if (null != trainticket){ + JSONObject trainObj = new JSONObject(); + trainObj.put("trainInvoice",JSONObject.toJSONString(trainticket)); + String fplx = "a2"; + //1是电子票 + if ("1".equals(trainticket.getTT_ELECTRONIC())){ + assembler = new ElecTrainInvoiceAssembler(trainObj); + fplx = "200"; + }else { + assembler = new TrainInvoiceAssembler(trainObj); + } + context = new ParamAssemblerContext(assembler); + contentInfo = context.assemble(); + baseInfo.put("fphm",trainticket.getTT_CODE());//发票号码 + baseInfo.put("fpdm","");//发票代码 火车票不用传 + baseInfo.put("fplx",fplx);//发票类型 + baseInfo.put("kprq",DateUtil.format(trainticket.getTT_OUTDATE(),"yyyy-MM-dd"));//开票日期 + baseInfo.put("bhszje",trainticket.getTT_NOTAXAMOUNT());//不含税总金额 + baseInfo.put("jym","");//校验码 + baseInfo.put("bxje",trainticket.getTT_NOTAXAMOUNT());//不含税实际报销金额 + baseInfo.put("jsse","");//有效计算税额 + baseInfo.put("jsdkzq","");//计算抵扣账期 + baseInfo.put("signPerson","");//签收人 + baseInfo.put("signStatus","1");//签收状态,默认传1 + invoiceInfo.put("baseInfo", baseInfo); + invoiceInfo.put("contentInfo",contentInfo); + }else { + inputInfos.remove(inputInfo); + logger.info("根据pi_datakey没有查到火车票发票信息:{},发票号:{}", info.getPI_DATAKEY()); + } + } + + /** + * 增值税发票 + * @param dataSourceCode 数据源编码 + * @param info 发票公共表 + * @param invoiceInfo 发票信息对象 + * @param baseInfo 发票基本数据对象 + */ + private void zzsInvoice(String dataSourceCode, LexmisPublicinfoEntity info, JSONObject invoiceInfo, JSONObject baseInfo) { + ParamAssemblerContext context; + JSONObject contentInfo; + ParamAssembler assembler; + LexmiscivInvoicemainEntity zzsInvoiceH = lexmiscivInvoicemainService.queryOne(new LexmiscivInvoicemainEntity(info.getPI_DATAKEY(), dataSourceCode)); + //增值税发票表体 + List zzsInvoiceBList = lexmiscivInvoicedetailService.query(new LexmiscivInvoicedetailEntity(zzsInvoiceH.getIM_ID(), dataSourceCode)); + JSONObject zzs = new JSONObject(); + zzs.put("zzsInvoiceH",JSONObject.toJSONString(zzsInvoiceH)); + zzs.put("zzsInvoiceBList",JSONObject.toJSONString(zzsInvoiceBList)); + assembler = new ZzsInvoiceAssembler(zzs); + context = new ParamAssemblerContext(assembler); + contentInfo = context.assemble(); + baseInfo.put("fphm",zzsInvoiceH.getIM_FPHM());//发票号码 + baseInfo.put("fpdm",zzsInvoiceH.getIM_FPDM());//发票代码 + baseInfo.put("fplx",convertZzsFplx(zzsInvoiceH.getIM_TYPE()));//发票类型 + baseInfo.put("kprq",DateUtil.format(zzsInvoiceH.getIM_DATE(),"yyyy-MM-dd"));//开票日期 + baseInfo.put("bhszje",zzsInvoiceH.getIM_NOTAXAMOUNT());//不含税总金额 + baseInfo.put("jym",zzsInvoiceH.getIM_CHECKCODE());//校验码 + baseInfo.put("bxje",zzsInvoiceH.getIM_NOTAXAMOUNT());//不含税实际报销金额 + baseInfo.put("jsse","");//有效计算税额 + baseInfo.put("jsdkzq","");//计算抵扣账期 + baseInfo.put("signPerson","");//签收人 + baseInfo.put("signStatus","1");//签收状态,默认传1 + invoiceInfo.put("baseInfo", baseInfo); + invoiceInfo.put("contentInfo",contentInfo); + } + + + /** + * 迈锐思增值税类发票类型转换成有度发票类型 + * @param fplx 迈锐思发票类型 + * @return + */ + private String convertZzsFplx(String fplx){ + if (StrUtil.isNotEmpty(fplx)){ + String youduFplx = null; + switch (fplx){ + case "01"://增值税专用发票 + youduFplx = "01"; + break; + case "04"://增值税普通发票 + youduFplx = "04"; + break; + case "10"://增值税电子普票 + youduFplx = "10"; + break; + case "20"://增值税电子专票 + youduFplx = "08"; + break; + case "31"://电子发票(增值税专票) + youduFplx = "31"; + break; + case "32"://电子发票(增值税普票) + youduFplx = "32"; + break; + } + return youduFplx; + } + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/util/YzfUtils.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/util/YzfUtils.java new file mode 100644 index 00000000..b1811548 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/util/YzfUtils.java @@ -0,0 +1,99 @@ +package com.hzya.frame.plugin.cinvoice.util; + +import cn.hutool.core.lang.Assert; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; + +import java.time.Instant; + +/** + * @Description 云帐房accessToken + * @Author xiangerlin + * @Date 2025/4/24 10:03 + **/ +public class YzfUtils { + static Logger logger = LoggerFactory.getLogger(YzfUtils.class); + //token + private static String accessToken; + //过期时间 + private static Instant expireTime; + private static final Long CACHE_EXPIRY_TIME = 7000L; // 缓存有效时间(秒) + //应用key + private static String accessKey; + //应用密钥 + private static String accessSecret; + //接口地址 + private static String baseUrl; + @Value("${yzf.accessKey:}") + public static void setaccessKey(String accessKey) { + YzfUtils.accessKey = accessKey; + } + @Value("${yzf.accessSecret:}") + public static void setaccessSecret(String accessSecret) { + YzfUtils.accessSecret = accessSecret; + } + @Value("${yzf.baseUrl:}") + public static void setBaseUrl(String baseUrl){ + YzfUtils.baseUrl = baseUrl; + } + /** + * 获取token + * @return + */ + public static String getAccessToken(){ + return getAccessToken(accessKey,accessSecret); + } + + /** + * 获取accessToken + * + * @param accessKey + * @param accessSecret + * @return + */ + public static String getAccessToken(String accessKey,String accessSecret) { + //判断是否过期 如果没过期直接返回 + if (null != accessToken && expireTime != null && Instant.now().isBefore(expireTime)) { + return accessToken; + } + //获取新的accessToken + accessToken = fetchNewAccessToken(accessKey,accessSecret); + //过期时间设置成当前事件+7000s,预留200s的时间 + expireTime = Instant.now().plusSeconds(CACHE_EXPIRY_TIME); + return accessToken; + } + /** + * 获取新的accessToken + * + * @return + */ + private static String fetchNewAccessToken(String accessKey,String accessSecret) { + try { + + if (StrUtil.isNotEmpty(accessKey) && StrUtil.isNotEmpty(accessSecret)) { + JSONObject param = new JSONObject(); + param.put("accessKey", YzfUtils.accessKey); + param.put("accessSecret", YzfUtils.accessSecret); + String res = HttpRequest.post(YzfUtils.baseUrl+"/api/getToken").body(param.toString()).execute().body(); + logger.info("调用云帐房token返回参数:{}",res); + if (StrUtil.isNotEmpty(res)){ + JSONObject tokenObj = JSONObject.parseObject(res); + String code = tokenObj.getString("code"); + if ("0".equals(code)){ + JSONObject resultObj = tokenObj.getJSONObject("result"); + if (null != resultObj){ + return resultObj.getString("accessToken"); + } + } + } + } + } catch (Exception _err) { + logger.error("获取oken出错:{}", _err); + } + return null; + } +} From bd4601e8c0b0ddd1fcd9ae81af623d499f39cd33 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 24 Apr 2025 13:37:59 +0800 Subject: [PATCH 38/42] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=91=E5=B8=90?= =?UTF-8?q?=E6=88=BF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-buildpackage/src/main/resources/application-ht.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/base-buildpackage/src/main/resources/application-ht.yml b/base-buildpackage/src/main/resources/application-ht.yml index afbc5086..3f014426 100644 --- a/base-buildpackage/src/main/resources/application-ht.yml +++ b/base-buildpackage/src/main/resources/application-ht.yml @@ -51,4 +51,9 @@ invoice_ofd: zx: # 生产用这个 这个是银行给的 privateKey: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgOHOzaKWBWOAbslvtYtS8tcQiJ9W9DT2cGQM3KSgXpfygCgYIKoEcz1UBgi2hRANCAAQNPct0MHOuDrVJBIy0RI7JKx9/PTlFHZlkIJr0EqpC+b/+N+z3JKbCMZ/wcP1V36Q+DlfDJCY9Ai/Uk2PZ9ZaF - publicKey: MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEDT3LdDBzrg61SQSMtESOySsffz05RR2ZZCCa9BKqQvm//jfs9ySmwjGf8HD9Vd+kPg5XwyQmPQIv1JNj2fWWhQ== \ No newline at end of file + publicKey: MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEDT3LdDBzrg61SQSMtESOySsffz05RR2ZZCCa9BKqQvm//jfs9ySmwjGf8HD9Vd+kPg5XwyQmPQIv1JNj2fWWhQ== +# 云帐房配置 +yzf: + accessKey: 6X3B526P5HqE6ums + accessSecret: 34e5fc32ac894a2ba2ade8c3852c7a0a + baseUrl: http://oapi.nanofintax.com \ No newline at end of file From b2d2a06086c4bf87e7b8eb4ec71e5873964b64c0 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 24 Apr 2025 13:38:13 +0800 Subject: [PATCH 39/42] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-xel.yml | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 base-buildpackage/src/main/resources/application-xel.yml diff --git a/base-buildpackage/src/main/resources/application-xel.yml b/base-buildpackage/src/main/resources/application-xel.yml new file mode 100644 index 00000000..32f34dbb --- /dev/null +++ b/base-buildpackage/src/main/resources/application-xel.yml @@ -0,0 +1,43 @@ +#######################本地环境####################### +logging: + #日志级别 指定目录级别 + level: + root: info + encodings: UTF-8 + file: +# 日志保存路径 + path: /Users/xiangerlin/work/app/logs/dev +spring: + datasource: + dynamic: + datasource: + master: + url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + username: root + password: bd993088e8a7c3dc5f44441617f9b4bf + driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +savefile: + # 文件保存路径 + path: /Users/xiangerlin/work/app/file/dev + pluginpath: /Users/xiangerlin/work/app/file/dev + tomcatpath: /Users/xiangerlin/work/app/file/dev +cbs8: + appId: 1P4AGrpz + appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a + url: https://cbs8-openapi-reprd.csuat.cmburl.cn + # 测试用这个 这个是银行给的,和下面的公钥不是一对密钥 + ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44 + # 这个私钥到时候上传到cbs,和下面到是同一对 + #ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46 + ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde + cbs_public_key: 0469146F06BF3B01236E84632441E826F3067A6B93BC3839C836A06007869CD351FBBE388B51F742859388BBC1DE089923AAFBC69E448F15141DDF30EE6CE90185 + #电子回单下载临时存放位置 + elec_path: /Users/xiangerlin/Downloads/ +OA: + data_source_code: yc-test +zt: + url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface +yzf: + accessKey: 6X3B526P5HqE6ums + accessSecret: 34e5fc32ac894a2ba2ade8c3852c7a0a + baseUrl: http://oapi.nanofintax.com From 1eb12c3527169657a5e1fadde9a29e4170778ba4 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 24 Apr 2025 13:38:25 +0800 Subject: [PATCH 40/42] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/com/hzya/frame/Test1.java | 15 +++++++++++++++ .../src/test/java/com/hzya/frame/temButtom.java | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/base-buildpackage/src/test/java/com/hzya/frame/Test1.java b/base-buildpackage/src/test/java/com/hzya/frame/Test1.java index a52aef06..2dc1c8ee 100644 --- a/base-buildpackage/src/test/java/com/hzya/frame/Test1.java +++ b/base-buildpackage/src/test/java/com/hzya/frame/Test1.java @@ -1,6 +1,7 @@ package com.hzya.frame; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.plugin.CInvoiceImportPluginInitializer; import com.hzya.frame.plugin.contract.plugin.ContractAuditPluginInitializer; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; @@ -21,6 +22,8 @@ public class Test1 { @Resource private ContractAuditPluginInitializer contractPlugin; + @Resource + private CInvoiceImportPluginInitializer cInvoiceImportPluginInitializer; @Test public void contractAuditPluginTest(){ JSONObject jsonObject = new JSONObject(); @@ -31,4 +34,16 @@ public class Test1 { throw new RuntimeException(e); } } + + //发票批量导入 + @Test + public void cinvoicePluginTest(){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("sourceCode","HT-OA"); + try { + cInvoiceImportPluginInitializer.executeBusiness(jsonObject); + } catch (Exception e) { + throw new RuntimeException(e); + } + } } diff --git a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java index a332bb96..f801ee65 100644 --- a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -163,6 +163,17 @@ public class temButtom { } + @Test + public void youduTest(){ + long timestamp = System.currentTimeMillis(); + System.out.println("时间戳:"+timestamp); + Map parametersMap = new HashMap<>(); + parametersMap.put("accessKey","6X3B526P5HqE6ums"); + parametersMap.put("timestamp",timestamp); + + String a = YzfSignUtil.signRequest(parametersMap,"34e5fc32ac894a2ba2ade8c3852c7a0a"); + System.out.println("sign"+a); + } private String getdata(String accessToken) { String url = "http://oapi.nanofintax.com/api/invoice_receive/fp/v1/query?accessToken="+accessToken; JSONObject dayabody = new JSONObject(); From ae6abb3a59e768f67874a20627803cfeb7807c52 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Thu, 24 Apr 2025 13:53:25 +0800 Subject: [PATCH 41/42] =?UTF-8?q?=E7=89=A9=E6=96=99=E5=AF=B9=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IncomeInvoiceServiceImpl.java | 147 ++++++++++++++++-- 1 file changed, 137 insertions(+), 10 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index 916c69a3..6adc2fea 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -17,7 +17,6 @@ import com.hzya.frame.uuid.UUIDLong; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; -import org.apache.commons.collections.CollectionUtils; import org.apache.http.HttpEntity; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; @@ -825,30 +824,151 @@ public class IncomeInvoiceServiceImpl extends BaseService Date: Fri, 25 Apr 2025 10:50:34 +0800 Subject: [PATCH 42/42] =?UTF-8?q?=E8=B4=A2=E6=8A=A5=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=BC=96=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base-buildpackage/pom.xml | 6 + .../entity/IncomeInvoiceEntity.xml | 540 +++++++++--------- .../FinancialReportPluginInitializer.java | 2 + .../impl/IncomeInvoiceServiceImpl.java | 310 +++++----- .../src/main/resources/application-dev.yml | 42 ++ .../service/impl/InvoiceServiceImpl.java | 4 +- 6 files changed, 476 insertions(+), 428 deletions(-) create mode 100644 base-buildpackage/src/main/resources/application-dev.yml diff --git a/base-buildpackage/pom.xml b/base-buildpackage/pom.xml index 1a6c915a..22c4191f 100644 --- a/base-buildpackage/pom.xml +++ b/base-buildpackage/pom.xml @@ -43,6 +43,12 @@ httest + + dev + + dev + + llg diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml index 4fc5953d..4646593b 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml @@ -256,276 +256,276 @@ SELECT a.ALONE_ID as ALONE_ID, - a.M10004 as aM10004, - a.M10005 as aM10005, - a.M10010 as aM10010, - a.M10012 as aM10012, - a.M10014 as aM10014, - a.M10019 as aM10019, - a.M10020 as aM10020, - a.M10021 as aM10021, - a.M10022 as aM10022, - a.M10025 as aM10025, - a.M10110 as aM10110, - a.M10027 as aM10027, - a.M10112 as aM10112, - a.M10029 as aM10029, - a.M10032 as aM10032, - a.M10033 as aM10033, - a.M10034 as aM10034, - a.M10035 as aM10035, - a.M10040 as aM10040, - a.M10128 as aM10128, - a.M10042 as aM10042, - a.M10130 as aM10130, - a.M10044 as aM10044, - a.M10045 as aM10045, - a.M10046 as aM10046, - a.M10047 as aM10047, - a.M10048 as aM10048, - a.M10049 as aM10049, - a.M10050 as aM10050, - a.M10051 as aM10051, - a.M10052 as aM10052, - a.M10053 as aM10053, - a.M10054 as aM10054, - a.M10055 as aM10055, - a.M10057 as aM10057, - a.M10059 as aM10059, - a.M10060 as aM10060, - a.M10061 as aM10061, - a.M10062 as aM10062, - a.M10063 as aM10063, - a.M10064 as aM10064, - a.M10065 as aM10065, - a.M10066 as aM10066, - a.M10073 as aM10073, - a.M10146 as aM10146, - a.M10075 as aM10075, - a.M10148 as aM10148, - a.M10077 as aM10077, - a.M10078 as aM10078, - a.M10079 as aM10079, - a.M10080 as aM10080, - a.M10081 as aM10081, - a.M10082 as aM10082, - a.M10083 as aM10083, - a.M10084 as aM10084, - a.M10087 as aM10087, - a.M10088 as aM10088, - a.M10091 as aM10091, - a.M10164 as aM10164, - a.M10093 as aM10093, - a.M10166 as aM10166, - a.M10095 as aM10095, - a.M10096 as aM10096, - a.M10097 as aM10097, - a.M10098 as aM10098, - a.M10099 as aM10099, - a.M10100 as aM10100, - a.M10101 as aM10101, - a.M10102 as aM10102, - a.M10105 as aM10105, - a.M10106 as aM10106, - a.M10109 as aM10109, - a.M10182 as aM10182, - a.M10111 as aM10111, - a.M10184 as aM10184, - a.M10113 as aM10113, - a.M10114 as aM10114, - a.M10115 as aM10115, - a.M10116 as aM10116, - a.M10117 as aM10117, - a.M10118 as aM10118, - a.M10119 as aM10119, - a.M10120 as aM10120, - a.M10123 as aM10123, - a.M10124 as aM10124, - a.M10127 as aM10127, - a.M10200 as aM10200, - a.M10129 as aM10129, - a.M10202 as aM10202, - a.M10131 as aM10131, - a.M10132 as aM10132, - a.M10133 as aM10133, - a.M10134 as aM10134, - a.M10135 as aM10135, - a.M10138 as aM10138, - a.M10141 as aM10141, - a.M10142 as aM10142, - a.M10143 as aM10143, - a.M10144 as aM10144, - a.M10145 as aM10145, - a.M10147 as aM10147, - a.M10149 as aM10149, - a.M10150 as aM10150, - a.M10151 as aM10151, - a.M10152 as aM10152, - a.M10153 as aM10153, - a.M10154 as aM10154, - a.M10155 as aM10155, - a.M10156 as aM10156, - a.M10257 as aM10257, - a.M10259 as aM10259, - a.M10159 as aM10159, - a.M10160 as aM10160, - a.M10161 as aM10161, - a.M10162 as aM10162, - a.M10163 as aM10163, - a.M10165 as aM10165, - a.M10167 as aM10167, - a.M10168 as aM10168, - a.M10169 as aM10169, - a.M10170 as aM10170, - a.M10171 as aM10171, - a.M10172 as aM10172, - a.M10173 as aM10173, - a.M10174 as aM10174, - a.M10281 as aM10281, - a.M10283 as aM10283, - a.M10179 as aM10179, - a.M10180 as aM10180, - a.M10181 as aM10181, - a.M10222 as aM10222, - a.M10183 as aM10183, - a.M10224 as aM10224, - a.M10185 as aM10185, - a.M10186 as aM10186, - a.M10187 as aM10187, - a.M10188 as aM10188, - a.M10189 as aM10189, - a.M10190 as aM10190, - a.M10191 as aM10191, - a.M10192 as aM10192, - a.M10295 as aM10295, - a.M10193 as aM10193, - a.M10297 as aM10297, - a.M10194 as aM10194, - a.M10195 as aM10195, - a.M10196 as aM10196, - a.M10197 as aM10197, - a.M10198 as aM10198, - a.M10199 as aM10199, - a.M10201 as aM10201, - a.M10203 as aM10203, - a.M10208 as aM10208, - a.M10209 as aM10209, - a.M10212 as aM10212, - a.M10310 as aM10310, - a.M10214 as aM10214, - a.M10312 as aM10312, - a.M10216 as aM10216, - a.M10217 as aM10217, - a.M10218 as aM10218, - a.M10219 as aM10219, - a.M10220 as aM10220, - a.M10221 as aM10221, - a.M10223 as aM10223, - a.M10225 as aM10225, - a.M10226 as aM10226, - a.M10227 as aM10227, - a.M10230 as aM10230, - a.M10231 as aM10231, - a.M10234 as aM10234, - a.M10325 as aM10325, - a.M10236 as aM10236, - a.M10327 as aM10327, - a.M10238 as aM10238, - a.M10239 as aM10239, - a.M10240 as aM10240, - a.M10241 as aM10241, - a.M10242 as aM10242, - a.M10243 as aM10243, - a.M10244 as aM10244, - a.M10245 as aM10245, - a.M10246 as aM10246, - a.M10247 as aM10247, - a.M10248 as aM10248, - a.M10249 as aM10249, - a.M10250 as aM10250, - a.M10251 as aM10251, - a.M10252 as aM10252, - a.M10253 as aM10253, - a.M10256 as aM10256, - a.M10340 as aM10340, - a.M10258 as aM10258, - a.M10342 as aM10342, - a.M10260 as aM10260, - a.M10265 as aM10265, - a.M10266 as aM10266, - a.M10267 as aM10267, - a.M10268 as aM10268, - a.M10269 as aM10269, - a.M10276 as aM10276, - a.M10277 as aM10277, - a.M10280 as aM10280, - a.M10282 as aM10282, - a.M10284 as aM10284, - a.M10287 as aM10287, - a.M10288 as aM10288, - a.M10289 as aM10289, - a.M10290 as aM10290, - a.M10291 as aM10291, - a.M10292 as aM10292, - a.M10293 as aM10293, - a.M10294 as aM10294, - a.M10011 as aM10011, - a.M10296 as aM10296, - a.M10013 as aM10013, - a.M10298 as aM10298, - a.M10299 as aM10299, - a.M10300 as aM10300, - a.M10301 as aM10301, - a.M10304 as aM10304, - a.M10305 as aM10305, - a.M10306 as aM10306, - a.M10307 as aM10307, - a.M10308 as aM10308, - a.M10309 as aM10309, - a.M10026 as aM10026, - a.M10311 as aM10311, - a.M10028 as aM10028, - a.M10313 as aM10313, - a.M10314 as aM10314, - a.M10315 as aM10315, - a.M10316 as aM10316, - a.M10319 as aM10319, - a.M10320 as aM10320, - a.M10321 as aM10321, - a.M10323 as aM10323, - a.M10326 as aM10326, - a.M10041 as aM10041, - a.M10328 as aM10328, - a.M10043 as aM10043, - a.M10329 as aM10329, - a.M10334 as aM10334, - a.M10335 as aM10335, - a.M10336 as aM10336, - a.M10338 as aM10338, - a.M10337 as aM10337, - a.M10339 as aM10339, - a.M10341 as aM10341, - a.M10056 as aM10056, - a.M10343 as aM10343, - a.M10058 as aM10058, - a.M10344 as aM10344, - a.M10347 as aM10347, - a.M10348 as aM10348, - a.M10349 as aM10349, - a.M10350 as aM10350, - a.M10351 as aM10351, - a.M10352 as aM10352, - a.M10353 as aM10353, - a.M10354 as aM10354, - b.MPQW10U as bMPQW10U, - b.MP81A2Z as bMP81A2Z, - b.MS13DPL as bMS13DPL, - b.M6TFKPL as bM6TFKPL, - c.M10002 as cM10002, - c.M10000 as cM10000, - c.M10004 as cM10004, - c.M10003 as cM10003, - c.M10001 as cM10001 + a.M10004 as AM10004, + a.M10005 as AM10005, + a.M10010 as AM10010, + a.M10012 as AM10012, + a.M10014 as AM10014, + a.M10019 as AM10019, + a.M10020 as AM10020, + a.M10021 as AM10021, + a.M10022 as AM10022, + a.M10025 as AM10025, + a.M10110 as AM10110, + a.M10027 as AM10027, + a.M10112 as AM10112, + a.M10029 as AM10029, + a.M10032 as AM10032, + a.M10033 as AM10033, + a.M10034 as AM10034, + a.M10035 as AM10035, + a.M10040 as AM10040, + a.M10128 as AM10128, + a.M10042 as AM10042, + a.M10130 as AM10130, + a.M10044 as AM10044, + a.M10045 as AM10045, + a.M10046 as AM10046, + a.M10047 as AM10047, + a.M10048 as AM10048, + a.M10049 as AM10049, + a.M10050 as AM10050, + a.M10051 as AM10051, + a.M10052 as AM10052, + a.M10053 as AM10053, + a.M10054 as AM10054, + a.M10055 as AM10055, + a.M10057 as AM10057, + a.M10059 as AM10059, + a.M10060 as AM10060, + a.M10061 as AM10061, + a.M10062 as AM10062, + a.M10063 as AM10063, + a.M10064 as AM10064, + a.M10065 as AM10065, + a.M10066 as AM10066, + a.M10073 as AM10073, + a.M10146 as AM10146, + a.M10075 as AM10075, + a.M10148 as AM10148, + a.M10077 as AM10077, + a.M10078 as AM10078, + a.M10079 as AM10079, + a.M10080 as AM10080, + a.M10081 as AM10081, + a.M10082 as AM10082, + a.M10083 as AM10083, + a.M10084 as AM10084, + a.M10087 as AM10087, + a.M10088 as AM10088, + a.M10091 as AM10091, + a.M10164 as AM10164, + a.M10093 as AM10093, + a.M10166 as AM10166, + a.M10095 as AM10095, + a.M10096 as AM10096, + a.M10097 as AM10097, + a.M10098 as AM10098, + a.M10099 as AM10099, + a.M10100 as AM10100, + a.M10101 as AM10101, + a.M10102 as AM10102, + a.M10105 as AM10105, + a.M10106 as AM10106, + a.M10109 as AM10109, + a.M10182 as AM10182, + a.M10111 as AM10111, + a.M10184 as AM10184, + a.M10113 as AM10113, + a.M10114 as AM10114, + a.M10115 as AM10115, + a.M10116 as AM10116, + a.M10117 as AM10117, + a.M10118 as AM10118, + a.M10119 as AM10119, + a.M10120 as AM10120, + a.M10123 as AM10123, + a.M10124 as AM10124, + a.M10127 as AM10127, + a.M10200 as AM10200, + a.M10129 as AM10129, + a.M10202 as AM10202, + a.M10131 as AM10131, + a.M10132 as AM10132, + a.M10133 as AM10133, + a.M10134 as AM10134, + a.M10135 as AM10135, + a.M10138 as AM10138, + a.M10141 as AM10141, + a.M10142 as AM10142, + a.M10143 as AM10143, + a.M10144 as AM10144, + a.M10145 as AM10145, + a.M10147 as AM10147, + a.M10149 as AM10149, + a.M10150 as AM10150, + a.M10151 as AM10151, + a.M10152 as AM10152, + a.M10153 as AM10153, + a.M10154 as AM10154, + a.M10155 as AM10155, + a.M10156 as AM10156, + a.M10257 as AM10257, + a.M10259 as AM10259, + a.M10159 as AM10159, + a.M10160 as AM10160, + a.M10161 as AM10161, + a.M10162 as AM10162, + a.M10163 as AM10163, + a.M10165 as AM10165, + a.M10167 as AM10167, + a.M10168 as AM10168, + a.M10169 as AM10169, + a.M10170 as AM10170, + a.M10171 as AM10171, + a.M10172 as AM10172, + a.M10173 as AM10173, + a.M10174 as AM10174, + a.M10281 as AM10281, + a.M10283 as AM10283, + a.M10179 as AM10179, + a.M10180 as AM10180, + a.M10181 as AM10181, + a.M10222 as AM10222, + a.M10183 as AM10183, + a.M10224 as AM10224, + a.M10185 as AM10185, + a.M10186 as AM10186, + a.M10187 as AM10187, + a.M10188 as AM10188, + a.M10189 as AM10189, + a.M10190 as AM10190, + a.M10191 as AM10191, + a.M10192 as AM10192, + a.M10295 as AM10295, + a.M10193 as AM10193, + a.M10297 as AM10297, + a.M10194 as AM10194, + a.M10195 as AM10195, + a.M10196 as AM10196, + a.M10197 as AM10197, + a.M10198 as AM10198, + a.M10199 as AM10199, + a.M10201 as AM10201, + a.M10203 as AM10203, + a.M10208 as AM10208, + a.M10209 as AM10209, + a.M10212 as AM10212, + a.M10310 as AM10310, + a.M10214 as AM10214, + a.M10312 as AM10312, + a.M10216 as AM10216, + a.M10217 as AM10217, + a.M10218 as AM10218, + a.M10219 as AM10219, + a.M10220 as AM10220, + a.M10221 as AM10221, + a.M10223 as AM10223, + a.M10225 as AM10225, + a.M10226 as AM10226, + a.M10227 as AM10227, + a.M10230 as AM10230, + a.M10231 as AM10231, + a.M10234 as AM10234, + a.M10325 as AM10325, + a.M10236 as AM10236, + a.M10327 as AM10327, + a.M10238 as AM10238, + a.M10239 as AM10239, + a.M10240 as AM10240, + a.M10241 as AM10241, + a.M10242 as AM10242, + a.M10243 as AM10243, + a.M10244 as AM10244, + a.M10245 as AM10245, + a.M10246 as AM10246, + a.M10247 as AM10247, + a.M10248 as AM10248, + a.M10249 as AM10249, + a.M10250 as AM10250, + a.M10251 as AM10251, + a.M10252 as AM10252, + a.M10253 as AM10253, + a.M10256 as AM10256, + a.M10340 as AM10340, + a.M10258 as AM10258, + a.M10342 as AM10342, + a.M10260 as AM10260, + a.M10265 as AM10265, + a.M10266 as AM10266, + a.M10267 as AM10267, + a.M10268 as AM10268, + a.M10269 as AM10269, + a.M10276 as AM10276, + a.M10277 as AM10277, + a.M10280 as AM10280, + a.M10282 as AM10282, + a.M10284 as AM10284, + a.M10287 as AM10287, + a.M10288 as AM10288, + a.M10289 as AM10289, + a.M10290 as AM10290, + a.M10291 as AM10291, + a.M10292 as AM10292, + a.M10293 as AM10293, + a.M10294 as AM10294, + a.M10011 as AM10011, + a.M10296 as AM10296, + a.M10013 as AM10013, + a.M10298 as AM10298, + a.M10299 as AM10299, + a.M10300 as AM10300, + a.M10301 as AM10301, + a.M10304 as AM10304, + a.M10305 as AM10305, + a.M10306 as AM10306, + a.M10307 as AM10307, + a.M10308 as AM10308, + a.M10309 as AM10309, + a.M10026 as AM10026, + a.M10311 as AM10311, + a.M10028 as AM10028, + a.M10313 as AM10313, + a.M10314 as AM10314, + a.M10315 as AM10315, + a.M10316 as AM10316, + a.M10319 as AM10319, + a.M10320 as AM10320, + a.M10321 as AM10321, + a.M10323 as AM10323, + a.M10326 as AM10326, + a.M10041 as AM10041, + a.M10328 as AM10328, + a.M10043 as AM10043, + a.M10329 as AM10329, + a.M10334 as AM10334, + a.M10335 as AM10335, + a.M10336 as AM10336, + a.M10338 as AM10338, + a.M10337 as AM10337, + a.M10339 as AM10339, + a.M10341 as AM10341, + a.M10056 as AM10056, + a.M10343 as AM10343, + a.M10058 as AM10058, + a.M10344 as AM10344, + a.M10347 as AM10347, + a.M10348 as AM10348, + a.M10349 as AM10349, + a.M10350 as AM10350, + a.M10351 as AM10351, + a.M10352 as AM10352, + a.M10353 as AM10353, + a.M10354 as AM10354, + b.MPQW10U as BMPQW10U, + b.MP81A2Z as BMP81A2Z, + b.MS13DPL as BMS13DPL, + b.M6TFKPL as BM6TFKPL, + c.M10002 as CM10002, + c.M10000 as CM10000, + c.M10004 as CM10004, + c.M10003 as CM10003, + c.M10001 as CM10001 FROM iufo_measure_data_qi0xy5nl a LEFT JOIN iufo_measure_data_v40w9co7 b on a.ALONE_ID = b.ALONE_ID diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java index 81153779..d1b275a1 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java @@ -3,6 +3,7 @@ package com.hzya.frame.plugin.incomeInvoiceData.plugin; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService; +import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,6 +54,7 @@ public class FinancialReportPluginInitializer extends PluginBaseEntity{ public JsonResultEntity executeBusiness(JSONObject requestJson) { try { logger.info("======开始执行财务信息同步========"); + //return BaseResult.getSuccessMessageEntity("数据获取成功"); return incomeInvoiceService.sendFinancialReportPlugin(requestJson); }catch (Exception e){ logger.info("======执行财务同步失败:{}========",e.getMessage()); diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index 6adc2fea..276820a3 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -32,7 +32,9 @@ import org.apache.http.util.EntityUtils; import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import com.hzya.frame.basedao.service.impl.BaseService; +import org.springframework.core.task.TaskExecutor; +import javax.annotation.Resource; import javax.net.ssl.SSLContext; import java.io.IOException; import java.math.BigDecimal; @@ -68,7 +70,8 @@ public class IncomeInvoiceServiceImpl extends BaseService sendFinancialReport(ztbm,cjzq,rwbm)); + return BaseResult.getSuccessMessageEntity("数据获取成功"); } - if(businessData.getString("field0007").equals("3")){//进项发票 + if(businessDataStr.getString("dataType").equals("3")){//进项发票 return BaseResult.getFailureMessageEntity("数据类型错误"); } - if(businessData.getString("field0007").equals("4")){//销项发票 + if(businessDataStr.getString("dataType").equals("4")){//销项发票 return BaseResult.getFailureMessageEntity("数据类型错误"); } return BaseResult.getSuccessMessageEntity("推送数据成功"); @@ -721,39 +736,25 @@ public class IncomeInvoiceServiceImpl extends BaseService jnlist = incomeInvoiceDao.queryZtzz(jnentity); @@ -784,7 +785,7 @@ public class IncomeInvoiceServiceImpl extends BaseService qnlist = incomeInvoiceDao.queryZtzz(qnentity); @@ -796,7 +797,7 @@ public class IncomeInvoiceServiceImpl extends BaseService dydataList = incomeInvoiceDao.queryByAloneId(jnquerydata); if(dydataList != null && dydataList.size() == 1){ @@ -808,7 +809,7 @@ public class IncomeInvoiceServiceImpl extends BaseService qndataList = incomeInvoiceDao.queryByAloneId(qnquerydata); if(qndataList != null && qndataList.size() == 1){ @@ -828,65 +829,65 @@ public class IncomeInvoiceServiceImpl extends BaseService imple @Value("${zt.url}") private String url; - @Value("${invoice_pdf.url}") + @Value("${invoice_pdf.url:}") private String invoicePdfUrl; - @Value("${invoice_ofd.url}") + @Value("${invoice_ofd.url:}") private String invoiceOfdUrl; @Override