From a287f6e30e9af4866126f56d9ba88a69f8bf8e22 Mon Sep 17 00:00:00 2001
From: lvleigang <957075182@qq.com>
Date: Thu, 10 Apr 2025 09:15:23 +0800
Subject: [PATCH 01/15] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BF=9D=E5=AD=98?=
=?UTF-8?q?=E5=88=B0=E4=B8=9A=E5=8A=A1=E6=95=B0=E6=8D=AE=E4=B8=AD=E5=BF=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
base-buildpackage/pom.xml | 6 +
.../dao/IIncomeInvoiceDao.java | 24 +
.../dao/impl/IncomeInvoiceDaoImpl.java | 32 ++
.../entity/IncomeInvoiceEntity.java | 14 +
.../entity/IncomeInvoiceEntity.xml | 106 ++++
.../IncomeInvoicePluginInitializer.java | 63 +++
.../service/IIncomeInvoiceService.java | 17 +
.../impl/IncomeInvoiceServiceImpl.java | 526 ++++++++++++++++++
.../src/main/resources/application-llg.yml | 82 +++
.../plugin/incomeInvoiceData/pluginCfg.xml | 6 +
.../spring/spring-buildpackage-dao.xml | 5 +
.../spring/spring-buildpackage-plugin.xml | 5 +
.../spring/spring-buildpackage-service.xml | 5 +
.../service/impl/ZxBankServiceImpl.java | 4 +-
14 files changed, 893 insertions(+), 2 deletions(-)
create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java
create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java
create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java
create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml
create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/IncomeInvoicePluginInitializer.java
create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java
create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
create mode 100644 base-buildpackage/src/main/resources/application-llg.yml
create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/pluginCfg.xml
create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-dao.xml
create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml
create mode 100644 base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-service.xml
diff --git a/base-buildpackage/pom.xml b/base-buildpackage/pom.xml
index 92fa0ece..1a6c915a 100644
--- a/base-buildpackage/pom.xml
+++ b/base-buildpackage/pom.xml
@@ -43,6 +43,12 @@
httest
+
+ llg
+
+ llg
+
+
kangarooDataCenterV3
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java
new file mode 100644
index 00000000..54190fe9
--- /dev/null
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java
@@ -0,0 +1,24 @@
+package com.hzya.frame.plugin.incomeInvoiceData.dao;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.basedao.dao.IBaseDao;
+import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity;
+
+import java.util.List;
+
+/**
+ * 客户档案(mdm_customer: table)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-06-21 13:52:35
+ */
+public interface IIncomeInvoiceDao extends IBaseDao {
+
+
+ List queryData(JSONObject saveData);
+
+ int saveDetailData(JSONObject saveDetailData);
+
+ int saveData(JSONObject saveData);
+}
+
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java
new file mode 100644
index 00000000..fa68e930
--- /dev/null
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java
@@ -0,0 +1,32 @@
+package com.hzya.frame.plugin.incomeInvoiceData.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.basedao.dao.MybatisGenericDao;
+import com.hzya.frame.plugin.incomeInvoiceData.dao.IIncomeInvoiceDao;
+import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity;
+
+import java.util.List;
+
+
+/**
+ *
+ * @author makejava
+ * @since 2024-06-21 13:52:35
+ */
+public class IncomeInvoiceDaoImpl extends MybatisGenericDao implements IIncomeInvoiceDao {
+
+ @Override
+ public List queryData(JSONObject saveData) {
+ List o = (List) super.selectList(getSqlIdPrifx() + "queryData", saveData);
+ return o;
+ }
+ @Override
+ public int saveData(JSONObject saveData) {
+ return super.insert(getSqlIdPrifx() + "saveData", saveData);
+ }
+ @Override
+ public int saveDetailData(JSONObject saveData) {
+ return super.insert(getSqlIdPrifx() + "saveDetailData", saveData);
+ }
+}
+
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java
new file mode 100644
index 00000000..a4d160c0
--- /dev/null
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java
@@ -0,0 +1,14 @@
+package com.hzya.frame.plugin.incomeInvoiceData.entity;
+
+import com.hzya.frame.web.entity.BaseEntity;
+/**
+ *
+ * @author makejava
+ * @since 2024-06-21 13:52:35
+ */
+public class IncomeInvoiceEntity extends BaseEntity {
+
+
+
+}
+
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml
new file mode 100644
index 00000000..219ac58a
--- /dev/null
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+ insert into mdm_fp(
+
+ id ,
+ document_rule ,
+ document_rule_num ,
+ data_status ,
+ add_status ,
+ update_status ,
+ delete_status ,
+ sorts ,
+ create_user_id ,
+ create_time ,
+ modify_user_id ,
+ modify_time ,
+ sts ,
+ org_id ,
+ company_id ,
+
+ fphm ,
+
+
+
+ )values
+ (
+
+ #{id} ,
+ #{document_rule} ,
+ #{document_rule_num} ,
+ #{data_status} ,
+ #{add_status} ,
+ #{update_status} ,
+ #{delete_status} ,
+ #{sorts} ,
+ #{create_user_id} ,
+ #{create_time} ,
+ #{modify_user_id} ,
+ #{modify_time} ,
+ #{sts} ,
+ #{org_id} ,
+ #{company_id} ,
+
+ #{fphm} ,
+
+
+
+ )
+
+
+ insert into mdm_fp_detail(
+
+ id ,
+ formmain_id ,
+ data_status ,
+ sorts ,
+ create_user_id ,
+ create_time ,
+ modify_user_id ,
+ modify_time ,
+ sts ,
+ org_id ,
+ company_id ,
+ remark ,
+
+
+
+
+ )values
+ (
+
+ #{id} ,
+ #{formmain_id} ,
+ #{data_status},
+ #{sorts} ,
+ #{create_user_id} ,
+ #{create_time} ,
+ #{modify_user_id} ,
+ #{modify_time} ,
+ #{sts} ,
+ #{org_id} ,
+ #{company_id} ,
+ #{remark} ,
+
+
+
+
+
+ )
+
+
+
+
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/IncomeInvoicePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/IncomeInvoicePluginInitializer.java
new file mode 100644
index 00000000..8c966920
--- /dev/null
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/IncomeInvoicePluginInitializer.java
@@ -0,0 +1,63 @@
+package com.hzya.frame.plugin.incomeInvoiceData.plugin;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.base.PluginBaseEntity;
+import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService;
+import com.hzya.frame.web.entity.JsonResultEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * 主数据同步
+ *
+ * @author makejava
+ * @since 2024-06-21 13:52:35
+ */
+public class IncomeInvoicePluginInitializer extends PluginBaseEntity{
+ Logger logger = LoggerFactory.getLogger(IncomeInvoicePluginInitializer.class);
+
+ @Autowired
+ private IIncomeInvoiceService incomeInvoiceService;
+
+ @Override
+ public void initialize() {
+ logger.info(getPluginLabel() + "执行初始化方法initialize()");
+ }
+
+ @Override
+ public void destroy() {
+ logger.info(getPluginLabel() + "执行销毁方法destroy()");
+ }
+
+ @Override
+ public String getPluginId() {
+ return "IncomeInvoicePlugin";
+ }
+
+ @Override
+ public String getPluginName() {
+ return "IncomeInvoicePlugin插件";
+ }
+
+ @Override
+ public String getPluginLabel() {
+ return "IncomeInvoicePlugin";
+ }
+
+ @Override
+ public String getPluginType() {
+ return "1";
+ }
+ @Override
+ public JsonResultEntity executeBusiness(JSONObject requestJson) {
+ try {
+ logger.info("======开始执行进项全量发票主数据信息同步========");
+ return incomeInvoiceService.getIncomeInvoiceData(requestJson);
+ }catch (Exception e){
+ logger.info("======执行进项全量发票主数据同步失败:{}========",e.getMessage());
+ e.printStackTrace();
+ }
+ return null;
+ }
+}
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java
new file mode 100644
index 00000000..08ca551f
--- /dev/null
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java
@@ -0,0 +1,17 @@
+package com.hzya.frame.plugin.incomeInvoiceData.service;
+
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.basedao.service.IBaseService;
+import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity;
+import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
+import com.hzya.frame.web.entity.JsonResultEntity;
+
+/**
+ *
+ * @author makejava
+ * @since 2024-06-21 13:52:35
+ */
+public interface IIncomeInvoiceService extends IBaseService {
+ JsonResultEntity getIncomeInvoiceData(JSONObject requestJson);
+ SysExtensionApiEntity setData(SysExtensionApiEntity entity) throws Exception;
+}
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
new file mode 100644
index 00000000..01861c17
--- /dev/null
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
@@ -0,0 +1,526 @@
+package com.hzya.frame.plugin.incomeInvoiceData.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.hzya.frame.plugin.incomeInvoiceData.dao.IIncomeInvoiceDao;
+import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity;
+import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService;
+import com.hzya.frame.seeyon.util.YzfSignUtil;
+import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity;
+import com.hzya.frame.sysnew.comparison.controlsLog.dao.impl.ControlsLogDaoImpl;
+import com.hzya.frame.sysnew.comparison.controlsLog.entity.ControlsLogEntity;
+import com.hzya.frame.sysnew.comparison.dao.IComparisonDao;
+import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
+import com.hzya.frame.uuid.UUIDLong;
+import com.hzya.frame.uuid.UUIDUtils;
+import com.hzya.frame.web.entity.BaseResult;
+import com.hzya.frame.web.entity.JsonResultEntity;
+import org.apache.http.HttpEntity;
+import org.apache.http.client.config.RequestConfig;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.conn.ssl.NoopHostnameVerifier;
+import org.apache.http.conn.ssl.TrustAllStrategy;
+import org.apache.http.entity.ByteArrayEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.util.EntityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.hzya.frame.basedao.service.impl.BaseService;
+
+import javax.net.ssl.SSLContext;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author makejava
+ * @since 2024-06-21 13:52:35
+ */
+public class IncomeInvoiceServiceImpl extends BaseService implements IIncomeInvoiceService {
+
+ private IIncomeInvoiceDao incomeInvoiceDao;
+ @Autowired
+ private ControlsLogDaoImpl controlsLogDaoimpl;
+ @Autowired
+ private IComparisonDao comparisonDao;
+ @Autowired
+ public void setIncomeInvoiceDao(IIncomeInvoiceDao dao) {
+ this.incomeInvoiceDao = dao;
+ this.dao = dao;
+ }
+ String dataUrl = "http://oapi.nanofintax.com/api/invoice_receive/fp/v1/query?accessToken=";
+ String tokenUrl = "http://oapi.nanofintax.com/api/getToken";
+ String accessKey = "6X3B526P5HqE6ums";
+ String accessSecret = "34e5fc32ac894a2ba2ade8c3852c7a0a";
+ String taxNo = "91330110MAC5FPUY2U";
+ Integer size = 50;
+
+ @Override
+ public JsonResultEntity getIncomeInvoiceData(JSONObject requestJson) {
+ //1、调用token
+ String access_token = getToken();
+ if (access_token == null) {
+ return BaseResult.getFailureMessageEntity("token获取失败");
+ }
+ Date date = new Date();
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+ String times = sdf.format(date);
+ times = "2025-03-25";
+ //2、调用接口获取数据
+ Integer queryCursor = 1;
+ JSONArray datalist = new JSONArray();
+ sendBusinessData(datalist, access_token, queryCursor,times);
+
+ if(datalist != null && datalist.size() > 0){
+ for (int i = 0; i < datalist.size(); i++) {
+ JSONObject saveData = new JSONObject();
+ //3、对照数据
+ JSONObject jsonObject = datalist.getJSONObject(i);
+ //发票号码
+ String fphm = jsonObject.getString("fphm");
+ if(fphm == null || "".equals(fphm) ){
+ continue;
+ }
+ saveData.put("fphm",fphm);
+ //判断是否有这个数据
+ List checkData = incomeInvoiceDao.queryData(saveData);
+ if(checkData != null && checkData.size() > 0){
+ continue;
+ }
+ saveData.put("id", String.valueOf(UUIDLong.longUUID()));
+ saveData.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
+ saveData.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
+ saveData.put("org_id", "0");
+ saveData.put("create_time", new Date());
+ saveData.put("modify_time", new Date());
+ saveData.put("sts", "Y");
+ saveData.put("data_status", "Y");//新增状态
+ saveData.put("add_status", "0");//新增状态
+ saveData.put("update_status", "1");//修改状态
+ saveData.put("delete_status", "1");//删除状态
+ ComparisonEntity comparisonEntityRule = new ComparisonEntity();
+ comparisonEntityRule.setRulePrefix("FP");
+ comparisonEntityRule.setRuleMiddle("%Y-%m-%d");
+ comparisonEntityRule.setRuleSuffix(5);
+ comparisonEntityRule.setDbName("mdm_fp");
+ ComparisonEntity comparisonEntityRuleGz = comparisonDao.queryComparisonRule(comparisonEntityRule);
+ saveData.put("document_rule", comparisonEntityRuleGz.getDocumentRule());//单据规则
+ saveData.put("document_rule_num", comparisonEntityRuleGz.getDocumentRuleNum());//单据规则流水号
+
+ JSONObject content = jsonObject.getJSONObject("content");
+ JSONArray detaildata = content.getJSONArray("items");
+ if(detaildata != null && detaildata.size() > 0){
+ for (int i1 = 0; i1 < detaildata.size(); i1++) {
+ JSONObject saveDetailData = new JSONObject();
+
+ saveDetailData.put("id", String.valueOf(UUIDLong.longUUID()));
+ saveDetailData.put("formmain_id", saveData.getString("id"));
+ saveDetailData.put("data_status", "Y");//新增状态
+
+ saveDetailData.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
+ saveDetailData.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
+ saveDetailData.put("org_id", "0");
+ saveDetailData.put("create_time", new Date());
+ saveDetailData.put("modify_time", new Date());
+ saveDetailData.put("sts", "Y");
+ saveDetailData.put("remark", detaildata.getJSONObject(i1).getString("xmmc"));
+ incomeInvoiceDao.saveDetailData(saveDetailData);
+ }
+ }
+ incomeInvoiceDao.saveData(saveData);
+
+ //5、保存写入日志
+ ControlsLogEntity controlsLogEntity=new ControlsLogEntity();
+ controlsLogEntity.setId(UUIDUtils.getUUID());
+ controlsLogEntity.setFormmainId(saveData.getString("id"));
+ controlsLogEntity.setSourceName("数智中台");
+ controlsLogEntity.setCode("800004");
+ controlsLogEntity.setSourceData(jsonObject.toString());
+ controlsLogEntity.setOptionType("接口新增");
+ controlsLogEntity.setOptionName("数智中台");
+ controlsLogEntity.setDbName("mdm_fp_option_log");
+ controlsLogEntity.setDataType("1");
+ controlsLogEntity.setCreate_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443");
+ controlsLogEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443");
+ controlsLogEntity.setOrg_id("0");
+ controlsLogEntity.setRemark("插件新增");
+ controlsLogDaoimpl.saveControlsLog(saveData.getString("id"), "数智中台", "800004", jsonObject.toJSONString(), "接口新增", "数智中台", "mdm_fp_option_log", "1");
+ }
+ }
+ return BaseResult.getSuccessMessageEntity("处理成功");
+ }
+
+
+ /**
+ * @Author lvleigang
+ * @Description 获取业务数据
+ * @Date 4:31 下午 2025/4/9
+ * @param datalist
+ * @param access_token
+ * @param queryCursor
+ * @param dataTime
+ * @return void
+ **/
+ private void sendBusinessData(JSONArray datalist, String access_token, Integer queryCursor, String dataTime) {
+ String url = dataUrl+access_token;
+ JSONObject dayabody = new JSONObject();
+ dayabody.put("accessKey",accessKey);
+ long timestamp = System.currentTimeMillis();
+ dayabody.put("timestamp",timestamp);
+ JSONObject queryParams = new JSONObject();
+ queryParams.put("page",queryCursor);
+ queryParams.put("size",size);
+ queryParams.put("kprqq",dataTime);
+ queryParams.put("kprqz",dataTime);
+ queryParams.put("taxNo",taxNo);
+ dayabody.put("queryParams",queryParams);
+ Map parametersMap = new HashMap<>();
+ parametersMap.put("accessKey",accessKey);
+ parametersMap.put("timestamp",timestamp);
+ String a = YzfSignUtil.signRequest(parametersMap,accessSecret);
+ dayabody.put("sign",a);
+ Map headers = new HashMap<>();
+ headers.put("Content-Type", "application/json; charset=utf-8");
+ String returndata = sendPost(url, headers, dayabody.toJSONString());
+
+ if (returndata != null && JSONObject.isValidObject(returndata)) {
+ JSONObject dataJson = JSONObject.parseObject(returndata);
+ if(dataJson != null && dataJson.getString("code") != null && "0".equals( dataJson.getString("code"))){
+ JSONObject data = dataJson.getJSONObject("result");
+ if(data != null ){
+ JSONArray businessList = data.getJSONArray("data");
+ if(data.getInteger("total") > queryCursor*size){
+ queryCursor = queryCursor+1;
+ sendBusinessData(datalist, access_token, queryCursor, dataTime);
+ }
+ if(businessList != null && businessList.size() > 0){
+ datalist.addAll(businessList);
+ }
+ }
+ }
+ }
+ }
+ private JSONObject getUser(String usercode,String access_token) {
+ JSONObject jsonObject = new JSONObject();
+ String url = "https://swoa.sunwave.com.cn:9999/seeyon/rest/orgMembers/code/"+usercode+"?pageNo=0&pageSize=100";
+ Map headers = new HashMap<>();
+ headers.put("token",access_token);
+
+ String returndata = sendGet(url, headers);
+ if (returndata != null && JSONArray.isValidArray(returndata)) {
+ JSONArray dataJson = JSONObject.parseArray(returndata);
+ if(dataJson != null && dataJson.size() > 0){
+ for (int i = 0; i < dataJson.size(); i++) {
+ if(dataJson.getJSONObject(i).getString("code") != null && !"".equals(dataJson.getJSONObject(i).getString("code"))
+ && usercode.toLowerCase().equals(dataJson.getJSONObject(i).getString("code").toLowerCase())){
+ jsonObject.put("telNumber",dataJson.getJSONObject(i).getString("telNumber"));
+ jsonObject.put("orgDepartmentName",dataJson.getJSONObject(i).getString("orgDepartmentName"));
+ jsonObject.put("orgPostName",dataJson.getJSONObject(i).getString("orgPostName"));
+ jsonObject.put("name",dataJson.getJSONObject(i).getString("name"));
+ break;
+ }
+ }
+ }
+ }
+ return jsonObject;
+ }
+ private String getOAToken(String name) {
+ String url = "https://swoa.sunwave.com.cn:9999/seeyon/rest/token";
+ Map headers = null;
+ String bodys = "{\"password\":\"64de4de7-23ce-4946-ac91-dd9e322d86e5\",\"userName\":\"beis\",\"loginName\":\""+name+"\"}";
+ String tokenData = sendPost(url, headers, bodys);
+ String access_token = null;
+ if (tokenData != null && JSONObject.isValidObject(tokenData)) {
+ JSONObject tokendataJson = JSONObject.parseObject(tokenData);
+ if (tokendataJson != null && tokendataJson.getString("id") != null) {
+ access_token = tokendataJson.getString("id");
+ }
+ }
+ return access_token;
+ }
+ /**
+ * @Author lvleigang
+ * @Description 获取token
+ * @Date 4:18 下午 2025/4/9
+ * @param
+ * @return java.lang.String
+ **/
+ private String getToken() {
+ String url = tokenUrl;
+ JSONObject tokenJson = new JSONObject();
+ tokenJson.put("accessKey",accessKey);
+ tokenJson.put("accessSecret",accessSecret);
+ String bodys = tokenJson.toJSONString();
+ StringBuilder body = new StringBuilder();
+ SSLContext sslContext = null;
+ try {
+ sslContext = new SSLContextBuilder()
+ .loadTrustMaterial(null, TrustAllStrategy.INSTANCE)
+ .build();
+ } catch (Exception e) {
+ return null;
+ }
+ CloseableHttpClient closeableHttpClient = HttpClients.custom()
+ .setSSLContext(sslContext)
+ .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE)
+ .build();
+
+ HttpPost post = new HttpPost(url);
+ CloseableHttpResponse response = null;
+ RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(6000).build();
+ post.setConfig(requestConfig);//设置请求参数【超时时间】
+ post.setHeader("Content-Type", "application/json; charset=utf-8");
+ try {
+ if (bodys != null && !"".equals(bodys)) {
+ ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8"));
+ entity.setContentType("application/json");
+ post.setEntity(entity);
+ }
+ response = closeableHttpClient.execute(post);
+
+ HttpEntity entity = response.getEntity();
+ body.append(EntityUtils.toString(entity, "UTF-8"));
+ } catch (Exception e) {
+ body.append(e.getMessage());
+ } finally {
+ try {
+ // 关闭响应对象
+ if (response != null) {
+ response.close();
+ }
+ // 关闭响应对象
+ if (closeableHttpClient != null) {
+ closeableHttpClient.close();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+ logger.info("token返回结果{}",body);
+ JSONObject bodyJson = JSONObject.parseObject(body.toString());
+ if(bodyJson.getString("code") == null || !"0".equals(bodyJson.getString("code"))){
+ return null;
+ }
+ JSONObject resultJson = bodyJson.getJSONObject("result");
+ if(resultJson == null){
+ return null;
+ }
+ if(resultJson.getString("accessToken") != null && !"".equals(resultJson.getString("accessToken"))){
+ return resultJson.getString("accessToken");
+ }
+ return null;
+ }
+
+ private String sendPost(String url, Map headers, String bodys) {
+ logger.info("url:"+url+"。bodys:"+bodys);
+
+ SSLContext sslContext = null;
+ try {
+ sslContext = new SSLContextBuilder()
+ .loadTrustMaterial(null, TrustAllStrategy.INSTANCE)
+ .build();
+ } catch (Exception e) {
+
+ }
+ CloseableHttpClient closeableHttpClient = HttpClients.custom()
+ .setSSLContext(sslContext)
+ .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE)
+ .build();
+ HttpPost post = new HttpPost(url);
+ CloseableHttpResponse response = null;
+ RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build();
+ post.setConfig(requestConfig);//设置请求参数【超时时间】
+ if (headers != null && headers.size() > 0) {
+ for (String key : headers.keySet()) {
+ post.setHeader(key, headers.get(key));
+ }
+ }
+ StringBuilder body = new StringBuilder();
+ try {
+ if (bodys != null && !"".equals(bodys)) {
+ ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8"));
+ entity.setContentType("application/json");
+ post.setEntity(entity);
+ }
+ response = closeableHttpClient.execute(post);
+ HttpEntity entity = response.getEntity();
+ body.append(EntityUtils.toString(entity, "UTF-8"));
+ logger.info("返回结果:" + body);
+ } catch (Exception e) {
+ logger.error("请求错误:" + e.getMessage());
+ body = new StringBuilder();
+ } finally {
+ try {
+ // 关闭响应对象
+ if (response != null) {
+ response.close();
+ }
+ // 关闭响应对象
+ if (closeableHttpClient != null) {
+ closeableHttpClient.close();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+ logger.info("url:"+url+"。bodys:"+bodys+"。body"+body);
+
+ return body.toString();
+ }
+ private String sendGet(String url, Map headers) {
+ SSLContext sslContext = null;
+ try {
+ sslContext = new SSLContextBuilder()
+ .loadTrustMaterial(null, TrustAllStrategy.INSTANCE)
+ .build();
+ } catch (Exception e) {
+
+ }
+ CloseableHttpClient closeableHttpClient = HttpClients.custom()
+ .setSSLContext(sslContext)
+ .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE)
+ .build();
+ // HttpClient
+ HttpGet get = new HttpGet(url);
+ CloseableHttpResponse response = null;
+
+ RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build();
+ get.setConfig(requestConfig);//设置请求参数【超时时间】
+ if (headers != null && headers.size() > 0) {
+ for (String key : headers.keySet()) {
+ get.setHeader(key, headers.get(key));
+ }
+ }
+ StringBuilder body = new StringBuilder();
+
+ try {
+ response = closeableHttpClient.execute(get);
+ HttpEntity entity = response.getEntity();
+ body.append(EntityUtils.toString(entity,"UTF-8"));
+ logger.info("返回结果:" + body);
+ } catch (Exception e) {
+ logger.error("请求错误:" + e.getMessage());
+ body.append(e.getMessage());
+ } finally {
+ try {
+ // 关闭响应对象
+ if (response != null) {
+ response.close();
+ }
+ // 关闭响应对象
+ if (closeableHttpClient != null) {
+ closeableHttpClient.close();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ return body.toString();
+ }
+
+
+ /**
+ * seeyon流程事件监听前置方法,绑定数据源
+ * @param entity
+ * @return
+ * @throws Exception
+ */
+ @Override
+ public SysExtensionApiEntity setData(SysExtensionApiEntity entity) throws Exception {
+ try {
+ JSONObject sendBody = new JSONObject();
+ String bodys = entity.getBodys();
+ Map headers = entity.getHeaders();
+ JSONObject jsonObject = JSONObject.parseObject(bodys);
+ String loginName = jsonObject.getString("field0002");
+ String dataXml = getXml(jsonObject);
+ //处理xml数据
+ String oaToken = getOAToken(loginName);
+ headers.put("token",oaToken);
+ sendBody.put("token",oaToken);
+ sendBody.put("loginName",loginName);
+ sendBody.put("dataXml",dataXml);
+ entity.setBodys(sendBody.toJSONString());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return entity;
+ }
+
+ private String getXml(JSONObject jsonObject) {
+ StringBuffer stringBuffer = new StringBuffer();
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0011") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0001") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0002") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0012") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0013") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0014") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0003") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0015") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0016") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0017") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0018") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0019") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0020") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append(jsonObject.getString("field0021") != null?"":"");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ //处理明细
+ JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("mdm_ccd_detail"));
+ if(jsonArray != null&& jsonArray.size() > 0){
+ for (int i = 0; i < jsonArray.size(); i++) {
+ JSONObject detailObject = jsonArray.getJSONObject(i);
+ stringBuffer.append("");
+ stringBuffer.append("").append(detailObject.getString("field0004") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("field0005") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("field0022") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("field0006") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("field0007") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("field0008") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("field0009") != null?"":"").append("");
+ stringBuffer.append("
");
+ }
+ }
+ stringBuffer.append("");
+ return stringBuffer.toString();
+ }
+
+
+
+}
diff --git a/base-buildpackage/src/main/resources/application-llg.yml b/base-buildpackage/src/main/resources/application-llg.yml
new file mode 100644
index 00000000..03cdf7ee
--- /dev/null
+++ b/base-buildpackage/src/main/resources/application-llg.yml
@@ -0,0 +1,82 @@
+#######################本地环境#######################
+logging:
+ #日志级别 指定目录级别
+ level:
+ root: info
+ encodings: UTF-8
+ file:
+ # 日志保存路径
+ path: /Users/apple/Desktop/log/local
+spring:
+ data:
+ mongodb:
+# host: 192.168.2.237
+# port: 27017
+# database: businesscenter
+# auto-index-creation: true
+# password: hzya1314
+# username: hzya
+ flyway:
+ # 启动flyway migration, 默认为true
+ enabled: false
+ datasource:
+ dynamic:
+ druid:
+ filters: stat,log4j2
+ datasource:
+ master:
+# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
+# username: hzyazt
+# password: 62e4295b615a30dbf3b8ee96f41c820b
+# driver-class-name: dm.jdbc.driver.DmDriver
+# type: com.alibaba.druid.pool.DruidDataSource
+ url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true
+ username: root
+ password: bd993088e8a7c3dc5f44441617f9b4bf
+ driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置
+# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8
+# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle
+# username: hzyazt
+# password: 62e4295b615a30dbf3b8ee96f41c820b
+# driver-class-name: dm.jdbc.driver.DmDriver
+savefile:
+ # 文件保存路径
+ path: /Users/apple/Desktop/log/local
+ tomcatpath: /Users/apple/Desktop/log/local
+ pluginpath: /Users/apple/Desktop/log/local
+zt:
+ url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface
+cbs8:
+ appId: 1P4AGrpz
+ appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a
+ url: https://cbs8-openapi-reprd.csuat.cmburl.cn
+ # 测试用这个 这个是银行给的,和下面的公钥不是一对密钥
+ ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44
+ # 这个私钥到时候上传到cbs,和下面到是同一对
+ #ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46
+ ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde
+ cbs_public_key: 0469146F06BF3B01236E84632441E826
+ #电子回单下载临时存放位置
+ elec_path: /Users/xiangerlin/Downloads/
+OA:
+ data_source_code: yc_oa
+server:
+ port: 10086
+
+# mysqldump -d mylm -hhzya.ufyct.com -p9096 -uroot -phzya1314 >%dirName%\table_view.sql
+
+
+database:
+ databaseName: businesscenter
+ host: 192.168.2.237
+ port: 3306
+ username: root
+ password: hzya@1314
+ filePase: /Users/apple/Desktop/log
+ fileName: data.sql
+#sftp:
+# host: 192.168.2.237
+# port: 9091
+# username: cs237
+# password: hzya@1314
+# filePase: /databaseBack
diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/pluginCfg.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/pluginCfg.xml
new file mode 100644
index 00000000..4fe837f2
--- /dev/null
+++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/pluginCfg.xml
@@ -0,0 +1,6 @@
+
+
+IncomeInvoicePlugin
+IncomeInvoicePlugin插件
+202404080001
+
diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-dao.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-dao.xml
new file mode 100644
index 00000000..52a288d1
--- /dev/null
+++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-dao.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml
new file mode 100644
index 00000000..07ee22b0
--- /dev/null
+++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-service.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-service.xml
new file mode 100644
index 00000000..68ce3bce
--- /dev/null
+++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-service.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java
index 6be14686..8761e1ca 100644
--- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java
+++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java
@@ -66,10 +66,10 @@ public class ZxBankServiceImpl extends BaseService impleme
@Value("${zt.url}")
private String url;
- @Value("${zx.privateKey}")
+ @Value("${zx.privateKey:}")
private String privateKey;
- @Value("${zx.publicKey}")
+ @Value("${zx.publicKey:}")
private String publicKey;
@Override
public JsonResultEntity queryArchives(JSONObject json) {
From dd600042c057607eec44f023bf8de9277c727560 Mon Sep 17 00:00:00 2001
From: lvleigang <957075182@qq.com>
Date: Thu, 10 Apr 2025 17:04:00 +0800
Subject: [PATCH 02/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E6=96=99?=
=?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E5=88=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../entity/IncomeInvoiceEntity.xml | 65 ++++++++++++++++++-
.../impl/IncomeInvoiceServiceImpl.java | 34 +++++++++-
2 files changed, 96 insertions(+), 3 deletions(-)
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml
index 219ac58a..76c3f17e 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml
@@ -32,6 +32,27 @@
company_id ,
fphm ,
+ fpdm ,
+ kprq ,
+ xfsh ,
+ xfmc ,
+ gfsh ,
+ gfmc ,
+ hjje ,
+ hjse ,
+ jshj ,
+ jym ,
+ xfdzdh ,
+ xfyhzh ,
+ gfdzdh ,
+ gfyhzh ,
+ mmq ,
+ bz ,
+ jqbh ,
+ jdhm ,
+ kpr ,
+ skr ,
+ fhr ,
@@ -55,6 +76,27 @@
#{company_id} ,
#{fphm} ,
+ #{fpdm} ,
+ #{kprq} ,
+ #{xfsh} ,
+ #{xfmc} ,
+ #{gfsh} ,
+ #{gfmc} ,
+ #{hjje} ,
+ #{hjse} ,
+ #{jshj} ,
+ #{jym} ,
+ #{xfdzdh} ,
+ #{xfyhzh} ,
+ #{gfdzdh} ,
+ #{gfyhzh} ,
+ #{mmq} ,
+ #{bz} ,
+ #{jqbh} ,
+ #{jdhm} ,
+ #{kpr} ,
+ #{skr} ,
+ #{fhr} ,
@@ -76,6 +118,17 @@
company_id ,
remark ,
+ xh ,
+ ssflbm ,
+ xmmc ,
+ ggxh ,
+ dw ,
+ sl ,
+ dj ,
+ je ,
+ slv ,
+ se ,
+
@@ -95,8 +148,16 @@
#{company_id} ,
#{remark} ,
-
-
+ #{xh} ,
+ #{ssflbm} ,
+ #{xmmc} ,
+ #{ggxh} ,
+ #{dw} ,
+ #{sl} ,
+ #{dj} ,
+ #{je} ,
+ #{slv} ,
+ #{se} ,
)
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
index 01861c17..2d4c6c0e 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
@@ -113,6 +113,28 @@ public class IncomeInvoiceServiceImpl extends BaseService 0){
@@ -129,7 +151,17 @@ public class IncomeInvoiceServiceImpl extends BaseService
Date: Fri, 11 Apr 2025 14:25:24 +0800
Subject: [PATCH 03/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E6=96=99?=
=?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E5=88=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../impl/IncomeInvoiceServiceImpl.java | 46 ++++++++++---------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
index 2d4c6c0e..dfbdb947 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
@@ -82,6 +82,8 @@ public class IncomeInvoiceServiceImpl extends BaseService 0){
for (int i1 = 0; i1 < detaildata.size(); i1++) {
@@ -208,8 +210,8 @@ public class IncomeInvoiceServiceImpl extends BaseService parametersMap = new HashMap<>();
From 3eee98f14216d2b794ee2ff9e7fe624bfe687f0c Mon Sep 17 00:00:00 2001
From: lvleigang <957075182@qq.com>
Date: Fri, 11 Apr 2025 15:33:30 +0800
Subject: [PATCH 04/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E6=96=99?=
=?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E5=88=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../impl/IncomeInvoiceServiceImpl.java | 23 -------------------
1 file changed, 23 deletions(-)
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
index dfbdb947..d950e050 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
@@ -240,30 +240,7 @@ public class IncomeInvoiceServiceImpl extends BaseService headers = new HashMap<>();
- headers.put("token",access_token);
- String returndata = sendGet(url, headers);
- if (returndata != null && JSONArray.isValidArray(returndata)) {
- JSONArray dataJson = JSONObject.parseArray(returndata);
- if(dataJson != null && dataJson.size() > 0){
- for (int i = 0; i < dataJson.size(); i++) {
- if(dataJson.getJSONObject(i).getString("code") != null && !"".equals(dataJson.getJSONObject(i).getString("code"))
- && usercode.toLowerCase().equals(dataJson.getJSONObject(i).getString("code").toLowerCase())){
- jsonObject.put("telNumber",dataJson.getJSONObject(i).getString("telNumber"));
- jsonObject.put("orgDepartmentName",dataJson.getJSONObject(i).getString("orgDepartmentName"));
- jsonObject.put("orgPostName",dataJson.getJSONObject(i).getString("orgPostName"));
- jsonObject.put("name",dataJson.getJSONObject(i).getString("name"));
- break;
- }
- }
- }
- }
- return jsonObject;
- }
private String getOAToken(String name) {
String url = "https://swoa.sunwave.com.cn:9999/seeyon/rest/token";
Map headers = null;
From c0125b7903c0c22456211a4b89a4b43ecf59a2ef Mon Sep 17 00:00:00 2001
From: lvleigang <957075182@qq.com>
Date: Tue, 15 Apr 2025 09:15:52 +0800
Subject: [PATCH 05/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E6=96=99?=
=?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E5=88=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../impl/IncomeInvoiceServiceImpl.java | 217 +++++++++++++-----
1 file changed, 160 insertions(+), 57 deletions(-)
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
index d950e050..6b45519c 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
@@ -242,9 +242,9 @@ public class IncomeInvoiceServiceImpl extends BaseService headers = null;
- String bodys = "{\"password\":\"64de4de7-23ce-4946-ac91-dd9e322d86e5\",\"userName\":\"beis\",\"loginName\":\""+name+"\"}";
+ String bodys = "{\"password\":\"a5ce21b8-91db-4cec-b3e3-3e44719655fd\",\"userName\":\"hzyaRest\",\"loginName\":\""+name+"\"}";
String tokenData = sendPost(url, headers, bodys);
String access_token = null;
if (tokenData != null && JSONObject.isValidObject(tokenData)) {
@@ -451,7 +451,7 @@ public class IncomeInvoiceServiceImpl extends BaseService headers = entity.getHeaders();
JSONObject jsonObject = JSONObject.parseObject(bodys);
- String loginName = jsonObject.getString("field0002");
+ String loginName = "hzya";
String dataXml = getXml(jsonObject);
//处理xml数据
String oaToken = getOAToken(loginName);
@@ -468,67 +468,170 @@ public class IncomeInvoiceServiceImpl extends BaseService");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0011") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0001") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0002") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0012") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0013") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0014") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0003") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0015") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0016") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0017") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0018") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0019") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0020") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- stringBuffer.append(jsonObject.getString("field0021") != null?"":"");
- stringBuffer.append("");
- stringBuffer.append("");
- //处理明细
- JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("mdm_ccd_detail"));
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("fpdm") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("fphm") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("kprq") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("xfsh") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("xfmc") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("gfsh") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("gfmc") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("hjje") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("hjse") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("jshj") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("jym") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("xfdzdh") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("xfyhzh") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("gfdzdh") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("gfyhzh") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("bz") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("jqbh") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("jdhm") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("kpr") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("skr") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("fhr") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("htbm") != null?"":"");
+ stringBuffer.append("").append("");
+
+ stringBuffer.append("").append("");
+ stringBuffer.append(jsonObject.getString("fpwj") != null?"":"");
+ stringBuffer.append("").append("");
+
+
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+
+ JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("mdm_fp_detail"));
if(jsonArray != null&& jsonArray.size() > 0){
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject detailObject = jsonArray.getJSONObject(i);
stringBuffer.append("");
- stringBuffer.append("").append(detailObject.getString("field0004") != null?"":"").append("");
- stringBuffer.append("").append(detailObject.getString("field0005") != null?"":"").append("");
- stringBuffer.append("").append(detailObject.getString("field0022") != null?"":"").append("");
- stringBuffer.append("").append(detailObject.getString("field0006") != null?"":"").append("");
- stringBuffer.append("").append(detailObject.getString("field0007") != null?"":"").append("");
- stringBuffer.append("").append(detailObject.getString("field0008") != null?"":"").append("");
- stringBuffer.append("").append(detailObject.getString("field0009") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("xh") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("ssflbm") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("xmmc") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("ggxh") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("dw") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("sl") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("dj") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("je") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("slv") != null?"":"").append("");
+ stringBuffer.append("").append(detailObject.getString("se") != null?"":"").append("");
stringBuffer.append("
");
}
}
- stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+ stringBuffer.append("");
+
return stringBuffer.toString();
}
From b6334bba1a80245d14fa7b2fc4bd2ddf3505e0ec Mon Sep 17 00:00:00 2001
From: lvleigang <957075182@qq.com>
Date: Tue, 15 Apr 2025 14:24:43 +0800
Subject: [PATCH 06/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=A9=E6=96=99?=
=?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E5=88=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java
index beb4c48e..1171b1c2 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java
@@ -473,6 +473,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
//查询主数据
MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity();
+ queryMdmModuleEntity.setMdmCode(10050L);
queryMdmModuleEntity.setSts("Y");
List mdmModuleEntities = mdmModuleDao.queryBase(queryMdmModuleEntity);
if(mdmModuleEntities == null || mdmModuleEntities.size() == 0){
From 103b9c29813da9cf3b2a9be1e12186dbeb3e3d1b Mon Sep 17 00:00:00 2001
From: lvleigang <957075182@qq.com>
Date: Tue, 15 Apr 2025 16:37:23 +0800
Subject: [PATCH 07/15] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BC=A0=E9=80=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../dao/IIncomeInvoiceDao.java | 8 +++
.../dao/impl/IncomeInvoiceDaoImpl.java | 24 +++++++
.../entity/IncomeInvoiceEntity.java | 64 ++++++++++++++++++-
.../entity/IncomeInvoiceEntity.xml | 51 +++++++++++++++
.../impl/IncomeInvoiceServiceImpl.java | 21 ++++++
.../plugin/MdmModulePluginInitializer.java | 45 +++++++++----
.../impl/SysApplicationServiceImpl.java | 10 ++-
7 files changed, 207 insertions(+), 16 deletions(-)
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java
index 54190fe9..512d1a80 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java
@@ -20,5 +20,13 @@ public interface IIncomeInvoiceDao extends IBaseDao
int saveDetailData(JSONObject saveDetailData);
int saveData(JSONObject saveData);
+
+ List queryOaZb(IncomeInvoiceEntity incomeInvoiceEntity);
+
+ List queryOaMx(IncomeInvoiceEntity incomeInvoiceEntity);
+
+ int updateMx(IncomeInvoiceEntity incomeInvoiceEntity);
+
+ int saveMx(IncomeInvoiceEntity incomeInvoiceEntity);
}
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java
index fa68e930..cc17e4a1 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java
@@ -1,6 +1,7 @@
package com.hzya.frame.plugin.incomeInvoiceData.dao.impl;
import com.alibaba.fastjson.JSONObject;
+import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.dao.MybatisGenericDao;
import com.hzya.frame.plugin.incomeInvoiceData.dao.IIncomeInvoiceDao;
import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity;
@@ -28,5 +29,28 @@ public class IncomeInvoiceDaoImpl extends MybatisGenericDao queryOaZb(IncomeInvoiceEntity entity) {
+ List o = (List) super.selectList(getSqlIdPrifx() + "queryOaZb", entity);
+ return o;
+ }
+ @DS("#entity.dataSourceCode")
+ @Override
+ public List queryOaMx(IncomeInvoiceEntity entity) {
+ List o = (List) super.selectList(getSqlIdPrifx() + "queryOaMx", entity);
+ return o;
+ }
+ @DS("#entity.dataSourceCode")
+ @Override
+ public int updateMx(IncomeInvoiceEntity entity) {
+ return super.update(getSqlIdPrifx() + "updateMx", entity);
+ }
+ @DS("#entity.dataSourceCode")
+ @Override
+ public int saveMx(IncomeInvoiceEntity entity) {
+ return super.insert(getSqlIdPrifx() + "saveMx", entity);
+ }
}
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java
index a4d160c0..71fb1e71 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java
@@ -7,8 +7,70 @@ import com.hzya.frame.web.entity.BaseEntity;
* @since 2024-06-21 13:52:35
*/
public class IncomeInvoiceEntity extends BaseEntity {
-
+
+ private Integer data_id;
+ private Integer formmain_id;
+ private String field0127;
+ private String field0128;
+ private String field0129;
+ private String field0130;
+ private String field0003;
+ public Integer getData_id() {
+ return data_id;
+ }
+
+ public void setData_id(Integer data_id) {
+ this.data_id = data_id;
+ }
+
+ public Integer getFormmain_id() {
+ return formmain_id;
+ }
+
+ public void setFormmain_id(Integer formmain_id) {
+ this.formmain_id = formmain_id;
+ }
+
+ public String getField0127() {
+ return field0127;
+ }
+
+ public void setField0127(String field0127) {
+ this.field0127 = field0127;
+ }
+
+ public String getField0128() {
+ return field0128;
+ }
+
+ public void setField0128(String field0128) {
+ this.field0128 = field0128;
+ }
+
+ public String getField0129() {
+ return field0129;
+ }
+
+ public void setField0129(String field0129) {
+ this.field0129 = field0129;
+ }
+
+ public String getField0130() {
+ return field0130;
+ }
+
+ public void setField0130(String field0130) {
+ this.field0130 = field0130;
+ }
+
+ public String getField0003() {
+ return field0003;
+ }
+
+ public void setField0003(String field0003) {
+ this.field0003 = field0003;
+ }
}
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml
index 76c3f17e..7cde37a3 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml
@@ -162,6 +162,57 @@
)
+
+
+
+
+ update formson_0702 set
+
+ field0127 = #{field0127},
+ field0128 = #{field0128},
+ field0129 = #{field0129},
+ field0130 = #{field0130},
+
+ where id = #{data_id}
+
+
+
+ insert into formson_0702(
+
+ id ,
+ formmain_id ,
+ field0127 ,
+ field0128 ,
+ field0129 ,
+ field0130 ,
+
+
+ )values(
+
+ #{data_id} ,
+ #{formmain_id} ,
+ #{field0127} ,
+ #{field0128} ,
+ #{field0129} ,
+ #{field0130} ,
+
+ )
+
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
index 6b45519c..f7dc1424 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java
@@ -460,6 +460,27 @@ public class IncomeInvoiceServiceImpl extends BaseService list = incomeInvoiceDao.queryOaZb(incomeInvoiceEntity);
+ if(list != null && list.size() == 1){
+ incomeInvoiceEntity.setFormmain_id(list.get(0).getData_id());
+ }
+ List mxlist = incomeInvoiceDao.queryOaMx(incomeInvoiceEntity);
+ if(mxlist != null && mxlist.size() == 1){
+ incomeInvoiceEntity.setData_id(mxlist.get(0).getData_id());
+ incomeInvoiceDao.updateMx(incomeInvoiceEntity);
+ }
+ if(mxlist == null || mxlist.size() == 0){
+ incomeInvoiceEntity.setData_id(1);
+ incomeInvoiceDao.saveMx(incomeInvoiceEntity);
+ }
} catch (Exception e) {
e.printStackTrace();
}
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java
index 1171b1c2..f79b7098 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java
@@ -470,7 +470,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
}
}
}else {//执行正常下发
-
+ logger.info("==========开始执行正常主数据下发=============");
//查询主数据
MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity();
queryMdmModuleEntity.setMdmCode(10050L);
@@ -510,13 +510,17 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
queryFildRule.setRuleCode("service");
List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule);
- //新增
- doAdd(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
- //修改
- doUpdate(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
- //删除
- doDelete(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
-
+ if(mdmModuleEntities.get(i).getMdmCode()!= 10045L){
+ //新增
+ doAdd(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
+ //修改
+ doUpdate(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
+ //删除
+ doDelete(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
+ }else{
+ logger.info("主数据编码为10045,已经在业务数据下发执行,主数据下发不执行");
+ continue;
+ }
}
}
@@ -740,7 +744,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
//map1.put("dataStatus", "F");
map1.put("updateStatus", "0");
- map1.put("size", 50);
+ //map1.put("size", 50);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@@ -828,6 +832,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
/** body */
String bodys = doObjects.get(i).toJSONString();
if(scriptEntity != null && scriptEntity.getId() != null ){
+ logger.info("=========开始执行正常主数据修改下发脚本,第一次==============");
groovy.put("code",scriptEntity.getScriptCode());
groovy.put("className",scriptEntity.getClassName());
groovy.put("name",scriptEntity.getScriptName());
@@ -855,6 +860,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
headers.putAll(header);
}
if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) {
+ logger.info("=========正常主数据修改开始执行登录接口==============");
//找到登陆接口
SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort());
if (null == loginApi) {
@@ -875,12 +881,15 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
continue;
}
JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString());
+ logger.info("=======主数据正常修改下发登录返回数据:{}========",attritube.toJSONString());
querys = getQuery(apiEntity,querys,attritube);
headers = getHeaders(apiEntity,headers,attritube);
bodys = getBodys(apiEntity,bodys,attritube);
}
//组装数据发送
+ logger.info("=========开始执行主业务修改数据下发脚本,第二次==============");
JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys);
+ logger.info("=====主数据修改下发返回结果为:{}",JSONObject.parseObject(jsonResultEntity.getAttribute().toString()).toJSONString());
if(jsonResultEntity.isFlag()){
//保存日志
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2");
@@ -912,7 +921,8 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
* @param mdmModuleDistributeEntities
* @return void
**/
- private void doAdd(String mdmId,Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities,List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities ) throws Exception {
+ private void
+ doAdd(String mdmId,Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities,List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities ) throws Exception {
//查询一千条数据
String mainDb = null;
List objects = new ArrayList<>();
@@ -928,7 +938,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
//map1.put("dataStatus", "Y");
map1.put("addStatus", "0");
- map1.put("size", 50);
+ //map1.put("size", 50);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@@ -1000,6 +1010,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
mdmModuleSendLogEntity.setOptionType("1");
Integer num = mdmModuleSendLogDao.getCount(mdmModuleSendLogEntity);
if(num > 0){//已经新增过不发送
+ objects.get(i).put("sendsanfzt123",true);
continue;
}
getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities);
@@ -1030,6 +1041,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
/** body */
String bodys = doObjects.get(i).toJSONString();
if(scriptEntity != null && scriptEntity.getId() != null ){
+ logger.info("=========开始执行正常主数据新增下发脚本,第一次==============");
groovy.put("code",scriptEntity.getScriptCode());
groovy.put("className",scriptEntity.getClassName());
groovy.put("name",scriptEntity.getScriptName());
@@ -1057,6 +1069,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
headers.putAll(header);
}
if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) {
+ logger.info("=========正常主数据新增开始执行登录接口==============");
//找到登陆接口
SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort());
if (null == loginApi) {
@@ -1077,15 +1090,19 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
continue;
}
JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString());
+ logger.info("=======主数据正常新增下发登录返回数据:{}========",attritube.toJSONString());
querys = getQuery(apiEntity,querys,attritube);
headers = getHeaders(apiEntity,headers,attritube);
bodys = getBodys(apiEntity,bodys,attritube);
}
//组装数据发送
+ logger.info("=========开始执行主业务新增数据下发脚本,第二次==============");
JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys);
+ logger.info("=====主数据新增下发返回结果为:{}",JSONObject.parseObject(jsonResultEntity.getAttribute().toString()).toJSONString());
if(jsonResultEntity.isFlag()){
if (scriptEntity != null && scriptEntity.getId() != null && scriptEntity.getBackScriptData() != null ) {
+ logger.info("=========开始执行主数据新增返回脚本==============");
JSONObject backScriptJson = new JSONObject();
backScriptJson.put("data", jsonResultEntity.getAttribute());
groovy.put("code", scriptEntity.getScriptCode()+"back");
@@ -1125,11 +1142,13 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
//保存日志
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1");
objects.get(i).put("sendsanfzt123",true);
+ logger.info("========主数据新增下发完成,日志保存为成功============");
continue;
}else {
//保存日志
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1");
objects.get(i).put("sendsanfzt123",false);
+ logger.info("========主数据新增下发完成,日志保存为失败============");
continue;
}
}
@@ -1137,7 +1156,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
//所有下发发送完成,修改数据状态
for (int i = 0; i < objects.size(); i++) {
- if(objects.get(i).getBoolean("sendsanfzt123")){
+ if(objects.get(i).getString("sendsanfzt123") != null && objects.get(i).getBoolean("sendsanfzt123")){
Map updateMap = new HashMap<>();
updateMap.put("tableName",mainDb);
//updateMap.put("dataStatus", "Y");
@@ -1491,4 +1510,4 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
}
return jsonObjects;
}
-}
+}
\ No newline at end of file
diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java
index ad9976a0..caf670cc 100644
--- a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java
+++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java
@@ -3055,8 +3055,13 @@ public class SysApplicationServiceImpl extends BaseService
Date: Wed, 16 Apr 2025 14:29:19 +0800
Subject: [PATCH 08/15] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BC=A0=E9=80=92?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../entity/IncomeInvoiceEntity.java | 20 +++++++++----------
.../entity/IncomeInvoiceEntity.xml | 14 ++++++-------
.../impl/IncomeInvoiceServiceImpl.java | 13 ++++++------
.../spring/spring-buildpackage-plugin.xml | 2 +-
4 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java
index 71fb1e71..51c2e8e3 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java
@@ -8,8 +8,8 @@ import com.hzya.frame.web.entity.BaseEntity;
*/
public class IncomeInvoiceEntity extends BaseEntity {
- private Integer data_id;
- private Integer formmain_id;
+ private Integer dataId;
+ private Integer formmainId;
private String field0127;
private String field0128;
private String field0129;
@@ -17,20 +17,20 @@ public class IncomeInvoiceEntity extends BaseEntity {
private String field0003;
- public Integer getData_id() {
- return data_id;
+ public Integer getDataId() {
+ return dataId;
}
- public void setData_id(Integer data_id) {
- this.data_id = data_id;
+ public void setDataId(Integer dataId) {
+ this.dataId = dataId;
}
- public Integer getFormmain_id() {
- return formmain_id;
+ public Integer getFormmainId() {
+ return formmainId;
}
- public void setFormmain_id(Integer formmain_id) {
- this.formmain_id = formmain_id;
+ public void setFormmainId(Integer formmainId) {
+ this.formmainId = formmainId;
}
public String getField0127() {
diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml
index 7cde37a3..5ecedcf9 100644
--- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml
+++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml
@@ -164,7 +164,7 @@