diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayBillPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayBillPluginInitializer.java
index 43ab218a..e57f8e6c 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayBillPluginInitializer.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/PayBillPluginInitializer.java
@@ -4,14 +4,13 @@ import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
import com.hzya.frame.seeyon.paybill.service.IPayBillService;
-import com.hzya.frame.sysnew.comparison.masterData.service.impl.MasterDataOrgsServiceImpl;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
/**
- * 组织档案(PayBill)表服务接口
+ * 付款单(PayBill)表服务接口
*
* @author makejava
* @since 2024-06-07 18:30:05
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/RecBillPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/RecBillPluginInitializer.java
new file mode 100644
index 00000000..f4689b83
--- /dev/null
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/a8bill/plugin/RecBillPluginInitializer.java
@@ -0,0 +1,63 @@
+package com.hzya.frame.plugin.a8bill.plugin;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.base.PluginBaseEntity;
+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;
+
+/**
+ * 收款单(RecBill)表服务接口
+ *
+ * @author makejava
+ * @since 2024-06-07 18:30:05
+ */
+public class RecBillPluginInitializer extends PluginBaseEntity{
+ Logger logger = LoggerFactory.getLogger(RecBillPluginInitializer.class);
+ @Autowired
+ private IRecBillService recBillService;
+
+ @Override
+ public void initialize() {
+ logger.info(getPluginLabel() + "執行初始化方法initialize()");
+ }
+
+ @Override
+ public void destroy() {
+ logger.info(getPluginLabel() + "執行銷毀方法destroy()");
+ }
+
+ @Override
+ public String getPluginId() {
+ return "RecBillPluginInitializer";
+ }
+
+ @Override
+ public String getPluginName() {
+ return "RecBillPluginInitializer插件";
+ }
+
+ @Override
+ public String getPluginLabel() {
+ return "RecBillPluginInitializer";
+ }
+
+ @Override
+ public String getPluginType() {
+ return "1";
+ }
+ @Override
+ public JsonResultEntity executeBusiness(JSONObject requestJson) {
+ try {
+ logger.info("======开始执行收款单据信息同步========");
+ return recBillService.sendRecBillToBip(requestJson);
+ }catch (Exception e){
+ logger.info("======执行收款单据同步失败:{}========",e.getMessage());
+ e.printStackTrace();
+ }
+ return null;
+ }
+}
diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/plugin/MdmPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/plugin/MdmPluginInitializer.java
index 298019eb..02577f11 100644
--- a/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/plugin/MdmPluginInitializer.java
+++ b/buildpackage/src/main/java/com/hzya/frame/plugin/masterData/plugin/MdmPluginInitializer.java
@@ -1,7 +1,6 @@
package com.hzya.frame.plugin.masterData.plugin;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.base.PluginBaseEntity;
-import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataCustoMermanageService;
import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.slf4j.Logger;
diff --git a/buildpackage/src/main/resources/application.yml b/buildpackage/src/main/resources/application.yml
index 9a669fa1..1f564c28 100644
--- a/buildpackage/src/main/resources/application.yml
+++ b/buildpackage/src/main/resources/application.yml
@@ -91,8 +91,7 @@ mybatis-plus:
db-config:
id-type: auto # 主键策略
zt:
- url:
-# 积木报表工具
+ url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface
#JimuReport[minidao配置]
minidao :
base-package: org.jeecg.modules.jmreport.desreport.dao*
diff --git a/buildpackage/src/main/resources/cfgHome/plugin/payBill/spring/spring-buildpackage-plugin.xml b/buildpackage/src/main/resources/cfgHome/plugin/payBill/spring/spring-buildpackage-plugin.xml
index dc955eca..03e1cd8a 100644
--- a/buildpackage/src/main/resources/cfgHome/plugin/payBill/spring/spring-buildpackage-plugin.xml
+++ b/buildpackage/src/main/resources/cfgHome/plugin/payBill/spring/spring-buildpackage-plugin.xml
@@ -2,4 +2,5 @@
+
diff --git a/pom.xml b/pom.xml
index f82be333..3f21aeaa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
2.8.5
3.3.0
5.8.19
- 1.2.0
+ 1.1.22
3.5.6
@@ -235,8 +235,7 @@
com.alibaba
druid-spring-boot-starter
- 1.2.23
-
+ ${druid-spring-boot-starter.version}
org.springframework.boot
@@ -246,12 +245,6 @@
-
-
-
-
-
-
com.dameng
Dm8JdbcDriver18
@@ -259,7 +252,6 @@
-
commons-beanutils
commons-beanutils
@@ -346,21 +338,7 @@
org.springframework.boot
spring-boot-starter-cache
-
-
-
- org.jeecgframework.jimureport
- jimureport-spring-boot-starter
- ${jimureport.version}
-
-
-
- io.minio
- minio
- ${minio.version}
- true
-
-
+
org.postgresql
postgresql
@@ -391,7 +369,6 @@
flyway-mysql
8.5.13
-
@@ -441,7 +418,6 @@
src/main/resources
**/*.yml
- **/*.jar
**/*.properties
**/*.xml
**/*.xmreport
@@ -460,7 +436,6 @@
src/
**/*.yml
- **/*.jar
**/*.properties
**/*.xml
**/*.json
diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml
index 5882dd6c..4e66bbe3 100644
--- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml
+++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/entity/MdmModuleEntity.xml
@@ -342,6 +342,7 @@ where id = #{id}
`sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
`company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
+ `data_id` varchar(100) DEFAULT NULL COMMENT 'data_id',
`id` varchar(50) NOT NULL COMMENT '唯一标识码',
@@ -355,6 +356,7 @@ where id = #{id}
`sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
`company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
+ `data_id` varchar(100) DEFAULT NULL COMMENT 'data_id',
`id` varchar(50) NOT NULL COMMENT '唯一标识码',
@@ -372,6 +374,8 @@ where id = #{id}
`sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
`company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
+ `data_type` varchar(255) DEFAULT NULL COMMENT '状态 1、成功2、失败',
+ `remark` varchar(255) DEFAULT NULL COMMENT '备注',
`id` varchar(50) NOT NULL COMMENT '唯一标识码',
@@ -388,6 +392,8 @@ where id = #{id}
`sts` varchar(1) DEFAULT NULL COMMENT '状态(Y正常N删除)',
`org_id` varchar(50) DEFAULT NULL COMMENT '组织机构ID',
`company_id` varchar(50) DEFAULT NULL COMMENT '公司id',
+ `data_type` varchar(50) DEFAULT NULL COMMENT '状态 1、成功2、失败',
+ `remark` varchar(255) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`sorts`,`id`) USING BTREE
@@ -812,7 +818,7 @@ where id = #{id}
AND
- ${item.leftBracket} ${item.filedName}
+ ${item.leftBracket} ${item.filedId}
=
diff --git a/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java
index 8a9c3ac6..6ffdef17 100644
--- a/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java
+++ b/service/src/main/java/com/hzya/frame/mdm/mdmModule/service/impl/MdmModuleServiceImpl.java
@@ -582,6 +582,24 @@ public class MdmModuleServiceImpl extends BaseService i
document_rule_num.setCreate();
document_rule_num.setDataType("1");
mdmModuleDbFiledsEntities.add(document_rule_num);
+
+ MdmModuleDbFiledsEntity data_id = new MdmModuleDbFiledsEntity();
+ data_id.setMdmId(entity.getMdmId());
+ data_id.setDbId(entity.getId());
+ data_id.setEnName("data_id");
+ data_id.setChName("第三方主键ID");
+ data_id.setFiledType("1");
+ data_id.setAddType("2");
+ data_id.setUpdateType("2");
+ data_id.setShowType("2");
+ data_id.setQueryType("2");
+ data_id.setListType("2");
+ data_id.setViewType("2");
+ data_id.setFiledLength("255");
+ data_id.setCreate();
+ data_id.setDataType("1");
+ mdmModuleDbFiledsEntities.add(data_id);
+
}
if ("2".equals(entity.getDbType()) || "3".equals(entity.getDbType()) || "4".equals(entity.getDbType())) {
MdmModuleDbFiledsEntity formmain_id = new MdmModuleDbFiledsEntity();
@@ -600,6 +618,24 @@ public class MdmModuleServiceImpl extends BaseService i
formmain_id.setCreate();
formmain_id.setDataType("1");
mdmModuleDbFiledsEntities.add(formmain_id);
+
+ MdmModuleDbFiledsEntity data_id = new MdmModuleDbFiledsEntity();
+ data_id.setMdmId(entity.getMdmId());
+ data_id.setDbId(entity.getId());
+ data_id.setEnName("data_id");
+ data_id.setChName("第三方主键ID");
+ data_id.setFiledType("1");
+ data_id.setAddType("2");
+ data_id.setUpdateType("2");
+ data_id.setShowType("2");
+ data_id.setQueryType("2");
+ data_id.setListType("2");
+ data_id.setViewType("2");
+ data_id.setFiledLength("255");
+ data_id.setCreate();
+ data_id.setDataType("1");
+ mdmModuleDbFiledsEntities.add(data_id);
+
}
//写入日志字段:操作人
if ("3".equals(entity.getDbType())) {
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 e30101f1..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
@@ -173,25 +173,28 @@
@@ -329,32 +332,7 @@ update mdm_module_source set sts= 'N' ,modify_time = #{modify_time},modify_user
delete from mdm_module_source where id = #{id}
-
-
diff --git a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java
index 45d2599a..8ea83185 100644
--- a/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java
+++ b/service/src/main/java/com/hzya/frame/mdm/service/impl/MdmServiceImpl.java
@@ -1688,7 +1688,7 @@ public class MdmServiceImpl implements IMdmService {
checkData.put("id", id);
checkData.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities);
JSONObject object1 = mdmModuleDao.queryMdmST(checkData);
- if (object1.getString("id") == null || "".equals(object1.getString("id"))) {
+ if (object1 == null || object1.getString("id") == null || "".equals(object1.getString("id"))) {
return BaseResult.getFailureMessageEntity("当前数据不符合规则不发送");
}
}
@@ -2511,35 +2511,84 @@ public class MdmServiceImpl implements IMdmService {
mdmDataDto.setTableName(mdmModuleDbEntityList.get(i).getDbName());
List mdmDataFiledDtos = new ArrayList<>();
for (int i1 = 0; i1 < fileds.size(); i1++) {
- MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto();
- mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName());
- mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName()));
- mdmDataFiledDtos.add(mdmDataFiledDto);
+ if("id".equals(fileds.get(i1).getEnName())){
+ if (jsonObject.getString("id") != null) {
+ MdmDataFiledDto ids = new MdmDataFiledDto();
+ ids.setFiledsName("id");
+ ids.setFiledsValue(jsonObject.getString("id"));
+ mdmDataFiledDtos.add(ids);
+ } else {
+ MdmDataFiledDto ids = new MdmDataFiledDto();
+ ids.setFiledsName("id");
+ ids.setFiledsValue(UUIDUtils.getUUID());
+ mdmDataFiledDtos.add(ids);
+ }
+ }else if("formmain_id".equals(fileds.get(i1).getEnName())){
+ MdmDataFiledDto formain_id = new MdmDataFiledDto();
+ formain_id.setFiledsName("formmain_id");
+ formain_id.setFiledsValue(id);
+ mdmDataFiledDtos.add(formain_id);
+ }else if("data_status".equals(fileds.get(i1).getEnName())){
+ if (jsonObject.getString("id") != null) {
+ MdmDataFiledDto ids = new MdmDataFiledDto();
+ ids.setFiledsName("data_status");
+ ids.setFiledsValue("F");
+ mdmDataFiledDtos.add(ids);
+ } else {
+ MdmDataFiledDto ids = new MdmDataFiledDto();
+ ids.setFiledsName("data_status");
+ ids.setFiledsValue("Y");
+ mdmDataFiledDtos.add(ids);
+ }
+ }else if("sorts".equals(fileds.get(i1).getEnName())){
+
+ }else if("create_user_id".equals(fileds.get(i1).getEnName())){
+ //if (jsonObject.getString("id") != null) {
+ //
+ //} else {
+ // MdmDataFiledDto ids = new MdmDataFiledDto();
+ // ids.setFiledsName("create_user_id");
+ // ids.setFiledsValue(UUIDUtils.getUUID());
+ // mdmDataFiledDtos.add(ids);
+ //}
+ }else if("create_time".equals(fileds.get(i1).getEnName())){
+
+ }else if("modify_user_id".equals(fileds.get(i1).getEnName())){
+ //MdmDataFiledDto ids = new MdmDataFiledDto();
+ //ids.setFiledsName("modify_user_id");
+ //ids.setFiledsValue(UUIDUtils.getUUID());
+ //mdmDataFiledDtos.add(ids);
+ }else if("company_id".equals(fileds.get(i1).getEnName())){
+ MdmDataFiledDto ids = new MdmDataFiledDto();
+ ids.setFiledsName("company_id");
+ ids.setFiledsValue("0");
+ mdmDataFiledDtos.add(ids);
+ }else if("org_id".equals(fileds.get(i1).getEnName())){
+ MdmDataFiledDto ids = new MdmDataFiledDto();
+ ids.setFiledsName("org_id");
+ ids.setFiledsValue("0");
+ mdmDataFiledDtos.add(ids);
+ }else if("modify_time".equals(fileds.get(i1).getEnName())){
+
+ }else if("sts".equals(fileds.get(i1).getEnName())){
+
+ }else {
+ MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto();
+ mdmDataFiledDto.setFiledsName(fileds.get(i1).getEnName());
+ mdmDataFiledDto.setFiledsValue(jsonObject.getString(fileds.get(i1).getEnName()));
+ mdmDataFiledDtos.add(mdmDataFiledDto);
+ }
}
MdmDataFiledDto mdmDataFiledDto = new MdmDataFiledDto();
mdmDataFiledDto.setFiledsName("logid");
mdmDataFiledDto.setFiledsValue(StpUtil.getLoginIdAsString());
mdmDataFiledDtos.add(mdmDataFiledDto);
- MdmDataFiledDto formain_id = new MdmDataFiledDto();
- formain_id.setFiledsName("formmain_id");
- formain_id.setFiledsValue(id);
- mdmDataFiledDtos.add(formain_id);
-
mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos);
if (jsonObject.getString("id") != null) {
- MdmDataFiledDto sts = new MdmDataFiledDto();
- sts.setFiledsName("sts");
- sts.setFiledsValue("Y");
- mdmDataFiledDtos.add(sts);
mdmDataDto.setId(jsonObject.getString("id"));
int a = mdmModuleDao.updateForm(mdmDataDto);
} else {
- MdmDataFiledDto ids = new MdmDataFiledDto();
- ids.setFiledsName("id");
- ids.setFiledsValue(UUIDUtils.getUUID());
- mdmDataFiledDtos.add(ids);
- mdmDataDto.setMdmDataFiledDtos(mdmDataFiledDtos);
mdmDataDto.setDbType(mdmModuleDbEntityList.get(i).getDbType());
int a = mdmModuleDao.saveForm(mdmDataDto);
}
@@ -2547,9 +2596,7 @@ public class MdmServiceImpl implements IMdmService {
}
}
}
-
saveOption(dbname,mdmCode,saveData,id,msg);
-
}
return str.toString();
}
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
index 9fa7a24b..1a9308de 100644
--- 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
@@ -21,6 +21,33 @@ public class PayBillEntity extends BaseEntity {
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;
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
index 8514cc4c..736d5914 100644
--- 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
@@ -3,6 +3,7 @@
+
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
index 9adbab1d..8eac7caa 100644
--- 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
@@ -93,7 +93,9 @@ public class PayBillServiceImpl extends BaseService implem
body.put("pay_primal",pay.getPrimalMoney());//付款原币金额
body.put("creationtime",pay.getBillDate());//创建时间
body.put("direction","-1");//方向 :1=收;-1=付;
- body.put("objecttype","");//交易对象
+ 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);//表头
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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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/serviceUtil/DsDataSourceUtil.java b/service/src/main/java/com/hzya/frame/serviceUtil/DsDataSourceUtil.java
index 3db99c32..1e59eda9 100644
--- a/service/src/main/java/com/hzya/frame/serviceUtil/DsDataSourceUtil.java
+++ b/service/src/main/java/com/hzya/frame/serviceUtil/DsDataSourceUtil.java
@@ -147,7 +147,7 @@ public class DsDataSourceUtil {
driveClass = DataSourceUtilProperties.SQL2000DRIVER;
} else if ("2".equalsIgnoreCase(dataSourceEntity.getSourceType())) {
driveClass = DataSourceUtilProperties.SQL2005DRIVER;
- } else if ("4".equalsIgnoreCase(dataSourceEntity.getSourceType())) {
+ }else if ("4".equalsIgnoreCase(dataSourceEntity.getSourceType())) {
driveClass = DataSourceUtilProperties.dm;
}
try {
diff --git a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java
index fe49d95d..d6f85b69 100644
--- a/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java
+++ b/service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java
@@ -225,8 +225,8 @@ public class SysApplicationServiceImpl extends BaseService sysApplicationDatabaseEntities = sysApplicationDatabaseDao.queryBase(checkData);
+ if(detailEntity.getId() != null && !"".equals(detailEntity.getId())){
+ if(sysApplicationDatabaseEntities != null && sysApplicationDatabaseEntities.size() > 0){
+ for (int i = 0; i < sysApplicationDatabaseEntities.size(); i++) {
+ if(!detailEntity.getId().equals(sysApplicationDatabaseEntities.get(i).getId())){
+ return BaseResult.getFailureMessageEntity("数据源编码已经存在,请修改");
+ }
+ }
+ }
+ }else {
+ if(sysApplicationDatabaseEntities != null && sysApplicationDatabaseEntities.size() > 0){
+ return BaseResult.getFailureMessageEntity("数据源编码已经存在,请修改");
+ }
+ }
+ }
//修改应用基本信息
SysApplicationEntity sysApplicationEntity = doUpdateApp(entity);
if ("2".equals(entity.getUpdateType())) {//开发管理界面,需要保存 接口参数,和数据源
@@ -1691,7 +1712,7 @@ public class SysApplicationServiceImpl extends BaseService
select * from ${dbName}
- where formmain_id=#{formmainId} and sts='Y'
+ where formmain_id=#{formmainId} and sts='Y' and (data_status='Y' or data_status='F')
@@ -48,19 +48,19 @@
${key} =#{value}
- where formmain_id=#{formmainId} and sts='Y'
+ where data_id=#{dataId} and formmain_id= #{formmainId} and sts='Y' and (data_status='Y' or data_status='F')
update
${dbName}
- set sts= 'N' ,modify_time = now(),modify_user_id = #{modify_user_id}, data_status= 'N',delete_status='0'
+ set modify_time = now(),modify_user_id = #{modify_user_id}, data_status= 'N'
- and formmain_id=#{formmainId} and sts='Y'
+ and formmain_id=#{formmainId} and sts='Y' and (data_status='Y' or data_status='F')
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java
index 6a97f2b4..1cb1b3db 100644
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java
+++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.java
@@ -44,6 +44,16 @@ public class ComparisonEntity extends BaseEntity {
private String listType;//显示类型:列表
private String viewType;//显示类型:显示
+ private String dataId;//第三方主键id
+
+ public String getDataId() {
+ return dataId;
+ }
+
+ public void setDataId(String dataId) {
+ this.dataId = dataId;
+ }
+
public String getAddType() {
return addType;
}
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.xml b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.xml
index d24c345d..341e28cd 100644
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.xml
+++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/entity/ComparisonEntity.xml
@@ -106,7 +106,7 @@
${key} =#{value}
- where id=#{id} and sts='Y'
+ where id=#{id} and sts='Y' and (data_status='Y' or data_status='F')
@@ -119,7 +119,7 @@
and ${key} =#{value}
- and id=#{id} and sts='Y'
+ and id=#{id} and sts='Y' and (data_status='Y' or data_status='F')
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataCustoMermanageService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataCustoMermanageService.java
deleted file mode 100644
index b7b2301a..00000000
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataCustoMermanageService.java
+++ /dev/null
@@ -1,18 +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 IMasterDataCustoMermanageService extends IBaseService {
-/**
- *
- * @content 查询客户档案同步中台主数据中心
- * @author laborer
- * @date 2024/6/20 0020 9:54
- *
- */
-
-JsonResultEntity queryCustoMermanageArchives(JSONObject jsonObject);
-}
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataMemberService.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataMemberService.java
deleted file mode 100644
index 73926f3e..00000000
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/IMasterDataMemberService.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 IMasterDataMemberService extends IBaseService {
-
- /**
- *
- * @content 查询项目档案
- * @Param
- * @Return
- * @Author hecan
- * @Date 2024/6/6 16:10
- * **/
- JsonResultEntity queryMemberArchives(JSONObject jsonObject);
-}
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/impl/MasterDataCustoMermanageServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataCustoMermanageServiceImpl.java
deleted file mode 100644
index c9bfd60f..00000000
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataCustoMermanageServiceImpl.java
+++ /dev/null
@@ -1,149 +0,0 @@
-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.IMasterDataCustoMermanageService;
-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("MasterDataCustoMermanageServiceImpl")
-public class MasterDataCustoMermanageServiceImpl extends BaseService implements IMasterDataCustoMermanageService {
-
- @Autowired
- private MasterDataDaoImpl masterDataDaoImpl;
- @Autowired
- private ComparisonServiceImpl comparisonServiceimpl;
- @Autowired
- private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl;
-
- private String ts = "";
-
- //同步客户档案到主数据
- public JsonResultEntity queryCustoMermanageArchives(JSONObject json){
- JSONObject jsonObject = json.getJSONObject("jsonStr");
- //查询主数据来源表,根据来源类型为插件得进行分类,获取来源名称和编码
- List list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType();
- if (CollectionUtils.isEmpty(list)) {
- logger.info("数据来源表中没有类型为插件得数据,无法获取来源名称和来源编码");
- return BaseResult.getFailureMessageEntity("数据来源表无插件类型");
- }
- for (MdmModuleSourceEntity mdmModuleSourceEntity : list) {
- //通过不同的应用类型用于拼接sql
- String appTyp = mdmModuleSourceEntity.getAppType();
- String dbCode = mdmModuleSourceEntity.getDbCode();
- switch (appTyp) {
- case "1":
- 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 id,field0013 AS code,field0014 AS name,field0016 AS pk_custclass,field0015 AS shortname,field0012 AS pk_org FROM formmain_0226 WHERE 1=1 AND id = '1706533959075383844' " );
-
- mdmModuleSourceEntity.setDataSourceCode(dbCode);
- try {
- List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
- logger.info("查询出来的值为:{}",hashMaps);
- if (null != hashMaps && hashMaps.size() > 0) {
- ParametricAssembly(mdmModuleSourceEntity,hashMaps,"10004");
- } 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);
- //查询明细信息
- Long formmainId = (Long) hashMap.get("id");
- StringBuffer stringBufferDetails = new StringBuffer();
- stringBufferDetails.append("SELECT field0023 AS pk_bankdoc,field0024 AS accnum,field0025 AS combinenum FROM formson_0229 WHERE formmain_id = '"+formmainId+"' " );
- List> hashMapsDetails = masterDataDaoImpl.queryArchivesByDataSource(stringBufferDetails.toString(),mdmModuleSourceEntity);
- //先查询编码和名称查询是否存在
- 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("details", hashMapsDetails);
- 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/MasterDataMemberServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataMemberServiceImpl.java
deleted file mode 100644
index c889c24b..00000000
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/masterData/service/impl/MasterDataMemberServiceImpl.java
+++ /dev/null
@@ -1,144 +0,0 @@
-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.IMasterDataMemberService;
-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("MasterDataMemberServiceImpl")
-public class MasterDataMemberServiceImpl extends BaseService implements IMasterDataMemberService {
-
- @Autowired
- private MasterDataDaoImpl masterDataDaoImpl;
- @Autowired
- private ComparisonServiceImpl comparisonServiceimpl;
- @Autowired
- private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl;
-
- private String ts = "";
-
- //同步用户信息到主数据
- public JsonResultEntity queryMemberArchives(JSONObject json){
- JSONObject jsonObject = json.getJSONObject("jsonStr");
- //查询主数据来源表,根据来源类型为插件得进行分类,获取来源名称和编码
- List list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType();
- if (CollectionUtils.isEmpty(list)) {
- logger.info("数据来源表中没有类型为插件得数据,无法获取来源名称和来源编码");
- return BaseResult.getFailureMessageEntity("数据来源表无插件类型");
- }
-
- for (MdmModuleSourceEntity mdmModuleSourceEntity : list) {
- //通过不同的应用类型用于拼接sql
- String appTyp = mdmModuleSourceEntity.getAppType();
- String dbCode = mdmModuleSourceEntity.getDbCode();
- switch (appTyp) {
- case "1":
- 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 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);
- try {
- List> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
- logger.info("查询出来的值为:{}",hashMaps);
- if (null != hashMaps && hashMaps.size() > 0) {
- ParametricAssembly(mdmModuleSourceEntity,hashMaps,"10003");
- } 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/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
index 05927f1b..2f0cab38 100644
--- 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
@@ -10,11 +10,11 @@ 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.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;
@@ -54,30 +54,31 @@ public class MasterDataServiceImpl extends BaseService
return BaseResult.getFailureMessageEntity("数据来源表无插件类型");
}
for (MdmModuleSourceEntity mdmModuleSourceEntity : list) {
+ String tableName = "";
try {
//通过不同的应用类型用于拼接sql
String appTyp = mdmModuleSourceEntity.getAppType();
String dbCode = mdmModuleSourceEntity.getDbCode();
String mdmCode = mdmModuleSourceEntity.getMdmCode();
- List>hashMaps = new ArrayList<>();
- List> hashMapsDetails = new ArrayList<>();
+ List listAll = new ArrayList<>();
+ if(!"10004".equals(mdmCode)){
+ continue;
+ }
switch (appTyp) {//1、致远OA 2、用友U8C 3、用友BIP
case "1":
//通过主数据编码判断,不同的接口走不通的查询逻辑
switch (mdmCode){
case "10003"://致远用户信息
- bindingUser(jsonObject, mdmModuleSourceEntity, dbCode);
+ tableName = "mdm_user";
+ listAll = bindingUser(jsonObject, mdmModuleSourceEntity, dbCode);
break;
case "10004"://致远客商信息
- hashMaps = binDingCust(jsonObject, mdmModuleSourceEntity, dbCode);
- //查询明细数据
- for (HashMap hashMap : hashMaps) {
- //查询明细信息
- Long formmainId = (Long) hashMap.get("id");
- StringBuffer stringBufferDetails = new StringBuffer();
- stringBufferDetails.append("SELECT field0023 AS pk_bankdoc,field0024 AS accnum,field0025 AS combinenum FROM formson_0229 WHERE formmain_id = '"+formmainId+"' " );
- hashMapsDetails = masterDataDaoImpl.queryArchivesByDataSource(stringBufferDetails.toString(),mdmModuleSourceEntity);
- }
+ tableName = "mdm_customer";
+ listAll = binDingCust(jsonObject, mdmModuleSourceEntity, dbCode);
+ break;
+ case "10007"://致远客商信息
+ tableName = "mdm_bank";
+ listAll = binDingBank(jsonObject, mdmModuleSourceEntity, dbCode);
break;
default:
logger.info("未匹配到主数据的编码,请检查");
@@ -85,8 +86,8 @@ public class MasterDataServiceImpl extends BaseService
}
}
//调用主数据接口进行数据推送或更新
- if (null != hashMaps && hashMaps.size() > 0) {
- ParametricAssembly(mdmModuleSourceEntity,hashMaps,mdmCode,hashMapsDetails);
+ if (null != listAll && listAll.size() > 0) {
+ ParametricAssembly(mdmModuleSourceEntity, listAll, mdmCode, tableName);
} else {
logger.info("U8C主数据档案没有需要同步中台的数据");
}
@@ -95,52 +96,123 @@ public class MasterDataServiceImpl extends BaseService
e.printStackTrace();
}
}
- return BaseResult.getSuccessMessageEntity("项目档案同步成功");
+ return BaseResult.getSuccessMessageEntity("主数据同步成功");
}
- //绑定客户档案
- private List> binDingCust(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) {
- List> hashMap;
- StringBuffer sbCust = new StringBuffer();
+ //绑定银行
+ 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");
- sbCust.append(" and a.code = '"+code+"'");
+ sb.append(" and a.code = '"+code+"'");
}else{
ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
- sbCust.append(" and a.update_time >= '"+ts+"'");
+ sb.append(" and a.update_time >= '"+ts+"'");
}
- StringBuffer stringBufferCust = new StringBuffer();
- stringBufferCust.append("SELECT id as id,field0013 AS code,field0014 AS name,field0016 AS pk_custclass,field0015 AS shortname,field0012 AS pk_org FROM formmain_0226 WHERE 1=1 "+ sbCust.toString());
+ StringBuffer stringBuffer = new StringBuffer();
+ stringBuffer.append("select id as data_id,a.* from bank a");
mdmModuleSourceEntity.setDataSourceCode(dbCode);
- return masterDataDaoImpl.queryArchivesByDataSource(stringBufferCust.toString(),mdmModuleSourceEntity);
+ 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 JSONArray bindingUser(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) {
- StringBuffer sbUser = new StringBuffer();
+ 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");
- sbUser.append(" and a.code = '"+code+"'");
+ sb.append(" and a.code = '"+code+"'");
}else{
ts = DateUtil.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss");
- sbUser.append(" and a.update_time >= '"+ts+"'");
+ sb.append(" and a.update_time >= '"+ts+"'");
}
- StringBuffer stringBufferUser = new StringBuffer();
- stringBufferUser.append("SELECT id as id,field0013 AS code,field0014 AS name,field0016 AS pk_custclass,field0015 AS shortname,field0012 AS pk_org FROM formmain_0226 WHERE 1=1 "+ sbUser.toString());
+ 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(stringBufferUser.toString(),mdmModuleSourceEntity);
- for (HashMap hashMap : hashMaps) {
-
+ 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 null;
+ return list;
}
//查询档案参数组装
- public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List> hashMaps,String mdmCode,List> hashMapsDetails){
- for (HashMap hashMap : hashMaps) {
+ 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("id", hashMap.get("id"));
+ jsonObjectUser.put("data_id", main.get("data_id"));
jsonObjectUser.put("mdmCode", mdmCode);
jsonStr.put("jsonStr", jsonObjectUser);
//先查询编码和名称查询是否存在
@@ -151,40 +223,30 @@ public class MasterDataServiceImpl extends BaseService
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());
+// //将查询出来得数据调用通用接口新增,保存到表中
+// 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 {
- 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());
- }
+ 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());
}
}
}
diff --git a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java
index 0045280f..251be257 100644
--- a/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java
+++ b/service/src/main/java/com/hzya/frame/sysnew/comparison/service/impl/ComparisonServiceImpl.java
@@ -18,6 +18,7 @@ import com.hzya.frame.sysnew.comparison.dao.IComparisonDetailsDao;
import com.hzya.frame.sysnew.comparison.entity.ComparisonDetailsEntity;
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
import com.hzya.frame.sysnew.comparison.service.IComparisonService;
+import com.hzya.frame.uuid.UUIDLong;
import com.hzya.frame.uuid.UUIDUtils;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
@@ -28,6 +29,7 @@ import org.springframework.stereotype.Service;
import sun.java2d.pipe.AAShapePipe;
import java.util.*;
+import java.util.stream.Collectors;
@Service(value = "comparisonServiceImpl")
public class ComparisonServiceImpl extends BaseService implements IComparisonService {
@@ -50,7 +52,6 @@ public class ComparisonServiceImpl extends BaseService
}
//分页查询通用数据数据
- @DS("master")
@Override
public JsonResultEntity queryEntityPage(JSONObject json) {
JSONObject jsonObject = json.getJSONObject("jsonStr");
@@ -100,13 +101,15 @@ public class ComparisonServiceImpl extends BaseService
for (Map comparisonEntitiePage : comparisonEntitiePages) {
JSONObject jsonObjects=new JSONObject();
jsonObjects.put(comparisonEntity.getDbName(),comparisonEntitiePage);
- comparisonDetailsEntity.setFormmainId(String.valueOf(comparisonEntitiePage.get("id")));
- //查询明细表数据
- List