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 1/2] =?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 a6af70de5f72e9d5b06ef5447120a8cc988438a5 Mon Sep 17 00:00:00 2001 From: "476474485@qq.com" Date: Mon, 7 Apr 2025 16:49:25 +0800 Subject: [PATCH 2/2] =?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; + } + + }