From 8bc54721ed1a4cfed760ea17de7d81479082bdc0 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 22 May 2025 09:37:11 +0800 Subject: [PATCH 01/31] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/CInvoiceImportHEntity.java | 20 ++++++++++++++++++ .../cinvoice/entity/CInvoiceImportHEntity.xml | 19 +++++++++++++---- .../CInvoiceImportPluginInitializer.java | 5 +++-- .../service/ICInvoiceImportHService.java | 7 +++++++ .../impl/CInvoiceImportHServiceImpl.java | 19 +++++++++++++++++ .../impl/CInvoiceImportPluginServiceImpl.java | 21 +++++++++++++++++-- 6 files changed, 83 insertions(+), 8 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.java index 77da27ba..b5e4c047 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.java @@ -14,6 +14,10 @@ public class CInvoiceImportHEntity extends BaseEntity { private String bill_type; //单据编码 private String bill_code; + //有度发票导入结果字段名 + private String yd_res_field; + //有度发票导入接口返回的id + private String yd_result; public String getTab_name() { return tab_name; @@ -38,4 +42,20 @@ public class CInvoiceImportHEntity extends BaseEntity { public void setBill_code(String bill_code) { this.bill_code = bill_code; } + + public String getYd_res_field() { + return yd_res_field; + } + + public void setYd_res_field(String yd_res_field) { + this.yd_res_field = yd_res_field; + } + + public String getYd_result() { + return yd_result; + } + + public void setYd_result(String yd_result) { + this.yd_result = yd_result; + } } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml index 0ffc8517..bdf34f15 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml @@ -4,6 +4,7 @@ + @@ -14,49 +15,59 @@ SELECT id, 'formmain_0327' as tab_name, + 'field0370' as yd_res_field, '对公付款单' as bill_type, field0146 as bill_code FROM formmain_0327 WHERE - 1 = 1 - -- and finishedflag = 1 + finishedflag = 1 UNION ALL SELECT id, 'formmain_0533' as tab_name, + 'field0383' as yd_res_field, '差旅费报销单' as bill_type, field0094 as bill_code FROM formmain_0533 WHERE - 1 = 1 - -- and finishedflag = 1 + finishedflag = 1 UNION ALL -- 日常费用报销 SELECT id, 'formmain_0314' as tab_name, + 'field0338' as yd_res_field, '日常报销单' as bill_type, field0220 as bill_code FROM formmain_0314 + WHERE + finishedflag = 1 UNION ALL -- 业务招待费 SELECT id, 'formmain_0294' as tab_name, + 'field0218' as yd_res_field, '招待报销单' as bill_type, field0053 as bill_code FROM formmain_0294 + WHERE + finishedflag = 1 ) f f.id = #{id} and f.bill_code = #{bill_code} + + + update ${tab_name} set ${yd_res_field} = #{yd_result} where id = #{id} + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/plugin/CInvoiceImportPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/plugin/CInvoiceImportPluginInitializer.java index 65865947..e27a7e54 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/plugin/CInvoiceImportPluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/plugin/CInvoiceImportPluginInitializer.java @@ -3,6 +3,7 @@ package com.hzya.frame.plugin.cinvoice.plugin; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.plugin.cinvoice.service.ICInvoiceImportPluginService; +import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -94,8 +95,8 @@ public class CInvoiceImportPluginInitializer extends PluginBaseEntity { **/ @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { - logger.info("======开始执OA发票批量导入有度税务插件======"); + logger.info("======开始执OA发票批量导入有度税务插件======:{}",requestJson.toString()); pluginService.importInvoice(requestJson); - return null; + return BaseResult.getSuccessMessageEntity("执行成功"); } } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java index 5ce1a532..506a7685 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java @@ -19,4 +19,11 @@ public interface ICInvoiceImportHService extends IBaseService queryInvoiceList(CInvoiceImportHEntity entity) throws Exception; + + /** + * 更新有度导入接口返回的id + * @param entity + * @return + */ + int updateResultId(CInvoiceImportHEntity entity); } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportHServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportHServiceImpl.java index c6edb605..bd07d396 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportHServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportHServiceImpl.java @@ -1,5 +1,6 @@ package com.hzya.frame.plugin.cinvoice.service.impl; +import cn.hutool.core.util.StrUtil; import com.baomidou.dynamic.datasource.annotation.DS; import com.hzya.frame.basedao.service.impl.BaseService; import com.hzya.frame.plugin.cinvoice.dao.ICInvoiceImportHDao; @@ -42,4 +43,22 @@ public class CInvoiceImportHServiceImpl extends BaseService list = cInvoiceImportHDao.queryList(entity, "com.hzya.frame.plugin.cinvoice.dao.impl.CInvoiceImportHDaoImpl.entity_list_base"); return list; } + + /** + * 更新有度导入接口返回的id + * + * @param entity + * @return + */ + @DS("#entity.dataSourceCode") + @Override + public int updateResultId(CInvoiceImportHEntity entity) { + if (null != entity + && StrUtil.isNotEmpty(entity.getTab_name()) + && StrUtil.isNotEmpty(entity.getYd_res_field()) && StrUtil.isNotEmpty(entity.getYd_result())){ + int updateRows = cInvoiceImportHDao.update("com.hzya.frame.plugin.cinvoice.dao.impl.CInvoiceImportHDaoImpl.entity_update", entity); + return updateRows; + } + return 0; + } } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java index 2617aa42..a4318bad 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java @@ -16,6 +16,7 @@ import com.hzya.frame.plugin.cinvoice.service.ICInvoiceImportPluginService; import com.hzya.frame.seeyon.util.YzfSignUtil; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.web.exception.BaseSystemException; import org.apache.commons.collections.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,10 +72,16 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer //1、 查OA主表 String dataSourceCode = requestJson.getString("sourceCode"); + if (StrUtil.isEmpty(dataSourceCode)){ + dataSourceCode = requestJson.getString("apiDataSourceCode"); + } String id = requestJson.getString("id");//主表id + if (StrUtil.isEmpty(id)){ + throw new BaseSystemException("id不能为空"); + } CInvoiceImportHEntity importHEntity = new CInvoiceImportHEntity(); importHEntity.setDataSourceCode(dataSourceCode); - importHEntity.setId("6286766887088770238"); + importHEntity.setId(id); List cInvoiceImportHList = cInvoiceImportHService.queryInvoiceList(importHEntity); if (CollectionUtils.isNotEmpty(cInvoiceImportHList)){ ParamAssembler assembler = null; @@ -83,7 +90,7 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer //3、 查迈瑞思发票表 //迈锐思发票公共信息表 LexmisPublicinfoEntity lexmisPublicinfoEntity = new LexmisPublicinfoEntity(cInvoiceH.getId(),dataSourceCode); - lexmisPublicinfoEntity.setPI_ID("-95056949260236712"); + //lexmisPublicinfoEntity.setPI_ID("6952494198841691018"); List lexmisPublicinfoEntityList = lexmisPublicinfoService.query(lexmisPublicinfoEntity); if (CollectionUtils.isNotEmpty(lexmisPublicinfoEntityList)){ //税务接口每次最多传50张发票 @@ -155,6 +162,15 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer if (StrUtil.isNotEmpty(body)){ JSONObject jsonObject = JSONObject.parseObject(body); Boolean flag = jsonObject.getBoolean("flag"); + JSONObject resObj = jsonObject.getJSONObject("attribute"); + if (null != resObj && "0".equals(resObj.getString("code"))){ + String result = resObj.getString("result"); + if (StrUtil.isNotEmpty(result)){ + cInvoiceH.setDataSourceCode(dataSourceCode); + cInvoiceH.setYd_result(result); + cInvoiceImportHService.updateResultId(cInvoiceH); + } + } //保存日志 IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity(); taskLivingDetail.setCreate_time(new Date()); @@ -167,6 +183,7 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer taskLivingDetail.setNewPushDate(new Date()); this.saveLog(id,flag,taskLivingDetail); } + return body; } } } From 271243ee4f881259f9f39425687417677be2ebaf Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 22 May 2025 10:09:18 +0800 Subject: [PATCH 02/31] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ds=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java | 1 + 1 file changed, 1 insertion(+) diff --git a/base-common/src/main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java b/base-common/src/main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java index 04398663..03d82fa9 100644 --- a/base-common/src/main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java +++ b/base-common/src/main/java/com/hzya/frame/basedao/dao/MybatisGenericDao.java @@ -217,6 +217,7 @@ public abstract class MybatisGenericDao Date: Thu, 22 May 2025 16:41:26 +0800 Subject: [PATCH 03/31] =?UTF-8?q?=E6=94=B9=E6=88=90=E6=9F=A5=E8=A7=86?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cinvoice/entity/CInvoiceImportHEntity.xml | 51 +------------------ 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml index bdf34f15..19a97996 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml @@ -11,56 +11,7 @@ update ${tab_name} set ${yd_res_field} = #{yd_result} where id = #{id} + + + update ${tab_name} set ${push_field} = '1' where id = #{id} + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java index 506a7685..4dfbcc76 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java @@ -26,4 +26,11 @@ public interface ICInvoiceImportHService extends IBaseService cInvoiceImportHList = cInvoiceImportHService.queryInvoiceList(importHEntity); - if (CollectionUtils.isNotEmpty(cInvoiceImportHList)){ + if (CollectionUtils.isNotEmpty(cInvoiceImportHList)) { ParamAssembler assembler = null; CInvoiceImportHEntity cInvoiceH = cInvoiceImportHList.get(0); + cInvoiceH.setDataSourceCode(dataSourceCode); //2、 查OA明细表 //3、 查迈瑞思发票表 //迈锐思发票公共信息表 - LexmisPublicinfoEntity lexmisPublicinfoEntity = new LexmisPublicinfoEntity(cInvoiceH.getId(),dataSourceCode); + LexmisPublicinfoEntity lexmisPublicinfoEntity = new LexmisPublicinfoEntity(cInvoiceH.getId(), dataSourceCode); //lexmisPublicinfoEntity.setPI_ID("6952494198841691018"); List lexmisPublicinfoEntityList = lexmisPublicinfoService.query(lexmisPublicinfoEntity); - if (CollectionUtils.isNotEmpty(lexmisPublicinfoEntityList)){ + if (CollectionUtils.isNotEmpty(lexmisPublicinfoEntityList)) { + cInvoiceH.setPush_status("1"); + cInvoiceImportHService.updateStatus(cInvoiceH); //税务接口每次最多传50张发票 int size = lexmisPublicinfoEntityList.size(); int batchSize = 50; - for (int i = 0; i < size; i += batchSize){ - int no = 1;//序号 - //4、 根据发票类型,组装不同参数 - JSONObject head = new JSONObject(); - JSONArray inputInfos = new JSONArray(); - head.put("inputInfos",inputInfos);//发票录入信息,单次最大50张 - // 获取当前批次的子列表 - List batchList = lexmisPublicinfoEntityList.subList(i, Math.min(i + batchSize, size)); - //使用stream方式 publicinfoList 按 PI_TABLENAME分组 - Map> groupedByPiTablename = batchList.stream() - .collect(Collectors.groupingBy(LexmisPublicinfoEntity::getPI_TABLENAME)); - for (Map.Entry> entry : groupedByPiTablename.entrySet()){ - String key = entry.getKey();//对应发票类型的表名 - List publicinfoList = entry.getValue(); - for (LexmisPublicinfoEntity info : publicinfoList){ + for (int i = 0; i < size; i += batchSize) { + try { + int no = 1;//序号 + //4、 根据发票类型,组装不同参数 + JSONObject head = new JSONObject(); + JSONArray inputInfos = new JSONArray(); + head.put("inputInfos", inputInfos);//发票录入信息,单次最大50张 + // 获取当前批次的子列表 + List batchList = lexmisPublicinfoEntityList.subList(i, Math.min(i + batchSize, size)); + //使用stream方式 publicinfoList 按 PI_TABLENAME分组 + Map> groupedByPiTablename = batchList.stream() + .collect(Collectors.groupingBy(LexmisPublicinfoEntity::getPI_TABLENAME)); + for (Map.Entry> entry : groupedByPiTablename.entrySet()) { + String key = entry.getKey();//对应发票类型的表名 + List publicinfoList = entry.getValue(); + for (LexmisPublicinfoEntity info : publicinfoList) { - JSONObject inputInfo = new JSONObject(); - inputInfos.add(inputInfo); - inputInfo.put("no",no);//编号 - inputInfo.put("systemName","4");//来源系统 默认写4 代表OA - inputInfo.put("businessNo",cInvoiceH.getBill_code());//业务单据号 - inputInfo.put("bookkeepingStatus","1");//记账状态,默认传1 - inputInfo.put("customFlag","2");//业务流转状态,默认传2 - JSONObject invoiceInfo = new JSONObject();//票面信息 - inputInfo.put("invoiceInfo", invoiceInfo); - JSONObject baseInfo = new JSONObject();//发票基本信息 - JSONObject contentInfo = new JSONObject();//发票内容 - JSONArray taxturnsInfos = new JSONArray();//进项转出信息 - invoiceInfo.put("taxturnsInfos",taxturnsInfos); + JSONObject inputInfo = new JSONObject(); + inputInfos.add(inputInfo); + inputInfo.put("no", no);//编号 + inputInfo.put("systemName", "4");//来源系统 默认写4 代表OA + inputInfo.put("businessNo", cInvoiceH.getBill_code());//业务单据号 + inputInfo.put("bookkeepingStatus", "1");//记账状态,默认传1 + inputInfo.put("customFlag", "2");//业务流转状态,默认传2 + JSONObject invoiceInfo = new JSONObject();//票面信息 + inputInfo.put("invoiceInfo", invoiceInfo); + JSONObject baseInfo = new JSONObject();//发票基本信息 + JSONObject contentInfo = new JSONObject();//发票内容 + JSONArray taxturnsInfos = new JSONArray();//进项转出信息 + invoiceInfo.put("taxturnsInfos", taxturnsInfos); - switch (key){ - case "LEXMISCIV_INVOICEMAIN"://增值税发票 - zzsInvoice(dataSourceCode, info, invoiceInfo, baseInfo); - break; - case "LEXMISCIV_TRAINTICKET"://火车票 - trainInvoice(dataSourceCode, inputInfos, info, inputInfo, invoiceInfo, baseInfo); - break; - case "LEXMISCIV_PLANETICKET"://飞机行程单 - planeInvoice(dataSourceCode, info, invoiceInfo, baseInfo); - break; - case "LEXMISCIV_BUSINVOICE"://客运汽车票 - busInvoice(dataSourceCode, info, invoiceInfo, baseInfo); - break; - default: - logger.info("没有匹配到类型"); - break; + switch (key) { + case "LEXMISCIV_INVOICEMAIN"://增值税发票 + zzsInvoice(dataSourceCode, info, invoiceInfo, baseInfo); + break; + case "LEXMISCIV_TRAINTICKET"://火车票 + trainInvoice(dataSourceCode, inputInfos, info, inputInfo, invoiceInfo, baseInfo); + break; + case "LEXMISCIV_PLANETICKET"://飞机行程单 + planeInvoice(dataSourceCode, info, invoiceInfo, baseInfo); + break; + case "LEXMISCIV_BUSINVOICE"://客运汽车票 + busInvoice(dataSourceCode, info, invoiceInfo, baseInfo); + break; + default: + logger.info("没有匹配到类型"); + break; + } + no++; } - no++; + head.put("taxNo", publicinfoList.get(0).getPI_TAXNO());//当前企业税号 } - head.put("taxNo",publicinfoList.get(0).getPI_TAXNO());//当前企业税号 - } - logger.info("调用有度发票批量导入接口请求参数:{}",head.toString()); - //调用税务接口 - Map headerMap = MapBuilder.create(true) - .put("apiCode", "8000600005")//有度发票导入接口 - .put("publicKey","ZJYA7f8FzV219otH8zhkReiyyWpXswpbY/+StvC2em0hf59Ce7eDIk+3zDUT+v578prj")//发起方应用 - .put("secretKey","xJ9J1Ev2F0faiJ/nQnCNklskAgtQp3QSm+ihO21uY/H0UADj0tSDPxmIhFfC4v6Fj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//发起方应用 - .put("appId","800060") - .build(); - String body = HttpRequest.post(url).addHeaders(headerMap).body(head.toString()).timeout(60000).execute().body(); - //String body = null; - logger.info("调用有度发票批量导入接口响应参数:{}",body); - //保存操作日志 - if (StrUtil.isNotEmpty(body)){ - JSONObject jsonObject = JSONObject.parseObject(body); - Boolean flag = jsonObject.getBoolean("flag"); - JSONObject resObj = jsonObject.getJSONObject("attribute"); - if (null != resObj && "0".equals(resObj.getString("code"))){ - String result = resObj.getString("result"); - if (StrUtil.isNotEmpty(result)){ - cInvoiceH.setDataSourceCode(dataSourceCode); - cInvoiceH.setYd_result(result); - cInvoiceImportHService.updateResultId(cInvoiceH); + logger.info("调用有度发票批量导入接口请求参数:{}", head.toString()); + //调用税务接口 + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000600005")//有度发票导入接口 + .put("publicKey", "ZJYA7f8FzV219otH8zhkReiyyWpXswpbY/+StvC2em0hf59Ce7eDIk+3zDUT+v578prj")//发起方应用 + .put("secretKey", "xJ9J1Ev2F0faiJ/nQnCNklskAgtQp3QSm+ihO21uY/H0UADj0tSDPxmIhFfC4v6Fj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//发起方应用 + .put("appId", "800060") + .build(); + String body = HttpRequest.post(url).addHeaders(headerMap).body(head.toString()).timeout(60000).execute().body(); + //String body = null; + logger.info("调用有度发票批量导入接口响应参数:{}", body); + //保存操作日志 + if (StrUtil.isNotEmpty(body)) { + JSONObject jsonObject = JSONObject.parseObject(body); + Boolean flag = jsonObject.getBoolean("flag"); + JSONObject resObj = jsonObject.getJSONObject("attribute"); + if (null != resObj && "0".equals(resObj.getString("code"))) { + String result = resObj.getString("result"); + if (StrUtil.isNotEmpty(result)) { + cInvoiceH.setDataSourceCode(dataSourceCode); + cInvoiceH.setYd_result(result); + cInvoiceImportHService.updateResultId(cInvoiceH); + } } + //保存日志 + IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity(); + taskLivingDetail.setCreate_time(new Date()); + taskLivingDetail.setModify_time(new Date()); + taskLivingDetail.setRootAppPk(cInvoiceH.getId()); + taskLivingDetail.setRootAppBill(cInvoiceH.getBill_code()); + taskLivingDetail.setPluginId("CInvoiceImportPluginInitializer"); + taskLivingDetail.setRootAppNewData(head.toString()); + taskLivingDetail.setNewTransmitInfo(body); + taskLivingDetail.setNewPushDate(new Date()); + this.saveLog(id, flag, taskLivingDetail); } - //保存日志 - IntegrationTaskLivingDetailsEntity taskLivingDetail = new IntegrationTaskLivingDetailsEntity(); - taskLivingDetail.setCreate_time(new Date()); - taskLivingDetail.setModify_time(new Date()); - taskLivingDetail.setRootAppPk(cInvoiceH.getId()); - taskLivingDetail.setRootAppBill(cInvoiceH.getBill_code()); - taskLivingDetail.setPluginId("CInvoiceImportPluginInitializer"); - taskLivingDetail.setRootAppNewData(head.toString()); - taskLivingDetail.setNewTransmitInfo(body); - taskLivingDetail.setNewPushDate(new Date()); - this.saveLog(id,flag,taskLivingDetail); + } catch (Exception e) { + logger.error("发票批量导入有度系统循环中出错:{}", e.getMessage()); } - return body; } + }else { + cInvoiceH.setPush_status("未查询到有效数据不推送"); + cInvoiceImportHService.updateStatus(cInvoiceH); } } @@ -193,39 +200,41 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer } - /** * 保存日志 + * * @param integration_task_living_details_id * @param flag * @param taskLivingDetail */ - public void saveLog(String integration_task_living_details_id, Boolean flag, IntegrationTaskLivingDetailsEntity taskLivingDetail){ + public void saveLog(String integration_task_living_details_id, Boolean flag, IntegrationTaskLivingDetailsEntity taskLivingDetail) { try { //判断,成功调用这个方法 - if (StrUtil.isEmpty(integration_task_living_details_id)){ - if (flag){ + if (StrUtil.isEmpty(integration_task_living_details_id)) { + if (flag) { taskLivingDetailsService.saveLogToSuccess(taskLivingDetail); - }else { + } else { //失败 调用这个方法 taskLivingDetailsService.saveLogToFail(taskLivingDetail); } - }else { + } else { taskLivingDetail.setId(integration_task_living_details_id); - if (flag){ + if (flag) { //如果是重试 成功调这个方法 taskLivingDetailsService.saveLogFailToSuccess(taskLivingDetail); - }else { + } else { //如果是重试 失败调这个方法 taskLivingDetailsService.updateLogFailToSuccess(taskLivingDetail); } } - }catch (Exception e){ - logger.error("保存日志出错:{}",e); + } catch (Exception e) { + logger.error("保存日志出错:{}", e); } } + /** * 机票 + * * @param dataSourceCode * @param info * @param invoiceInfo @@ -236,43 +245,44 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer JSONObject contentInfo; ParamAssembler assembler; LexmiscivPlaneticketEntity planeticketH = lexmiscivPlaneticketService.queryOne(new LexmiscivPlaneticketEntity(info.getPI_DATAKEY(), dataSourceCode)); - if (null != planeticketH){ + if (null != planeticketH) { String fplx = "a4"; LexmiscivPlaneticketsEntity planeticketB = new LexmiscivPlaneticketsEntity(planeticketH.getPT_ID(), dataSourceCode); //飞机行程单子表 List planeticketBList = lexmiscivPlaneticketsService.query(planeticketB); JSONObject planeObj = new JSONObject(); - planeObj.put("planeticketH",JSONObject.toJSONString(planeticketH)); - planeObj.put("planeticketBList",JSONObject.toJSONString(planeticketBList)); + planeObj.put("planeticketH", JSONObject.toJSONString(planeticketH)); + planeObj.put("planeticketBList", JSONObject.toJSONString(planeticketBList)); //1表示电子行程单 先不区分试试,策略类内部判断来实现区分 - if ("1".equals(planeticketH.getPT_ELECTRONICMARK())){ - //assembler = new ElecFlightInvoiceAssembler(planeObj); - fplx = "400"; - } + if ("1".equals(planeticketH.getPT_ELECTRONICMARK())) { + //assembler = new ElecFlightInvoiceAssembler(planeObj); + fplx = "400"; + } // else { // assembler = new FlightInvoiceAssembler(planeObj); // } assembler = new ElecFlightInvoiceAssembler(planeObj); context = new ParamAssemblerContext(assembler); contentInfo = context.assemble(); - baseInfo.put("fphm",planeticketH.getPT_FPHM());//发票号码 - baseInfo.put("fpdm","");//发票代码 - baseInfo.put("fplx",fplx);//发票类型 - baseInfo.put("kprq",planeticketH.getPT_MAKEDATE());//开票日期 - baseInfo.put("bhszje",planeticketH.getPT_NOTAXAMOUNT());//不含税总金额 - baseInfo.put("jym",planeticketH.getPT_VALIDCODE());//校验码 - baseInfo.put("bxje",planeticketH.getPT_NOTAXAMOUNT());//不含税实际报销金额 - baseInfo.put("jsse","");//有效计算税额 - baseInfo.put("jsdkzq","");//计算抵扣账期 - baseInfo.put("signPerson","");//签收人 - baseInfo.put("signStatus","1");//签收状态,默认传1 + baseInfo.put("fphm", planeticketH.getPT_FPHM());//发票号码 + baseInfo.put("fpdm", "");//发票代码 + baseInfo.put("fplx", fplx);//发票类型 + baseInfo.put("kprq", planeticketH.getPT_MAKEDATE());//开票日期 + baseInfo.put("bhszje", planeticketH.getPT_NOTAXAMOUNT());//不含税总金额 + baseInfo.put("jym", planeticketH.getPT_VALIDCODE());//校验码 + baseInfo.put("bxje", planeticketH.getPT_NOTAXAMOUNT());//不含税实际报销金额 + baseInfo.put("jsse", "");//有效计算税额 + baseInfo.put("jsdkzq", "");//计算抵扣账期 + baseInfo.put("signPerson", "");//签收人 + baseInfo.put("signStatus", "1");//签收状态,默认传1 invoiceInfo.put("baseInfo", baseInfo); - invoiceInfo.put("contentInfo",contentInfo); + invoiceInfo.put("contentInfo", contentInfo); } } /** * 火车票发票 + * * @param dataSourceCode * @param inputInfos * @param info @@ -287,34 +297,34 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer LexmiscivTrainticketEntity trainticketEntity = new LexmiscivTrainticketEntity(info.getPI_DATAKEY(), dataSourceCode); trainticketEntity.setTT_BUSINESSTYPE(1);//1售票 2退票 3售票换开 4退票换开,3和4没遇到过,先查1 LexmiscivTrainticketEntity trainticket = lexmiscivTrainticketService.queryOne(trainticketEntity); - if (null != trainticket){ + if (null != trainticket) { JSONObject trainObj = new JSONObject(); - trainObj.put("trainInvoice",JSONObject.toJSONString(trainticket)); - trainObj.put("publicInvoice",JSONObject.toJSONString(info)); + trainObj.put("trainInvoice", JSONObject.toJSONString(trainticket)); + trainObj.put("publicInvoice", JSONObject.toJSONString(info)); String fplx = "a2"; //1是电子票 - if ("1".equals(trainticket.getTT_ELECTRONIC())){ + if ("1".equals(trainticket.getTT_ELECTRONIC())) { assembler = new ElecTrainInvoiceAssembler(trainObj); fplx = "200"; - }else { + } else { assembler = new TrainInvoiceAssembler(trainObj); } context = new ParamAssemblerContext(assembler); contentInfo = context.assemble(); - baseInfo.put("fphm",trainticket.getTT_CODE());//发票号码 - baseInfo.put("fpdm","");//发票代码 火车票不用传 - baseInfo.put("fplx",fplx);//发票类型 - baseInfo.put("kprq",DateUtil.format(trainticket.getTT_DATE(),"yyyy-MM-dd"));//开票日期 - baseInfo.put("bhszje",trainticket.getTT_NOTAXAMOUNT());//不含税总金额 - baseInfo.put("jym","");//校验码 - baseInfo.put("bxje",trainticket.getTT_NOTAXAMOUNT());//不含税实际报销金额 - baseInfo.put("jsse","");//有效计算税额 - baseInfo.put("jsdkzq","");//计算抵扣账期 - baseInfo.put("signPerson","");//签收人 - baseInfo.put("signStatus","1");//签收状态,默认传1 + baseInfo.put("fphm", trainticket.getTT_CODE());//发票号码 + baseInfo.put("fpdm", "");//发票代码 火车票不用传 + baseInfo.put("fplx", fplx);//发票类型 + baseInfo.put("kprq", DateUtil.format(trainticket.getTT_DATE(), "yyyy-MM-dd"));//开票日期 + baseInfo.put("bhszje", trainticket.getTT_NOTAXAMOUNT());//不含税总金额 + baseInfo.put("jym", "");//校验码 + baseInfo.put("bxje", trainticket.getTT_NOTAXAMOUNT());//不含税实际报销金额 + baseInfo.put("jsse", "");//有效计算税额 + baseInfo.put("jsdkzq", "");//计算抵扣账期 + baseInfo.put("signPerson", "");//签收人 + baseInfo.put("signStatus", "1");//签收状态,默认传1 invoiceInfo.put("baseInfo", baseInfo); - invoiceInfo.put("contentInfo",contentInfo); - }else { + invoiceInfo.put("contentInfo", contentInfo); + } else { inputInfos.remove(inputInfo); logger.info("根据pi_datakey没有查到火车票发票信息:{},发票号:{}", info.getPI_DATAKEY()); } @@ -322,10 +332,11 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer /** * 增值税发票 + * * @param dataSourceCode 数据源编码 - * @param info 发票公共表 - * @param invoiceInfo 发票信息对象 - * @param baseInfo 发票基本数据对象 + * @param info 发票公共表 + * @param invoiceInfo 发票信息对象 + * @param baseInfo 发票基本数据对象 */ private void zzsInvoice(String dataSourceCode, LexmisPublicinfoEntity info, JSONObject invoiceInfo, JSONObject baseInfo) { ParamAssemblerContext context;//策略上下文类 @@ -335,70 +346,72 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer //增值税发票表体 List zzsInvoiceBList = lexmiscivInvoicedetailService.query(new LexmiscivInvoicedetailEntity(zzsInvoiceH.getIM_ID(), dataSourceCode)); JSONObject zzs = new JSONObject(); - zzs.put("zzsInvoiceH",JSONObject.toJSONString(zzsInvoiceH)); - zzs.put("zzsInvoiceBList",JSONObject.toJSONString(zzsInvoiceBList)); + zzs.put("zzsInvoiceH", JSONObject.toJSONString(zzsInvoiceH)); + zzs.put("zzsInvoiceBList", JSONObject.toJSONString(zzsInvoiceBList)); assembler = new ZzsInvoiceAssembler(zzs); context = new ParamAssemblerContext(assembler); contentInfo = context.assemble(); - baseInfo.put("fphm",zzsInvoiceH.getIM_FPHM());//发票号码 - baseInfo.put("fpdm",zzsInvoiceH.getIM_FPDM());//发票代码 - baseInfo.put("fplx",convertZzsFplx(zzsInvoiceH.getIM_TYPE()));//发票类型 - baseInfo.put("kprq",DateUtil.format(zzsInvoiceH.getIM_DATE(),"yyyy-MM-dd"));//开票日期 - baseInfo.put("bhszje",zzsInvoiceH.getIM_NOTAXAMOUNT());//不含税总金额 - baseInfo.put("jym",zzsInvoiceH.getIM_CHECKCODE());//校验码 - baseInfo.put("bxje",zzsInvoiceH.getIM_NOTAXAMOUNT());//不含税实际报销金额 - baseInfo.put("jsse","");//有效计算税额 - baseInfo.put("jsdkzq","");//计算抵扣账期 - baseInfo.put("signPerson","");//签收人 - baseInfo.put("signStatus","1");//签收状态,默认传1 + baseInfo.put("fphm", zzsInvoiceH.getIM_FPHM());//发票号码 + baseInfo.put("fpdm", zzsInvoiceH.getIM_FPDM());//发票代码 + baseInfo.put("fplx", convertZzsFplx(zzsInvoiceH.getIM_TYPE()));//发票类型 + baseInfo.put("kprq", DateUtil.format(zzsInvoiceH.getIM_DATE(), "yyyy-MM-dd"));//开票日期 + baseInfo.put("bhszje", zzsInvoiceH.getIM_NOTAXAMOUNT());//不含税总金额 + baseInfo.put("jym", zzsInvoiceH.getIM_CHECKCODE());//校验码 + baseInfo.put("bxje", zzsInvoiceH.getIM_NOTAXAMOUNT());//不含税实际报销金额 + baseInfo.put("jsse", "");//有效计算税额 + baseInfo.put("jsdkzq", "");//计算抵扣账期 + baseInfo.put("signPerson", "");//签收人 + baseInfo.put("signStatus", "1");//签收状态,默认传1 invoiceInfo.put("baseInfo", baseInfo); - invoiceInfo.put("contentInfo",contentInfo); + invoiceInfo.put("contentInfo", contentInfo); } /** * 客运汽车 + * * @param dataSourceCode 数据源编码 - * @param info 发票公共表嘻嘻 - * @param invoiceInfo 发票参数对象 - * @param baseInfo 发票base参数对象 + * @param info 发票公共表嘻嘻 + * @param invoiceInfo 发票参数对象 + * @param baseInfo 发票base参数对象 */ private void busInvoice(String dataSourceCode, LexmisPublicinfoEntity info, JSONObject invoiceInfo, JSONObject baseInfo) { ParamAssemblerContext context;//策略上下文类 JSONObject contentInfo; ParamAssembler assembler; - LexmiscivBusinvoiceEntity businvoiceEntity = lexmiscivBusinvoiceService.queryOne(new LexmiscivBusinvoiceEntity(info.getPI_DATAKEY(),dataSourceCode)); - if (null != businvoiceEntity){ + LexmiscivBusinvoiceEntity businvoiceEntity = lexmiscivBusinvoiceService.queryOne(new LexmiscivBusinvoiceEntity(info.getPI_DATAKEY(), dataSourceCode)); + if (null != businvoiceEntity) { JSONObject busObj = new JSONObject(); - busObj.put("busInvoice",JSONObject.toJSONString(businvoiceEntity)); - busObj.put("publicInfoice",JSONObject.toJSONString(info)); + busObj.put("busInvoice", JSONObject.toJSONString(businvoiceEntity)); + busObj.put("publicInfoice", JSONObject.toJSONString(info)); assembler = new BusInvoiceAssembler(busObj); context = new ParamAssemblerContext(assembler); contentInfo = context.assemble(); baseInfo.put("fphm", businvoiceEntity.getBI_FPHM());//发票号码 - baseInfo.put("fpdm",businvoiceEntity.getBI_FPDM());//发票代码 - baseInfo.put("fplx","a3");//发票类型 - baseInfo.put("kprq",DateUtil.format(businvoiceEntity.getBI_DATE(),"yyyy-MM-dd"));//开票日期 - baseInfo.put("bhszje",businvoiceEntity.getBI_NOTAXAMOUNT());//不含税总金额 - baseInfo.put("jym","");//校验码 - baseInfo.put("bxje",businvoiceEntity.getBI_NOTAXAMOUNT());//不含税金额 - baseInfo.put("jsse","");//有效计算税额 - baseInfo.put("jsdkzq","");//计算抵扣账期 - baseInfo.put("signPerson","");//签收人 - baseInfo.put("signStatus","1");//签收状态,默认传1 + baseInfo.put("fpdm", businvoiceEntity.getBI_FPDM());//发票代码 + baseInfo.put("fplx", "a3");//发票类型 + baseInfo.put("kprq", DateUtil.format(businvoiceEntity.getBI_DATE(), "yyyy-MM-dd"));//开票日期 + baseInfo.put("bhszje", businvoiceEntity.getBI_NOTAXAMOUNT());//不含税总金额 + baseInfo.put("jym", "");//校验码 + baseInfo.put("bxje", businvoiceEntity.getBI_NOTAXAMOUNT());//不含税金额 + baseInfo.put("jsse", "");//有效计算税额 + baseInfo.put("jsdkzq", "");//计算抵扣账期 + baseInfo.put("signPerson", "");//签收人 + baseInfo.put("signStatus", "1");//签收状态,默认传1 invoiceInfo.put("baseInfo", baseInfo); - invoiceInfo.put("contentInfo",contentInfo); + invoiceInfo.put("contentInfo", contentInfo); } } /** * 迈锐思增值税类发票类型转换成有度发票类型 + * * @param fplx 迈锐思发票类型 * @return */ - private String convertZzsFplx(String fplx){ - if (StrUtil.isNotEmpty(fplx)){ + private String convertZzsFplx(String fplx) { + if (StrUtil.isNotEmpty(fplx)) { String youduFplx = null; - switch (fplx){ + switch (fplx) { case "01"://增值税专用发票 youduFplx = "01"; break; @@ -418,8 +431,8 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer youduFplx = "32"; break; case "14"://电子发票(通行费) - youduFplx = "14"; - break; + youduFplx = "14"; + break; } return youduFplx; } From 3e42ec3616e0068349921857917f6c68746d7962 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Mon, 26 May 2025 14:18:23 +0800 Subject: [PATCH 06/31] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=AF=BC=E5=85=A5=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8F=91=E7=A5=A8=E6=89=B9=E9=87=8F=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E7=BB=93=E6=9E=9C=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/seeyon/invoice/dao/IInvoiceDao.java | 10 ++++ .../invoice/dao/impl/InvoiceDaoImpl.java | 6 +++ .../seeyon/invoice/entity/InvoiceEntity.java | 46 +++++++++++++++++++ .../seeyon/invoice/entity/InvoiceEntity.xml | 7 ++- .../service/impl/InvoiceServiceImpl.java | 10 ++-- .../seeyon/zxbank/entity/ZxBankEntity.xml | 2 +- 6 files changed, 74 insertions(+), 7 deletions(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java index e8304591..bae1c824 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java @@ -69,4 +69,14 @@ public interface IInvoiceDao extends IBaseDao { * @Date 2025-04-17 15:19 * **/ List queryInputInvoiceResult(InvoiceEntity entity); + + /** + * + * @content 更新发票批量录入结果 + * @Param + * @Return + * @Author hecan + * @Date 2025-05-26 10:34 + * **/ + Integer updateInputInvoiceResult(InvoiceEntity entity); } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java index 1d189240..5a3a17db 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java @@ -62,4 +62,10 @@ public class InvoiceDaoImpl extends MybatisGenericDao impl public List queryInputInvoiceResult(InvoiceEntity entity) { return (List)super.selectList("queryInputInvoiceResult",entity); } + + @DS("#entity.dataSourceCode") + @Override + public Integer updateInputInvoiceResult(InvoiceEntity entity) { + return super.update("updateInputInvoiceResult",entity); + } } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java index 239b0659..a9c4d534 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java @@ -75,6 +75,52 @@ public class InvoiceEntity extends BaseEntity { private String summaryId;// private String input_result_status_filed;//进项发票结果字段 private String input_result_status;//进项发票结果 + private String yd_result;//进项发票批量导入返回流水号 + private String tab_name;//表名称 + private String yd_res_field;//进项发票批量导入返回流水号字段 + private String import_result_field;//进项发票批量导入返回结果字段 + private String import_result;//进项发票批量导入返回结果 + + + public String getTab_name() { + return tab_name; + } + + public void setTab_name(String tab_name) { + this.tab_name = tab_name; + } + + public String getYd_res_field() { + return yd_res_field; + } + + public void setYd_res_field(String yd_res_field) { + this.yd_res_field = yd_res_field; + } + + public String getImport_result_field() { + return import_result_field; + } + + public void setImport_result_field(String import_result_field) { + this.import_result_field = import_result_field; + } + + public String getImport_result() { + return import_result; + } + + public void setImport_result(String import_result) { + this.import_result = import_result; + } + + public String getYd_result() { + return yd_result; + } + + public void setYd_result(String yd_result) { + this.yd_result = yd_result; + } public String getInput_result_status_filed() { return input_result_status_filed; diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml index 18fa2fc2..aa51a2b7 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml @@ -90,7 +90,7 @@ @@ -115,6 +115,11 @@ where id=#{id} + + + update ${tab_name} set ${import_result_field} =#{import_result} where id=#{id} + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java index e9535a6d..a86943c2 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -267,7 +267,7 @@ public class InvoiceServiceImpl extends BaseService imple for (InvoiceEntity entity : invoiceEntities) { entity.setDataSourceCode("HT-OA"); JSONObject jsonObject=new JSONObject(); - jsonObject.put("serialNumber",entity.getId()); + jsonObject.put("serialNumber",entity.getYd_result()); //发送数据 String result = HttpRequest.post(url). header("appId", "800060"). @@ -280,7 +280,7 @@ public class InvoiceServiceImpl extends BaseService imple logger.info("=====调用杭泰税务查询发票批量录入结果的返回参数为:{}===========",result); JSONObject resultJson = JSONObject.parseObject(result); if (!resultJson.getBoolean("flag")) { - saveTaskLivingDetails(entity.getId(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false,""); + saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false,""); } else { JSONObject attribute = resultJson.getJSONObject("attribute"); if("0".equals(attribute.getString("code"))) { @@ -288,12 +288,12 @@ public class InvoiceServiceImpl extends BaseService imple if (null != jsonResult) { String serialNumber = jsonResult.getString("serialNumber");//流水号 String status = jsonResult.getString("status");//发票批量录入返回结果状态 - if(serialNumber.equals(entity.getId())){ + if(serialNumber.equals(entity.getYd_result())){ //修改发票批量录入结果状态 logger.info("=========开始更新进项发票的结果=========="); - entity.setInput_result_status(InvoiceState.invoiceStateGetValue(status)); + entity.setImport_result(InvoiceState.invoiceStateGetValue(status)); entity.setDataSourceCode("HT-OA"); - invoiceDao.updateInvoiceResult(entity); + invoiceDao.updateInputInvoiceResult(entity); logger.info("=========更新进项发票的结果完成=========="); saveTaskLivingDetails(entity.getId(),entity.getBusiness_no(),jsonObject.toJSONString(), resultJson.toJSONString(), true,""); } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml index 74f290c8..7c598d8a 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml @@ -97,7 +97,7 @@ - update ${tabName} set ${receiptFiled} =#{receipt} where id=#{id} + update ${tabName} set ${receiptFiled} =#{receipt} where id=#{dataId} From 9bda9783b26302ab73152ca14806cc9d3cb03c64 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Tue, 27 May 2025 15:26:44 +0800 Subject: [PATCH 07/31] =?UTF-8?q?=E4=B8=BA=E4=BA=86=E6=96=B9=E4=BE=BF?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=8C=E5=85=88=E6=8A=8A=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml index 9b0fb4c8..c7794078 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml @@ -19,7 +19,7 @@ f.id = #{id} and f.bill_code = #{bill_code} and push_status is null - and start_date >= '2025-05-26' + -- and start_date >= '2025-05-26' From 2bb2866d5483c5205b24fb6640bc9d73bb310cb8 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 28 May 2025 18:50:05 +0800 Subject: [PATCH 08/31] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assembler/ElecFlightInvoiceAssembler.java | 12 +++++++++++- .../lexmis/entity/LexmiscivPlaneticketEntity.java | 6 +++--- .../impl/CInvoiceImportPluginServiceImpl.java | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecFlightInvoiceAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecFlightInvoiceAssembler.java index de8aaa1e..17d0e2ba 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecFlightInvoiceAssembler.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecFlightInvoiceAssembler.java @@ -1,5 +1,6 @@ package com.hzya.frame.plugin.cinvoice.assembler; +import cn.hutool.core.convert.Convert; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; @@ -8,6 +9,7 @@ import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketEntity; import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity; import org.apache.commons.collections.CollectionUtils; +import java.math.BigDecimal; import java.util.LinkedList; import java.util.List; @@ -109,7 +111,10 @@ public class ElecFlightInvoiceAssembler implements ParamAssembler{ flightItem.setSl("");//数量 flightItem.setDj("");//单价 flightItem.setJe(planeticketH.getPT_PRICE());//金额 - flightItem.setSlv(planeticketH.getPT_TAXRATE());//税率 + if (StrUtil.isEmpty(planeticketH.getPT_TAXRATE())){ + planeticketH.setPT_TAXRATE(null); + } + flightItem.setSlv(Convert.toBigDecimal(planeticketH.getPT_TAXRATE()));//税率 flightItem.setSe(planeticketH.getPT_TAXAMOUNT());//税额 } filightItemList.add(flightItem); @@ -118,4 +123,9 @@ public class ElecFlightInvoiceAssembler implements ParamAssembler{ } return param; } + + public static void main(String[] args) { + BigDecimal bigDecimal = Convert.toBigDecimal(null); + System.out.println(bigDecimal); + } } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.java index c0457b9b..c69364ce 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.java @@ -77,7 +77,7 @@ public class LexmiscivPlaneticketEntity extends BaseEntity { /** * 无备注 */ - private BigDecimal PT_TAXRATE; + private String PT_TAXRATE; /** * 无备注 */ @@ -387,11 +387,11 @@ public class LexmiscivPlaneticketEntity extends BaseEntity { return PT_AMOUNT; } - public BigDecimal getPT_TAXRATE() { + public String getPT_TAXRATE() { return PT_TAXRATE; } - public void setPT_TAXRATE(BigDecimal PT_TAXRATE) { + public void setPT_TAXRATE(String PT_TAXRATE) { this.PT_TAXRATE = PT_TAXRATE; } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java index a591d4dc..a5d4a45c 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java @@ -88,6 +88,7 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer //2、 查OA明细表 //3、 查迈瑞思发票表 //迈锐思发票公共信息表 + logger.info("开始查迈锐思发票公共表信息:{},{}",cInvoiceH.getId(),cInvoiceH.getBill_code()); LexmisPublicinfoEntity lexmisPublicinfoEntity = new LexmisPublicinfoEntity(cInvoiceH.getId(), dataSourceCode); //lexmisPublicinfoEntity.setPI_ID("6952494198841691018"); List lexmisPublicinfoEntityList = lexmisPublicinfoService.query(lexmisPublicinfoEntity); From 38773ef16a390ef48097dc8f22e8158a568de262 Mon Sep 17 00:00:00 2001 From: hecan <1718492867@qq.com> Date: Thu, 29 May 2025 16:18:31 +0800 Subject: [PATCH 09/31] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8F=91=E7=A5=A8?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=AF=BC=E5=85=A5=E7=BB=93=E6=9E=9C=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../seeyon/invoice/entity/InvoiceEntity.java | 8 ++++ .../seeyon/invoice/entity/InvoiceEntity.xml | 11 ++++- .../invoice/entity/InvoiceImportState.java | 45 +++++++++++++++++++ .../service/impl/InvoiceServiceImpl.java | 14 +++--- 4 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceImportState.java diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java index a9c4d534..ae52df6d 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java @@ -80,7 +80,15 @@ public class InvoiceEntity extends BaseEntity { private String yd_res_field;//进项发票批量导入返回流水号字段 private String import_result_field;//进项发票批量导入返回结果字段 private String import_result;//进项发票批量导入返回结果 + private String bill_code;//发票批量导入单号 + public String getBill_code() { + return bill_code; + } + + public void setBill_code(String bill_code) { + this.bill_code = bill_code; + } public String getTab_name() { return tab_name; diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml index aa51a2b7..3bfe03ed 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml @@ -70,6 +70,15 @@ + + + + + + + + + @@ -90,7 +99,7 @@ diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceImportState.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceImportState.java new file mode 100644 index 00000000..f732abea --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceImportState.java @@ -0,0 +1,45 @@ +package com.hzya.frame.seeyon.invoice.entity; + +public enum InvoiceImportState { + inputZero("0","进行中"), + inputOne("1","全部成功"), + inputTwo("2","部分失败"), + inputThree("3","全部失败"); + + + + + private String type; + //值 + private String value; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + InvoiceImportState(String type, String value){ + this.type=type; + this.value=value; + } + + public static String invoiceStateGetValue(String type){ + for (InvoiceImportState invoiceState : InvoiceImportState.values()){ + if(invoiceState.getType()==type||invoiceState.getType().equals(type)){ + return invoiceState.getValue().toString(); + } + } + return null; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java index a86943c2..f83258a9 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -16,6 +16,7 @@ import com.hzya.frame.seeyon.entity.CtpFileEntity; import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao; import com.hzya.frame.seeyon.invoice.dao.IInvoiceDetailsDao; import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity; +import com.hzya.frame.seeyon.invoice.entity.InvoiceImportState; import com.hzya.frame.seeyon.invoice.entity.InvoiceState; import com.hzya.frame.seeyon.invoice.service.IInvoiceService; import com.hzya.frame.seeyon.util.OARestUtil; @@ -179,7 +180,7 @@ public class InvoiceServiceImpl extends BaseService imple logger.info("=====调用杭泰税务查询申请单详情的返回参数为:{}===========", result); JSONObject resultJson = JSONObject.parseObject(result); if (!resultJson.getBoolean("flag")) { - saveTaskLivingDetails(entity.getId(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false, ""); + saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false, "QueryInvoiceResultPluginInitializer"); } else { JSONObject attribute = resultJson.getJSONObject("attribute"); if ("0".equals(attribute.getString("code"))) { @@ -231,6 +232,7 @@ public class InvoiceServiceImpl extends BaseService imple ManyfileUpload(fileOfd, entity, sub_reference, att_reference, jsonObject); logger.info("========ofd文件上传OA完成========"); } + saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), true, "QueryInvoiceResultPluginInitializer"); } } }else{ @@ -240,6 +242,7 @@ public class InvoiceServiceImpl extends BaseService imple entity.setId(entity.getSerial_number()); invoiceDao.updateInvoiceResult(entity); logger.info("=======将开票结果回写OA完毕======"); + saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false, "QueryInvoiceResultPluginInitializer"); } } } @@ -268,6 +271,7 @@ public class InvoiceServiceImpl extends BaseService imple entity.setDataSourceCode("HT-OA"); JSONObject jsonObject=new JSONObject(); jsonObject.put("serialNumber",entity.getYd_result()); + logger.info("=====调用杭泰税务查询发票批量录入结果的请求参数为:{}===========",jsonObject.toJSONString()); //发送数据 String result = HttpRequest.post(url). header("appId", "800060"). @@ -280,7 +284,7 @@ public class InvoiceServiceImpl extends BaseService imple logger.info("=====调用杭泰税务查询发票批量录入结果的返回参数为:{}===========",result); JSONObject resultJson = JSONObject.parseObject(result); if (!resultJson.getBoolean("flag")) { - saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false,""); + saveTaskLivingDetails(entity.getId(), entity.getBill_code(), jsonObject.toJSONString(), resultJson.toJSONString(), false,"QueryInputInvoiceResultPluginInitializer"); } else { JSONObject attribute = resultJson.getJSONObject("attribute"); if("0".equals(attribute.getString("code"))) { @@ -291,11 +295,11 @@ public class InvoiceServiceImpl extends BaseService imple if(serialNumber.equals(entity.getYd_result())){ //修改发票批量录入结果状态 logger.info("=========开始更新进项发票的结果=========="); - entity.setImport_result(InvoiceState.invoiceStateGetValue(status)); + entity.setImport_result(InvoiceImportState.invoiceStateGetValue(status)); entity.setDataSourceCode("HT-OA"); invoiceDao.updateInputInvoiceResult(entity); logger.info("=========更新进项发票的结果完成=========="); - saveTaskLivingDetails(entity.getId(),entity.getBusiness_no(),jsonObject.toJSONString(), resultJson.toJSONString(), true,""); + saveTaskLivingDetails(entity.getId(),entity.getBill_code(),jsonObject.toJSONString(), resultJson.toJSONString(), true,"QueryInputInvoiceResultPluginInitializer"); } } } @@ -577,7 +581,7 @@ public class InvoiceServiceImpl extends BaseService imple taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); } }catch (Exception e){ - logger.info("抽取杭泰付款单保存日志到集成任务日志明细中失败:{}",e.getMessage()); + logger.info("发票保存日志到集成任务日志明细中失败:{}",e.getMessage()); e.printStackTrace(); } } From 84e388124c39927715752b2d3442ce4a6e718897 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 30 May 2025 14:57:25 +0800 Subject: [PATCH 10/31] =?UTF-8?q?=E7=89=A9=E6=96=99=E5=AF=B9=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IncomeInvoiceServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index 53914c8b..5321d84b 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 @@ -190,7 +190,7 @@ public class IncomeInvoiceServiceImpl extends BaseService 0){ From 255a8d14f4130dcf0ce05dd4995db63434730cf3 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Fri, 30 May 2025 17:35:58 +0800 Subject: [PATCH 11/31] =?UTF-8?q?=E5=A2=9E=E5=8A=A0xml=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-ht.yml | 2 ++ .../invoice/service/impl/InvoiceServiceImpl.java | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/base-buildpackage/src/main/resources/application-ht.yml b/base-buildpackage/src/main/resources/application-ht.yml index afbc5086..f1199cb5 100644 --- a/base-buildpackage/src/main/resources/application-ht.yml +++ b/base-buildpackage/src/main/resources/application-ht.yml @@ -48,6 +48,8 @@ invoice_pdf: #税务ofd附件下载存放路径 invoice_ofd: url: D:\yongansystem\invoice\ofd\ +invoice_xml: + url: D:\yongansystem\invoice\xml\ zx: # 生产用这个 这个是银行给的 privateKey: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgOHOzaKWBWOAbslvtYtS8tcQiJ9W9DT2cGQM3KSgXpfygCgYIKoEcz1UBgi2hRANCAAQNPct0MHOuDrVJBIy0RI7JKx9/PTlFHZlkIJr0EqpC+b/+N+z3JKbCMZ/wcP1V36Q+DlfDJCY9Ai/Uk2PZ9ZaF diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java index f83258a9..4d91ad4f 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -75,6 +75,8 @@ public class InvoiceServiceImpl extends BaseService imple private String invoicePdfUrl; @Value("${invoice_ofd.url:}") private String invoiceOfdUrl; + @Value("${invoice_xml.url:}") + private String invoiceXmlUrl; @Override public JsonResultEntity queryArchives(JSONObject json) { @@ -232,6 +234,18 @@ public class InvoiceServiceImpl extends BaseService imple ManyfileUpload(fileOfd, entity, sub_reference, att_reference, jsonObject); logger.info("========ofd文件上传OA完成========"); } + //获取xml文件到本地 并为xml取名,否则会报无法访问错误 + logger.info("========开始将xml文件保存到本地========"); + String xmlFileName = generateFileName(xmlUrl, "XML"); + String xmlSavePath = invoiceXmlUrl + xmlFileName; + downloadPdf(xmlUrl, xmlSavePath); + logger.info("========pdf文件保存到本地完成========"); + File fileXml = new File(xmlSavePath); + if(null !=fileXml){ + logger.info("========开始将xml文件上传OA========"); + ManyfileUpload(fileXml, entity, sub_reference, att_reference, jsonObject); + logger.info("========xml文件上传OA完成========"); + } saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), true, "QueryInvoiceResultPluginInitializer"); } } From ad97637a42c0f6fb09db55a936fe64fc938c8ae1 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 3 Jun 2025 13:43:33 +0800 Subject: [PATCH 12/31] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IncomeInvoiceServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java index 5321d84b..878badaa 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 @@ -183,7 +183,7 @@ public class IncomeInvoiceServiceImpl extends BaseService Date: Tue, 3 Jun 2025 16:24:50 +0800 Subject: [PATCH 13/31] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=B2=A1=E7=94=A8?= =?UTF-8?q?=E7=9A=84logger.info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/seeyon/zxbank/service/impl/ZxBankServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 2852a9c2..5e55f41b 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 @@ -179,7 +179,7 @@ public class ZxBankServiceImpl extends BaseService impleme String encrypt = SM2Util.encrypt(objectData.toJSONString(), publicKey); JSONObject jsonData=new JSONObject(); jsonData.put("data",encrypt); - logger.info("=======杭泰付款单调用中信支付结果查询请求参数密文为:{}", jsonData.toJSONString()); + //logger.info("=======杭泰付款单调用中信支付结果查询请求参数密文为:{}", jsonData.toJSONString()); //发送数据 String result = HttpRequest.post(url). header("appId", "800058"). @@ -197,7 +197,7 @@ public class ZxBankServiceImpl extends BaseService impleme } else { JSONObject attribute = resultJson.getJSONObject("attribute"); String data = attribute.getString("data"); - logger.info("=======杭泰付款单调用中信支付结果查询返回参数密文为:{}", data); + // logger.info("=======杭泰付款单调用中信支付结果查询返回参数密文为:{}", data); String decrypt = SM2Util.decrypt(data, privateKey); logger.info("=======杭泰付款单调用中信支付结果查询返回参数明文为:{}", decrypt); JSONObject jsonObjectData = JSONObject.parseObject(decrypt); @@ -223,7 +223,7 @@ public class ZxBankServiceImpl extends BaseService impleme } } } - logger.info("========杭泰付款单查询支付结果执行成功========"); + //logger.info("========杭泰付款单查询支付结果执行成功========"); return BaseResult.getSuccessMessageEntity("支付结果查询成功"); }catch (Exception e){ logger.info("=========查询中信返回的支付结果失败:{}=======",e.getMessage()); From 32c21bdcb4d4ac099b56f7d8abc231b94128c749 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Wed, 4 Jun 2025 16:23:20 +0800 Subject: [PATCH 14/31] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/IncomeInvoiceEntity.java | 13 ++--- .../impl/IncomeInvoiceServiceImpl.java | 53 +++++++++++++++---- 2 files changed, 51 insertions(+), 15 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 de25701b..6579fb16 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 @@ -9,8 +9,8 @@ import com.hzya.frame.web.entity.BaseEntity; public class IncomeInvoiceEntity extends BaseEntity { //发票字段 - private Integer dataId; - private Integer formmainId; + private String dataId; + private String formmainId; private String field0127; private String field0128; private String field0129; @@ -28,6 +28,7 @@ public class IncomeInvoiceEntity extends BaseEntity { private String iufoVer; + public String getAloneId() { return aloneId; } @@ -68,19 +69,19 @@ public class IncomeInvoiceEntity extends BaseEntity { this.iufoVer = iufoVer; } - public Integer getDataId() { + public String getDataId() { return dataId; } - public void setDataId(Integer dataId) { + public void setDataId(String dataId) { this.dataId = dataId; } - public Integer getFormmainId() { + public String getFormmainId() { return formmainId; } - public void setFormmainId(Integer formmainId) { + public void setFormmainId(String formmainId) { this.formmainId = formmainId; } 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 878badaa..6c884147 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -1,6 +1,7 @@ package com.hzya.frame.plugin.incomeInvoiceData.service.impl; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSON; @@ -40,7 +41,11 @@ import com.hzya.frame.basedao.service.impl.BaseService; import org.springframework.core.task.TaskExecutor; import javax.annotation.Resource; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileOutputStream; @@ -49,6 +54,8 @@ import java.io.InputStream; import java.math.BigDecimal; import java.net.HttpURLConnection; import java.net.URL; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -183,15 +190,17 @@ public class IncomeInvoiceServiceImpl extends BaseService 0){ for (int i1 = 0; i1 < detaildata.size(); i1++) { @@ -239,6 +248,7 @@ public class IncomeInvoiceServiceImpl extends BaseService true; + HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid); + + + URL url = new URL(fileUrl); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); @@ -637,7 +672,7 @@ public class IncomeInvoiceServiceImpl extends BaseService Date: Wed, 4 Jun 2025 18:00:22 +0800 Subject: [PATCH 15/31] =?UTF-8?q?=E5=AF=86=E6=96=87=E8=A7=A3=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java index 860a45a3..b44f4d11 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java @@ -244,7 +244,7 @@ public class SM2Util { System.out.println("明文:" + value); //加密 //String encryptStr = encrypt(value, publicKey); - String encryptStr="BLTRQV8d8D1ILWs21weVXVubIB1Ppx3Oy3rWqdocyrAXm5WBNhSz6YemoVVPTTtdycJ3mcFF1YuRKhuHsMhU/VkzssS3i7W8FPwWHNyyorhd3LrP0HMx+j3MN/s7kGs9PGRem/X4U+tQsJxoQSi8CkmwCcF42aN78LkQ5292cDQ6/AcobhKYNHBqCeX9+gUhue76pWFM12k9rXQYvCnIqdf+vB5ot+UXuk3eXwnlmVdP+f5kSSKxyWRIC8GjLwHRWChkuk6IkjIhVlSMJfVt1fOseBYq5VW32XkHQFbSZW3JvYUhHpimibw7SP6SK60TT8lfJzsABJ5euADCFlhVwfUZZXZLdSV4YFSB/IQ6vVkHorQmD5RdGxktgu3MbErdEPhiGl7/tLj6gKi2ecRobGkQwu1peKcKB08WgnWFX/6Wbs0dxfavAAc1W3mXta0zx/+q2jiIydCsySUT2xCRDVBlGHPIlN8RDucQ4mOE5gBlr9vvMxnKOG2kdWzTVoj+aibqKh5ljwGbIUetbE3XtwNlO7deupvTaUN565P1M8cuK7zQjLeoUD2gqLMZOzz5fgkrPTzd7jUyf3QatDOGEFxrF1u03BMJVNAssxj7pdq2aSBTrHKwafoplUpWEAogeiUh2xYlVSEu2BUinHoMxqGU57UM/ZU1IRFgVKTdHV/R/4hLOpu55Mq7C5cOTVwVFasnIdbkJvabNX/vN0js9Bx/2QJx5SN2wqCV5R4yrXTH4dUGVTQFNLuiZSX8TML463FCIrtiofHZ/jvp3hEbyYTchkMuPEvH3MBZAt6ZXmwInYEktymF2nvBD7Pw22xQaE1Sqfjig5m4gQHB1mRV/RKCaNv7CuXsef29ldU5mQnER0U="; + String encryptStr="BD0GuyA+11ejXLUgFbf2jW0YBh0klhbiHry6dyUtnto2Ld3Mb9DLmsKtDulejqdhpZpFffaMumy+eLU80cERr4QwGGCP7rOVt010bsP8a0RMH7JbMdpSMNUeB8nAYTI+rdsHVCFn6wTWMpMAqNqAw8HkZ+OHEjuPBht3Q1VX670twFSnOa/h/hBY2DeEO1Nzo1yodzfLVJF6fyDA+4dwz7Zi/4cqO+AEwFYmZ20WR6hTAmC4dzDK9BLFx7ymSQX46X3ppydZGcnGQcBR8RWItk4ev84TB59PREeXf0ruNEqsryUrCLsVAHeB1+RhhgRYQyz0L8hFRRbXq0ArMgrnYZzDgagAtGvo6QtE49dbERr4rSfAk65XVew5aEBmhHmL4gEgGOgaJ8juIzoYnj5pssmdxYh8xOzrpFprLI5Rp7mbbl/GhPruUNCrZOg5kTahVzMYodgokeWjQLp3bjXROIQBcgkLH2Dhov9lVKqa9Bnf291XxvsWkU7hr68WGz+30nEEOfmCfoFF8ZBZPyCbZ/zNKYL136F3qqezdh6x7OgTH8CFbFdK/qMIgGrzLTwIXYJJx3ZA+zzUQ7PlosFuv/vYACN5BQ3NbX8uVWJQVJ2KmG4fgo7xEa61TeBB3i5n6FJNxO5NPelDlJToy/FS0tutmwgwu/vvKbeb4Hz6ZZt9nyCvDoHbMdKutyQKmNPNc6fz2VvhUCEbQrtDmZqimHMpozm+lZFHn8bHsxVqDY0M0G3hJhoQDWElIWBrZF7TWb0WEk4leCKB6z+qK8V8Bjdc3UdV4IsFU2MV9H5tcjKk+2k4gqUB9+vfV5fYhVsBpflyw6uGNjwdWoGmZAXbKyrKI3bIlmPCe2/boraFNQfr7BsRT6D0PgJn+kb4TVgl6TP2MTX3bDMe4h5XR6Qs6HYQnm8KnS5uXdrQh3Luyhw+dch5D4kzK7Yf"; System.out.println("加密结果:" + encryptStr); //解密 From 7ada82b811458862b43405465cfb6fbc6f8285fe Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 4 Jun 2025 18:00:42 +0800 Subject: [PATCH 16/31] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GroovyIntegrationServiceImpl.java | 88 ++++++++----------- 1 file changed, 37 insertions(+), 51 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java index ac2aaef4..69c0dc4c 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java @@ -41,62 +41,48 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService { static class A88772 { String execute(String jsonStr) { + com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject(); + com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject(); + com.alibaba.fastjson.JSONObject parent = new com.alibaba.fastjson.JSONObject(); com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr); com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data"); - com.alibaba.fastjson.JSONArray gl_detail = data.getJSONArray("gl_detail"); - com.alibaba.fastjson.JSONArray gl_fixtmpfreevalue = data.getJSONArray("gl_fixtmpfreevalue"); - - com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONObject sendData = new com.alibaba.fastjson.JSONObject(); - sendData.put("accbookCode",data.getString("accbook_code")); - sendData.put("prepareddate",data.getString("prepareddate")); - sendData.put("year",data.getString("year")); - sendData.put("num",data.getString("num")); - sendData.put("period",data.getString("period")); - sendData.put("vouchertype",data.getString("vouchertype")); - sendData.put("attachment",data.getString("attachment")); - sendData.put("prepared",data.getString("prepared")); - com.alibaba.fastjson.JSONArray detail = new com.alibaba.fastjson.JSONArray(); - if(gl_detail != null && gl_detail.size() > 0){ - for (int i = 0; i < gl_detail.size(); i++) { - com.alibaba.fastjson.JSONObject detaildata = gl_detail.getJSONObject(i); - com.alibaba.fastjson.JSONObject object1 = new com.alibaba.fastjson.JSONObject(); - object1.put("detailindex",detaildata.getString("detailindex")); - object1.put("explanation",detaildata.getString("explanation")); - object1.put("accountCode",detaildata.getString("account_code")); - object1.put("currtypeCode",detaildata.getString("currtype_code")); - object1.put("amount",detaildata.getString("amount")); - object1.put("localdebitamount",detaildata.getString("localdebitamount")); - object1.put("localcreditamount",detaildata.getString("localcreditamount")); - object1.put("groupdebitamount",detaildata.getString("groupdebitamount")); - object1.put("groupcreditamount",detaildata.getString("groupcreditamount")); - object1.put("globaldebitamount",detaildata.getString("globaldebitamount")); - object1.put("globalcreditamount",detaildata.getString("globalcreditamount")); - object1.put("busidate",detaildata.getString("busidate")); - detail.add(object1); - if(gl_fixtmpfreevalue != null && gl_fixtmpfreevalue.size() > 0){ - com.alibaba.fastjson.JSONArray ass = new com.alibaba.fastjson.JSONArray(); - for (int i1 = 0; i1 < gl_fixtmpfreevalue.size(); i1++) { - if(gl_fixtmpfreevalue.getJSONObject(i1).getString("voucher_id").equals(data.getString("voucher_id")) - && gl_fixtmpfreevalue.getJSONObject(i1).getString("detail_id").equals(detaildata.getString("detail_id"))){ - com.alibaba.fastjson.JSONObject assdetail1 = new com.alibaba.fastjson.JSONObject(); - assdetail1.put("checktypecode",gl_fixtmpfreevalue.getJSONObject(i1).getString("checktypecode")); - assdetail1.put("checkvaluecode",gl_fixtmpfreevalue.getJSONObject(i1).getString("checkvaluecode")); - ass.add(assdetail1); - } - } - if(ass.size() > 0){ - object1.put("ass",ass); - - } - } + java.lang.String hour = cn.hutool.core.convert.Convert.toStr(cn.hutool.core.date.DateUtil.hour(new java.util.Date(),true)); + java.lang.String minute = cn.hutool.core.convert.Convert.toStr(cn.hutool.core.date.DateUtil.minute(new java.util.Date())); + parent.put("sourceFlowNumber", data.getString("source_flow_number")+"_"+hour+minute); + parent.put("documentNo", data.getString("document_no")); + parent.put("companyCode", data.getString("company_code")); + parent.put("fundType", data.getString("fund_type")); + parent.put("digest", data.getString("digest")); + parent.put("payAccountNum", data.getString("pay_account_num")); + parent.put("payAccountName", data.getString("pay_account_name")); + parent.put("recAccountNum", data.getString("rec_account_num")); + parent.put("recAccountName", data.getString("rec_account_name")); + parent.put("recBankCode", data.getString("rec_bank_code")); + parent.put("settleAccountType", data.getString("settle_account_type")); + parent.put("payChannel", data.getString("pay_channel")); + parent.put("currency", data.getString("currency")); + parent.put("transAmount", data.getString("trans_amount")); + parent.put("payDate", data.getString("pay_date")); + boolean fale=true; + if("false".equals(data.getString("to_public"))){ + fale=false; + parent.put("toPublic",fale); + parent.put("recFinanceCode",data.getString("recFinanceCode")); + //如果银行编码不为空,则不用传联行号 + if (null != data.getString("recFinanceCode")){ + parent.put("recBankCode", null); } } - sendData.put("detail",detail); - returnObject.put("bodys",sendData); + parent.put("toPublic",fale); + parent.put("purpose", data.getString("purpose")); + bodys.put("data",parent); + java.lang.String params = bodys.toJSONString(); + //com.hzya.frame.seeyon.util.SM2Util sm2Util=new com.hzya.frame.seeyon.util.SM2Util(); + //java.lang.String encrypt = sm2Util.encrypt(params, "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEDT3LdDBzrg61SQSMtESOySsffz05RR2ZZCCa9BKqQvm//jfs9ySmwjGf8HD9Vd+kPg5XwyQmPQIv1JNj2fWWhQ=="); + //com.alibaba.fastjson.JSONObject zx = new com.alibaba.fastjson.JSONObject(); + //zx.put("data",encrypt); + //returnObject.put("bodys",zx.toJSONString()); return returnObject.toJSONString(); } } - - } From af68eff4cb365686a42f8a4945d86c2a722d4e72 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Wed, 4 Jun 2025 18:41:03 +0800 Subject: [PATCH 17/31] =?UTF-8?q?=E5=8A=A0=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hzya/frame/seeyon/util/SM2Util.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java index b44f4d11..a7a49819 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java @@ -237,14 +237,15 @@ public class SM2Util { private void testSignByQuickpass() throws Exception { //密钥生成 String privateKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgOHOzaKWBWOAbslvtYtS8tcQiJ9W9DT2cGQM3KSgXpfygCgYIKoEcz1UBgi2hRANCAAQNPct0MHOuDrVJBIy0RI7JKx9/PTlFHZlkIJr0EqpC+b/+N+z3JKbCMZ/wcP1V36Q+DlfDJCY9Ai/Uk2PZ9ZaF"; - String publicKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEDT3LdDBzrg61SQSMtESOySsffz05RR2ZZCCa9BKqQvm//jfs9ySmwjGf8HD9Vd+kPg5XwyQmPQIv1JNj2fWWhQ=="; + //String publicKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEDT3LdDBzrg61SQSMtESOySsffz05RR2ZZCCa9BKqQvm//jfs9ySmwjGf8HD9Vd+kPg5XwyQmPQIv1JNj2fWWhQ=="; + String publicKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEyocGV+D91yPL2EyngjizFW2p1DW2l46yBGcp7IcHTs0VYM0UEojzVqOjgQZAD76hPtkUvuQAaUvNg0pSpfNc9A==";//测试环境 // 加验签 //String value = "{\"partner\": \"test\",\"tranTime\": \"20240128003627\",\"seqNo\": \"123456\",\"orderNo\": \"order123456\", \"orderAmt\": \"1500\"}"; - String value="{\"data\":{\"companyCode\":\"CN000001\",\"purpose\":\"加入中国光伏行业协会会员单位,获得行业技术支持,2025年会员单位缴纳标准为1万元/年,汇款时需注明“会费”字样,并在备注中注明汇款单位;缴纳会费后,需有付款凭证,将付款凭证发送至协会邮箱,并填写开票信息等内容\",\"recAccountNum\":\"8110701012801540483\",\"recAccountName\":\"\",\"payAccountNum\":\"8110701012601540892\",\"fundType\":\"0001\",\"transAmount\":\"9.90\",\"documentNo\":\"DG202503240321\",\"recBankCode\":\"\",\"settleAccountType\":\"CASH_TRANSFER\",\"sourceFlowNumber\":\"-3854827654841675885_1539\",\"submitUser\":\"user1\",\"digest\":\"加入中国光伏行业协会会员单位,获得行业技术支持,2025年会\",\"payChannel\":\"DIRECT\",\"currency\":\"CNY\",\"toPublic\":true,\"payAccountName\":\"\",\"payDate\":\"2025-03-26\"}}"; + String value="{\"data\":{\"companyCode\":\"CN000001\",\"recFinanceCode\":\"ICBC\",\"purpose\":\"丽水景宁招商局拜访我司,交流业务需求,购买星巴克咖啡\",\"recAccountNum\":\"6222031202014975097\",\"recAccountName\":\"董笑笑\",\"payAccountNum\":\"8110701012601540892\",\"fundType\":\"0002\",\"transAmount\":\"192.00\",\"documentNo\":\"ZD202505290104\",\"recBankCode\":\"102331002036\",\"settleAccountType\":\"CASH_TRANSFER\",\"sourceFlowNumber\":\"-1647479218002638895_1746\",\"digest\":\"付招待报销ZD202505290104\",\"payChannel\":\"DIRECT\",\"currency\":\"CNY\",\"toPublic\":false,\"payDate\":\"2025-06-04\"}}"; System.out.println("明文:" + value); //加密 - //String encryptStr = encrypt(value, publicKey); - String encryptStr="BD0GuyA+11ejXLUgFbf2jW0YBh0klhbiHry6dyUtnto2Ld3Mb9DLmsKtDulejqdhpZpFffaMumy+eLU80cERr4QwGGCP7rOVt010bsP8a0RMH7JbMdpSMNUeB8nAYTI+rdsHVCFn6wTWMpMAqNqAw8HkZ+OHEjuPBht3Q1VX670twFSnOa/h/hBY2DeEO1Nzo1yodzfLVJF6fyDA+4dwz7Zi/4cqO+AEwFYmZ20WR6hTAmC4dzDK9BLFx7ymSQX46X3ppydZGcnGQcBR8RWItk4ev84TB59PREeXf0ruNEqsryUrCLsVAHeB1+RhhgRYQyz0L8hFRRbXq0ArMgrnYZzDgagAtGvo6QtE49dbERr4rSfAk65XVew5aEBmhHmL4gEgGOgaJ8juIzoYnj5pssmdxYh8xOzrpFprLI5Rp7mbbl/GhPruUNCrZOg5kTahVzMYodgokeWjQLp3bjXROIQBcgkLH2Dhov9lVKqa9Bnf291XxvsWkU7hr68WGz+30nEEOfmCfoFF8ZBZPyCbZ/zNKYL136F3qqezdh6x7OgTH8CFbFdK/qMIgGrzLTwIXYJJx3ZA+zzUQ7PlosFuv/vYACN5BQ3NbX8uVWJQVJ2KmG4fgo7xEa61TeBB3i5n6FJNxO5NPelDlJToy/FS0tutmwgwu/vvKbeb4Hz6ZZt9nyCvDoHbMdKutyQKmNPNc6fz2VvhUCEbQrtDmZqimHMpozm+lZFHn8bHsxVqDY0M0G3hJhoQDWElIWBrZF7TWb0WEk4leCKB6z+qK8V8Bjdc3UdV4IsFU2MV9H5tcjKk+2k4gqUB9+vfV5fYhVsBpflyw6uGNjwdWoGmZAXbKyrKI3bIlmPCe2/boraFNQfr7BsRT6D0PgJn+kb4TVgl6TP2MTX3bDMe4h5XR6Qs6HYQnm8KnS5uXdrQh3Luyhw+dch5D4kzK7Yf"; + String encryptStr = encrypt(value, publicKey); + //String encryptStr="BD0GuyA+11ejXLUgFbf2jW0YBh0klhbiHry6dyUtnto2Ld3Mb9DLmsKtDulejqdhpZpFffaMumy+eLU80cERr4QwGGCP7rOVt010bsP8a0RMH7JbMdpSMNUeB8nAYTI+rdsHVCFn6wTWMpMAqNqAw8HkZ+OHEjuPBht3Q1VX670twFSnOa/h/hBY2DeEO1Nzo1yodzfLVJF6fyDA+4dwz7Zi/4cqO+AEwFYmZ20WR6hTAmC4dzDK9BLFx7ymSQX46X3ppydZGcnGQcBR8RWItk4ev84TB59PREeXf0ruNEqsryUrCLsVAHeB1+RhhgRYQyz0L8hFRRbXq0ArMgrnYZzDgagAtGvo6QtE49dbERr4rSfAk65XVew5aEBmhHmL4gEgGOgaJ8juIzoYnj5pssmdxYh8xOzrpFprLI5Rp7mbbl/GhPruUNCrZOg5kTahVzMYodgokeWjQLp3bjXROIQBcgkLH2Dhov9lVKqa9Bnf291XxvsWkU7hr68WGz+30nEEOfmCfoFF8ZBZPyCbZ/zNKYL136F3qqezdh6x7OgTH8CFbFdK/qMIgGrzLTwIXYJJx3ZA+zzUQ7PlosFuv/vYACN5BQ3NbX8uVWJQVJ2KmG4fgo7xEa61TeBB3i5n6FJNxO5NPelDlJToy/FS0tutmwgwu/vvKbeb4Hz6ZZt9nyCvDoHbMdKutyQKmNPNc6fz2VvhUCEbQrtDmZqimHMpozm+lZFHn8bHsxVqDY0M0G3hJhoQDWElIWBrZF7TWb0WEk4leCKB6z+qK8V8Bjdc3UdV4IsFU2MV9H5tcjKk+2k4gqUB9+vfV5fYhVsBpflyw6uGNjwdWoGmZAXbKyrKI3bIlmPCe2/boraFNQfr7BsRT6D0PgJn+kb4TVgl6TP2MTX3bDMe4h5XR6Qs6HYQnm8KnS5uXdrQh3Luyhw+dch5D4kzK7Yf"; System.out.println("加密结果:" + encryptStr); //解密 From c1edd7a55fa4abf9484408c6c1712eba09ca17b4 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Fri, 6 Jun 2025 16:23:07 +0800 Subject: [PATCH 18/31] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/IncomeInvoiceEntity.xml | 1 + .../impl/IncomeInvoiceServiceImpl.java | 203 +++++++++++++++--- .../controler/EntranceController.java | 10 + .../seeyon/service/ICtpAttachmentService.java | 4 +- .../impl/CtpAttachmentServiceImpl.java | 2 +- 5 files changed, 185 insertions(+), 35 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 706adb7e..2cee4f3a 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 @@ -194,6 +194,7 @@ from formson_0702 and field0128 = #{field0128} + and formmain_id = #{formmainId} 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 6c884147..b6921683 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 @@ -51,9 +51,12 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; +import java.io.UnsupportedEncodingException; import java.math.BigDecimal; import java.net.HttpURLConnection; import java.net.URL; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.text.ParseException; @@ -65,6 +68,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.regex.Matcher; +import java.util.regex.Pattern; /** * @author makejava @@ -515,10 +520,60 @@ public class IncomeInvoiceServiceImpl extends BaseService true; + HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid); + + + + URL url = new URL(fileurl); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("GET"); + // 从响应头获取Content-Disposition + String contentDisposition = connection.getHeaderField("Content-Disposition"); + // 尝试从Content-Disposition中提取文件名 + if (contentDisposition != null) { + filename = extractFileNameFromContentDisposition(contentDisposition); + }else { + // 提取结果为 "recv-open-input-1364609961183034880-1377757054294396417.ofd" + filename = fileurl.substring(fileurl.lastIndexOf("/") + 1); + } + + try (InputStream inputStream = connection.getInputStream(); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + fileBytes = outputStream.toByteArray(); + } + + if (fileBytes != null) { // 模拟一个文件 File tempFile = new File(filename); @@ -532,7 +587,7 @@ public class IncomeInvoiceServiceImpl extends BaseService list = incomeInvoiceDao.queryOaFp(incomeInvoiceEntity); + logger.error("999999查询formmain_0705"+list.size() ); + if(list != null && list.size() == 1){ incomeInvoiceEntity.setDataId(list.get(0).getDataId()); + logger.error("999999保存关联表url"+list.get(0).getDataId()); + if(urlData != null){ //保存关联表 String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits()); + incomeInvoiceEntity.setField0130(urluuid);//发票文件 ctpAttachmentService.saveAttachment(urlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode()); } + logger.error("999999保存关联表ofdurlData"+list.get(0).getDataId()); + if(ofdurlData != null){ //保存关联表 String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits()); + incomeInvoiceEntity.setField0138(urluuid);//发票文件 ctpAttachmentService.saveAttachment(ofdurlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode()); } + logger.error("999999保存关联表xmlurlData"+list.get(0).getDataId()); + if(xmlurlData != null){ //保存关联表 String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits()); + incomeInvoiceEntity.setField0139(urluuid);//发票文件 ctpAttachmentService.saveAttachment(xmlurlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode()); } + logger.error("999999修改发票开始"); + incomeInvoiceDao.updateFP(incomeInvoiceEntity); + logger.error("999999修改发票结束"); + } } //修改明细表 + logger.error("999999修改合同开始"); + if(jsonObject.getString("htbh") != null){ + logger.error("999999修改合同开始1"); + IncomeInvoiceEntity incomeInvoiceEntity = new IncomeInvoiceEntity(); incomeInvoiceEntity.setDataSourceCode("HT-OA"); incomeInvoiceEntity.setField0003(jsonObject.getString("htbh"));//合同号 incomeInvoiceEntity.setField0127(jsonObject.getString("fpdm"));//发票代码 incomeInvoiceEntity.setField0128(jsonObject.getString("fphm"));//发票号码 incomeInvoiceEntity.setField0129(jsonObject.getString("jshj"));//发票总额 - incomeInvoiceEntity.setField0130(urlData);//发票文件 - incomeInvoiceEntity.setField0138(ofdurlData);//发票文件 - incomeInvoiceEntity.setField0139(xmlurlData);//发票文件 + + logger.error("999999查询合同明细"); + List list = incomeInvoiceDao.queryOaZb(incomeInvoiceEntity); + logger.error("999999查询合同明细"+list.size()); + if(list != null && list.size() == 1){ incomeInvoiceEntity.setFormmainId(list.get(0).getDataId()); - if(urlData != null){ - //保存关联表 - String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits()); - ctpAttachmentService.saveAttachment(urlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode()); - } - if(ofdurlData != null){ - //保存关联表 - String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits()); - ctpAttachmentService.saveAttachment(ofdurlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode()); - } - if(xmlurlData != null){ - //保存关联表 - String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits()); - ctpAttachmentService.saveAttachment(xmlurlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode()); - } + //logger.error("999999保存合同附件"+list.get(0).getDataId()); + // + //if(urlData != null){ + // //保存关联表 + // String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits()); + //incomeInvoiceEntity.setField0130(urluuid);//发票文件 + + // ctpAttachmentService.saveAttachment(urlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode()); + //} + //logger.error("999999保存合同附件ofdurlData"+list.get(0).getDataId()); + // + //if(ofdurlData != null){ + // //保存关联表 + // String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits()); + + //incomeInvoiceEntity.setField0138(urluuid);//发票文件 + + // ctpAttachmentService.saveAttachment(ofdurlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode()); + //} + //logger.error("999999保存合同附件xmlurlData"+list.get(0).getDataId()); + // + //if(xmlurlData != null){ + // //保存关联表 + // String urluuid = String.valueOf(UUID.randomUUID().getLeastSignificantBits()); + //incomeInvoiceEntity.setField0138(urluuid);//发票文件 + + // ctpAttachmentService.saveAttachment(xmlurlData,list.get(0).getDataId().toString(),urluuid,incomeInvoiceEntity.getDataSourceCode()); + //} + logger.error("999999查询合同明细"+list.get(0).getDataId()); + List mxlist = incomeInvoiceDao.queryOaMx(incomeInvoiceEntity); + + logger.error("999999查询合同明细结果"+mxlist.size()); + if(mxlist != null && mxlist.size() == 1){ + logger.error("999999修改合同明细结果"+mxlist.get(0).getDataId()); + incomeInvoiceEntity.setDataId(mxlist.get(0).getDataId()); incomeInvoiceDao.updateMx(incomeInvoiceEntity); + logger.error("999999修改合同明细结果完成"); + } if(mxlist == null || mxlist.size() == 0){ + incomeInvoiceEntity.setDataId(String.valueOf(UUIDLong.longUUID())); + logger.error("999999保存合同明细结果"+incomeInvoiceEntity.getDataId()); + incomeInvoiceDao.saveMx(incomeInvoiceEntity); + logger.error("999999保存合同明细结果完成"); + } } } + logger.error("999999结束"); + } catch (Exception e) { - logger.error(e.getMessage()); + logger.error("999999"+e.getMessage()); } } @@ -804,7 +943,7 @@ public class IncomeInvoiceServiceImpl extends BaseService").append(""); stringBuffer.append("").append(""); - stringBuffer.append(jsonObject.getString("htbm") != null?"":""); + stringBuffer.append(jsonObject.getString("htbh") != null?"":""); stringBuffer.append("").append(""); stringBuffer.append("").append(""); diff --git a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java index 253ef940..bb0532a9 100644 --- a/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java +++ b/base-webapp/src/main/java/com/hzya/frame/webapp/entrance/controler/EntranceController.java @@ -27,6 +27,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -224,4 +225,13 @@ public class EntranceController { } + @RequestMapping(value = "/option1") + @ResponseBody + public JsonResultEntity option1(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception { + HttpServletRequest request = (HttpServletRequest) servletRequest; + String queryString = request.getQueryString(); + + return BaseResult.getSuccessMessageEntity("成功"); + } + } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java index 4802682d..8f5b0c94 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ICtpAttachmentService.java @@ -11,8 +11,8 @@ import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; public interface ICtpAttachmentService extends IBaseService { /** * 保存附件关系表 - * @param fileUrl ctp_file id - * @param col_summary_id col_summary id + * @param fileUrl ctp_file id fileUrl + * @param col_summary_id col_summary id oa表单id * @param sub_reference 随机uuid * @return */ diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java index 39632855..2588108f 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/CtpAttachmentServiceImpl.java @@ -61,7 +61,7 @@ public class CtpAttachmentServiceImpl extends BaseService Date: Fri, 6 Jun 2025 18:54:41 +0800 Subject: [PATCH 19/31] =?UTF-8?q?xml=E9=99=84=E4=BB=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java index 4d91ad4f..ad2dcee4 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -239,7 +239,7 @@ public class InvoiceServiceImpl extends BaseService imple String xmlFileName = generateFileName(xmlUrl, "XML"); String xmlSavePath = invoiceXmlUrl + xmlFileName; downloadPdf(xmlUrl, xmlSavePath); - logger.info("========pdf文件保存到本地完成========"); + logger.info("========xml文件保存到本地完成========"); File fileXml = new File(xmlSavePath); if(null !=fileXml){ logger.info("========开始将xml文件上传OA========"); From a780d9717dda1eeb919444eb9eff0350772ad4d1 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Sat, 7 Jun 2025 11:20:57 +0800 Subject: [PATCH 20/31] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GroovyIntegrationServiceImpl.java | 63 ++++++++----------- 1 file changed, 25 insertions(+), 38 deletions(-) diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java index 69c0dc4c..3f10d2e3 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/grovy/service/impl/GroovyIntegrationServiceImpl.java @@ -41,47 +41,34 @@ public class GroovyIntegrationServiceImpl implements IGroovyIntegrationService { static class A88772 { String execute(String jsonStr) { + com.alibaba.fastjson.JSONObject resData = com.alibaba.fastjson.JSON.parseObject(jsonStr); com.alibaba.fastjson.JSONObject returnObject = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONObject bodys = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONObject parent = new com.alibaba.fastjson.JSONObject(); - com.alibaba.fastjson.JSONObject reqData = com.alibaba.fastjson.JSON.parseObject(jsonStr); - com.alibaba.fastjson.JSONObject data = reqData.getJSONObject("data"); - java.lang.String hour = cn.hutool.core.convert.Convert.toStr(cn.hutool.core.date.DateUtil.hour(new java.util.Date(),true)); - java.lang.String minute = cn.hutool.core.convert.Convert.toStr(cn.hutool.core.date.DateUtil.minute(new java.util.Date())); - parent.put("sourceFlowNumber", data.getString("source_flow_number")+"_"+hour+minute); - parent.put("documentNo", data.getString("document_no")); - parent.put("companyCode", data.getString("company_code")); - parent.put("fundType", data.getString("fund_type")); - parent.put("digest", data.getString("digest")); - parent.put("payAccountNum", data.getString("pay_account_num")); - parent.put("payAccountName", data.getString("pay_account_name")); - parent.put("recAccountNum", data.getString("rec_account_num")); - parent.put("recAccountName", data.getString("rec_account_name")); - parent.put("recBankCode", data.getString("rec_bank_code")); - parent.put("settleAccountType", data.getString("settle_account_type")); - parent.put("payChannel", data.getString("pay_channel")); - parent.put("currency", data.getString("currency")); - parent.put("transAmount", data.getString("trans_amount")); - parent.put("payDate", data.getString("pay_date")); - boolean fale=true; - if("false".equals(data.getString("to_public"))){ - fale=false; - parent.put("toPublic",fale); - parent.put("recFinanceCode",data.getString("recFinanceCode")); - //如果银行编码不为空,则不用传联行号 - if (null != data.getString("recFinanceCode")){ - parent.put("recBankCode", null); + if("200".equals(resData.getJSONObject("data").get("status"))){ + com.alibaba.fastjson.JSONObject reqData = resData.getJSONObject("data").getJSONObject("attribute"); + if(null !=reqData){ + if("0".equals(reqData.getString("code"))){ + com.alibaba.fastjson.JSONObject result=reqData.getJSONObject("result"); + if(null != result){ + java.lang.String applicationId= result.getString("applicationId"); + if(null != applicationId){ + returnObject.put("success","true"); + returnObject.put("tripartiteId",applicationId); + }else{ + returnObject.put("success","false"); + } + }else{ + returnObject.put("success","false"); + } + }else{ + returnObject.put("success","false"); + returnObject.put("message",reqData.getString("message")); + } + }else{ + returnObject.put("success","false"); } + }else { + returnObject.put("success","false"); } - parent.put("toPublic",fale); - parent.put("purpose", data.getString("purpose")); - bodys.put("data",parent); - java.lang.String params = bodys.toJSONString(); - //com.hzya.frame.seeyon.util.SM2Util sm2Util=new com.hzya.frame.seeyon.util.SM2Util(); - //java.lang.String encrypt = sm2Util.encrypt(params, "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEDT3LdDBzrg61SQSMtESOySsffz05RR2ZZCCa9BKqQvm//jfs9ySmwjGf8HD9Vd+kPg5XwyQmPQIv1JNj2fWWhQ=="); - //com.alibaba.fastjson.JSONObject zx = new com.alibaba.fastjson.JSONObject(); - //zx.put("data",encrypt); - //returnObject.put("bodys",zx.toJSONString()); return returnObject.toJSONString(); } } From 0813623f1459fdea6bef2550650ce3dab78a41b1 Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Mon, 16 Jun 2025 18:44:45 +0800 Subject: [PATCH 21/31] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=8F=91=E7=A5=A8xml?= =?UTF-8?q?=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InvoiceServiceImpl.java | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java index ad2dcee4..8803eca5 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -1,6 +1,7 @@ package com.hzya.frame.seeyon.invoice.service.impl; import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.ZipUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSON; @@ -236,11 +237,11 @@ public class InvoiceServiceImpl extends BaseService imple } //获取xml文件到本地 并为xml取名,否则会报无法访问错误 logger.info("========开始将xml文件保存到本地========"); - String xmlFileName = generateFileName(xmlUrl, "XML"); + String xmlFileName = generateFileName(xmlUrl, "zip"); String xmlSavePath = invoiceXmlUrl + xmlFileName; - downloadPdf(xmlUrl, xmlSavePath); + File fileXml = downloadXml(xmlUrl, xmlSavePath); logger.info("========xml文件保存到本地完成========"); - File fileXml = new File(xmlSavePath); + //File fileXml = new File(xmlSavePath); if(null !=fileXml){ logger.info("========开始将xml文件上传OA========"); ManyfileUpload(fileXml, entity, sub_reference, att_reference, jsonObject); @@ -462,6 +463,20 @@ public class InvoiceServiceImpl extends BaseService imple } } + /** + * 下载发票xml附件, 税务系统返回的xml文件是.zip压缩包 + * @param xmlUrl + * @param savePath + */ + private File downloadXml(String xmlUrl,String savePath){ + long size = HttpUtil.downloadFile(xmlUrl,savePath); + File xmlZipFile = new File(savePath); +// if (null != xmlZipFile && xmlZipFile.getName().endsWith(".zip")){ +// File unzip = ZipUtil.unzip(xmlZipFile); +// return unzip; +// } + return xmlZipFile; + } private static void trustAllCertificates(HttpsURLConnection conn) throws Exception { TrustManager[] trustAllCerts = new TrustManager[]{ new X509TrustManager() { From 6f39ac218ee6a37d771bb48c205b2297a757ee3b Mon Sep 17 00:00:00 2001 From: xiang2lin <251481237@qq.com> Date: Thu, 19 Jun 2025 09:20:36 +0800 Subject: [PATCH 22/31] =?UTF-8?q?=E5=9B=9E=E5=86=99=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InvoiceDistributePluginInitializer.java | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java index af9593bc..010cd33e 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java @@ -22,6 +22,8 @@ import com.hzya.frame.mdm.mdmModuleDistributeTripartite.entity.MdmModuleDistribu import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao; import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; import com.hzya.frame.mdm.service.IMdmServiceCache; +import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao; +import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity; import com.hzya.frame.sys.sysenum.SysEnum; import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; @@ -45,6 +47,7 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.util.EntityUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import javax.annotation.Resource; @@ -78,6 +81,8 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity { private IMdmModuleSendLogDao mdmModuleSendLogDao; @Resource private IMdmModuleDistributeTripartiteDao mdmModuleDistributeTripartiteDao; + @Autowired + private IInvoiceDao invoiceDao; @Value("${zt.url}") private String url ; @@ -1117,6 +1122,8 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity { logger.info("=========开始执行开票申请单申请新增数据下发脚本,第二次=============="); JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); logger.info("=====开票申请单申请数据新增下发返回结果为:{}",JSONObject.parseObject(jsonResultEntity.getAttribute().toString()).toJSONString()); + //todo 更新OA开票结果 + updateOAForm(jsonResultEntity,doObjects.get(i)); if(jsonResultEntity.isFlag()){ if (scriptEntity != null && scriptEntity.getId() != null && scriptEntity.getBackScriptData() != null ) { logger.info("=========开始执行开票申请单申请数据新增返回脚本=============="); @@ -1208,6 +1215,44 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity { }*/ } + /** + * 更新OA开票结果 + * @param jsonResultEntity + * @param data + */ + private void updateOAForm(JsonResultEntity jsonResultEntity, JSONObject data) { + try { + logger.info("准备更新开票结果到OA单据返回参数:{},data_id:{}",JSONObject.toJSONString(jsonResultEntity),data.getString("data_id")); + if (null != jsonResultEntity && null != data && StrUtil.isNotEmpty(data.getString("data_id"))){ + String data_id = data.getString("data_id"); + String attrStr = (String) jsonResultEntity.getAttribute(); + JSONObject attrObj = JSONObject.parseObject(attrStr); + JSONObject attribute = attrObj.getJSONObject("attribute"); + if (null != attribute && !"0".equals(attribute.getString("code"))){ + String message = attribute.getString("message"); + InvoiceEntity invoiceEntity = new InvoiceEntity(); + invoiceEntity.setId(data_id); + invoiceEntity.setResult_status(message); + invoiceDao.updateInvoiceResult(invoiceEntity); + } + } + }catch (Exception e){ + logger.info("调用有度开票申请接口后更新OA表单开票结果出错:{}",e); + } + } + + public static void main(String[] args) { + String resultStr = "{\"attribute\":\"{\\\"msg\\\":\\\"转发成功\\\",\\\"type\\\":null,\\\"flag\\\":true,\\\"status\\\":\\\"200\\\",\\\"attribute\\\":{\\\"result\\\":{\\\"businessNo\\\":\\\"KP202506170028\\\",\\\"applicationNumber\\\":\\\"LZ250617000004\\\",\\\"applicationId\\\":\\\"1384530530992742657\\\"},\\\"code\\\":\\\"0\\\",\\\"cause\\\":null,\\\"message\\\":\\\"成功\\\"}}\",\"flag\":true,\"msg\":\"转发成功\",\"status\":\"200\"}"; + JsonResultEntity jsonResultEntity = JSON.parseObject(resultStr,JsonResultEntity.class); + JSONObject data = new JSONObject(); + data.put("data_id","2076813022629089234"); + InvoiceDistributePluginInitializer plugin = new InvoiceDistributePluginInitializer(); + String attrStr = (String) jsonResultEntity.getAttribute(); + JSONObject attrObj = JSONObject.parseObject(attrStr); + plugin.updateOAForm(jsonResultEntity,data); + + } + private void saveMdmModuleSendLogEntity(Long mdmCode,String distributeId,String dataType,String remark,String dbname,String formmain_id, String target_app, String appId, String target_api,String apiID, String source_data, String option_type) throws Exception { MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity(); mdmModuleSendLogEntity.setTableName(dbname+"_send_log"); From 0703938594563b1cd79bd579e4dd52cb09520144 Mon Sep 17 00:00:00 2001 From: xiangerlin <251481237@qq.com> Date: Sat, 21 Jun 2025 18:45:51 +0800 Subject: [PATCH 23/31] =?UTF-8?q?=E8=8E=B7=E5=8F=96token=E6=97=B6=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E8=B0=83=E7=94=A8=E6=96=B9=E6=8C=87=E5=AE=9A=E4=BA=86?= =?UTF-8?q?loginName=EF=BC=8C=E5=88=99=E7=94=A8=E8=B0=83=E7=94=A8=E6=96=B9?= =?UTF-8?q?=E7=9A=84=E4=BC=A0=E5=85=A5=E7=9A=84loginName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java index 73b2d0dc..63d2c14e 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java @@ -177,6 +177,9 @@ public class OARestUtil { hashMap.put(parameterName,example); } } + if (StrUtil.isNotEmpty(login_name)){ + hashMap.put("loginName",login_name); + } login_name = hashMap.get("loginName"); if (StrUtil.isEmpty(login_name)){ hashMap.put("loginName","hzya"); From 2f31e2af74802079e6b4e12bd2169d1748be6992 Mon Sep 17 00:00:00 2001 From: xiangerlin <251481237@qq.com> Date: Mon, 23 Jun 2025 09:52:27 +0800 Subject: [PATCH 24/31] =?UTF-8?q?=E8=B5=84=E9=87=91=E6=8B=A8=E4=BB=98?= =?UTF-8?q?=E5=9B=9E=E4=BC=A0=E7=A8=8E=E5=8A=A1=E3=80=81=E5=8F=B8=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/plugin/ht/dao/IApplyInvoiceDao.java | 12 ++ .../plugin/ht/dao/IFundsAllocationDao.java | 12 ++ .../ht/dao/impl/ApplyInvoiceDaoImpl.java | 15 ++ .../ht/dao/impl/FundsAllocationDaoImpl.java | 15 ++ .../plugin/ht/entity/ApplyInvoiceEntity.java | 59 ++++++++ .../plugin/ht/entity/ApplyInvoiceEntity.xml | 44 ++++++ .../ht/entity/FundsAllocationEntity.java | 105 ++++++++++++++ .../ht/entity/FundsAllocationEntity.xml | 50 +++++++ .../FundsAllocationPluginInitializer.java | 98 +++++++++++++ .../InvoiceDistributePluginInitializer.java | 14 ++ .../ht/service/IApplyInvoiceService.java | 48 +++++++ .../IFundsAllocationPluginService.java | 21 +++ .../ht/service/IFundsAllocationService.java | 20 +++ .../service/impl/ApplyInvoiceServiceImpl.java | 136 ++++++++++++++++++ .../FundsAllocationPluginServiceImpl.java | 132 +++++++++++++++++ .../impl/FundsAllocationServiceImpl.java | 39 +++++ 16 files changed, 820 insertions(+) create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/IApplyInvoiceDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/IFundsAllocationDao.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/impl/ApplyInvoiceDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/impl/FundsAllocationDaoImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/ApplyInvoiceEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/ApplyInvoiceEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/FundsAllocationEntity.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/FundsAllocationEntity.xml create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/FundsAllocationPluginInitializer.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/IApplyInvoiceService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/IFundsAllocationPluginService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/IFundsAllocationService.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/ApplyInvoiceServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java create mode 100644 base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationServiceImpl.java diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/IApplyInvoiceDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/IApplyInvoiceDao.java new file mode 100644 index 00000000..e75045c0 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/IApplyInvoiceDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.ht.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity; + +/** + * @Description OA开票申请 + * @Author xiangerlin + * @Date 2025/6/21 17:07 + **/ +public interface IApplyInvoiceDao extends IBaseDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/IFundsAllocationDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/IFundsAllocationDao.java new file mode 100644 index 00000000..a870399f --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/IFundsAllocationDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.ht.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity; + +/** + * @Description OA资金拨付 + * @Author xiangerlin + * @Date 2025/6/21 14:23 + **/ +public interface IFundsAllocationDao extends IBaseDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/impl/ApplyInvoiceDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/impl/ApplyInvoiceDaoImpl.java new file mode 100644 index 00000000..a0e7a432 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/impl/ApplyInvoiceDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.ht.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.ht.dao.IApplyInvoiceDao; +import com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description OA开票申请 + * @Author xiangerlin + * @Date 2025/6/21 17:07 + **/ +@Repository(value = "applyInvoiceDaoImpl") +public class ApplyInvoiceDaoImpl extends MybatisGenericDao implements IApplyInvoiceDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/impl/FundsAllocationDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/impl/FundsAllocationDaoImpl.java new file mode 100644 index 00000000..3a849f48 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/dao/impl/FundsAllocationDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.ht.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.ht.dao.IFundsAllocationDao; +import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description OA资金拨付 + * @Author xiangerlin + * @Date 2025/6/21 14:24 + **/ +@Repository(value = "fundsAllocationDaoImpl") +public class FundsAllocationDaoImpl extends MybatisGenericDao implements IFundsAllocationDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/ApplyInvoiceEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/ApplyInvoiceEntity.java new file mode 100644 index 00000000..49e87cd1 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/ApplyInvoiceEntity.java @@ -0,0 +1,59 @@ +package com.hzya.frame.plugin.ht.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description OA开票申请 formmain_0331 + * @Author xiangerlin + * @Date 2025/6/21 17:02 + **/ +public class ApplyInvoiceEntity extends BaseEntity { + private String field0117;//单据号 + + + //查询待办用的字段 + + private String col_summary_id; + private String ctp_affair_id; + private String workitem_id; + private String member_id;//用来指定查哪个用户的待办,这里要查固定人员的待办 + public String getField0117() { + return field0117; + } + + public void setField0117(String field0117) { + this.field0117 = field0117; + } + + public String getCol_summary_id() { + return col_summary_id; + } + + public void setCol_summary_id(String col_summary_id) { + this.col_summary_id = col_summary_id; + } + + public String getCtp_affair_id() { + return ctp_affair_id; + } + + public void setCtp_affair_id(String ctp_affair_id) { + this.ctp_affair_id = ctp_affair_id; + } + + public String getWorkitem_id() { + return workitem_id; + } + + public void setWorkitem_id(String workitem_id) { + this.workitem_id = workitem_id; + } + + public String getMember_id() { + return member_id; + } + + public void setMember_id(String member_id) { + this.member_id = member_id; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/ApplyInvoiceEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/ApplyInvoiceEntity.xml new file mode 100644 index 00000000..2f312035 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/ApplyInvoiceEntity.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/FundsAllocationEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/FundsAllocationEntity.java new file mode 100644 index 00000000..3611076a --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/FundsAllocationEntity.java @@ -0,0 +1,105 @@ +package com.hzya.frame.plugin.ht.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description OA资金拨付 formmain_0464 + * @Author xiangerlin + * @Date 2025/6/21 14:19 + **/ +public class FundsAllocationEntity extends BaseEntity { + + private String field0045;//单据编号 + private String field0061;//税务系统id,这个字段不为空时表示是税务推过来的单子 + private String field0062;//单据来源,这个字段不为空时表示是司库推过来的单子 + private String field0063;//司库系统批次号,回调时用 + + + //审批意见相关的字段 + private String col_summary_id;//流程id + private String subject;//流程标题 + private String state;//流程状态 + private String name;//处理人姓名 + private String approval_time;//处理时间 + private String content;//审批意见 + + public String getField0045() { + return field0045; + } + + public void setField0045(String field0045) { + this.field0045 = field0045; + } + + public String getField0061() { + return field0061; + } + + public void setField0061(String field0061) { + this.field0061 = field0061; + } + + public String getField0062() { + return field0062; + } + + public void setField0062(String field0062) { + this.field0062 = field0062; + } + + public String getCol_summary_id() { + return col_summary_id; + } + + public void setCol_summary_id(String col_summary_id) { + this.col_summary_id = col_summary_id; + } + + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getApproval_time() { + return approval_time; + } + + public void setApproval_time(String approval_time) { + this.approval_time = approval_time; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getField0063() { + return field0063; + } + + public void setField0063(String field0063) { + this.field0063 = field0063; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/FundsAllocationEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/FundsAllocationEntity.xml new file mode 100644 index 00000000..9c8ee996 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/entity/FundsAllocationEntity.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/FundsAllocationPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/FundsAllocationPluginInitializer.java new file mode 100644 index 00000000..ccb4addf --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/FundsAllocationPluginInitializer.java @@ -0,0 +1,98 @@ +package com.hzya.frame.plugin.ht.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @Description 资金拨付 流程结束回调 需要同时回调有度税务和中信司库 + * @Author xiangerlin + * @Date 2025/6/21 14:06 + **/ +public class FundsAllocationPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(FundsAllocationPluginInitializer.class); + + + /*** + * 插件初始化方法 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 10:48 + * @Param [] + * @return void + **/ + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + /**** + * 插件销毁方法 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + /**** + * 插件的ID + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginId() { + return "FundsAllocationPlugin"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "资金拨付回调税务和司库"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "资金拨付回调税务和司库"; + } + + /*** + * 插件类型 1、场景插件 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-02 14:01 + * @Param [] + * @return java.lang.String + **/ + @Override + public String getPluginType() { + return "1"; + } + + /*** + * 执行业务代码 + * @Author 👻👻👻👻👻👻👻👻 gjh + * @Date 2023-08-07 11:20 + * @param requestJson 执行业务代码的参数 + * @return void + **/ + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + logger.info("======开始执行资金拨付回调有度税务和中信司库插件========"); + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java index 010cd33e..014bb5f6 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java @@ -22,6 +22,8 @@ import com.hzya.frame.mdm.mdmModuleDistributeTripartite.entity.MdmModuleDistribu import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao; import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; import com.hzya.frame.mdm.service.IMdmServiceCache; +import com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity; +import com.hzya.frame.plugin.ht.service.IApplyInvoiceService; import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao; import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity; import com.hzya.frame.sys.sysenum.SysEnum; @@ -82,6 +84,8 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity { @Resource private IMdmModuleDistributeTripartiteDao mdmModuleDistributeTripartiteDao; @Autowired + private IApplyInvoiceService applyInvoiceService; + @Autowired private IInvoiceDao invoiceDao; @Value("${zt.url}") private String url ; @@ -1233,7 +1237,17 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity { InvoiceEntity invoiceEntity = new InvoiceEntity(); invoiceEntity.setId(data_id); invoiceEntity.setResult_status(message); + invoiceEntity.setDataSourceCode("HT-OA"); invoiceDao.updateInvoiceResult(invoiceEntity); + //查询待办,退回流程用,这里只处理退回的情况,如果要处理提交,要等开票成功后才能提交,去定时查开票结果的定时任务里做 + ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity(); + applyInvoice.setId(data_id); + applyInvoice.setDataSourceCode("HT-OA"); + ApplyInvoiceEntity applyInvoiceEntity = applyInvoiceService.queryAffair(applyInvoice); + if (null != applyInvoiceEntity){ + String stepBack = applyInvoiceService.stepBackValueOf(applyInvoiceEntity.getWorkitem_id(), message); + applyInvoiceService.process(stepBack,"8000590006"); + } } } }catch (Exception e){ diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/IApplyInvoiceService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/IApplyInvoiceService.java new file mode 100644 index 00000000..448fe05d --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/IApplyInvoiceService.java @@ -0,0 +1,48 @@ +package com.hzya.frame.plugin.ht.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity; +import com.hzya.frame.web.exception.BaseSystemException; + +import java.util.List; + +/** + * @Description OA开票申请 + * @Author xiangerlin + * @Date 2025/6/21 17:56 + **/ +public interface IApplyInvoiceService extends IBaseService { + + /** + * 查询待办信息 + * 这里要指定人员 所以只会查出一条,如果查出多条那就是有问题的 + * @param entity + * @return + * @throws BaseSystemException + */ + ApplyInvoiceEntity queryAffair(ApplyInvoiceEntity entity)throws BaseSystemException; + + /** + * 流程回退参数组装 + * @param workitemId + * @param content + * @return + */ + String stepBackValueOf(String workitemId,String content); + + /** + * 流程结束参数组装 + * @param workitemId + * @param content + * @return + */ + String finishValueOf(String workitemId,String content); + + /** + * 流程处理 + * @param param + * @param apiCode + * @return + */ + String process(String param,String apiCode); +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/IFundsAllocationPluginService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/IFundsAllocationPluginService.java new file mode 100644 index 00000000..addcf43a --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/IFundsAllocationPluginService.java @@ -0,0 +1,21 @@ +package com.hzya.frame.plugin.ht.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.web.entity.JsonResultEntity; +import com.hzya.frame.web.exception.BaseSystemException; + +/** + * @Description 资金拨付 流程结束回调 需要同时回调有度税务和中信司库 + * @Author xiangerlin + * @Date 2025/6/21 14:13 + **/ +public interface IFundsAllocationPluginService { + + /** + * 资金拨付流程结束回调有度税务系统和中信司库 + * @param requestJson + * @return + * @throws BaseSystemException + */ + JsonResultEntity callback(JSONObject requestJson)throws BaseSystemException; +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/IFundsAllocationService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/IFundsAllocationService.java new file mode 100644 index 00000000..45ebea50 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/IFundsAllocationService.java @@ -0,0 +1,20 @@ +package com.hzya.frame.plugin.ht.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity; + +import java.util.List; + +/** + * @Description OA资金拨付 formmain_0464 + * @Author xiangerlin + * @Date 2025/6/21 15:01 + **/ +public interface IFundsAllocationService extends IBaseService { + /** + * 查询审批意见 + * @param entity + * @return + */ + List queryCtpCommentList(FundsAllocationEntity entity); +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/ApplyInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/ApplyInvoiceServiceImpl.java new file mode 100644 index 00000000..82c8fc2e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/ApplyInvoiceServiceImpl.java @@ -0,0 +1,136 @@ +package com.hzya.frame.plugin.ht.service.impl; + +import cn.hutool.core.lang.Assert; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.ht.dao.IApplyInvoiceDao; +import com.hzya.frame.plugin.ht.entity.ApplyInvoiceEntity; +import com.hzya.frame.plugin.ht.service.IApplyInvoiceService; +import com.hzya.frame.seeyon.util.OARestUtil; +import com.hzya.frame.web.exception.BaseSystemException; +import org.apache.commons.collections.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2025/6/21 17:56 + **/ +@Service(value = "applyInvoiceServiceImpl") +public class ApplyInvoiceServiceImpl extends BaseService implements IApplyInvoiceService { + + private IApplyInvoiceDao applyInvoiceDao; + + @Autowired + public void setApplyInvoiceDao(IApplyInvoiceDao dao) { + this.applyInvoiceDao = dao; + this.dao = dao; + } + @Value("${zt.url}") + private String interfaceUrl; + + + + + /** + * 查询待办信息 + * + * @param entity + * @return + * @throws BaseSystemException + */ + @DS("entity.dataSourceCode") + @Override + public ApplyInvoiceEntity queryAffair(ApplyInvoiceEntity entity) throws BaseSystemException { + List queryList = applyInvoiceDao.queryList(entity, "com.hzya.frame.plugin.ht.dao.impl.ApplyInvoiceDaoImpl.entity_list_affair"); + if (CollectionUtils.isNotEmpty(queryList)){ + if (queryList.size() > 1){ + throw new BaseSystemException("数据异常,查询到多条待办数据"+entity.getId()); + } + return queryList.get(0); + } + return null; + } + + /** + * 流程回退参数组装 + * + * @param workitemId + * @param content + * @return + */ + @Override + public String stepBackValueOf(String workitemId, String content) { + Assert.notEmpty(workitemId,"流程回退时workitemId 必填"); + JSONObject jsonObject = new JSONObject(); + jsonObject.put("appName", "collaboration"); + jsonObject.put("workitemId", workitemId); + + JSONObject commentDeal = new JSONObject(); + commentDeal.put("attitude", "1");//1表示已阅 + commentDeal.put("content", content); + + JSONObject data = new JSONObject(); + data.put("isWFTrace", "0"); + data.put("comment_deal", commentDeal); + + jsonObject.put("data", data); + return jsonObject.toJSONString(); + } + + /** + * 流程结束参数组装 + * + * @param workitemId + * @param content + * @return + */ + @Override + public String finishValueOf(String workitemId, String content) { + Assert.notEmpty(workitemId,"流程回退时workitemId 必填"); + JSONObject json = new JSONObject(); + json.put("appName", "collaboration"); + json.put("workitemId", workitemId); + + JSONObject data = new JSONObject(); + data.put("submitType", "1"); + + JSONObject commentDeal = new JSONObject(); + commentDeal.put("attitude", "2");//2表示同意 + commentDeal.put("content", content); + data.put("comment_deal", commentDeal); + json.put("data", data); + return json.toJSONString(); + } + + /** + * 流程处理 + * + * @param param + * @param apiCode + * @return + */ + @Override + public String process(String param, String apiCode) { + Assert.notEmpty(param,"流程处理时参数不能为空"); + Assert.notEmpty(apiCode,"apiCode不能为空"); + logger.info("准备提交或退回流程:{},{}",apiCode,param); + String token = OARestUtil.getToken("hzya", "8000590001"); + String result = HttpRequest.post(interfaceUrl) + .header("appId", "800059")//OA应用 + .header("apiCode", apiCode)//流程提交/回退接口 + .header("token", token)//token + .header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj")//中台公钥 + .header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//中台密钥 + .body(param)//表单内容 + .timeout(30000)//超时,毫秒 + .execute().body(); + return result; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java new file mode 100644 index 00000000..78251cb9 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java @@ -0,0 +1,132 @@ +package com.hzya.frame.plugin.ht.service.impl; + +import cn.hutool.core.lang.Assert; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity; +import com.hzya.frame.plugin.ht.service.IFundsAllocationPluginService; +import com.hzya.frame.plugin.ht.service.IFundsAllocationService; +import com.hzya.frame.seeyon.enums.ColEventTypeEnum; +import com.hzya.frame.seeyon.util.SM2Util; +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.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description 资金拨付 流程结束回调 需要同时回调有度税务和中信司库 + * @Author xiangerlin + * @Date 2025/6/21 14:17 + **/ +@Service(value = "fundsAllocationPluginServiceImpl") +public class FundsAllocationPluginServiceImpl implements IFundsAllocationPluginService { + Logger logger = LoggerFactory.getLogger(FundsAllocationPluginServiceImpl.class); + @Value("${zt.url}") + private String interfaceUrl; + @Value("${zx.publicKey:}") + private String publicKey; + @Autowired + private IFundsAllocationService fundsAllocationService; + /** + * 资金拨付流程结束回调有度税务系统和中信司库 + * + * @param requestJson + * @return + * @throws BaseSystemException + */ + @Override + public JsonResultEntity callback(JSONObject requestJson) throws BaseSystemException { + String dataSourceCode = requestJson.getString("apiDataSourceCode");//数据源 + String headerStr = requestJson.getString("headers");//表头 + String eventType = requestJson.getString("eventType"); + String summaryId = requestJson.getString("summaryId"); + Assert.notEmpty(dataSourceCode,"数据源不能为空"); + Assert.notEmpty(headerStr,"headers不能为空"); + Assert.notEmpty(eventType,"eventType不能为空"); + Assert.notEmpty(summaryId,"summaryId不能为空"); + JSONObject headers = requestJson.getJSONObject("headers"); + String formmainTableName = headers.getString("formmainTableName"); + JSONObject jsonStrObj = requestJson.getJSONObject("jsonStr"); + JSONObject businessData = jsonStrObj.getJSONObject("businessDataStr"); + JSONObject formmainData = businessData.getJSONObject(formmainTableName); + if (null != formmainData){ + //税务系统id,这个字段不为空时表示是税务推过来的单子 + String field0061 = formmainData.getString("field0061"); + //税务系统批次号 + String field0063 = formmainData.getString("field0063"); + if (StrUtil.isNotEmpty(field0061) || StrUtil.isNotEmpty(field0063)){ + //查询审批意见 + FundsAllocationEntity fundAllocation = new FundsAllocationEntity(); + fundAllocation.setCol_summary_id(summaryId); + List fundsAllocationList = fundsAllocationService.queryCtpCommentList(fundAllocation); + if (CollectionUtils.isNotEmpty(fundsAllocationList)){ + fundAllocation = fundsAllocationList.get(0); + } + String appId = "";//应用 + String apiCode = "";//api + String param = "";//参数 + if (StrUtil.isNotEmpty(field0061)){ + appId = "800060"; + apiCode = "8000600009"; + //税务 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("transferOrderNumber",field0061); + jsonObject.put("approvalUser",fundAllocation.getName()); + jsonObject.put("approvalTime",fundAllocation.getApproval_time()); + jsonObject.put("approvalRemark",StrUtil.isEmpty(fundAllocation.getContent()) ? "审批通过" : fundAllocation.getContent()); + if (ColEventTypeEnum.ONPROCESSFINISHED.getType().equals(eventType)){ + jsonObject.put("approvalStatus","2"); + }else if (ColEventTypeEnum.ONSTOP.getType().equals(eventType)){//审批终止 + jsonObject.put("approvalStatus","3"); + } + param = jsonObject.toJSONString(); + }else if (StrUtil.isNotEmpty(field0063)){ + appId = "800058"; + apiCode = "8000580004"; + //司库 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("batchNo",field0063); + jsonObject.put("reason",fundAllocation.getContent()); + if (ColEventTypeEnum.ONPROCESSFINISHED.getType().equals(eventType)){ + jsonObject.put("status","APPROVED"); + }else if (ColEventTypeEnum.ONSTOP.getType().equals(eventType)){//审批终止 + jsonObject.put("status","REJECTION"); + } + JSONObject objectData = new JSONObject(); + objectData.put("data",jsonObject); + logger.info("资金拨付审批回调司库请求参数明文:{}",objectData.toJSONString()); + String encrypt = SM2Util.encrypt(objectData.toJSONString(),publicKey); + JSONObject jsonData = new JSONObject(); + jsonData.put("data",encrypt); + param = jsonData.toJSONString(); + } + if (StrUtil.isNotEmpty(appId) && StrUtil.isNotEmpty(apiCode) && StrUtil.isNotEmpty(param)){ + logger.info("回调有度/司库请求apiCode{},报文:{}",apiCode,param); + String result = HttpRequest.post(interfaceUrl) + .header("appId", appId)//税务/司库应用 + .header("apiCode", apiCode)//回调接口 + .header("publicKey", "ZJYA7f8FzV219otH8zhkReiyyWpXswpbY/+StvC2em0hf59Ce7eDIk+3zDUT+v578prj")//OA公钥 + .header("secretKey", "xJ9J1Ev2F0faiJ/nQnCNklskAgtQp3QSm+ihO21uY/H0UADj0tSDPxmIhFfC4v6Fj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//OA密钥 + .body(param)//表单内容 + .timeout(30000)//超时,毫秒 + .execute().body(); + logger.info("回调有度/司库返回报文:{}",result); + return BaseResult.getSuccessMessageEntity(result); + }else { + logger.info("appId、apiCode、param 其中有参数是空的,不能执行"); + } + }else { + logger.info("不是有度税务/中信司库推过来的单子,不需要执行"); + } + } + return BaseResult.getFailureMessageEntity("表单数据为空"); + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationServiceImpl.java new file mode 100644 index 00000000..23956465 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationServiceImpl.java @@ -0,0 +1,39 @@ +package com.hzya.frame.plugin.ht.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.ht.dao.IFundsAllocationDao; +import com.hzya.frame.plugin.ht.entity.FundsAllocationEntity; +import com.hzya.frame.plugin.ht.service.IFundsAllocationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description + * @Author xiangerlin + * @Date 2025/6/21 15:03 + **/ +@Service(value = "fundsAllocationServiceImpl") +public class FundsAllocationServiceImpl extends BaseService implements IFundsAllocationService { + private IFundsAllocationDao fundsAllocationDao; + @Autowired + public void setFundsAllocationDao(IFundsAllocationDao dao) { + this.fundsAllocationDao = dao; + this.dao = dao; + } + + /** + * 查询审批意见 + * + * @param entity + * @return + */ + @DS("#entity.dataSourceCode") + @Override + public List queryCtpCommentList(FundsAllocationEntity entity) { + List queryList = fundsAllocationDao.queryList(entity, "com.hzya.frame.plugin.ht.dao.impl.FundsAllocationDaoImpl.entity_ctp_comment_all"); + return queryList; + } +} From 434f63f5ed7a18770a4aca61566e7678eff1d0f1 Mon Sep 17 00:00:00 2001 From: xiangerlin <251481237@qq.com> Date: Mon, 23 Jun 2025 09:52:39 +0800 Subject: [PATCH 25/31] =?UTF-8?q?=E8=B5=84=E9=87=91=E6=8B=A8=E4=BB=98?= =?UTF-8?q?=E5=9B=9E=E4=BC=A0=E7=A8=8E=E5=8A=A1=E3=80=81=E5=8F=B8=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml index 6758f61b..27c3b239 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/ht/spring/spring-buildpackage-plugin.xml @@ -5,5 +5,6 @@ + From 718e1727613b364d8f45522c72f15c058280699f Mon Sep 17 00:00:00 2001 From: xiangerlin <251481237@qq.com> Date: Mon, 23 Jun 2025 09:53:18 +0800 Subject: [PATCH 26/31] =?UTF-8?q?=E5=BC=80=E7=A5=A8=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InvoiceServiceImpl.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java index 8803eca5..997f4eaf 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -260,6 +260,27 @@ public class InvoiceServiceImpl extends BaseService imple saveTaskLivingDetails(entity.getSerial_number(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false, "QueryInvoiceResultPluginInitializer"); } } + //开票成功,提交流程 + //查询待办,退回流程用,这里只处理退回的情况,如果要处理提交,要等开票成功后才能提交,去定时查开票结果的定时任务里做 + ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity(); + applyInvoice.setId(entity.getSerial_number()); + applyInvoice.setDataSourceCode("HT-OA"); + ApplyInvoiceEntity applyInvoiceEntity = applyInvoiceService.queryAffair(applyInvoice); + if (null != applyInvoiceEntity){ + String stepBack = applyInvoiceService.stepBackValueOf(applyInvoiceEntity.getWorkitem_id(), InvoiceState.invoiceStateGetValue(jsonResult.getString("resultStatus")); + applyInvoiceService.process(stepBack,"8000590007"); + } + }else { + //开票失败,流程回退 + //查询待办,退回流程用,这里只处理退回的情况,如果要处理提交,要等开票成功后才能提交,去定时查开票结果的定时任务里做 + ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity(); + applyInvoice.setId(entity.getSerial_number()); + applyInvoice.setDataSourceCode("HT-OA"); + ApplyInvoiceEntity applyInvoiceEntity = applyInvoiceService.queryAffair(applyInvoice); + if (null != applyInvoiceEntity){ + String stepBack = applyInvoiceService.stepBackValueOf(applyInvoiceEntity.getWorkitem_id(), attribute.getString("resultMsg")); + applyInvoiceService.process(stepBack,"8000590006"); + } } } } From df159e1e8dc1fe4570a4b53555390a9f389e0e5c Mon Sep 17 00:00:00 2001 From: xiangerlin <251481237@qq.com> Date: Mon, 23 Jun 2025 09:56:28 +0800 Subject: [PATCH 27/31] =?UTF-8?q?=E8=B0=83=E7=94=A8=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ht/plugin/FundsAllocationPluginInitializer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/FundsAllocationPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/FundsAllocationPluginInitializer.java index ccb4addf..5db7c3ca 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/FundsAllocationPluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/FundsAllocationPluginInitializer.java @@ -2,9 +2,12 @@ package com.hzya.frame.plugin.ht.plugin; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.ht.service.IFundsAllocationPluginService; +import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; /** * @Description 资金拨付 流程结束回调 需要同时回调有度税务和中信司库 @@ -14,7 +17,8 @@ import org.slf4j.LoggerFactory; public class FundsAllocationPluginInitializer extends PluginBaseEntity { Logger logger = LoggerFactory.getLogger(FundsAllocationPluginInitializer.class); - + @Autowired + private IFundsAllocationPluginService fundsAllocationPluginService; /*** * 插件初始化方法 * @Author 👻👻👻👻👻👻👻👻 gjh @@ -93,6 +97,7 @@ public class FundsAllocationPluginInitializer extends PluginBaseEntity { @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { logger.info("======开始执行资金拨付回调有度税务和中信司库插件========"); - return null; + fundsAllocationPluginService.callback(requestJson); + return BaseResult.getSuccessMessageEntity("执行成功"); } } From 59c7d33ecd42f6a4b006d1935186668cf90939b9 Mon Sep 17 00:00:00 2001 From: xiangerlin <251481237@qq.com> Date: Mon, 23 Jun 2025 15:27:18 +0800 Subject: [PATCH 28/31] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InvoiceServiceImpl.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java index 997f4eaf..e34e855d 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -262,25 +262,25 @@ public class InvoiceServiceImpl extends BaseService imple } //开票成功,提交流程 //查询待办,退回流程用,这里只处理退回的情况,如果要处理提交,要等开票成功后才能提交,去定时查开票结果的定时任务里做 - ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity(); - applyInvoice.setId(entity.getSerial_number()); - applyInvoice.setDataSourceCode("HT-OA"); - ApplyInvoiceEntity applyInvoiceEntity = applyInvoiceService.queryAffair(applyInvoice); - if (null != applyInvoiceEntity){ - String stepBack = applyInvoiceService.stepBackValueOf(applyInvoiceEntity.getWorkitem_id(), InvoiceState.invoiceStateGetValue(jsonResult.getString("resultStatus")); - applyInvoiceService.process(stepBack,"8000590007"); - } +// ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity(); +// applyInvoice.setId(entity.getSerial_number()); +// applyInvoice.setDataSourceCode("HT-OA"); +// ApplyInvoiceEntity applyInvoiceEntity = applyInvoiceService.queryAffair(applyInvoice); +// if (null != applyInvoiceEntity){ +// String stepBack = applyInvoiceService.stepBackValueOf(applyInvoiceEntity.getWorkitem_id(), InvoiceState.invoiceStateGetValue(jsonResult.getString("resultStatus")); +// applyInvoiceService.process(stepBack,"8000590007"); +// } }else { //开票失败,流程回退 //查询待办,退回流程用,这里只处理退回的情况,如果要处理提交,要等开票成功后才能提交,去定时查开票结果的定时任务里做 - ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity(); - applyInvoice.setId(entity.getSerial_number()); - applyInvoice.setDataSourceCode("HT-OA"); - ApplyInvoiceEntity applyInvoiceEntity = applyInvoiceService.queryAffair(applyInvoice); - if (null != applyInvoiceEntity){ - String stepBack = applyInvoiceService.stepBackValueOf(applyInvoiceEntity.getWorkitem_id(), attribute.getString("resultMsg")); - applyInvoiceService.process(stepBack,"8000590006"); - } +// ApplyInvoiceEntity applyInvoice = new ApplyInvoiceEntity(); +// applyInvoice.setId(entity.getSerial_number()); +// applyInvoice.setDataSourceCode("HT-OA"); +// ApplyInvoiceEntity applyInvoiceEntity = applyInvoiceService.queryAffair(applyInvoice); +// if (null != applyInvoiceEntity){ +// String stepBack = applyInvoiceService.stepBackValueOf(applyInvoiceEntity.getWorkitem_id(), attribute.getString("resultMsg")); +// applyInvoiceService.process(stepBack,"8000590006"); +// } } } } From b9a51e2681007f1965968d2ba60a458876bb36b7 Mon Sep 17 00:00:00 2001 From: xiangerlin <251481237@qq.com> Date: Mon, 23 Jun 2025 17:13:59 +0800 Subject: [PATCH 29/31] =?UTF-8?q?apiCode=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ht/service/impl/FundsAllocationPluginServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java index 78251cb9..9a18b0cc 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java @@ -60,7 +60,7 @@ public class FundsAllocationPluginServiceImpl implements IFundsAllocationPluginS if (null != formmainData){ //税务系统id,这个字段不为空时表示是税务推过来的单子 String field0061 = formmainData.getString("field0061"); - //税务系统批次号 + //司库系统批次号 String field0063 = formmainData.getString("field0063"); if (StrUtil.isNotEmpty(field0061) || StrUtil.isNotEmpty(field0063)){ //查询审批意见 @@ -75,7 +75,7 @@ public class FundsAllocationPluginServiceImpl implements IFundsAllocationPluginS String param = "";//参数 if (StrUtil.isNotEmpty(field0061)){ appId = "800060"; - apiCode = "8000600009"; + apiCode = "8000600008"; //税务 JSONObject jsonObject = new JSONObject(); jsonObject.put("transferOrderNumber",field0061); From 88bcbc1895ac65530b6347d3e79c68819ebade90 Mon Sep 17 00:00:00 2001 From: lvleigang <957075182@qq.com> Date: Tue, 24 Jun 2025 09:41:16 +0800 Subject: [PATCH 30/31] =?UTF-8?q?=E5=9B=9E=E8=B0=83=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FundsAllocationPluginServiceImpl.java | 3 + .../src/main/resources/application-ht.yml | 14 +- .../src/main/resources/application-httest.yml | 24 +- .../test/java/com/hzya/frame/temButtom.java | 274 +++++++++--------- .../api/entity/SysApplicationApiEntity.xml | 39 +-- .../seeyon/service/ISeeYonInterFace.java | 2 +- .../service/impl/SeeYonInterFaceImpl.java | 5 +- 7 files changed, 188 insertions(+), 173 deletions(-) diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java index 9a18b0cc..c3467159 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java @@ -44,6 +44,8 @@ public class FundsAllocationPluginServiceImpl implements IFundsAllocationPluginS */ @Override public JsonResultEntity callback(JSONObject requestJson) throws BaseSystemException { + logger.error(" 资金拨付流程结束回调:"+requestJson.toJSONString()); + String dataSourceCode = requestJson.getString("apiDataSourceCode");//数据源 String headerStr = requestJson.getString("headers");//表头 String eventType = requestJson.getString("eventType"); @@ -66,6 +68,7 @@ public class FundsAllocationPluginServiceImpl implements IFundsAllocationPluginS //查询审批意见 FundsAllocationEntity fundAllocation = new FundsAllocationEntity(); fundAllocation.setCol_summary_id(summaryId); + fundAllocation.setDataSourceCode(dataSourceCode); List fundsAllocationList = fundsAllocationService.queryCtpCommentList(fundAllocation); if (CollectionUtils.isNotEmpty(fundsAllocationList)){ fundAllocation = fundsAllocationList.get(0); diff --git a/base-buildpackage/src/main/resources/application-ht.yml b/base-buildpackage/src/main/resources/application-ht.yml index f1199cb5..4d472fd1 100644 --- a/base-buildpackage/src/main/resources/application-ht.yml +++ b/base-buildpackage/src/main/resources/application-ht.yml @@ -3,7 +3,7 @@ logging: #日志级别 指定目录级别 level: root: INFO - encodings: UTF-8 + encodings: GBK file: # 日志保存路径 path: D:\yongansystem\serverV3\log\zs @@ -12,17 +12,17 @@ spring: dynamic: datasource: master: - url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + url: jdbc:mysql://127.0.0.1:3307/businesscenter_zs?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true username: root password: bd993088e8a7c3dc5f44441617f9b4bf driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 path: /home/webservice/zt/file -# path: D:\webservice\file -# pluginpath: D:\webservice\plugin + # path: D:\webservice\file + # pluginpath: D:\webservice\plugin pluginpath: /home/webservice/zt/plugin -# tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\ + # tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\ tomcatpath: /home/webservice/zt/tomcatV3/webapps/kangarooDataCenterV3/WEB-INF/classes/ cbs8: appId: 1P4AGrpz @@ -39,9 +39,9 @@ cbs8: OA: data_source_code: yc_oa zt: - url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface + url: http://127.0.0.1:9081/kangarooDataCenterV3/entranceController/externalCallInterface file_oa: - url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfacefileUpload + url: http://127.0.0.1:9081/kangarooDataCenterV3/entranceController/externalCallInterfacefileUpload #税务pdf附件下载存放路径 invoice_pdf: url: D:\yongansystem\invoice\pdf\ diff --git a/base-buildpackage/src/main/resources/application-httest.yml b/base-buildpackage/src/main/resources/application-httest.yml index 5c067349..7652b1e1 100644 --- a/base-buildpackage/src/main/resources/application-httest.yml +++ b/base-buildpackage/src/main/resources/application-httest.yml @@ -18,12 +18,12 @@ spring: driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 - path: /home/webservice/zt/file -# path: D:\webservice\file -# pluginpath: D:\webservice\plugin - pluginpath: /home/webservice/zt/plugin -# tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\ - tomcatpath: /home/webservice/zt/tomcatV3/webapps/kangarooDataCenterV3/WEB-INF/classes/ + path: D:\yongansystem\serverV3\zt\file + # path: D:\webservice\file + # pluginpath: D:\webservice\plugin + pluginpath: D:\yongansystem\serverV3\zt\plugin + # tomcatpath: D:\apache-tomcat-9.0.69\webapps\kangarooDataCenter\WEB-INF\classes\ + tomcatpath: D:\yongansystem\serverV3\apache-tomcat-9.0.68_test\webapps\kangarooDataCenterV3\WEB-INF\classes\ cbs8: appId: 1P4AGrpz appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a @@ -39,7 +39,17 @@ cbs8: OA: data_source_code: yc_oa zt: - url: http://127.0.0.1:10087/kangarooDataCenterV3/entranceController/externalCallInterface + url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface +file_oa: + url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterfacefileUpload +#税务pdf附件下载存放路径 +invoice_pdf: + url: D:\yongansystem\invoice\pdf\ +#税务ofd附件下载存放路径 +invoice_ofd: + url: D:\yongansystem\invoice\ofd\ +invoice_xml: + url: D:\yongansystem\invoice\xml\ zx: # 测试用这个 这个是银行给的 privateKey: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgtzMo2o6THK3yLIm+83Ch/560+02l2hjjBSFGieWY/Z6gCgYIKoEcz1UBgi2hRANCAATKhwZX4P3XI8vYTKeCOLMVbanUNbaXjrIEZynshwdOzRVgzRQSiPNWo6OBBkAPvqE+2RS+5ABpS82DSlKl81z0 diff --git a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java index f801ee65..857a3ed4 100644 --- a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -153,15 +153,15 @@ public class temButtom { } - @Test - public void test0111() { - //请求token - String accessToken = getToken(); - //请求分页查询全量进项发票 - String data = getdata(accessToken); - - - } + //@Test + //public void test0111() { + // //请求token + // String accessToken = getToken(); + // //请求分页查询全量进项发票 + // String data = getdata(accessToken); + // + // + //} @Test public void youduTest(){ @@ -174,133 +174,133 @@ public class temButtom { String a = YzfSignUtil.signRequest(parametersMap,"34e5fc32ac894a2ba2ade8c3852c7a0a"); System.out.println("sign"+a); } - private String getdata(String accessToken) { - String url = "http://oapi.nanofintax.com/api/invoice_receive/fp/v1/query?accessToken="+accessToken; - JSONObject dayabody = new JSONObject(); - dayabody.put("accessKey","6X3B526P5HqE6ums"); - long timestamp = System.currentTimeMillis(); - dayabody.put("timestamp",timestamp); - JSONObject queryParams = new JSONObject(); - queryParams.put("page",1); - queryParams.put("size",50); - //queryParams.put("kprqq","2025-04-06"); - //queryParams.put("kprqz","2025-04-06"); - queryParams.put("taxNo","91330110MAC5FPUY2U"); - dayabody.put("queryParams",queryParams); - Map parametersMap = new HashMap<>(); - parametersMap.put("accessKey","6X3B526P5HqE6ums"); - parametersMap.put("timestamp",timestamp); + //private String getdata(String accessToken) { + // String url = "http://oapi.nanofintax.com/api/invoice_receive/fp/v1/query?accessToken="+accessToken; + // JSONObject dayabody = new JSONObject(); + // dayabody.put("accessKey","6X3B526P5HqE6ums"); + // long timestamp = System.currentTimeMillis(); + // dayabody.put("timestamp",timestamp); + // JSONObject queryParams = new JSONObject(); + // queryParams.put("page",1); + // queryParams.put("size",50); + // //queryParams.put("kprqq","2025-04-06"); + // //queryParams.put("kprqz","2025-04-06"); + // queryParams.put("taxNo","91330110MAC5FPUY2U"); + // dayabody.put("queryParams",queryParams); + // Map parametersMap = new HashMap<>(); + // parametersMap.put("accessKey","6X3B526P5HqE6ums"); + // parametersMap.put("timestamp",timestamp); + // + // String a = YzfSignUtil.signRequest(parametersMap,"34e5fc32ac894a2ba2ade8c3852c7a0a"); + // dayabody.put("sign",a); + // + // StringBuilder body = new StringBuilder(); + // SSLContext sslContext = null; + // try { + // sslContext = new SSLContextBuilder() + // .loadTrustMaterial(null, TrustAllStrategy.INSTANCE) + // .build(); + // } catch (Exception e) { + // + // } + // CloseableHttpClient closeableHttpClient = HttpClients.custom() + // .setSSLContext(sslContext) + // .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + // .build(); + // + // HttpPost post = new HttpPost(url); + // CloseableHttpResponse response = null; + // + // RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(6000).build(); + // post.setConfig(requestConfig);//设置请求参数【超时时间】 + // post.setHeader("Content-Type", "application/json; charset=utf-8"); + // + // try { + // if (dayabody.toJSONString() != null && !"".equals(dayabody.toJSONString())) { + // ByteArrayEntity entity = new ByteArrayEntity(dayabody.toJSONString().getBytes("UTF-8")); + // entity.setContentType("application/json"); + // post.setEntity(entity); + // } + // response = closeableHttpClient.execute(post); + // + // HttpEntity entity = response.getEntity(); + // body.append(EntityUtils.toString(entity, "UTF-8")); + // } catch (Exception e) { + // body.append(e.getMessage()); + // } finally { + // try { + // // 关闭响应对象 + // if (response != null) { + // response.close(); + // } + // // 关闭响应对象 + // if (closeableHttpClient != null) { + // closeableHttpClient.close(); + // } + // } catch (IOException e) { + // e.printStackTrace(); + // } + // + // } + // System.out.println("body"+body); + // + // return body.toString(); + //} - String a = YzfSignUtil.signRequest(parametersMap,"34e5fc32ac894a2ba2ade8c3852c7a0a"); - dayabody.put("sign",a); - - StringBuilder body = new StringBuilder(); - SSLContext sslContext = null; - try { - sslContext = new SSLContextBuilder() - .loadTrustMaterial(null, TrustAllStrategy.INSTANCE) - .build(); - } catch (Exception e) { - - } - CloseableHttpClient closeableHttpClient = HttpClients.custom() - .setSSLContext(sslContext) - .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) - .build(); - - HttpPost post = new HttpPost(url); - CloseableHttpResponse response = null; - - RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(6000).build(); - post.setConfig(requestConfig);//设置请求参数【超时时间】 - post.setHeader("Content-Type", "application/json; charset=utf-8"); - - try { - if (dayabody.toJSONString() != null && !"".equals(dayabody.toJSONString())) { - ByteArrayEntity entity = new ByteArrayEntity(dayabody.toJSONString().getBytes("UTF-8")); - entity.setContentType("application/json"); - post.setEntity(entity); - } - response = closeableHttpClient.execute(post); - - HttpEntity entity = response.getEntity(); - body.append(EntityUtils.toString(entity, "UTF-8")); - } catch (Exception e) { - body.append(e.getMessage()); - } finally { - try { - // 关闭响应对象 - if (response != null) { - response.close(); - } - // 关闭响应对象 - if (closeableHttpClient != null) { - closeableHttpClient.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - - } - System.out.println("body"+body); - - return body.toString(); - } - - private String getToken() { - String url = "http://oapi.nanofintax.com/api/getToken"; - String bodys = "{\"accessKey\":\"6X3B526P5HqE6ums\",\"accessSecret\":\"34e5fc32ac894a2ba2ade8c3852c7a0a\"}"; - StringBuilder body = new StringBuilder(); - SSLContext sslContext = null; - try { - sslContext = new SSLContextBuilder() - .loadTrustMaterial(null, TrustAllStrategy.INSTANCE) - .build(); - } catch (Exception e) { - - } - CloseableHttpClient closeableHttpClient = HttpClients.custom() - .setSSLContext(sslContext) - .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) - .build(); - - HttpPost post = new HttpPost(url); - CloseableHttpResponse response = null; - - RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(6000).build(); - post.setConfig(requestConfig);//设置请求参数【超时时间】 - post.setHeader("Content-Type", "application/json; charset=utf-8"); - - try { - if (bodys != null && !"".equals(bodys)) { - ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); - entity.setContentType("application/json"); - post.setEntity(entity); - } - response = closeableHttpClient.execute(post); - - HttpEntity entity = response.getEntity(); - body.append(EntityUtils.toString(entity, "UTF-8")); - } catch (Exception e) { - body.append(e.getMessage()); - } finally { - try { - // 关闭响应对象 - if (response != null) { - response.close(); - } - // 关闭响应对象 - if (closeableHttpClient != null) { - closeableHttpClient.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - - } - System.out.println("body"+body); - String accessToken = JSONObject.parseObject(body.toString()).getJSONObject("result").getString("accessToken"); - - return accessToken; - } + //private String getToken() { + // String url = "http://oapi.nanofintax.com/api/getToken"; + // String bodys = "{\"accessKey\":\"6X3B526P5HqE6ums\",\"accessSecret\":\"34e5fc32ac894a2ba2ade8c3852c7a0a\"}"; + // StringBuilder body = new StringBuilder(); + // SSLContext sslContext = null; + // try { + // sslContext = new SSLContextBuilder() + // .loadTrustMaterial(null, TrustAllStrategy.INSTANCE) + // .build(); + // } catch (Exception e) { + // + // } + // CloseableHttpClient closeableHttpClient = HttpClients.custom() + // .setSSLContext(sslContext) + // .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + // .build(); + // + // HttpPost post = new HttpPost(url); + // CloseableHttpResponse response = null; + // + // RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(6000).build(); + // post.setConfig(requestConfig);//设置请求参数【超时时间】 + // post.setHeader("Content-Type", "application/json; charset=utf-8"); + // + // try { + // if (bodys != null && !"".equals(bodys)) { + // ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + // entity.setContentType("application/json"); + // post.setEntity(entity); + // } + // response = closeableHttpClient.execute(post); + // + // HttpEntity entity = response.getEntity(); + // body.append(EntityUtils.toString(entity, "UTF-8")); + // } catch (Exception e) { + // body.append(e.getMessage()); + // } finally { + // try { + // // 关闭响应对象 + // if (response != null) { + // response.close(); + // } + // // 关闭响应对象 + // if (closeableHttpClient != null) { + // closeableHttpClient.close(); + // } + // } catch (IOException e) { + // e.printStackTrace(); + // } + // + // } + // System.out.println("body"+body); + // String accessToken = JSONObject.parseObject(body.toString()).getJSONObject("result").getString("accessToken"); + // + // return accessToken; + //} } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml b/base-service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml index f2d0a1dc..ae69afcf 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/api/entity/SysApplicationApiEntity.xml @@ -83,25 +83,26 @@ - sys_application_api.id, - sys_application.app_id as app_code, - sys_application_api.api_code, - sys_application_api.api_name, - sys_application_api.api_remark, - sys_application_api.destination_address, - sys_application_api.header_in, - sys_application_api.query_in, - sys_application_api.body_in_type, - sys_application_api.body_in, - sys_application_api.body_out, - sys_application_api.body_in_type, - sys_application_api.sorts, - sys_application_api.bean_name, - sys_application_api.fun_name, - sys_application_api.extension_api, - sys_application_api.return_success_field, - sys_application_api.return_success_value, - sys_application_api.return_msg + sys_application_api.id, + sys_application.id as app_id, + sys_application.app_id as app_code, + sys_application_api.api_code, + sys_application_api.api_name, + sys_application_api.api_remark, + sys_application_api.destination_address, + sys_application_api.header_in, + sys_application_api.query_in, + sys_application_api.body_in_type, + sys_application_api.body_in, + sys_application_api.body_out, + sys_application_api.body_in_type, + sys_application_api.sorts, + sys_application_api.bean_name, + sys_application_api.fun_name, + sys_application_api.extension_api, + sys_application_api.return_success_field, + sys_application_api.return_success_value, + sys_application_api.return_msg