diff --git a/buildpackage/pom.xml b/buildpackage/pom.xml
index da168c31..5c949541 100644
--- a/buildpackage/pom.xml
+++ b/buildpackage/pom.xml
@@ -87,6 +87,12 @@
ydc
+
+ yc
+
+ yc
+
+
kangarooDataCenterV3
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/IPayBillDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/IPayBillDao.java
new file mode 100644
index 00000000..4c8956ed
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/IPayBillDao.java
@@ -0,0 +1,15 @@
+package com.hzya.frame.plugin.a8bill.dao;
+
+import com.hzya.frame.basedao.dao.IBaseDao;
+import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
+
+/**
+ * 组织档案(mdm_org: table)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-06-07 18:30:04
+ */
+public interface IPayBillDao extends IBaseDao {
+
+}
+
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/impl/PayBillDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/impl/PayBillDaoImpl.java
new file mode 100644
index 00000000..f4bc0c6e
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/dao/impl/PayBillDaoImpl.java
@@ -0,0 +1,16 @@
+package com.hzya.frame.plugin.a8bill.dao.impl;
+
+import com.hzya.frame.basedao.dao.MybatisGenericDao;
+import com.hzya.frame.plugin.a8bill.dao.IPayBillDao;
+import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
+
+/**
+ * 组织档案(MdmOrg)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-06-07 18:30:04
+ */
+public class PayBillDaoImpl extends MybatisGenericDao implements IPayBillDao {
+
+}
+
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.java
new file mode 100644
index 00000000..ecca14fb
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.java
@@ -0,0 +1,14 @@
+package com.hzya.frame.plugin.a8bill.entity;
+
+import com.hzya.frame.web.entity.BaseEntity;
+
+/**
+ * 付款单
+ *
+ * @author makejava
+ * @since 2024-06-07 18:30:04
+ */
+public class PayBillEntity extends BaseEntity {
+
+}
+
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.xml
new file mode 100644
index 00000000..a251e1cd
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/entity/PayBillEntity.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+ id
+
+
+
+
+
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/plugin/MdmOrgPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayBillPluginInitializer.java
similarity index 57%
rename from buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/plugin/MdmOrgPluginInitializer.java
rename to buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayBillPluginInitializer.java
index f4e7c8f6..e57f8e6c 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/org/plugin/MdmOrgPluginInitializer.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayBillPluginInitializer.java
@@ -1,23 +1,24 @@
-package com.hzya.frame.plugin.masterData.org.plugin;
+package com.hzya.frame.plugin.a8bill.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
-import com.hzya.frame.sysnew.comparison.masterData.service.impl.MasterDataOrgsServiceImpl;
+
+import com.hzya.frame.seeyon.paybill.service.IPayBillService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
- * 组织档案(MdmOrg)表服务接口
+ * 付款单(PayBill)表服务接口
*
* @author makejava
* @since 2024-06-07 18:30:05
*/
-public class MdmOrgPluginInitializer extends PluginBaseEntity{
- Logger logger = LoggerFactory.getLogger(MdmOrgPluginInitializer.class);
- @Autowired
- private MasterDataOrgsServiceImpl masterDataOrgsService;
+public class PayBillPluginInitializer extends PluginBaseEntity{
+ Logger logger = LoggerFactory.getLogger(PayBillPluginInitializer.class);
+ @Autowired
+ private IPayBillService payBillService;
@Override
public void initialize() {
@@ -31,17 +32,17 @@ public class MdmOrgPluginInitializer extends PluginBaseEntity{
@Override
public String getPluginId() {
- return "MdmOrgPlugin";
+ return "PayBillPlugin";
}
@Override
public String getPluginName() {
- return "MdmOrgPlugin插件";
+ return "PayBillPlugin插件";
}
@Override
public String getPluginLabel() {
- return "MdmOrgPlugin";
+ return "PayBillPlugin";
}
@Override
@@ -51,10 +52,10 @@ public class MdmOrgPluginInitializer extends PluginBaseEntity{
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
try {
- logger.info("======开始执行主数据档案组织档案同步========");
- return masterDataOrgsService.queryOrgsArchives(requestJson);
+ logger.info("======开始执行付款单据信息同步========");
+ return payBillService.sendEngineerPayBillToBip(requestJson);
}catch (Exception e){
- logger.info("======执行主数据档案组织档案同步失败:{}========",e.getMessage());
+ logger.info("======执行付款单据同步失败:{}========",e.getMessage());
e.printStackTrace();
}
return null;
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/plugin/MdmProjectPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/RecBillPluginInitializer.java
similarity index 51%
rename from buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/plugin/MdmProjectPluginInitializer.java
rename to buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/RecBillPluginInitializer.java
index 0a554a69..f4689b83 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/project/plugin/MdmProjectPluginInitializer.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/RecBillPluginInitializer.java
@@ -1,24 +1,24 @@
-package com.hzya.frame.plugin.masterData.project.plugin;
+package com.hzya.frame.plugin.a8bill.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
-import com.hzya.frame.sysnew.comparison.masterData.service.impl.MasterDataProjectServiceImpl;
+import com.hzya.frame.seeyon.paybill.service.IPayBillService;
+import com.hzya.frame.seeyon.recbill.service.IRecBillService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
- * 项目档案(MdmProject)表服务接口
+ * 收款单(RecBill)表服务接口
*
* @author makejava
- * @since 2024-06-07 18:29:23
+ * @since 2024-06-07 18:30:05
*/
-public class MdmProjectPluginInitializer extends PluginBaseEntity{
- Logger logger = LoggerFactory.getLogger(MdmProjectPluginInitializer.class);
-
- @Autowired
- private MasterDataProjectServiceImpl masterDataProjectService;
+public class RecBillPluginInitializer extends PluginBaseEntity{
+ Logger logger = LoggerFactory.getLogger(RecBillPluginInitializer.class);
+ @Autowired
+ private IRecBillService recBillService;
@Override
public void initialize() {
@@ -32,17 +32,17 @@ public class MdmProjectPluginInitializer extends PluginBaseEntity{
@Override
public String getPluginId() {
- return "MdmProjectPlugin";
+ return "RecBillPluginInitializer";
}
@Override
public String getPluginName() {
- return "MdmProjectPlugin插件";
+ return "RecBillPluginInitializer插件";
}
@Override
public String getPluginLabel() {
- return "MdmProjectPlugin";
+ return "RecBillPluginInitializer";
}
@Override
@@ -52,13 +52,12 @@ public class MdmProjectPluginInitializer extends PluginBaseEntity{
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) {
try {
- logger.info("=====开始执行主数据档案项目档案同步=======");
- JsonResultEntity jsonResultEntity = masterDataProjectService.queryProjectArchives(requestJson);
- return jsonResultEntity;
+ logger.info("======开始执行收款单据信息同步========");
+ return recBillService.sendRecBillToBip(requestJson);
}catch (Exception e){
- logger.info("======执行主数据档案项目档案同步失败:{}",e.getMessage());
+ logger.info("======执行收款单据同步失败:{}========",e.getMessage());
e.printStackTrace();
}
- return null;
+ return null;
}
}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/IPayBillService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/IPayBillService.java
new file mode 100644
index 00000000..8a8f041c
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/IPayBillService.java
@@ -0,0 +1,13 @@
+package com.hzya.frame.plugin.a8bill.service;
+
+import com.hzya.frame.basedao.service.IBaseService;
+import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
+
+/**
+ * 付款单
+ *
+ * @author makejava
+ * @since 2024-06-07 18:30:05
+ */
+public interface IPayBillService extends IBaseService{
+}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/PayBillServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/PayBillServiceImpl.java
new file mode 100644
index 00000000..e6375473
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/service/impl/PayBillServiceImpl.java
@@ -0,0 +1,22 @@
+package com.hzya.frame.plugin.a8bill.service.impl;
+
+import com.hzya.frame.basedao.service.impl.BaseService;
+import com.hzya.frame.plugin.a8bill.entity.PayBillEntity;
+import com.hzya.frame.plugin.a8bill.service.IPayBillService;
+
+/**
+ * private IMdmOrgDao mdmOrgDao;
+ *
+ * @Autowired
+ * public void setMdmOrgDao(IMdmOrgDao dao) {
+ * this.mdmOrgDao = dao;
+ * this.dao = dao;
+ * }
+ *
+ * @author makejava
+ * @since 2024-06-07 18:30:05
+ */
+public class PayBillServiceImpl extends BaseService implements IPayBillService {
+
+
+}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/AgentPayResultPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/AgentPayResultPluginInitializer.java
new file mode 100644
index 00000000..ac1c5224
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/AgentPayResultPluginInitializer.java
@@ -0,0 +1,111 @@
+package com.hzya.frame.plugin.cbs8.plugin;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.base.PluginBaseEntity;
+import com.hzya.frame.cbs8.dto.req.AgentPayResultRequestDTO;
+import com.hzya.frame.cbs8.dto.res.AgentPayResultResDTO;
+import com.hzya.frame.plugin.cbs8.service.ICbsPluginService;
+import com.hzya.frame.web.entity.JsonResultEntity;
+import org.checkerframework.checker.units.qual.A;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @Description
+ * @Author xiangerlin
+ * @Date 2024/6/18 17:22
+ **/
+public class AgentPayResultPluginInitializer extends PluginBaseEntity {
+ Logger logger = LoggerFactory.getLogger(AgentPayResultPluginInitializer.class);
+
+ @Autowired
+ private ICbsPluginService cbsPluginService;
+
+ /***
+ * 插件初始化方法
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-02 10:48
+ * @Param []
+ * @return void
+ **/
+ @Override
+ public void initialize() {
+
+ }
+
+ /****
+ * 插件销毁方法
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public void destroy() {
+ logger.info(getPluginLabel() + "執行銷毀方法destroy()");
+ }
+
+ /****
+ * 插件的ID
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginId() {
+ return "CBS8AgentPayResultPlugin";
+ }
+
+ /****
+ * 插件的名称
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginName() {
+ return "cbs8代发代扣详情查询插件";
+ }
+
+ /****
+ * 插件的显示值
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginLabel() {
+ return "cbs8代发代扣详情查询插件";
+ }
+
+ /***
+ * 插件类型 1、场景插件
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-02 14:01
+ * @Param []
+ * @return java.lang.String
+ **/
+ @Override
+ public String getPluginType() {
+ return "1";
+ }
+
+ /***
+ * 执行业务代码
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-07 11:20
+ * @param requestJson 执行业务代码的参数
+ * @return void
+ **/
+ @Override
+ public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
+ //1、查询代发代扣交易未完成代
+ //2、调用cbs接口
+ AgentPayResultRequestDTO agentPayResultRequestDTO = new AgentPayResultRequestDTO();
+ agentPayResultRequestDTO.setBusNum("");
+ AgentPayResultResDTO agentPayResultResDTO = cbsPluginService.agentPayResult(agentPayResultRequestDTO);
+ //更新OA表单
+ //记录日志
+ return null;
+ }
+}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/ElecBillPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/ElecBillPluginInitializer.java
new file mode 100644
index 00000000..685cef93
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/ElecBillPluginInitializer.java
@@ -0,0 +1,101 @@
+package com.hzya.frame.plugin.cbs8.plugin;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.base.PluginBaseEntity;
+import com.hzya.frame.plugin.cbs8.service.ICbsPluginService;
+import com.hzya.frame.web.entity.JsonResultEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @Description 电子回单定时任务
+ * @Author xiangerlin
+ * @Date 2024/6/17 14:03
+ **/
+public class ElecBillPluginInitializer extends PluginBaseEntity {
+
+ Logger logger = LoggerFactory.getLogger(getClass());
+ @Autowired
+ private ICbsPluginService cbsPluginService;
+ /***
+ * 插件初始化方法
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-02 10:48
+ * @Param []
+ * @return void
+ **/
+ @Override
+ public void initialize() {
+ logger.info(getPluginLabel() + "執行初始化方法initialize()");
+ }
+
+ /****
+ * 插件销毁方法
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public void destroy() {
+ logger.info(getPluginLabel() + "執行銷毀方法destroy()");
+ }
+
+ /****
+ * 插件的ID
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginId() {
+ return "CBS8ElecBillPlugin";
+ }
+
+ /****
+ * 插件的名称
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginName() {
+ return "cbs8电子回单插件";
+ }
+
+ /****
+ * 插件的显示值
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginLabel() {
+ return "cbs8电子回单插件";
+ }
+
+ /***
+ * 插件类型 1、场景插件
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-02 14:01
+ * @Param []
+ * @return java.lang.String
+ **/
+ @Override
+ public String getPluginType() {
+ return "1";
+ }
+
+ /***
+ * 执行业务代码
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-07 11:20
+ * @param requestJson 执行业务代码的参数
+ * @return void
+ **/
+ @Override
+ public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
+ cbsPluginService.elecBillUpload(requestJson);
+ return null;
+ }
+}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/PayApplyAgentPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/PayApplyAgentPluginInitializer.java
new file mode 100644
index 00000000..3866684d
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/PayApplyAgentPluginInitializer.java
@@ -0,0 +1,128 @@
+package com.hzya.frame.plugin.cbs8.plugin;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.base.PluginBaseEntity;
+import com.hzya.frame.cbs8.dto.res.PayResponseDTO;
+import com.hzya.frame.plugin.cbs8.service.ICbsPluginService;
+import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity;
+import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity;
+import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentService;
+import com.hzya.frame.web.entity.JsonResultEntity;
+import org.apache.commons.collections.CollectionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+/**
+ * @Description
+ * @Author xiangerlin
+ * @Date 2024/6/18 14:03
+ **/
+public class PayApplyAgentPluginInitializer extends PluginBaseEntity {
+ Logger logger = LoggerFactory.getLogger(PayApplyAgentPluginInitializer.class);
+ @Autowired
+ private ICbsPluginService cbsPluginService;
+
+
+ @Autowired
+ private IAgentPaymentService agentPaymentService;
+
+
+ /***
+ * 插件初始化方法
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-02 10:48
+ * @Param []
+ * @return void
+ **/
+ @Override
+ public void initialize() {
+ logger.info(getPluginLabel() + "執行初始化方法initialize()");
+ }
+
+ /****
+ * 插件销毁方法
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public void destroy() {
+ logger.info(getPluginLabel() + "執行銷毀方法destroy()");
+ }
+
+ /****
+ * 插件的ID
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginId() {
+ return "CBS8PayApplyAgentPlugin";
+ }
+
+ /****
+ * 插件的名称
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginName() {
+ return "cbs8代发代扣插件";
+ }
+
+ /****
+ * 插件的显示值
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginLabel() {
+ return "cbs8代发代扣插件";
+ }
+
+ /***
+ * 插件类型 1、场景插件
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-02 14:01
+ * @Param []
+ * @return java.lang.String
+ **/
+ @Override
+ public String getPluginType() {
+ return "1";
+ }
+
+ /***
+ * 执行业务代码
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-07 11:20
+ * @param requestJson 执行业务代码的参数
+ * @return void
+ **/
+ @Override
+ public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
+ //1、查询代支付的
+ AgentPaymentEntity agentPaymentEntity = new AgentPaymentEntity();
+ List agentPaymentList = agentPaymentService.queryUnpaid(agentPaymentEntity);
+ if (CollectionUtils.isNotEmpty(agentPaymentList)){
+ for (AgentPaymentEntity paymentEntity : agentPaymentList) {
+ AgentPaymentDetailEntity detailEntity = new AgentPaymentDetailEntity();
+ detailEntity.setFormmainId(paymentEntity.getId());
+ List agentPaymentDetailList = agentPaymentService.queryDetails(detailEntity);
+ if (CollectionUtils.isNotEmpty(agentPaymentDetailList)){
+ //调用代发代扣接口
+ PayResponseDTO payResponseDTO = cbsPluginService.applyAgentPay(paymentEntity, agentPaymentDetailList);
+ //更新OA表单
+ //记录日志
+ }
+ }
+ }
+ return null;
+ }
+}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/PayApplyPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/PayApplyPluginInitializer.java
new file mode 100644
index 00000000..83886054
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/PayApplyPluginInitializer.java
@@ -0,0 +1,112 @@
+package com.hzya.frame.plugin.cbs8.plugin;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.base.PluginBaseEntity;
+import com.hzya.frame.plugin.cbs8.service.ICbsPluginService;
+import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity;
+import com.hzya.frame.web.entity.JsonResultEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @Description 经办支付申请
+ * @Author xiangerlin
+ * @Date 2024/6/7 13:42
+ **/
+public class PayApplyPluginInitializer extends PluginBaseEntity {
+ Logger logger = LoggerFactory.getLogger(PayApplyPluginInitializer.class);
+
+ @Autowired
+ private ICbsPluginService cbsPluginService;
+
+ /***
+ * 插件初始化方法
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-02 10:48
+ * @Param []
+ * @return void
+ **/
+ @Override
+ public void initialize() {
+ logger.info(getPluginLabel() + "執行初始化方法initialize()");
+ }
+
+ /****
+ * 插件销毁方法
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public void destroy() {
+ logger.info(getPluginLabel() + "執行銷毀方法destroy()");
+ }
+
+ /****
+ * 插件的ID
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginId() {
+ return "CBS8PayApplyPlugin";
+ }
+
+ /****
+ * 插件的名称
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginName() {
+ return "cbs8支付申请插件";
+ }
+
+ /****
+ * 插件的显示值
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginLabel() {
+ return "cbs8支付申请插件";
+ }
+
+ /***
+ * 插件类型 1、场景插件
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-02 14:01
+ * @Param []
+ * @return java.lang.String
+ **/
+ @Override
+ public String getPluginType() {
+ return "1";
+ }
+
+ /***
+ * 执行业务代码
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-07 11:20
+ * @param requestJson 执行业务代码的参数
+ * @return void
+ **/
+ @Override
+ public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
+ PaymentEntity paymentEntity = null;
+ if (null != requestJson){
+ requestJson.remove("jsonStr");
+ paymentEntity = JSONObject.parseObject(requestJson.toString(),PaymentEntity.class);
+ }
+ if (null == paymentEntity)
+ paymentEntity = new PaymentEntity();
+ //支付申请
+ paymentEntity.setOaId("5490849762671477371");
+ cbsPluginService.applyPay(paymentEntity);
+ return null;
+ }
+}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/PayResultPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/PayResultPluginInitializer.java
new file mode 100644
index 00000000..fab668fa
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/PayResultPluginInitializer.java
@@ -0,0 +1,110 @@
+package com.hzya.frame.plugin.cbs8.plugin;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.base.PluginBaseEntity;
+import com.hzya.frame.plugin.cbs8.service.ICbsPluginService;
+import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity;
+import com.hzya.frame.web.entity.JsonResultEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @Description 查询支付结果
+ * @Author xiangerlin
+ * @Date 2024/6/14 16:24
+ **/
+public class PayResultPluginInitializer extends PluginBaseEntity {
+ Logger logger = LoggerFactory.getLogger(PayResultPluginInitializer.class);
+
+ @Autowired
+ private ICbsPluginService cbsPluginService;
+ /***
+ * 插件初始化方法
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-02 10:48
+ * @Param []
+ * @return void
+ **/
+ @Override
+ public void initialize() {
+ logger.info(getPluginLabel() + "執行初始化方法initialize()");
+ }
+
+ /****
+ * 插件销毁方法
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public void destroy() {
+ logger.info(getPluginLabel() + "執行銷毀方法destroy()");
+ }
+
+ /****
+ * 插件的ID
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginId() {
+ return "CBS8PayResultPlugin";
+ }
+
+ /****
+ * 插件的名称
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginName() {
+ return "cbs8支付结果查询插件";
+ }
+
+ /****
+ * 插件的显示值
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginLabel() {
+ return "cbs8支付结果查询插件";
+ }
+
+ /***
+ * 插件类型 1、场景插件
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-02 14:01
+ * @Param []
+ * @return java.lang.String
+ **/
+ @Override
+ public String getPluginType() {
+ return "1";
+ }
+
+ /***
+ * 执行业务代码
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-07 11:20
+ * @param requestJson 执行业务代码的参数
+ * @return void
+ **/
+ @Override
+ public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
+ CbsLogEntity cbsLogEntity = null;
+ if (null != requestJson){
+ requestJson.remove("jsonStr");
+ cbsLogEntity = JSONObject.parseObject(requestJson.toString(),CbsLogEntity.class);
+ }
+ if (null == cbsLogEntity){
+ cbsLogEntity = new CbsLogEntity();
+ }
+ cbsPluginService.queryResult(cbsLogEntity);
+ return null;
+ }
+}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/TransactionDetailPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/TransactionDetailPluginInitializer.java
new file mode 100644
index 00000000..de84e734
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/plugin/TransactionDetailPluginInitializer.java
@@ -0,0 +1,126 @@
+package com.hzya.frame.plugin.cbs8.plugin;
+
+import cn.hutool.core.date.DateUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.base.PluginBaseEntity;
+import com.hzya.frame.cbs8.dto.req.TransactionDetailReqDTO;
+import com.hzya.frame.cbs8.dto.res.TransactionDetailDTO;
+import com.hzya.frame.cbs8.util.CBSUtil;
+import com.hzya.frame.plugin.cbs8.service.ICbsPluginService;
+import com.hzya.frame.web.entity.JsonResultEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.util.List;
+
+/**
+ * @Description 交易明细查询
+ * @Author xiangerlin
+ * @Date 2024/6/17 16:03
+ **/
+public class TransactionDetailPluginInitializer extends PluginBaseEntity {
+ Logger logger = LoggerFactory.getLogger(getClass());
+
+ @Autowired
+ private ICbsPluginService cbsPluginService;
+
+ /***
+ * 插件初始化方法
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-02 10:48
+ * @Param []
+ * @return void
+ **/
+ @Override
+ public void initialize() {
+ logger.info(getPluginLabel() + "執行初始化方法initialize()");
+ }
+
+ /****
+ * 插件销毁方法
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public void destroy() {
+ logger.info(getPluginLabel() + "執行銷毀方法destroy()");
+ }
+
+ /****
+ * 插件的ID
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginId() {
+ return "CBS8TransactionDetailQueryPlugin";
+ }
+
+ /****
+ * 插件的名称
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginName() {
+ return "cbs8交易明细查询插件";
+ }
+
+ /****
+ * 插件的显示值
+ * @author 👻👻👻👻👻👻👻👻 gjh
+ * @date 2023-08-02 10:48
+ * @return void
+ **/
+ @Override
+ public String getPluginLabel() {
+ return "cbs8交易明细查询插件";
+ }
+
+ /***
+ * 插件类型 1、场景插件
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-02 14:01
+ * @Param []
+ * @return java.lang.String
+ **/
+ @Override
+ public String getPluginType() {
+ return "1";
+ }
+
+ /***
+ * 执行业务代码
+ * @Author 👻👻👻👻👻👻👻👻 gjh
+ * @Date 2023-08-07 11:20
+ * @param requestJson 执行业务代码的参数
+ * @return void
+ **/
+ @Override
+ public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
+ TransactionDetailReqDTO transactionDetailReqDTO = null;
+ if (null != requestJson){
+ requestJson.remove("jsonStr");
+ transactionDetailReqDTO = JSONObject.parseObject(requestJson.toString(),TransactionDetailReqDTO.class);
+ }
+ if (null == transactionDetailReqDTO){
+ transactionDetailReqDTO = new TransactionDetailReqDTO();
+ }
+ transactionDetailReqDTO.setCurrentPage(CBSUtil.DEFAULT_CURRENT_PAGE);
+ transactionDetailReqDTO.setPageSize(CBSUtil.DEFAULT_PAGE_SIZE);
+ transactionDetailReqDTO.setStartDate(DateUtil.today());
+ transactionDetailReqDTO.setEndDate(DateUtil.today());
+ transactionDetailReqDTO.setDateType("0");
+ transactionDetailReqDTO.setLoanType("2");
+ //1查询交易明细
+ List transactionDetailList = cbsPluginService.queryTransactionDetail(transactionDetailReqDTO);
+ //保存交易明细到OA底表
+ cbsPluginService.saveTransactionDetail(transactionDetailList);
+ return new JsonResultEntity("成功",true,transactionDetailList);
+ //return null;
+ }
+}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/service/ICbsPluginService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/service/ICbsPluginService.java
new file mode 100644
index 00000000..8fc1f712
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/service/ICbsPluginService.java
@@ -0,0 +1,77 @@
+package com.hzya.frame.plugin.cbs8.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.cbs8.dto.req.AgentPayResultRequestDTO;
+import com.hzya.frame.cbs8.dto.req.TransactionDetailReqDTO;
+import com.hzya.frame.cbs8.dto.res.AgentPayResultResDTO;
+import com.hzya.frame.cbs8.dto.res.PayResponseDTO;
+import com.hzya.frame.cbs8.dto.res.TransactionDetailDTO;
+import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity;
+import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity;
+import com.hzya.frame.seeyon.cbs8.entity.CbsLogEntity;
+import com.hzya.frame.seeyon.cbs8.entity.PaymentEntity;
+
+import java.util.List;
+
+/**
+ * @Description
+ * @Author xiangerlin
+ * @Date 2024/6/17 08:46
+ **/
+public interface ICbsPluginService {
+
+ /**
+ * 支付申请
+ * @param entity
+ */
+ void applyPay(PaymentEntity entity)throws Exception;
+
+ /**
+ * 保存支付申请日志
+ * @param entity
+ * @throws Exception
+ */
+ void savePayLog(PaymentEntity entity,PayResponseDTO payResponseDTO)throws Exception;
+
+ /**
+ * 查询支付申请的交易结果
+ * @param cbsLogEntity
+ * @throws Exception
+ */
+ void queryResult(CbsLogEntity cbsLogEntity)throws Exception;
+
+ /**
+ * 电子回单查询 并上传OA
+ * @param requestJson
+ * @throws Exception
+ */
+ void elecBillUpload(JSONObject requestJson)throws Exception;
+
+ /**
+ * 查询交易明细
+ * transactionDetailReqDTO.currentPage 、 transactionDetailReqDTO.pageSize 必填
+ * @param transactionDetailReqDTO
+ */
+ List queryTransactionDetail(TransactionDetailReqDTO transactionDetailReqDTO);
+
+ /**
+ * 代发代扣 支付申请
+ * @param paymentEntity
+ * @param agentPaymentDetailList
+ */
+ PayResponseDTO applyAgentPay(AgentPaymentEntity paymentEntity, List agentPaymentDetailList);
+
+ /**
+ * 代发代扣 结果详情查询
+ * @param agentPayResultRequestDTO
+ * @return
+ */
+ AgentPayResultResDTO agentPayResult(AgentPayResultRequestDTO agentPayResultRequestDTO);
+
+ /**
+ * 保存交易明细到OA底表
+ * @param transactionDetailList
+ */
+ void saveTransactionDetail(List transactionDetailList);
+
+}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/service/impl/CbsPluginServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/service/impl/CbsPluginServiceImpl.java
new file mode 100644
index 00000000..cdf26b9e
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/cbs8/service/impl/CbsPluginServiceImpl.java
@@ -0,0 +1,411 @@
+package com.hzya.frame.plugin.cbs8.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.io.FileUtil;
+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.JSONObject;
+import com.hzya.frame.cbs8.dto.req.*;
+import com.hzya.frame.cbs8.dto.res.*;
+import com.hzya.frame.cbs8.service.ICbs8Service;
+import com.hzya.frame.cbs8.util.CBSUtil;
+import com.hzya.frame.cbs8.util.PayState;
+import com.hzya.frame.plugin.cbs8.service.ICbsPluginService;
+import com.hzya.frame.seeyon.cap4.form.dto.*;
+import com.hzya.frame.seeyon.cbs8.entity.*;
+import com.hzya.frame.seeyon.cbs8.service.ICbsLogService;
+import com.hzya.frame.seeyon.cbs8.service.IPaymentService;
+import com.hzya.frame.seeyon.cbs8.service.ITransactionDetailService;
+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.util.RestUtil;
+import com.hzya.frame.uuid.UUIDLong;
+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 java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description
+ * @Author xiangerlin
+ * @Date 2024/6/17 08:46
+ **/
+public class CbsPluginServiceImpl implements ICbsPluginService {
+
+ Logger logger = LoggerFactory.getLogger(CbsPluginServiceImpl.class);
+ @Autowired
+ private ICbs8Service cbs8Service;
+ @Autowired
+ private IPaymentService paymentService;
+ @Autowired
+ private ICbsLogService cbsLogService;
+ @Autowired
+ private ICtpAttachmentService ctpAttachmentService;
+ @Autowired
+ private ITransactionDetailService transactionDetailService;
+
+ @Autowired
+ private RestUtil restUtil;
+ @Value("${cbs8.elec_path}")
+ private String elec_path;
+ @Value("${OA.data_source_code}")
+ private String oa_data_source_code;
+ /**
+ * 支付申请
+ *
+ * @param paymentEntity
+ */
+ @Override
+ public void applyPay(PaymentEntity paymentEntity) throws Exception{
+ //查询待支付的列表
+ if (null == paymentEntity){
+ paymentEntity = new PaymentEntity();
+ }
+ paymentEntity.setDataSourceCode(oa_data_source_code);
+ List paymentList = paymentService.queryUnpaid(paymentEntity);
+ /* List paymentList = new ArrayList<>();
+ paymentEntity.setReferenceNum("CL202406140001");
+ paymentEntity.setPayAccount("655905707410000");
+ paymentEntity.setPayBankName("");
+ paymentEntity.setAmount("99");
+ paymentEntity.setRevAccount("123456778");
+ paymentEntity.setRevBankName("中国工商银行总行清算中心");
+ paymentEntity.setRevBankType("ICB");
+ paymentEntity.setRevAccountName("测试账户");
+ paymentEntity.setCnapsCode("102100099996");
+ paymentEntity.setPurpose("测试用途");
+ paymentEntity.setBusType("202");
+ paymentEntity.setCurrency("10");
+ paymentEntity.setPurpose("测试用途");
+ paymentList.add(paymentEntity);*/
+ if (CollectionUtils.isNotEmpty(paymentList)){
+ for (PaymentEntity pay : paymentList) {
+ //调用支付申请接口
+ PayResponseDTO payResponseDTO = cbs8Service.payApply(pay);
+ boolean successed = payResponseDTO.getSuccessed();
+ if (successed){
+ pay.setPayResult(PayState.p.getValue());
+ }else {
+ pay.setPayResult("推送失败");
+ }
+ //4、更新OA表单
+ pay.setDataSourceCode(oa_data_source_code);
+ paymentService.updatePayState(pay);
+ //5、记录操作日志
+ savePayLog(pay,payResponseDTO);
+ }
+ }
+ }
+
+ /**
+ * 保存支付申请日志
+ *
+ * @param entity
+ * @throws Exception
+ */
+ @Override
+ public void savePayLog(PaymentEntity entity,PayResponseDTO payResponseDTO) throws Exception {
+ //4. 保存日志
+ CbsLogEntity cbsLogEntity = new CbsLogEntity();
+ cbsLogEntity.setTitle(entity.getTitle());
+ cbsLogEntity.setPay_company(entity.getPayCompany());
+ cbsLogEntity.setPayee(entity.getRevAccountName());
+ cbsLogEntity.setAmount(entity.getAmount());
+ cbsLogEntity.setOa_id(entity.getOaId());
+ cbsLogEntity.setBill_code(Convert.toStr(entity.getReferenceNumNew(),entity.getReferenceNum()));
+ cbsLogEntity.setTab_name_ch(entity.getBillName());
+ cbsLogEntity.setTab_name_en(entity.getTableName());
+ Boolean successed = payResponseDTO.getSuccessed();
+ if (successed){
+ cbsLogEntity.setPay_state(PayState.p.getValue());
+ cbsLogEntity.setApply_state(PayState.two.getValue());
+ cbsLogEntity.setCbs_apply_code(payResponseDTO.getBusNum());
+ cbsLogEntity.setSuccessed("true");
+ entity.setPayResult(PayState.p.getValue());
+ }else {
+ cbsLogEntity.setPay_state("推送失败");
+ cbsLogEntity.setMessage(payResponseDTO.getErrorMsg());
+ cbsLogEntity.setSuccessed("false");
+ entity.setPayResult("推送失败");
+ }
+ cbsLogService.saveLog(cbsLogEntity);
+ }
+
+ /**
+ * 查询支付申请的交易结果
+ *
+ * @param cbsLogEntity
+ * @throws Exception
+ */
+ @Override
+ public void queryResult(CbsLogEntity cbsLogEntity) throws Exception {
+ if (null == cbsLogEntity){
+ cbsLogEntity = new CbsLogEntity();
+ }
+ cbsLogEntity.setDataSourceCode(oa_data_source_code);
+ // 1、查询支付中的日志
+ List inPayList = cbsLogService.queryInPayment(cbsLogEntity);
+ if (CollectionUtils.isNotEmpty(inPayList)){
+ for (CbsLogEntity entity : inPayList) {
+ try {
+ List payResultResList = cbs8Service.queryPayResult(new PayResultRequestDTO(entity.getBill_code()));
+ if (CollectionUtils.isNotEmpty(payResultResList)){
+ PayResultResDTO payResultResDTO = payResultResList.get(0);
+ //支付申请状态
+ String status = payResultResDTO.getStatus();
+ //支付状态
+ String pay_status = payResultResDTO.getPayStatus();
+ //不等于支付中的时候 更新支付状态
+ if (!PayState.p.getType().equals(pay_status)){
+ //如果支付状态为空,保存支付申请状态,如果支付状态不为空,则保存支付状态
+ PaymentEntity paymentEntity = new PaymentEntity();
+ paymentEntity.setOaId(entity.getOa_id());
+ paymentEntity.setDataSourceCode(oa_data_source_code);
+ List paymentList = paymentService.query(paymentEntity);
+ if (CollectionUtils.isNotEmpty(paymentList)){
+ paymentEntity = paymentList.get(0);
+ if (StrUtil.isEmpty(pay_status)) {
+ //支付申请状态 支付状态和支付申请状态用一个
+ paymentEntity.setPayResult(PayState.payStateGetValue(status));
+ } else {
+ //支付状态 支付状态和支付申请状态用一个
+ paymentEntity.setPayResult(PayState.payStateGetValue(pay_status));
+ }
+ if (StrUtil.isNotEmpty(pay_status) && pay_status.equals(PayState.g.getType())) {
+ //支付时间
+ paymentEntity.setPayDate(CBSUtil.convertTimestampToString(payResultResDTO.getPayDate()));
+ }
+ //更新视图单据状态
+ paymentEntity.setDataSourceCode(oa_data_source_code);
+ paymentService.updatePayState(paymentEntity);
+ //更新日志表状态
+ entity.setPay_state(paymentEntity.getPayResult());
+ entity.setApply_state(PayState.payStateGetValue(status));
+ entity.setDataSourceCode(oa_data_source_code);
+ cbsLogService.updateLog(entity);
+ }
+ }
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ logger.error("查询交易结果出错",e);
+ }
+ }
+ }
+ }
+
+ /**
+ * 电子回单查询 并上传OA
+ *
+ * @param requestJson
+ * @throws Exception
+ */
+ @Override
+ public void elecBillUpload(JSONObject requestJson) throws Exception {
+ //查询支付成功 没有电子回单的数据
+ PaymentEntity paymentEntity = new PaymentEntity();
+ // List paymentList = paymentService.queryElecIsNull(paymentEntity);
+ paymentEntity.setPayDate("2024-06-20");
+ paymentEntity.setReferenceNum("41");
+ List paymentList = Arrays.asList(paymentEntity);
+ if (CollectionUtils.isNotEmpty(paymentList)) {
+ for (PaymentEntity pay : paymentList) {
+ try {
+ String payDate = DateUtil.format(DateUtil.parse(pay.getPayDate()), "yyyy-MM-dd");
+ //查询cbs电子回单
+ List elecResList = cbs8Service.queryElecBill(new ElecRequestDTO(payDate,DateUtil.today(),pay.getReferenceNum()));
+ if (CollectionUtils.isNotEmpty(elecResList)){
+ ElecResponseDTO elecResponseDTO = elecResList.get(0);
+ String bucketFileUrl = elecResponseDTO.getBucketFileUrl();
+ String bucketFileName = elecResponseDTO.getBucketFileName();
+ //上传电子回单到OA
+ HttpUtil.downloadFile(bucketFileUrl, FileUtil.file(elec_path));//附件下载
+ String pdfUrl = elec_path + bucketFileName;
+ File file = new File(pdfUrl);
+ if (file.exists()) {
+ CtpFileEntity cpFileEntity = new CtpFileEntity();
+ cpFileEntity.setFile(file);
+ cpFileEntity.setDataSourceCode(oa_data_source_code);
+ JSONObject jsonObjectUpload = restUtil.fileUpload(file,"8000240005");
+ String file_url = jsonObjectUpload.getString("fileUrl");
+ if (null != jsonObjectUpload && StrUtil.isNotEmpty(file_url)) {
+ String sub_reference = String.valueOf(UUIDLong.longUUID());
+ pay.setReceipt(sub_reference);
+ //更新表单的电子回单值
+ paymentService.updateElec(pay);
+ //保存附件关系
+ CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity();
+ ctpAttachmentEntity.setFile_url(file_url);
+ ctpAttachmentService.saveAttachment(file_url, pay.getSummaryId(), sub_reference);
+ }
+ //删除本地临时文件
+ file.delete();
+ }
+ }
+ }catch (Exception e){
+ logger.error("电子回单查询出错",e);
+ }
+ }
+ }
+ }
+
+ /**
+ * 查询交易明细
+ * transactionDetailReqDTO.currentPage 、 transactionDetailReqDTO.pageSize 必填
+ * @param transactionDetailReqDTO
+ */
+ @Override
+ public List queryTransactionDetail(TransactionDetailReqDTO transactionDetailReqDTO) {
+ boolean hasNextPage = true;//是否有下一页
+ int currentPage = transactionDetailReqDTO.getCurrentPage();
+ int pageSize = transactionDetailReqDTO.getPageSize();
+ if (currentPage == 0){
+ currentPage = CBSUtil.DEFAULT_CURRENT_PAGE;//页码
+ }
+ if (pageSize == 0){
+ pageSize = CBSUtil.DEFAULT_PAGE_SIZE;//每页条数
+ transactionDetailReqDTO.setPageSize(pageSize);
+ }
+ List resultList = new ArrayList<>();
+ do{
+ transactionDetailReqDTO.setCurrentPage(currentPage);//页码
+ currentPage++;//页码自增
+ hasNextPage = false;//保护功能,防止出现死循环
+ CbsResDataDTO dataDTO = cbs8Service.queryTransactionDetail(transactionDetailReqDTO);
+ if (null != dataDTO){
+ hasNextPage = dataDTO.getHasNextPage();
+ List transactionDetailDTOList = CBSUtil.convertJsonArrayToList(dataDTO.getList(), TransactionDetailDTO.class);
+ resultList.addAll(transactionDetailDTOList);
+ }
+ }while (hasNextPage);
+
+ return resultList;
+ }
+
+ /**
+ * 代发代扣 支付申请
+ *
+ * @param paymentEntity
+ * @param agentPaymentDetailList
+ */
+ @Override
+ public PayResponseDTO applyAgentPay(AgentPaymentEntity paymentEntity, List agentPaymentDetailList) {
+ if (null != paymentEntity && CollectionUtils.isNotEmpty(agentPaymentDetailList)){
+ PaymentApplySubmitReqDTO paymentApplySubmitReqDTO = BeanUtil.copyProperties(paymentEntity,PaymentApplySubmitReqDTO.class);
+ List paymentApplyAgentList = new ArrayList<>();
+ for (AgentPaymentDetailEntity detailEntity : agentPaymentDetailList) {
+ PaymentApplyAgentDTO detailDTO = BeanUtil.copyProperties(detailEntity,PaymentApplyAgentDTO.class);
+ paymentApplyAgentList.add(detailDTO);
+ }
+ PayResponseDTO payResponseDTO = cbs8Service.agentPayApply(paymentApplySubmitReqDTO,paymentApplyAgentList);
+ return payResponseDTO;
+ }else {
+ throw new BaseSystemException("参数不能为空");
+ }
+ }
+
+ /**
+ * 代发代扣 结果详情查询
+ *
+ * @param agentPayResultRequestDTO
+ * @return
+ */
+ @Override
+ public AgentPayResultResDTO agentPayResult(AgentPayResultRequestDTO agentPayResultRequestDTO) {
+ if (null != agentPayResultRequestDTO && StrUtil.isNotEmpty(agentPayResultRequestDTO.getBusNum())){
+ AgentPayResultResDTO agentPayResultResDTO = cbs8Service.agentPayResult(agentPayResultRequestDTO);
+ return agentPayResultResDTO;
+ }
+ return null;
+ }
+
+ /**
+ * 保存交易明细到OA底表
+ *
+ * @param transactionDetailList
+ */
+ @Override
+ public void saveTransactionDetail(List transactionDetailList) {
+ if (CollectionUtils.isNotEmpty(transactionDetailList)){
+ //过滤已经保存过的数据
+ for (TransactionDetailDTO dto : transactionDetailList) {
+ TransactionDetailEntity transactionDetail = new TransactionDetailEntity();
+ BeanUtil.copyProperties(dto,transactionDetail);
+ transactionDetailService.restSave(transactionDetail);
+ }
+ }
+ }
+
+ //这个方法没用,用的是8.0批量保存方式,我没有测试
+ private void saveTransactionDetailTemp(List transactionDetailList) {
+ if (CollectionUtils.isNotEmpty(transactionDetailList)){
+ //过滤已经保存过的数据
+ for (TransactionDetailDTO dto : transactionDetailList) {
+ List dataList = new ArrayList<>();
+ FormDTO formDTO = new FormDTO();
+ formDTO.setFormCode("formmain_0233");
+ formDTO.setLoginName("yonyou");
+ formDTO.setRightId("6603635988997229999.-8611088937958683581");
+ String field0001=dto.getAccountNo();//我方银行账号
+ String field0002=dto.getAccountName();//我方户名
+ String field0003=dto.getOpenBank();//我方开户行
+ String field0004=dto.getBankType();//我方银行类型
+ String field0005=dto.getTransactionSerialNumber();//交易流水号
+ String field0006=dto.getBankTransactionDate();//交易日期
+ String field0007=dto.getBankSerialNumber();//银行流水号
+ String field0008=dto.getCurrency();//币种
+ String field0009=dto.getIncurredAmount();//收款金额
+ String field0010=dto.getPurpose();//用途
+ String field0011=dto.getDigest();//摘要
+ String field0012=dto.getOppositeAccount();//对方账号
+ String field0013=dto.getOppositeName();//对方户名
+ String field0014=dto.getOppositeOpeningBank();//对方开户行
+ String field0015=dto.getRemark();//备注
+ //fields
+ List fields = new ArrayList<>();
+ fields.add(new RecordFieldDTO("field0001",field0001,field0001));
+ fields.add(new RecordFieldDTO("field0002",field0002,field0002));
+ fields.add(new RecordFieldDTO("field0003",field0003,field0003));
+ fields.add(new RecordFieldDTO("field0004",field0004,field0004));
+ fields.add(new RecordFieldDTO("field0005",field0005,field0005));
+ fields.add(new RecordFieldDTO("field0006",field0006,field0006));
+ fields.add(new RecordFieldDTO("field0007",field0007,field0007));
+ fields.add(new RecordFieldDTO("field0008",field0008,field0008));
+ fields.add(new RecordFieldDTO("field0009",field0009,field0009));
+ fields.add(new RecordFieldDTO("field0010",field0010,field0010));
+ fields.add(new RecordFieldDTO("field0011",field0011,field0011));
+ fields.add(new RecordFieldDTO("field0012",field0012,field0012));
+ fields.add(new RecordFieldDTO("field0013",field0013,field0013));
+ fields.add(new RecordFieldDTO("field0014",field0014,field0014));
+ fields.add(new RecordFieldDTO("field0015",field0015,field0015));
+ //masterTable
+ MasterTableDTO masterTableDTO = new MasterTableDTO();
+ masterTableDTO.setName("formmain_1284");
+ RecordDTO recordDTO = new RecordDTO();
+ recordDTO.setId(UUIDLong.longUUID());
+ recordDTO.setFields(fields);
+ masterTableDTO.setRecord(recordDTO);
+ //dataList
+ FormDataDTO formDataDTO = new FormDataDTO();
+ formDataDTO.setMasterTable(masterTableDTO);
+ dataList.add(formDataDTO);
+ formDTO.setDataList(dataList);
+ }
+ }
+ }
+
+}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/IMdmCustomerBankDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/IMdmCustomerBankDao.java
deleted file mode 100644
index d22d954a..00000000
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/IMdmCustomerBankDao.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.hzya.frame.plugin.masterData.customer.bank.dao;
-
-import com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity;
-import com.hzya.frame.basedao.dao.IBaseDao;
-
-/**
- * 客户银行(mdm_customer_bank: table)表数据库访问层
- *
- * @author makejava
- * @since 2024-06-21 13:55:55
- */
-public interface IMdmCustomerBankDao extends IBaseDao {
-
-}
-
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/impl/MdmCustomerBankDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/impl/MdmCustomerBankDaoImpl.java
deleted file mode 100644
index 78161b29..00000000
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/dao/impl/MdmCustomerBankDaoImpl.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.hzya.frame.plugin.masterData.customer.bank.dao.impl;
-
-import com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity;
-import com.hzya.frame.plugin.masterData.customer.bank.dao.IMdmCustomerBankDao;
-import org.springframework.stereotype.Repository;
-import com.hzya.frame.basedao.dao.MybatisGenericDao;
-/**
- * 客户银行(MdmCustomerBank)表数据库访问层
- *
- * @author makejava
- * @since 2024-06-21 13:55:55
- */
-public class MdmCustomerBankDaoImpl extends MybatisGenericDao implements IMdmCustomerBankDao{
-
-}
-
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.java
deleted file mode 100644
index 4c389315..00000000
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package com.hzya.frame.plugin.masterData.customer.bank.entity;
-
-import java.util.Date;
-import com.hzya.frame.web.entity.BaseEntity;
-/**
- * 客户银行(MdmCustomerBank)实体类
- *
- * @author makejava
- * @since 2024-06-21 13:55:55
- */
-public class MdmCustomerBankEntity extends BaseEntity {
-
- /** formmain_id */
- private String formmainId;
- /** 数据状态 Y正常 N删除 F修改 */
- private String dataStatus;
- /** 公司id */
- private String companyId;
- /** 银行 */
- private String bank;
- /** 开户银行 */
- private String pkBankdoc;
- /** 账号 */
- private String accnum;
- /** 联行号 */
- private String combinenum;
-
-
- public String getFormmainId() {
- return formmainId;
- }
-
- public void setFormmainId(String formmainId) {
- this.formmainId = formmainId;
- }
-
- public String getDataStatus() {
- return dataStatus;
- }
-
- public void setDataStatus(String dataStatus) {
- this.dataStatus = dataStatus;
- }
-
- public String getCompanyId() {
- return companyId;
- }
-
- public void setCompanyId(String companyId) {
- this.companyId = companyId;
- }
-
- public String getBank() {
- return bank;
- }
-
- public void setBank(String bank) {
- this.bank = bank;
- }
-
- public String getPkBankdoc() {
- return pkBankdoc;
- }
-
- public void setPkBankdoc(String pkBankdoc) {
- this.pkBankdoc = pkBankdoc;
- }
-
- public String getAccnum() {
- return accnum;
- }
-
- public void setAccnum(String accnum) {
- this.accnum = accnum;
- }
-
- public String getCombinenum() {
- return combinenum;
- }
-
- public void setCombinenum(String combinenum) {
- this.combinenum = combinenum;
- }
-
-}
-
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.xml
deleted file mode 100644
index 3689e8c9..00000000
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/entity/MdmCustomerBankEntity.xml
+++ /dev/null
@@ -1,267 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- id
- ,formmain_id
- ,data_status
- ,sorts
- ,create_user_id
- ,create_time
- ,modify_user_id
- ,modify_time
- ,sts
- ,org_id
- ,company_id
- ,bank
- ,pk_bankdoc
- ,accnum
- ,combinenum
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- insert into mdm_customer_bank(
-
- id ,
- formmain_id ,
- data_status ,
- sorts ,
- create_user_id ,
- create_time ,
- modify_user_id ,
- modify_time ,
- sts ,
- org_id ,
- company_id ,
- bank ,
- pk_bankdoc ,
- accnum ,
- combinenum ,
- sorts,
- sts,
-
- )values(
-
- #{id} ,
- #{formmainId} ,
- #{dataStatus} ,
- #{sorts} ,
- #{create_user_id} ,
- #{create_time} ,
- #{modify_user_id} ,
- #{modify_time} ,
- #{sts} ,
- #{org_id} ,
- #{companyId} ,
- #{bank} ,
- #{pkBankdoc} ,
- #{accnum} ,
- #{combinenum} ,
- (select (max(IFNULL( a.sorts, 0 )) + 1) as sort from mdm_customer_bank a WHERE a.sts = 'Y' ),
- 'Y',
-
- )
-
-
-
- insert into mdm_customer_bank(formmain_id, data_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bank, pk_bankdoc, accnum, combinenum, sts)
- values
-
- (#{entity.formmainId},#{entity.dataStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.bank},#{entity.pkBankdoc},#{entity.accnum},#{entity.combinenum}, 'Y')
-
-
-
-
- insert into mdm_customer_bank(formmain_id, data_status, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, bank, pk_bankdoc, accnum, combinenum)
- values
-
- (#{entity.formmainId},#{entity.dataStatus},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId},#{entity.bank},#{entity.pkBankdoc},#{entity.accnum},#{entity.combinenum})
-
- on duplicate key update
- formmain_id = values(formmain_id),
- data_status = values(data_status),
- create_user_id = values(create_user_id),
- create_time = values(create_time),
- modify_user_id = values(modify_user_id),
- modify_time = values(modify_time),
- sts = values(sts),
- org_id = values(org_id),
- company_id = values(company_id),
- bank = values(bank),
- pk_bankdoc = values(pk_bankdoc),
- accnum = values(accnum),
- combinenum = values(combinenum)
-
-
-update mdm_customer_bank set
-
- formmain_id = #{formmainId},
- data_status = #{dataStatus},
- create_user_id = #{create_user_id},
- create_time = #{create_time},
- modify_user_id = #{modify_user_id},
- modify_time = #{modify_time},
- sts = #{sts},
- org_id = #{org_id},
- company_id = #{companyId},
- bank = #{bank},
- pk_bankdoc = #{pkBankdoc},
- accnum = #{accnum},
- combinenum = #{combinenum},
-
-where id = #{id}
-
-
-
-update mdm_customer_bank set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
-where id = #{id}
-
-
-
-update mdm_customer_bank set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
-
- and id = #{id}
- and formmain_id = #{formmainId}
- and data_status = #{dataStatus}
- and sorts = #{sorts}
- and sts = #{sts}
- and company_id = #{companyId}
- and bank = #{bank}
- and pk_bankdoc = #{pkBankdoc}
- and accnum = #{accnum}
- and combinenum = #{combinenum}
- and sts='Y'
-
-
-
-
- delete from mdm_customer_bank where id = #{id}
-
-
-
-
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/plugin/MdmCustomerBankPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/plugin/MdmCustomerBankPluginInitializer.java
deleted file mode 100644
index e62824b8..00000000
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/plugin/MdmCustomerBankPluginInitializer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.hzya.frame.plugin.masterData.customer.bank.plugin;
-import com.alibaba.fastjson.JSONObject;
-import com.hzya.frame.base.PluginBaseEntity;
-import com.hzya.frame.web.entity.JsonResultEntity;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-/**
- * 客户银行(MdmCustomerBank)表服务接口
- *
- * @author makejava
- * @since 2024-06-21 13:55:55
- */
-public class MdmCustomerBankPluginInitializer extends PluginBaseEntity{
- Logger logger = LoggerFactory.getLogger(MdmCustomerBankPluginInitializer.class);
-
- @Override
- public void initialize() {
- logger.info(getPluginLabel() + "執行初始化方法initialize()");
- }
-
- @Override
- public void destroy() {
- logger.info(getPluginLabel() + "執行銷毀方法destroy()");
- }
-
- @Override
- public String getPluginId() {
- return "MdmCustomerBankPlugin";
- }
-
- @Override
- public String getPluginName() {
- return "MdmCustomerBankPlugin插件";
- }
-
- @Override
- public String getPluginLabel() {
- return "MdmCustomerBankPlugin";
- }
-
- @Override
- public String getPluginType() {
- return "1";
- }
- @Override
- public JsonResultEntity executeBusiness(JSONObject requestJson) {
- logger.info("执行业务代码逻辑");
- return null;
- }
-}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/IMdmCustomerBankService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/IMdmCustomerBankService.java
deleted file mode 100644
index b1be580d..00000000
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/IMdmCustomerBankService.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.hzya.frame.plugin.masterData.customer.bank.service;
-
-import com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity;
-import com.hzya.frame.basedao.service.IBaseService;
-/**
- * 客户银行(MdmCustomerBank)表服务接口
- *
- * @author makejava
- * @since 2024-06-21 13:55:55
- */
-public interface IMdmCustomerBankService extends IBaseService{
-}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/impl/MdmCustomerBankServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/impl/MdmCustomerBankServiceImpl.java
deleted file mode 100644
index 11fe5130..00000000
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/bank/service/impl/MdmCustomerBankServiceImpl.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.hzya.frame.plugin.masterData.customer.bank.service.impl;
-
-import com.hzya.frame.plugin.masterData.customer.bank.entity.MdmCustomerBankEntity;
-import com.hzya.frame.plugin.masterData.customer.bank.dao.IMdmCustomerBankDao;
-import com.hzya.frame.plugin.masterData.customer.bank.service.IMdmCustomerBankService;
-import org.springframework.stereotype.Service;
-import org.springframework.beans.factory.annotation.Autowired;
-import javax.annotation.Resource;
-import com.hzya.frame.basedao.service.impl.BaseService;
-/**
- * 客户银行(MdmCustomerBank)表服务实现类
- *
- * @author makejava
- * @since 2024-06-21 13:55:55
- */
-public class MdmCustomerBankServiceImpl extends BaseService implements IMdmCustomerBankService {
-
- private IMdmCustomerBankDao mdmCustomerBankDao;
-
- @Autowired
- public void setMdmCustomerBankDao(IMdmCustomerBankDao dao) {
- this.mdmCustomerBankDao = dao;
- this.dao = dao;
- }
-}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/IMdmCustomerDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/IMdmCustomerDao.java
deleted file mode 100644
index 8b8ae96e..00000000
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/IMdmCustomerDao.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.hzya.frame.plugin.masterData.customer.dao;
-
-import com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity;
-import com.hzya.frame.basedao.dao.IBaseDao;
-
-/**
- * 客户档案(mdm_customer: table)表数据库访问层
- *
- * @author makejava
- * @since 2024-06-21 13:52:35
- */
-public interface IMdmCustomerDao extends IBaseDao {
-
-}
-
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/impl/MdmCustomerDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/impl/MdmCustomerDaoImpl.java
deleted file mode 100644
index 8899979b..00000000
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/dao/impl/MdmCustomerDaoImpl.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.hzya.frame.plugin.masterData.customer.dao.impl;
-
-import com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity;
-import com.hzya.frame.plugin.masterData.customer.dao.IMdmCustomerDao;
-import org.springframework.stereotype.Repository;
-import com.hzya.frame.basedao.dao.MybatisGenericDao;
-/**
- * 客户档案(MdmCustomer)表数据库访问层
- *
- * @author makejava
- * @since 2024-06-21 13:52:35
- */
-public class MdmCustomerDaoImpl extends MybatisGenericDao implements IMdmCustomerDao{
-
-}
-
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/IMdmCustomerService.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/IMdmCustomerService.java
deleted file mode 100644
index 83ea4dfe..00000000
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/IMdmCustomerService.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.hzya.frame.plugin.masterData.customer.service;
-
-import com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity;
-import com.hzya.frame.basedao.service.IBaseService;
-/**
- * 客户档案(MdmCustomer)表服务接口
- *
- * @author makejava
- * @since 2024-06-21 13:52:35
- */
-public interface IMdmCustomerService extends IBaseService{
-}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/impl/MdmCustomerServiceImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/impl/MdmCustomerServiceImpl.java
deleted file mode 100644
index 6e48b6d1..00000000
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/service/impl/MdmCustomerServiceImpl.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.hzya.frame.plugin.masterData.customer.service.impl;
-
-import com.hzya.frame.plugin.masterData.customer.entity.MdmCustomerEntity;
-import com.hzya.frame.plugin.masterData.customer.dao.IMdmCustomerDao;
-import com.hzya.frame.plugin.masterData.customer.service.IMdmCustomerService;
-import org.springframework.stereotype.Service;
-import org.springframework.beans.factory.annotation.Autowired;
-import javax.annotation.Resource;
-import com.hzya.frame.basedao.service.impl.BaseService;
-/**
- * 客户档案(MdmCustomer)表服务实现类
- *
- * @author makejava
- * @since 2024-06-21 13:52:35
- */
-public class MdmCustomerServiceImpl extends BaseService implements IMdmCustomerService {
-
- private IMdmCustomerDao mdmCustomerDao;
-
- @Autowired
- public void setMdmCustomerDao(IMdmCustomerDao dao) {
- this.mdmCustomerDao = dao;
- this.dao = dao;
- }
-}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/dao/IMdmDao.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/dao/IMdmDao.java
new file mode 100644
index 00000000..b69adb80
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/dao/IMdmDao.java
@@ -0,0 +1,15 @@
+package com.hzya.frame.plugin.masterData.dao;
+
+import com.hzya.frame.basedao.dao.IBaseDao;
+import com.hzya.frame.plugin.masterData.entity.MdmEntity;
+
+/**
+ * 客户档案(mdm_customer: table)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-06-21 13:52:35
+ */
+public interface IMdmDao extends IBaseDao {
+
+}
+
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/dao/impl/MdmDaoImpl.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/dao/impl/MdmDaoImpl.java
new file mode 100644
index 00000000..05e95b1e
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/dao/impl/MdmDaoImpl.java
@@ -0,0 +1,15 @@
+package com.hzya.frame.plugin.masterData.dao.impl;
+
+import com.hzya.frame.plugin.masterData.entity.MdmEntity;
+import com.hzya.frame.plugin.masterData.dao.IMdmDao;
+import com.hzya.frame.basedao.dao.MybatisGenericDao;
+/**
+ * 客户档案(MdmCustomer)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-06-21 13:52:35
+ */
+public class MdmDaoImpl extends MybatisGenericDao implements IMdmDao {
+
+}
+
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/entity/MdmEntity.java
similarity index 97%
rename from buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.java
rename to buildpackage/src/main/java/com/hzya/frame/plugin/masterData/entity/MdmEntity.java
index 7e61cc1c..e8d7f6f9 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/entity/MdmEntity.java
@@ -1,4 +1,4 @@
-package com.hzya.frame.plugin.masterData.customer.entity;
+package com.hzya.frame.plugin.masterData.entity;
import java.util.Date;
import com.hzya.frame.web.entity.BaseEntity;
@@ -8,7 +8,7 @@ import com.hzya.frame.web.entity.BaseEntity;
* @author makejava
* @since 2024-06-21 13:52:35
*/
-public class MdmCustomerEntity extends BaseEntity {
+public class MdmEntity extends BaseEntity {
/** 单据规则 */
private String documentRule;
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.xml b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/entity/MdmEntity.xml
similarity index 97%
rename from buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.xml
rename to buildpackage/src/main/java/com/hzya/frame/plugin/masterData/entity/MdmEntity.xml
index 41c3a4ff..dd48ba87 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/customer/entity/MdmCustomerEntity.xml
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/entity/MdmEntity.xml
@@ -1,8 +1,8 @@
-
+
-
+
@@ -58,7 +58,7 @@
,taxpayerid
-
diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java
index 497b69b5..04704d16 100644
--- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java
+++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/dao/impl/MdmModuleDaoImpl.java
@@ -30,6 +30,8 @@ public class MdmModuleDaoImpl extends MybatisGenericDao
return o;
}
+
+
@Override
public MdmModuleEntity getByMdmCode(Long mdmCode) {
MdmModuleEntity mdmModuleEntity = (MdmModuleEntity) super.selectOne(getSqlIdPrifx() + "getByMdmCode",mdmCode);
diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java
index 40af0a2c..1267d9b6 100644
--- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java
+++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.java
@@ -30,8 +30,43 @@ public class MdmModuleSourceEntity extends BaseEntity {
private String enabledState;
/** 公司id */
private String companyId;
- /** 公司id */
- private String pluginCode;
+ private String pluginCode;//插件编码
+ private String appType;//应用类型
+ private String dbCode;//数据源编码
+ private String appName;//应用名称
+ private String mdmCode;//主数据编码
+
+ public String getAppName() {
+ return appName;
+ }
+
+ public void setAppName(String appName) {
+ this.appName = appName;
+ }
+
+ public String getMdmCode() {
+ return mdmCode;
+ }
+
+ public void setMdmCode(String mdmCode) {
+ this.mdmCode = mdmCode;
+ }
+
+ public String getAppType() {
+ return appType;
+ }
+
+ public void setAppType(String appType) {
+ this.appType = appType;
+ }
+
+ public String getDbCode() {
+ return dbCode;
+ }
+
+ public void setDbCode(String dbCode) {
+ this.dbCode = dbCode;
+ }
public String getPluginCode() {
return pluginCode;
diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.xml
index 1918707d..5808f79b 100644
--- a/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.xml
+++ b/service/src/main/java/com/hzya/frame/mdm/mdmModuleSource/entity/MdmModuleSourceEntity.xml
@@ -21,6 +21,10 @@
+
+
+
+
@@ -28,13 +32,13 @@
,mdm_id
,source_type
,source_name
- ,trigger_type
- ,source_code
- ,add_api
- ,update_api
- ,delete_api
- ,enabled_state
- ,sorts
+ ,trigger_type
+ ,source_code
+ ,add_api
+ ,update_api
+ ,delete_api
+ ,enabled_state
+ ,sorts
,create_user_id
,create_time
,modify_user_id
@@ -167,6 +171,33 @@
order by ${sort} ${order}
+
+
+ SELECT
+ plug.plugin_code,
+ plug.plugin_name,
+ application.name as app_name,
+ source.source_name,
+ source.source_code ,
+ application.app_type,
+ model.mdm_code,
+ applicationdatabase.source_code as db_code
+ FROM
+ mdm_module_source source
+ LEFT JOIN sys_application_plugin plug ON plug.id = source.source_code
+ LEFT JOIN sys_application application ON source.source_name = application.id
+ left join sys_application_database applicationdatabase on applicationdatabase.app_id = source.source_name
+ LEFT JOIN mdm_module model on source.mdm_id = model.id
+ WHERE
+ source.source_type = '1'
+ AND source.sts = 'Y'
+ AND plug.sts = 'Y'
+ and application.sts = 'Y'
+ AND applicationdatabase.sts = 'Y'
+ AND applicationdatabase.db_status = '1'
+
+
+
insert into mdm_module_source(
@@ -219,7 +250,7 @@
- insert into mdm_module_source(mdm_id, source_type, source_name, trigger_type, source_code, add_api, update_api, delete_api, enabled_state, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
+ insert into mdm_module_source(mdm_id, source_type, source_name, trigger_type, source_code, add_api, update_api, delete_api, enabled_state, create_user_id, create_time, modify_user_id, modify_time, sts, org_id, company_id, sts)
values
(#{entity.mdmId},#{entity.sourceType},#{entity.sourceName},#{entity.triggerType},#{entity.sourceCode},#{entity.addApi},#{entity.updateApi},#{entity.deleteApi},#{entity.enabledState},#{entity.create_user_id},#{entity.create_time},#{entity.modify_user_id},#{entity.modify_time},#{entity.sts},#{entity.org_id},#{entity.companyId}, 'Y')
@@ -301,13 +332,7 @@ update mdm_module_source set sts= 'N' ,modify_time = #{modify_time},modify_user
delete from mdm_module_source where id = #{id}
-
-
- select plugin_code,plugin_name,source_name,source_code
- from mdm_module_source source
- left join sys_application_plugin plug on plug.id=source.source_code
- where source_type='1' and source.sts='Y' and plug.sts='Y'
-
+
diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ICbsLogDao.java
new file mode 100644
index 00000000..032d1a3e
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IPaymentDao.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/IPaymentDao.java
new file mode 100644
index 00000000..c8a18848
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ITransactionDetailDao.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/ITransactionDetailDao.java
new file mode 100644
index 00000000..37cf015a
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/CbsLogDaoImpl.java
new file mode 100644
index 00000000..a42437b0
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/PaymentDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/PaymentDaoImpl.java
new file mode 100644
index 00000000..f2744983
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/TransactionDetailDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/dao/impl/TransactionDetailDaoImpl.java
new file mode 100644
index 00000000..e4fb1bac
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.java
new file mode 100644
index 00000000..9ab32fc9
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentDetailEntity.java
@@ -0,0 +1,91 @@
+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;
+
+ 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;
+ }
+}
diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.java
new file mode 100644
index 00000000..001fb42a
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/AgentPaymentEntity.java
@@ -0,0 +1,97 @@
+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 {
+
+ //业务参考号
+ private String referenceNum;
+ /**
+ * 业务类型
+ * 201-代扣
+ * 203-代发
+ * 代发工资传203
+ */
+ private String busType;
+ //总金额 小数位2位
+ private String amount;
+ //币种
+ private String currency;
+ //付款账号
+ private String payAccount;
+ //用途
+ private String purpose;
+
+
+ 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;
+ }
+}
diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.java
new file mode 100644
index 00000000..21cc1a4f
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/CbsLogEntity.xml
new file mode 100644
index 00000000..3e03a88a
--- /dev/null
+++ b/service/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
+
+
+
+
+ select
+
+ from
+ formmain_0232
+
+ field0002 = #{title}
+ and field0003 = #{pay_company}
+ and field0004 = #{payee}
+ and field0005 = #{cbs_apply_code}
+ and field0006 = #{bill_code}
+ and field0007 = #{oa_id}
+ and field0008 = #{tab_name_ch}
+ and field0009 = #{tab_name_en}
+ and field0010 = #{pay_state}
+ and field0011 = #{message}
+ and field0012 = #{apply_state}
+ and field0014 = #{successed}
+
+
+
+
+ select
+
+ from
+ formmain_0232
+
+ field0002 = #{title}
+ and id = #{id}
+ and field0003 like '${pay_company}%'
+ and field0004 like '${payee}%'
+ and field0005 like '${cbs_apply_code}%'
+ and field0006 like '${bill_code}%'
+ and field0007 = #{oa_id}
+ and field0008 like '${tab_name_ch}%'
+ and field0009 like '${tab_name_en}%'
+ and field0010 like '${pay_state}%'
+ and field0011 like '${message}%'
+ and field0012 like '${apply_state}%'
+ and field0014 like '${successed}%'
+
+
+
+
+ select
+
+ from
+ formmain_0232
+
+ field0007 = #{oa_id}
+ and id = #{id}
+ and field0006 = #{bill_code}
+ and field0008 = #{tab_name_en}
+ and field0009 = #{tab_name_ch}
+ and field0010 = #{pay_state}
+ and field0011 = #{message}
+ and field0012 = #{apply_state}
+ and field0014 = #{successed}
+ and (field0010='支付中'
+ or field0010 not in ('审批撤销','审批拒绝','处理失败','退票','支付成功','取消支付','修改支付','支付失败','推送失败'))
+
+
+
+
+
+
+ update formmain_0232 set
+
+ field0010 =#{pay_state},
+ field0011 =#{message},
+ field0012 =#{apply_state},
+ field0014 =#{successed}
+
+ where id = #{id}
+
+
+
+
+
diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.java
new file mode 100644
index 00000000..c52ba289
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.java
@@ -0,0 +1,300 @@
+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 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 receiptFiled;//电子回单字段
+ private String summaryId;//summaryid
+ private String startDate;//单据日期
+ private String finishedflag;//流程状态
+ private String payDate;//打款日期
+ private String payResult;//支付结果
+ 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;
+ }
+}
diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.xml
new file mode 100644
index 00000000..9eb9c031
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/PaymentEntity.xml
@@ -0,0 +1,298 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ oaId,
+ payCompany,
+ payCompanyCode,
+ title,
+ tableName,
+ billName,
+ referenceNum,
+ busType,
+ payResultField,
+ payDateField,
+ receiptFiled,
+ summaryId,
+ startDate,
+ finishedflag,
+ payDate,
+ payResult,
+ payAccount,
+ payBankName,
+ amount,
+ purpose,
+ revAccount,
+ revBankName,
+ revBankType,
+ revAccountName,
+ cnapsCode,
+ receipt,
+ currency,
+ personalFlag,
+ payType
+
+
+
+
+ SELECT
+ formson_0210.id as oaId,
+ 'formson_0210' as tableName,
+ COL_SUMMARY.SUBJECT as title,
+ unit.name as payCompany,
+ '差旅费报销单' as billName,
+ 'field0072' as payResultField,
+ 'field0073' as payDateField,
+ '' 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,
+ 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,
+ '测试' as revAccountName,
+ REGEXP_REPLACE(formson_0210.field0071, '[[:space:]]', '') as cnapsCode,
+ item.showvalue as personalFlag,
+ 'OTH' as revBankType,
+ '10' as currency,
+ '202' as busType,
+ '' as receipt
+ from
+ 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_AFFAIR ON CTP_AFFAIR.object_id = COL_SUMMARY.id
+ left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070
+ left join ORG_UNIT unit on unit.id =formmain_0209.field0002
+
+
+
+ select v.* from (
+
+ ) v
+
+ v.referenceNum = #{referenceNum}
+ and v.busType = #{busType}
+ and v.amount = #{amount}
+ and v.currency = #{currency}
+ and v.payAccount = #{payAccount}
+ and v.revAccount = #{revAccount}
+ and v.revAccountName = #{revAccountName}
+ and v.revBankType = #{revBankType}
+ and v.revBankName = #{revBankName}
+ and v.cnapsCode = #{cnapsCode}
+ and v.purpose = #{purpose}
+ and v.personalFlag = #{personalFlag}
+ and v.tableName = #{tableName}
+ and v.oaId = #{oaId}
+ and v.payCompany = #{payCompany}
+ and v.payCompanyCode = #{payCompanyCode}
+ and v.title = #{title}
+ and v.billName = #{billName}
+ and v.payResult = #{payResult}
+ and v.payBankName = #{payBankName}
+ and v.payType = #{payType}
+ and v.finishedflag = #{finishedflag}
+
+
+
+
+
+
+
+ -- 差旅费报销单
+ SELECT
+ formson_0210.id as oaId, -- 主表id
+ 'formson_0210' as tableName, -- 表名
+ COL_SUMMARY.SUBJECT as title, -- 单据标题
+ unit.name as payCompany, -- 付款公司
+ '差旅费报销单' as billName,
+ 'field0072' as payResultField, -- 支付结果字段
+ 'field0073' as payDateField, -- 打款日期字段
+ '' 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, -- 支付结果
+ 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, -- 收款开户行
+ '' as revAccountName, -- 收款人
+ REGEXP_REPLACE(formson_0210.field0071, '[[:space:]]', '') as cnapsCode, -- 收款联行号
+ item.showvalue as personalFlag,-- 公私标记
+ '' as revBankType,-- 收款银行类型
+ '10' as currency,-- 币种
+ '' as busType,-- 业务类型
+ '' as receipt -- 电子回单
+ from
+ 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_AFFAIR ON CTP_AFFAIR.object_id = COL_SUMMARY.id
+ left join CTP_ENUM_ITEM item on item.id =formson_0210.field0070
+ left join ORG_UNIT unit on unit.id =formmain_0209.field0002
+ -- left join V_USER_VIEW_ALL us on us.staffid=formmain_0209.field0024
+ WHERE 1=1
+ -- and formson_0210.field0031>0
+ and CTP_AFFAIR.node_name = '发起者' and CTP_AFFAIR.COMPLETE_TIME is null and CTP_AFFAIR.STATE = 3
+
+ referenceNum = #{referenceNum}
+ and busType = #{busType}
+ and amount = #{amount}
+ and currency = #{currency}
+ and payAccount = #{payAccount}
+ and revAccount = #{revAccount}
+ and revAccountName = #{revAccountName}
+ and revBankType = #{revBankType}
+ and revBankName = #{revBankName}
+ and cnapsCode = #{cnapsCode}
+ and purpose = #{purpose}
+ and personalFlag = #{personalFlag}
+ and tableName = #{tableName}
+ and oaId = #{oaId}
+ and payCompany = #{payCompany}
+ and payCompanyCode = #{payCompanyCode}
+ and title = #{title}
+ and billName = #{billName}
+ and payBankName = #{payBankName}
+ and payType = #{payType}
+ and receipt is null and personalFlag='0' and payResult = '支付成功'
+
+
+
+
+ select v.* from (
+
+ ) v
+
+ v.referenceNum = #{referenceNum}
+ and v.busType = #{busType}
+ and v.amount = #{amount}
+ and v.currency = #{currency}
+ and v.payAccount = #{payAccount}
+ and v.revAccount = #{revAccount}
+ and v.revAccountName = #{revAccountName}
+ and v.revBankType = #{revBankType}
+ and v.revBankName = #{revBankName}
+ and v.cnapsCode = #{cnapsCode}
+ and v.purpose = #{purpose}
+ and v.personalFlag = #{personalFlag}
+ and v.tableName = #{tableName}
+ and v.oaId = #{oaId}
+ and v.payCompany = #{payCompany}
+ and v.payCompanyCode = #{payCompanyCode}
+ and v.title = #{title}
+ and v.billName = #{billName}
+ and v.payResult = #{payResult}
+ and v.payBankName = #{payBankName}
+ and v.payType = #{payType}
+ and v.finishedflag = #{finishedflag}
+
+
+
+
+
+
+
+
+
+
+ select
+
+ from
+ v_hzya_oa_cbs
+
+ referenceNum = #{referenceNum}
+ and busType = #{busType}
+ and amount = #{amount}
+ and currency = #{currency}
+ and payAccount = #{payAccount}
+ and revAccount = #{revAccount}
+ and revAccountName = #{revAccountName}
+ and revBankType = #{revBankType}
+ and revBankName = #{revBankName}
+ and cnapsCode = #{cnapsCode}
+ and purpose = #{purpose}
+ and personalFlag = #{personalFlag}
+ and tableName = #{tableName}
+ and oaId = #{oaId}
+ and payCompany = #{payCompany}
+ and payCompanyCode = #{payCompanyCode}
+ and title = #{title}
+ and billName = #{billName}
+ and payResult = #{payResult}
+ and payBankName = #{payBankName}
+ and payType = #{payType}
+ and (payResult='支付中'
+ or payResult not in ('审批撤销','审批拒绝','处理失败','退票','支付成功','取消支付','修改支付','支付失败'))
+ and personalFlag='0'
+
+
+
+
+
+
+
+
+ update ${tableName} set
+
+ ${payDateField} =#{payDate},
+ ${payResultField} =#{payResult}
+
+ where id = #{oaId}
+
+
+
+
+ update ${tableName} set ${receiptFiled}=#{receipt} where id = #{oaId} and ${receiptFiled} is null
+
+
+
diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.java
new file mode 100644
index 00000000..e1d66a2d
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/cbs8/entity/TransactionDetailEntity.xml
new file mode 100644
index 00000000..3fa7fc60
--- /dev/null
+++ b/service/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
+
+
+
+
+ select
+
+ from
+ formmain_0233
+
+ id = #{id}
+ and field0001 = #{accountNo}
+ and field0002 = #{accountName}
+ and field0003 = #{openBank}
+ and field0004 = #{bankType}
+ and field0005 = #{transactionSerialNumber}
+ and field0006 = #{bankTransactionDate}
+ and field0007 = #{bankSerialNumber}
+ and field0008 = #{currency}
+ and field0009 = #{incurredAmount}
+ and field0010 = #{purpose}
+ and field0011 = #{digest}
+ and field0012 = #{oppositeAccount}
+ and field0013 = #{oppositeName}
+ and field0014 = #{oppositeOpeningBank}
+ and field0015 = #{remark}
+
+
+
+
+ select
+ field0005 as transactionSerialNumber
+ from
+ formmain_0233
+
+ id = #{id}
+ and field0001 = #{accountNo}
+ and field0002 = #{accountName}
+ and field0003 = #{openBank}
+ and field0004 = #{bankType}
+ and field0005 = #{transactionSerialNumber}
+ and field0006 >= #{bankTransactionDate}
+ and field0007 = #{bankSerialNumber}
+ and field0008 = #{currency}
+ and field0009 = #{incurredAmount}
+ and field0010 = #{purpose}
+ and field0011 = #{digest}
+ and field0012 = #{oppositeAccount}
+ and field0013 = #{oppositeName}
+ and field0014 = #{oppositeOpeningBank}
+ and field0015 = #{remark}
+
+
+
diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentService.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentService.java
new file mode 100644
index 00000000..707c226b
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/IAgentPaymentService.java
@@ -0,0 +1,31 @@
+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 entity
+ * @return
+ * @throws Exception
+ */
+ List queryDetails(AgentPaymentDetailEntity entity)throws Exception;
+}
diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/ICbsLogService.java
new file mode 100644
index 00000000..7160c21f
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/IPaymentService.java
new file mode 100644
index 00000000..4243084c
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/ITransactionDetailService.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/ITransactionDetailService.java
new file mode 100644
index 00000000..61126686
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentServiceImpl.java
new file mode 100644
index 00000000..e06b2998
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/AgentPaymentServiceImpl.java
@@ -0,0 +1,41 @@
+package com.hzya.frame.seeyon.cbs8.service.impl;
+
+import com.hzya.frame.basedao.service.impl.BaseService;
+import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentDetailEntity;
+import com.hzya.frame.seeyon.cbs8.entity.AgentPaymentEntity;
+import com.hzya.frame.seeyon.cbs8.service.IAgentPaymentService;
+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 {
+ /**
+ * 查询待支付待代发代扣 主表
+ *
+ * @param entity
+ * @return
+ * @throws Exception
+ */
+ @Override
+ public List queryUnpaid(AgentPaymentEntity entity) throws Exception {
+ return null;
+ }
+
+ /**
+ * 查询明细表
+ *
+ * @param entity
+ * @return
+ * @throws Exception
+ */
+ @Override
+ public List queryDetails(AgentPaymentDetailEntity entity) throws Exception {
+ return null;
+ }
+}
diff --git a/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java
new file mode 100644
index 00000000..bb2df76f
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/CbsLogServiceImpl.java
@@ -0,0 +1,199 @@
+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.cbs8.util.PayState;
+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.RestUtil;
+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 RestUtil 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 (PayState.h.getValue().equals(pay_state)
+ || PayState.three.getValue().equals(pay_state)
+ || PayState.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/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java
new file mode 100644
index 00000000..3c59ab96
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/PaymentServiceImpl.java
@@ -0,0 +1,145 @@
+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.cbs8.util.PayState;
+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 org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+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(PayState.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.getPayDateField())
+ && StrUtil.isNotEmpty(entity.getPayResultField())){
+ 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/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/TransactionDetailServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/cbs8/service/impl/TransactionDetailServiceImpl.java
new file mode 100644
index 00000000..21cee3ea
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/dao/ICtpAttachmentDao.java b/service/src/main/java/com/hzya/frame/seeyon/dao/ICtpAttachmentDao.java
index 73ae2711..5c64e35f 100644
--- a/service/src/main/java/com/hzya/frame/seeyon/dao/ICtpAttachmentDao.java
+++ b/service/src/main/java/com/hzya/frame/seeyon/dao/ICtpAttachmentDao.java
@@ -8,14 +8,14 @@ import java.util.List;
public interface ICtpAttachmentDao extends IBaseDao {
//更新数据
- @DS("ht_oa_sqlserver")
+ @DS("#ctpAttachmentEntity.dataSourceCode")
int updateCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity);
//根据fiel_url查询附件业务记录,如果存在则更新,如果不存在则新增
- @DS("ht_oa_sqlserver")
+ @DS("#ctpAttachmentEntity.dataSourceCode")
List queryCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity);
//新增
- @DS("ht_oa_sqlserver")
+ @DS("#ctpAttachmentEntity.dataSourceCode")
CtpAttachmentEntity saveCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity);
}
diff --git a/service/src/main/java/com/hzya/frame/seeyon/dao/ICtpFileDao.java b/service/src/main/java/com/hzya/frame/seeyon/dao/ICtpFileDao.java
new file mode 100644
index 00000000..87961648
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpAttachmentDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpAttachmentDaoImpl.java
index 2d11fe25..080c28bc 100644
--- a/service/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpAttachmentDaoImpl.java
+++ b/service/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpAttachmentDaoImpl.java
@@ -11,19 +11,19 @@ import java.util.List;
@Repository(value = "ctpAttachmentDaoImpl")
public class
CtpAttachmentDaoImpl extends MybatisGenericDao implements ICtpAttachmentDao {
- @DS("ht_oa_sqlserver")
+ @DS("#ctpAttachmentEntity.dataSourceCode")
@Override
public int updateCtpAttachment(CtpAttachmentEntity ctpAttachmentEntity) {
return super.update("com.hzya.frame.seeyon.dao.impl.CtpAttachmentDaoImpl.entity_update",ctpAttachmentEntity);
}
- @DS("ht_oa_sqlserver")
+ @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("ht_oa_sqlserver")
+ @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/service/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpFileDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/dao/impl/CtpFileDaoImpl.java
new file mode 100644
index 00000000..8b80d3d7
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.java b/service/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.java
new file mode 100644
index 00000000..61ebce25
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/entity/CtpFileEntity.xml
new file mode 100644
index 00000000..3f3c8cad
--- /dev/null
+++ b/service/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
+
+
+
+
+
+ select
+
+ from
+ ctp_file
+
+ id = #{id}
+ and filename = #{filename}
+
+
+
+
+
diff --git a/service/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java b/service/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java
new file mode 100644
index 00000000..a0ec8db8
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java
new file mode 100644
index 00000000..3a753554
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java b/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java
new file mode 100644
index 00000000..1a9308de
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml
new file mode 100644
index 00000000..736d5914
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SELECT
+ body.id as id,
+ field0070 AS bill_date,
+ field0057 AS primal_money,
+ field0019 AS pk_oppaccount,
+ field0082 AS pk_supplier,
+ 'formson_0222' as table_name,
+ 'field0084' as field_name
+ FROM formmain_0093 main
+ LEFT JOIN formson_0222 body ON main.id = body.formmain_id
+ WHERE field0070 IS NOT null and field0084 is null
+ union all
+ SELECT
+ body.id as id,
+ field0073 AS bill_date,
+ field0031 AS primal_money,
+ field0042 AS pk_oppaccount,
+ field0077 AS pk_supplier,
+ 'formson_0210' as table_name,
+ 'field0078' as field_name
+ FROM formmain_0209 main
+ LEFT JOIN formson_0210 body ON main.id = body.formmain_id
+ WHERE field0073 IS NOT null and field0078 is null
+ union all
+ SELECT
+ body.id as id,
+ field0053 AS bill_date,
+ field0041 AS primal_money,
+ field0024 AS pk_oppaccount,
+ field0057 AS pk_supplier,
+ 'formson_0223' as table_name,
+ 'field0058' as field_name
+ FROM formmain_0094 main
+ LEFT JOIN formson_0223 body ON main.id = body.formmain_id
+ WHERE field0053 IS NOT NULL and field0058 is null
+
+
+
+
+ update ${tableName} set ${fieldName} = #{state} where id = #{id}
+
+
+
+
+
diff --git a/service/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java b/service/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java
new file mode 100644
index 00000000..caad27a7
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java
new file mode 100644
index 00000000..8eac7caa
--- /dev/null
+++ b/service/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.bip.v3.v2207.util.BipUtil;
+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.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 = BipUtil.getBipToken("yonyou","8000230000");
+ JSONObject main = bindingAdd(pay);
+ logger.info("工程付款单调用中台生成BIP付款结算单推送报文{}",main.toString());
+ String result = BipUtil.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/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java b/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/IRecBillDao.java
new file mode 100644
index 00000000..7668f65e
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java b/service/src/main/java/com/hzya/frame/seeyon/recbill/dao/impl/RecBillDaoImpl.java
new file mode 100644
index 00000000..3682e8a2
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java b/service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.java
new file mode 100644
index 00000000..5a271b5d
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml b/service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml
new file mode 100644
index 00000000..21f3fc7e
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/seeyon/recbill/entity/RecBillEntity.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ SELECT
+ field0002 AS pk_org,
+ field0006 AS bill_date,
+ field0009 AS primal_money,
+ field0001 AS pk_account,
+ field0013 AS pk_customer,
+ field0012 AS pk_oppaccount,
+ 'formmain_0233' as table_name,
+ 'field0016' as field_name
+ FROM formmain_0233
+ WHERE field0016 IS null
+
+
+
+
+ update ${tableName} set ${fieldName} = #{state} where id = #{id}
+
+
+
+
+
diff --git a/service/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java b/service/src/main/java/com/hzya/frame/seeyon/recbill/service/IRecBillService.java
new file mode 100644
index 00000000..96930a43
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java
new file mode 100644
index 00000000..78497edf
--- /dev/null
+++ b/service/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.bip.v3.v2207.util.BipUtil;
+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.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 = BipUtil.getBipToken("yonyou","8000230000");
+ JSONObject main = bindingAdd(pay);
+ logger.info("银行流水收款信息数据{}",main.toString());
+ String result = BipUtil.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/service/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java b/service/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java
new file mode 100644
index 00000000..3af20d9d
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/service/ICtpFileService.java b/service/src/main/java/com/hzya/frame/seeyon/service/ICtpFileService.java
new file mode 100644
index 00000000..b34826ef
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java b/service/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java
index d7e93dce..4344c648 100644
--- a/service/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java
+++ b/service/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java
@@ -55,6 +55,4 @@ public interface ISeeYonInterFace {
* @throws Exception
*/
JsonResultEntity thirdInterfaceSeeYonDefinitionRePush(JSONObject jsonObject) throws Exception;
-
-
}
diff --git a/service/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java
new file mode 100644
index 00000000..0ee1e68f
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/service/impl/CtpFileServiceImpl.java b/service/src/main/java/com/hzya/frame/seeyon/service/impl/CtpFileServiceImpl.java
new file mode 100644
index 00000000..31f96553
--- /dev/null
+++ b/service/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/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java b/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java
new file mode 100644
index 00000000..dc6195f2
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/seeyon/util/RestUtil.java
@@ -0,0 +1,127 @@
+package com.hzya.frame.seeyon.util;
+
+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.entity.CtpFileEntity;
+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;
+
+/**
+ * @Description 致远rest接口工具类
+ * @Author xiangerlin
+ * @Date 2024/6/17 15:49
+ **/
+@Component
+public class RestUtil {
+
+ @Autowired
+ private ISysApplicationApiService sysApplicationApiService;
+ static Logger logger = LoggerFactory.getLogger(RestUtil.class);
+
+ private RestUtil() {
+ }
+
+
+ /**
+ * 附件上传
+ * @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;
+ }
+
+ /**
+ * 获取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);
+ if (null != sysApp){
+ HashMap hashMap = new HashMap<>();
+ String app_url = 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);
+ }
+ }
+ if (StrUtil.isNotEmpty(login_name)){
+ hashMap.put("loginName",login_name);
+ }
+ 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");
+ }
+ }
+ }else {
+ throw new BaseSystemException("api_code不能为空");
+ }
+ 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/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.xml b/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.xml
index edea0765..f9065b2b 100644
--- a/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.xml
+++ b/service/src/main/java/com/hzya/frame/sys/file/download/entity/FileDownloadEntity.xml
@@ -56,7 +56,7 @@
from sys_file
- id=#{id}
+ id=#{id}
and filename = #{filename}
and filesavename = #{filesavename}
and type = #{type}
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/IMasterDataDao.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/IMasterDataDao.java
index 8fb8ce73..a598068b 100644
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/IMasterDataDao.java
+++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/IMasterDataDao.java
@@ -2,6 +2,7 @@ package com.hzya.frame.sysnew.comparison.masterData.dao;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.IBaseService;
+import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
import java.util.HashMap;
@@ -20,4 +21,5 @@ public interface IMasterDataDao extends IBaseService {
* **/
@DS("swu8c")
List> queryArchives(String str);
+ List> queryArchivesByDataSource(String str , MdmModuleSourceEntity entity);
}
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/impl/MasterDataDaoImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/impl/MasterDataDaoImpl.java
index ad9f3588..af057aa8 100644
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/impl/MasterDataDaoImpl.java
+++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/dao/impl/MasterDataDaoImpl.java
@@ -3,6 +3,7 @@ package com.hzya.frame.sysnew.comparison.masterData.dao.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.execsql.service.IExecSqlService;
+import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
import com.hzya.frame.sysnew.comparison.masterData.dao.IMasterDataDao;
import org.springframework.beans.factory.annotation.Autowired;
@@ -28,4 +29,15 @@ public class MasterDataDaoImpl extends BaseService imp
return null;
}
}
+ @DS("#entity.dataSourceCode")
+ @Override
+ public List> queryArchivesByDataSource(String str, MdmModuleSourceEntity entity) {
+ try {
+ List> hashMaps = execSqlService.execSelectSql(str, "");
+ return hashMaps;
+ }catch (Exception e){
+ logger.info("U8C主数据档案用户档案没有需要同步中台的数据");
+ return null;
+ }
+ }
}
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataOrgsService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataOrgsService.java
deleted file mode 100644
index 1e08f408..00000000
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataOrgsService.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.hzya.frame.sysnew.comparison.masterData.service;
-
-import com.alibaba.fastjson.JSONObject;
-import com.hzya.frame.basedao.service.IBaseService;
-import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
-import com.hzya.frame.web.entity.JsonResultEntity;
-
-public interface IMasterDataOrgsService extends IBaseService {
- /**
- *
- * @content 查询组织档案
- * @Param
- * @Return
- * @Author hecan
- * @Date 2024/6/4 16:57
- * **/
- JsonResultEntity queryOrgsArchives(JSONObject jsonObject);
-
-}
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataProjectService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataProjectService.java
deleted file mode 100644
index 6b6799c1..00000000
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataProjectService.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.hzya.frame.sysnew.comparison.masterData.service;
-
-import com.alibaba.fastjson.JSONObject;
-import com.hzya.frame.basedao.service.IBaseService;
-import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
-import com.hzya.frame.web.entity.JsonResultEntity;
-
-public interface IMasterDataProjectService extends IBaseService {
-
- /**
- *
- * @content 查询项目档案
- * @Param
- * @Return
- * @Author hecan
- * @Date 2024/6/6 16:10
- * **/
- JsonResultEntity queryProjectArchives(JSONObject jsonObject);
-}
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataService.java
new file mode 100644
index 00000000..b9f44b08
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataService.java
@@ -0,0 +1,19 @@
+package com.hzya.frame.sysnew.comparison.masterData.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.basedao.service.IBaseService;
+import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
+import com.hzya.frame.web.entity.JsonResultEntity;
+
+public interface IMasterDataService extends IBaseService {
+
+/**
+*
+* @content 查询经过配置的主数据信息进行同步主数据档案接口
+* @author laborer
+* @date 2024/6/24 0024 9:34
+*
+*/
+
+ JsonResultEntity queryArchives(JSONObject jsonObject);
+}
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java
deleted file mode 100644
index e382aabf..00000000
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataOrgsServiceImpl.java
+++ /dev/null
@@ -1,138 +0,0 @@
-package com.hzya.frame.sysnew.comparison.masterData.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.dateutil.DateUtil;
-import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl;
-import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
-import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
-import com.hzya.frame.sysnew.comparison.masterData.dao.impl.MasterDataDaoImpl;
-import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataOrgsService;
-import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataProjectService;
-import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl;
-import com.hzya.frame.web.entity.BaseResult;
-import com.hzya.frame.web.entity.JsonResultEntity;
-import org.apache.commons.collections.CollectionUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-
-@Service("masterDataOrgsServiceImpl")
-public class MasterDataOrgsServiceImpl extends BaseService implements IMasterDataOrgsService {
-
- @Autowired
- private MasterDataDaoImpl masterDataDaoImpl;
- @Autowired
- private ComparisonServiceImpl comparisonServiceimpl;
- @Autowired
- private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl;
-
- private String ts = "";
- //查询用户档案并同步中台
- @Override
- public JsonResultEntity queryOrgsArchives(JSONObject json) {
- JSONObject jsonObject = json.getJSONObject("jsonStr");
- //查询主数据来源表,根据来源类型为插件得进行分类,获取来源名称和编码
- List list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType();
- if (CollectionUtils.isEmpty(list)) {
- logger.info("数据来源表中没有类型为插件得数据,无法获取来源名称和来源编码");
- return BaseResult.getFailureMessageEntity("数据来源表无插件类型");
- }
- for (MdmModuleSourceEntity mdmModuleSourceEntity : list) {
- //此处应该根据来源编码进行case ,暂时测试使用U8C
- switch (mdmModuleSourceEntity.getPluginCode()) {
- case "MdmOrgPlugin":
- if (null == ts || "".equals(ts)) {
- ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
- }
- ts = "'" + ts + "'";
- StringBuffer stringBuffer = new StringBuffer();
- stringBuffer.append("select pk_corp as id,unitcode as org_code,unitname as org_name,");
- stringBuffer.append("saleaddr as org_address,countryarea as org_countryzone,memo as org_memo,");
- stringBuffer.append("industry as org_ncindustry,fathercorp as org_fatherorg,legalbodycode as org_principal,");
- stringBuffer.append("phone1 as org_tel from bd_corp where dr='0' and ts>"+ts);
- try {
- List> hashMaps = masterDataDaoImpl.queryArchives(stringBuffer.toString());
- logger.info("查询出来的值为:{}",hashMaps);
- if (null != hashMaps && hashMaps.size() > 0) {
- ParametricAssembly(mdmModuleSourceEntity,hashMaps,"10001");
- } else {
- logger.info("U8C主数据档案组织档案没有需要同步中台的数据");
- return null;
- }
- } catch (Exception e) {
- logger.info("查询主数据档案组织档案错误:{}", e.getMessage());
- }
- break;
- default:
- break;
- }
- }
- return BaseResult.getSuccessMessageEntity("组织档案同步成功");
- }
-
-
-
-
-
- //查询档案参数组装
- private void ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List> hashMaps,String mdmCode){
- for (HashMap hashMap : hashMaps) {
- JSONObject jsonObjectUser = new JSONObject();
- JSONObject jsonStr = new JSONObject();
- jsonObjectUser.put("id", hashMap.get("id"));
- jsonObjectUser.put("mdmCode", mdmCode);
- jsonStr.put("jsonStr", jsonObjectUser);
- //先查询编码和名称查询是否存在
- JsonResultEntity jsonResultEntity = comparisonServiceimpl.queryEntityPage(jsonStr);
- Object attribute = jsonResultEntity.getAttribute();
- logger.info("得到的attribute值为:{}", attribute);
- JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute);
- JSONArray jsonArrayList = jsonObjectAttribute.getJSONArray("list");
- //如果jsonArrayList为null,说明没有值,在表中不存在
- if (jsonArrayList == null || jsonArrayList.size() == 0) {
- //将查询出来得数据调用通用接口新增,保存到表中
- JSONObject main = new JSONObject();
- for(String key:hashMap.keySet()) {
- main.put(key, hashMap.get(key));
- }
- jsonObjectUser.put("main", main);
- jsonObjectUser.put("appName","数智中台");
- jsonObjectUser.put("appCode","800004");
- jsonObjectUser.put("optionName", "数智中台");
- jsonStr.put("jsonStr", jsonObjectUser);
- try {
- comparisonServiceimpl.saveEntity(jsonStr);
- } catch (Exception e) {
- logger.info("U8C主数据档案新增档案失败,失败原因:{}",e.getMessage());
- }
- } else {
- for (Object o : jsonArrayList) {
- JSONObject jsonObjectUpdate = JSON.parseObject(String.valueOf(o));
- String id = jsonObjectUpdate.getString("id");
- JSONObject main = new JSONObject();
- for(String key:hashMap.keySet()) {
- main.put(key, hashMap.get(key));
- main.put("id",id);
- }
- jsonObjectUser.put("main", main);
- jsonObjectUser.put("appName","数智中台");
- jsonObjectUser.put("appCode","800004");
- jsonObjectUser.put("optionName", "数智中台");
- jsonStr.put("jsonStr", jsonObjectUser);
- try {
- comparisonServiceimpl.updateEntity(jsonStr);
- } catch (Exception e) {
- logger.info("U8C主数据档案更新档案失败,失败原因:{}", e.getMessage());
- }
- }
- }
- }
- }
-
-}
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataProjectServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataProjectServiceImpl.java
deleted file mode 100644
index ca6639a2..00000000
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataProjectServiceImpl.java
+++ /dev/null
@@ -1,132 +0,0 @@
-package com.hzya.frame.sysnew.comparison.masterData.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.dateutil.DateUtil;
-import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl;
-import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
-import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
-import com.hzya.frame.sysnew.comparison.masterData.dao.impl.MasterDataDaoImpl;
-import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataProjectService;
-import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl;
-import com.hzya.frame.web.entity.BaseResult;
-import com.hzya.frame.web.entity.JsonResultEntity;
-import org.apache.commons.collections.CollectionUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-
-@Service("masterDataProjectServiceImpl")
-public class MasterDataProjectServiceImpl extends BaseService implements IMasterDataProjectService {
-
- @Autowired
- private MasterDataDaoImpl masterDataDaoImpl;
- @Autowired
- private ComparisonServiceImpl comparisonServiceimpl;
- @Autowired
- private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl;
-
- private String ts = "";
-
- //同步项目档案
- public JsonResultEntity queryProjectArchives(JSONObject json){
- JSONObject jsonObject = json.getJSONObject("jsonStr");
- //查询主数据来源表,根据来源类型为插件得进行分类,获取来源名称和编码
- List list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType();
- if (CollectionUtils.isEmpty(list)) {
- logger.info("数据来源表中没有类型为插件得数据,无法获取来源名称和来源编码");
- return BaseResult.getFailureMessageEntity("数据来源表无插件类型");
- }
- for (MdmModuleSourceEntity mdmModuleSourceEntity : list) {
- //此处应该根据来源编码进行case ,暂时测试使用U8C
- switch (mdmModuleSourceEntity.getPluginCode()) {
- case "MdmProjectPlugin":
- if (null == ts || "".equals(ts)) {
- ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
- }
- ts = "'" + ts + "'";
- StringBuffer stringBuffer = new StringBuffer();
- stringBuffer.append("select pk_jobbasfil as id,jobcode as project_code, jobname as project_name from bd_jobbasfil where dr='0' and ts>" + ts);
- try {
- List> hashMaps = masterDataDaoImpl.queryArchives(stringBuffer.toString());
- logger.info("查询出来的值为:{}",hashMaps);
- if (null != hashMaps && hashMaps.size() > 0) {
- ParametricAssembly(mdmModuleSourceEntity,hashMaps,"10002");
- } else {
- logger.info("U8C主数据档案项目档案没有需要同步中台的数据");
- return null;
- }
- } catch (Exception e) {
- logger.info("查询主数据档案项目档案错误:{}", e.getMessage());
- }
- break;
- default:
- break;
- }
- }
- return BaseResult.getSuccessMessageEntity("项目档案同步成功");
- }
-
-
- //查询档案参数组装
- public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List> hashMaps,String mdmCode){
- for (HashMap hashMap : hashMaps) {
- JSONObject jsonObjectUser = new JSONObject();
- JSONObject jsonStr = new JSONObject();
- jsonObjectUser.put("id", hashMap.get("id"));
- jsonObjectUser.put("mdmCode", mdmCode);
- jsonStr.put("jsonStr", jsonObjectUser);
- //先查询编码和名称查询是否存在
- JsonResultEntity jsonResultEntity = comparisonServiceimpl.queryEntityPage(jsonStr);
- Object attribute = jsonResultEntity.getAttribute();
- logger.info("得到的attribute值为:{}", attribute);
- JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute);
- JSONArray jsonArrayList = jsonObjectAttribute.getJSONArray("list");
- //如果jsonArrayList为null,说明没有值,在表中不存在
- if (jsonArrayList == null || jsonArrayList.size() == 0) {
- //将查询出来得数据调用通用接口新增,保存到表中
- JSONObject main = new JSONObject();
- for(String key:hashMap.keySet()) {
- main.put(key, hashMap.get(key));
- }
- jsonObjectUser.put("main", main);
- jsonObjectUser.put("appName","数智中台");
- jsonObjectUser.put("appCode","800004");
- jsonObjectUser.put("optionName", "数智中台");
- jsonStr.put("jsonStr", jsonObjectUser);
- try {
- comparisonServiceimpl.saveEntity(jsonStr);
- } catch (Exception e) {
- logger.info("U8C主数据档案新增用户档案失败,失败原因:{}",e.getMessage());
- }
- } else {
- for (Object o : jsonArrayList) {
- JSONObject jsonObjectUpdate = JSON.parseObject(String.valueOf(o));
- String id = jsonObjectUpdate.getString("id");
- JSONObject main = new JSONObject();
- for(String key:hashMap.keySet()) {
- main.put(key, hashMap.get(key));
- main.put("id",id);
- }
- jsonObjectUser.put("main", main);
- jsonObjectUser.put("appName","数智中台");
- jsonObjectUser.put("appCode","800004");
- jsonObjectUser.put("optionName", "数智中台");
- jsonStr.put("jsonStr", jsonObjectUser);
- try {
- comparisonServiceimpl.updateEntity(jsonStr);
- } catch (Exception e) {
- logger.info("U8C主数据档案更新用户档案失败,失败原因:{}", e.getMessage());
- }
- }
- }
- }
- return null;
- }
-
-}
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataServiceImpl.java
new file mode 100644
index 00000000..2f0cab38
--- /dev/null
+++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataServiceImpl.java
@@ -0,0 +1,256 @@
+package com.hzya.frame.sysnew.comparison.masterData.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.basedao.service.impl.BaseService;
+import com.hzya.frame.dateutil.DateUtil;
+import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl;
+import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
+import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
+import com.hzya.frame.sysnew.comparison.masterData.dao.impl.MasterDataDaoImpl;
+import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService;
+import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl;
+import com.hzya.frame.web.entity.BaseResult;
+import com.hzya.frame.web.entity.JsonResultEntity;
+import com.hzya.frame.web.exception.BaseSystemException;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+@Service("MasterDataServiceImpl")
+public class MasterDataServiceImpl extends BaseService implements IMasterDataService {
+
+ @Autowired
+ private MasterDataDaoImpl masterDataDaoImpl;
+ @Autowired
+ private ComparisonServiceImpl comparisonServiceimpl;
+ @Autowired
+ private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl;
+
+ private String ts = "";
+
+ /**
+ *
+ * @content 查询经过配置的主数据信息进行同步主数据档案接口
+ * @author laborer
+ * @date 2024/6/24 0024 9:56
+ *
+ */
+
+ @Override
+ public JsonResultEntity queryArchives(JSONObject json){
+ JSONObject jsonObject = json.getJSONObject("jsonStr");
+ //查询主数据来源表,根据来源类型为插件得进行分类,获取来源名称和编码
+ List list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType();
+ if (CollectionUtils.isEmpty(list)) {
+ logger.info("数据来源表中没有类型为插件得数据,无法获取来源名称和来源编码");
+ return BaseResult.getFailureMessageEntity("数据来源表无插件类型");
+ }
+ for (MdmModuleSourceEntity mdmModuleSourceEntity : list) {
+ String tableName = "";
+ try {
+ //通过不同的应用类型用于拼接sql
+ String appTyp = mdmModuleSourceEntity.getAppType();
+ String dbCode = mdmModuleSourceEntity.getDbCode();
+ String mdmCode = mdmModuleSourceEntity.getMdmCode();
+ List listAll = new ArrayList<>();
+ if(!"10004".equals(mdmCode)){
+ continue;
+ }
+ switch (appTyp) {//1、致远OA 2、用友U8C 3、用友BIP
+ case "1":
+ //通过主数据编码判断,不同的接口走不通的查询逻辑
+ switch (mdmCode){
+ case "10003"://致远用户信息
+ tableName = "mdm_user";
+ listAll = bindingUser(jsonObject, mdmModuleSourceEntity, dbCode);
+ break;
+ case "10004"://致远客商信息
+ tableName = "mdm_customer";
+ listAll = binDingCust(jsonObject, mdmModuleSourceEntity, dbCode);
+ break;
+ case "10007"://致远客商信息
+ tableName = "mdm_bank";
+ listAll = binDingBank(jsonObject, mdmModuleSourceEntity, dbCode);
+ break;
+ default:
+ logger.info("未匹配到主数据的编码,请检查");
+ break;
+ }
+ }
+ //调用主数据接口进行数据推送或更新
+ if (null != listAll && listAll.size() > 0) {
+ ParametricAssembly(mdmModuleSourceEntity, listAll, mdmCode, tableName);
+ } else {
+ logger.info("U8C主数据档案没有需要同步中台的数据");
+ }
+ } catch (Exception e) {
+ logger.info("主数据同步错误:{}",e.getMessage());
+ e.printStackTrace();
+ }
+ }
+ return BaseResult.getSuccessMessageEntity("主数据同步成功");
+ }
+ //绑定银行
+ private List binDingBank(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode)throws Exception {
+ List list = new ArrayList<>();
+ StringBuffer sb = new StringBuffer();
+ if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){
+ String code = jsonObject.getString("code");
+ sb.append(" and a.code = '"+code+"'");
+ }else{
+ ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
+ sb.append(" and a.update_time >= '"+ts+"'");
+ }
+ StringBuffer stringBuffer = new StringBuffer();
+ stringBuffer.append("select id as data_id,a.* from bank a");
+ mdmModuleSourceEntity.setDataSourceCode(dbCode);
+ List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
+ int i = 0;
+ if(CollectionUtils.isNotEmpty(hashMaps)){
+ for (HashMap hashMap : hashMaps) {
+ JSONObject main = new JSONObject();
+ JSONObject mdm = new JSONObject();
+ for(String key:hashMap.keySet()) {
+ mdm.put(key, hashMap.get(key));
+ }
+ main.put("mdm_bank",mdm);
+ list.add(main);
+ }
+ }
+ return list;
+ }
+
+ //绑定客户档案
+ private List binDingCust(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode)throws Exception {
+ List list = new ArrayList<>();
+ StringBuffer sb = new StringBuffer();
+ if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){
+ String code = jsonObject.getString("code");
+ sb.append(" and a.code = '"+code+"'");
+ }else{
+ ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
+ sb.append(" and a.update_time >= '"+ts+"'");
+ }
+ StringBuffer stringBuffer = new StringBuffer();
+ stringBuffer.append("SELECT id as data_id,field0013 AS code,field0014 AS name,field0016 AS pk_custclass,field0015 AS shortname,field0012 AS pk_org FROM formmain_0226 a WHERE 1=1 ");
+ mdmModuleSourceEntity.setDataSourceCode(dbCode);
+ List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
+ if(CollectionUtils.isNotEmpty(hashMaps)){
+ for (HashMap hashMap : hashMaps) {
+ JSONObject main = new JSONObject();
+ JSONObject mdm_cust = new JSONObject();
+ for(String key:hashMap.keySet()) {
+ mdm_cust.put(key, hashMap.get(key));
+ }
+ //获取明细信息
+ Long formmainId = (Long) hashMap.get("data_id");
+ StringBuffer stringBufferDetails = new StringBuffer();
+ stringBufferDetails.append("SELECT id as data_id ,field0023 AS pk_bankdoc,field0024 AS accnum,field0025 AS combinenum FROM formson_0229 WHERE formmain_id = '"+formmainId+"' " );
+ List> hashMapsDetails = masterDataDaoImpl.queryArchivesByDataSource(stringBufferDetails.toString(),mdmModuleSourceEntity);
+ JSONArray mdm_customer_bank = new JSONArray();
+ if(CollectionUtils.isNotEmpty(hashMapsDetails)){
+ for (HashMap detailsMap : hashMapsDetails) {
+ JSONObject details = new JSONObject();
+ for (String key : detailsMap.keySet()) {
+ details.put(key, detailsMap.get(key));
+ }
+ mdm_customer_bank.add(details);
+ }
+ }
+ main.put("mdm_customer_bank",mdm_customer_bank);
+ main.put("mdm_customer",mdm_cust);
+ list.add(main);
+ }
+ }
+ return list;
+ }
+
+ //绑定OA用户参数
+ private List bindingUser(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode)throws Exception {
+ List list = new ArrayList<>();
+ StringBuffer sb = new StringBuffer();
+ if(null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("code"))){
+ String code = jsonObject.getString("code");
+ sb.append(" and a.code = '"+code+"'");
+ }else{
+ ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
+ sb.append(" and a.update_time >= '"+ts+"'");
+ }
+ StringBuffer stringBuffer = new StringBuffer();
+ stringBuffer.append("select a.id as data_id, a.name as user_name, e.LOGIN_NAME as user_code FROM org_member a left join org_principal e on a.id = e.MEMBER_ID" +
+ " WHERE 1=1 " + sb.toString());
+ mdmModuleSourceEntity.setDataSourceCode(dbCode);
+ List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
+ int i = 0;
+ if(CollectionUtils.isNotEmpty(hashMaps)){
+ for (HashMap hashMap : hashMaps) {
+ JSONObject main = new JSONObject();
+ JSONObject mdm_user = new JSONObject();
+ for(String key:hashMap.keySet()) {
+ mdm_user.put(key, hashMap.get(key));
+ }
+ main.put("mdm_user",mdm_user);
+ list.add(main);
+ }
+ }
+ return list;
+ }
+
+
+ //查询档案参数组装
+ public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List hashMaps,String mdmCode,String tableName)throws Exception{
+ for (JSONObject hashMap : hashMaps) {
+ JSONObject main = hashMap.getJSONObject(tableName);
+
+ JSONObject jsonObjectUser = new JSONObject();
+ JSONObject jsonStr = new JSONObject();
+ jsonObjectUser.put("data_id", main.get("data_id"));
+ jsonObjectUser.put("mdmCode", mdmCode);
+ jsonStr.put("jsonStr", jsonObjectUser);
+ //先查询编码和名称查询是否存在
+ JsonResultEntity jsonResultEntity = comparisonServiceimpl.queryEntityPage(jsonStr);
+ Object attribute = jsonResultEntity.getAttribute();
+ logger.info("得到的attribute值为:{}", attribute);
+ JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute);
+ JSONArray jsonArrayList = jsonObjectAttribute.getJSONArray("list");
+ //如果jsonArrayList为null,说明没有值,在表中不存在
+ if (jsonArrayList == null || jsonArrayList.size() == 0) {
+// //将查询出来得数据调用通用接口新增,保存到表中
+// JSONObject main = new JSONObject();
+// for(String key:hashMap.keySet()) {
+// main.put(key, hashMap.get(key));
+// }
+// jsonObjectUser.put("main", main);
+ hashMap.put("appName","数智中台");
+ hashMap.put("appCode","800004");
+ hashMap.put("mdmCode", mdmCode);
+ hashMap.put("optionName", "数智中台");
+ jsonStr.put("jsonStr", hashMap);
+ JsonResultEntity result = comparisonServiceimpl.saveEntity(jsonStr);
+ if(!result.isFlag()){
+ throw new BaseSystemException("主数据保存失败"+ result.getMsg());
+ }
+ } else {
+ hashMap.put("appName","数智中台");
+ hashMap.put("appCode","800004");
+ hashMap.put("mdmCode", mdmCode);
+ hashMap.put("optionName", "数智中台");
+ jsonStr.put("jsonStr", hashMap);
+ JsonResultEntity result = comparisonServiceimpl.updateEntity(jsonStr);
+ if(!result.isFlag()){
+ throw new BaseSystemException("主数据更新失败"+ result.getMsg());
+ }
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/service/src/main/java/com/hzya/frame/u8c/ax/entity/VoucherDetails.java b/service/src/main/java/com/hzya/frame/u8c/ax/entity/VoucherDetails.java
index ef8798d6..2c47bdb7 100644
--- a/service/src/main/java/com/hzya/frame/u8c/ax/entity/VoucherDetails.java
+++ b/service/src/main/java/com/hzya/frame/u8c/ax/entity/VoucherDetails.java
@@ -12,6 +12,24 @@ public class VoucherDetails {
private String localdebitamount;
private String pk_accsubj;
private String pk_currtype;
+ private String debitquantity;
+ private String price;
+
+ public String getDebitquantity() {
+ return debitquantity;
+ }
+
+ public void setDebitquantity(String debitquantity) {
+ this.debitquantity = debitquantity;
+ }
+
+ public String getPrice() {
+ return price;
+ }
+
+ public void setPrice(String price) {
+ this.price = price;
+ }
public List getAss() {
return ass;
diff --git a/service/src/main/webapp/WEB-INF/lib/DataApiSdk-jar-with-dependencies.jar b/service/src/main/webapp/WEB-INF/lib/DataApiSdk-jar-with-dependencies.jar
new file mode 100644
index 00000000..85b98bf5
Binary files /dev/null and b/service/src/main/webapp/WEB-INF/lib/DataApiSdk-jar-with-dependencies.jar differ
diff --git a/service/src/main/webapp/WEB-INF/lib/bcprov-jdk15on-1.57.jar b/service/src/main/webapp/WEB-INF/lib/bcprov-jdk15on-1.57.jar
new file mode 100644
index 00000000..5a10986b
Binary files /dev/null and b/service/src/main/webapp/WEB-INF/lib/bcprov-jdk15on-1.57.jar differ
diff --git a/service/src/main/webapp/WEB-INF/lib/bcprov-jdk15on-1.70.jar b/service/src/main/webapp/WEB-INF/lib/bcprov-jdk15on-1.70.jar
new file mode 100644
index 00000000..0e4198e5
Binary files /dev/null and b/service/src/main/webapp/WEB-INF/lib/bcprov-jdk15on-1.70.jar differ
diff --git a/service/src/main/webapp/WEB-INF/lib/pubbaseapp_nccloud_rtLevel-1.jar b/service/src/main/webapp/WEB-INF/lib/pubbaseapp_nccloud_rtLevel-1.jar
new file mode 100644
index 00000000..78aedbcf
Binary files /dev/null and b/service/src/main/webapp/WEB-INF/lib/pubbaseapp_nccloud_rtLevel-1.jar differ
diff --git a/service/src/main/webapp/WEB-INF/lib/yonyoulog.jar b/service/src/main/webapp/WEB-INF/lib/yonyoulog.jar
new file mode 100644
index 00000000..06a4fa84
Binary files /dev/null and b/service/src/main/webapp/WEB-INF/lib/yonyoulog.jar differ
diff --git a/service/src/main/webapp/WEB-INF/web.xml b/service/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 00000000..d80081d1
--- /dev/null
+++ b/service/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,6 @@
+
+
+
\ No newline at end of file
diff --git a/webapp/src/main/java/com/hzya/frame/webapp/web/init/FlywayConfig.java b/webapp/src/main/java/com/hzya/frame/webapp/web/init/FlywayConfig.java
index 06ffc876..5d2fb22d 100644
--- a/webapp/src/main/java/com/hzya/frame/webapp/web/init/FlywayConfig.java
+++ b/webapp/src/main/java/com/hzya/frame/webapp/web/init/FlywayConfig.java
@@ -1,4 +1,5 @@
package com.hzya.frame.webapp.web.init;
+import com.baomidou.dynamic.datasource.DynamicRoutingDataSource;
import com.hzya.frame.util.AESUtil;
import lombok.RequiredArgsConstructor;
import org.flywaydb.core.Flyway;
@@ -7,10 +8,12 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import javax.sql.DataSource;
-@Configuration
-@RequiredArgsConstructor
-@EnableTransactionManagement
+//@Configuration
+//@RequiredArgsConstructor
+//@EnableTransactionManagement
public class FlywayConfig {
@Value("${spring.flyway.enabled}")
@@ -39,13 +42,21 @@ public class FlywayConfig {
private String username;
@Value("${spring.datasource.dynamic.datasource.master.password}")
private String password;
+ @Resource
+ private DataSource dataSource;
- @PostConstruct
+
+ //@PostConstruct
public void migrateOrder() {
String pwd = AESUtil.decrypt(password);
+ DynamicRoutingDataSource ds = (DynamicRoutingDataSource) dataSource;
+ DataSource dsDatasource = null;
+
+ dsDatasource = ds.getDataSource("master");
// 将路径转换
Flyway flyway = Flyway.configure()
- .dataSource(url,username,pwd)
+ //.dataSource(url,username,pwd)
+ .dataSource(dsDatasource)
.cleanDisabled(cleanDisabled)
.locations(locations)
.table(table)