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/entity/CInvoiceImportHEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.java index 77da27ba..600d51ce 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,16 @@ public class CInvoiceImportHEntity extends BaseEntity { private String bill_type; //单据编码 private String bill_code; + //有度发票导入结果字段名 + private String yd_res_field; + //有度发票导入接口返回的id + private String yd_result; + //发起时间 + private String start_date; + //推送状态 + private String push_status; + //推送字段 + private String push_field; public String getTab_name() { return tab_name; @@ -38,4 +48,44 @@ 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; + } + + public String getStart_date() { + return start_date; + } + + public void setStart_date(String start_date) { + this.start_date = start_date; + } + + public String getPush_status() { + return push_status; + } + + public void setPush_status(String push_status) { + this.push_status = push_status; + } + + public String getPush_field() { + return push_field; + } + + public void setPush_field(String push_field) { + this.push_field = push_field; + } } 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..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 @@ -4,59 +4,30 @@ + + + + + + + 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/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/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..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 @@ -19,4 +19,18 @@ public interface ICInvoiceImportHService extends IBaseService queryInvoiceList(CInvoiceImportHEntity entity) throws Exception; + + /** + * 更新有度导入接口返回的id + * @param entity + * @return + */ + int updateResultId(CInvoiceImportHEntity entity); + + /** + * 更新推送标记 + * @param entity + * @return + */ + int updateStatus(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..a1362114 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,40 @@ 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; + } + + /** + * 更新推送标记 + * + * @param entity + * @return + */ + @DS("#entity.dataSourceCode") + @Override + public int updateStatus(CInvoiceImportHEntity entity) { + if (null != entity + && StrUtil.isNotEmpty(entity.getTab_name()) + && StrUtil.isNotEmpty(entity.getPush_field())){ + int updateRows = cInvoiceImportHDao.update("com.hzya.frame.plugin.cinvoice.dao.impl.CInvoiceImportHDaoImpl.entity_update_status", 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..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 @@ -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; @@ -58,6 +59,7 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer private IIntegrationTaskLivingDetailsService taskLivingDetailsService; @Value("${zt.url:}") private String url; + /** * 发票导入 * @@ -71,103 +73,126 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer //1、 查OA主表 String dataSourceCode = requestJson.getString("sourceCode"); - String id = requestJson.getString("id");//主表id + if (StrUtil.isEmpty(dataSourceCode)) { + dataSourceCode = requestJson.getString("apiDataSourceCode"); + } + String id = requestJson.getString("id");//主表id 测试的时候用 CInvoiceImportHEntity importHEntity = new CInvoiceImportHEntity(); importHEntity.setDataSourceCode(dataSourceCode); - importHEntity.setId("6286766887088770238"); + importHEntity.setId(id); List 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.setPI_ID("-95056949260236712"); + logger.info("开始查迈锐思发票公共表信息:{},{}",cInvoiceH.getId(),cInvoiceH.getBill_code()); + 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"); - //保存日志 - 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); + 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); + } + } catch (Exception e) { + logger.error("发票批量导入有度系统循环中出错:{}", e.getMessage()); } } + }else { + cInvoiceH.setPush_status("未查询到有效数据不推送"); + cInvoiceImportHService.updateStatus(cInvoiceH); } } @@ -176,39 +201,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 @@ -219,43 +246,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 @@ -270,34 +298,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()); } @@ -305,10 +333,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;//策略上下文类 @@ -318,70 +347,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; @@ -401,8 +432,8 @@ public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginSer youduFplx = "32"; break; case "14"://电子发票(通行费) - youduFplx = "14"; - break; + youduFplx = "14"; + break; } return youduFplx; } 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..5db7c3ca --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/FundsAllocationPluginInitializer.java @@ -0,0 +1,103 @@ +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 资金拨付 流程结束回调 需要同时回调有度税务和中信司库 + * @Author xiangerlin + * @Date 2025/6/21 14:06 + **/ +public class FundsAllocationPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(FundsAllocationPluginInitializer.class); + + @Autowired + private IFundsAllocationPluginService fundsAllocationPluginService; + /*** + * 插件初始化方法 + * @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("======开始执行资金拨付回调有度税务和中信司库插件========"); + fundsAllocationPluginService.callback(requestJson); + return BaseResult.getSuccessMessageEntity("执行成功"); + } +} 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..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,10 @@ 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; import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; @@ -45,6 +49,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 +83,10 @@ public class InvoiceDistributePluginInitializer extends PluginBaseEntity { private IMdmModuleSendLogDao mdmModuleSendLogDao; @Resource private IMdmModuleDistributeTripartiteDao mdmModuleDistributeTripartiteDao; + @Autowired + private IApplyInvoiceService applyInvoiceService; + @Autowired + private IInvoiceDao invoiceDao; @Value("${zt.url}") private String url ; @@ -1117,6 +1126,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 +1219,54 @@ 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); + 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){ + 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"); 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..3656b389 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/service/impl/FundsAllocationPluginServiceImpl.java @@ -0,0 +1,156 @@ +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 { + logger.error(" 资金拨付流程结束回调:"+requestJson.toJSONString()); + + 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"); + //资金归集 + String field0062 = formmainData.getString("field0062"); + if (StrUtil.isNotEmpty(field0061) || StrUtil.isNotEmpty(field0063) || StrUtil.isNotEmpty(field0062)){ + //查询审批意见 + 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); + } + String appId = "";//应用 + String apiCode = "";//api + String param = "";//参数 + if (StrUtil.isNotEmpty(field0061)){ + appId = "800060"; + apiCode = "8000600008"; + //税务 + 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(); + }else if (StrUtil.isNotEmpty(field0062)){ + appId = "800058"; + apiCode = "8000580004"; + //司库 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("batchNo",field0062); + 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; + } +} 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/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 8c402d5d..054f3d7f 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,15 +41,24 @@ 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; 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; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -58,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 @@ -88,13 +100,12 @@ public class IncomeInvoiceServiceImpl extends BaseService 0){ for (int i = 0; i < datalist.size(); i++) { @@ -183,15 +197,17 @@ public class IncomeInvoiceServiceImpl extends BaseService 0){ for (int i1 = 0; i1 < detaildata.size(); i1++) { @@ -239,6 +255,7 @@ public class IncomeInvoiceServiceImpl extends BaseService queryCursor*size){ queryCursor = queryCursor+1; - sendBusinessData(datalist, access_token, queryCursor, dataTime); + sendBusinessData(datalist, access_token, queryCursor, dataTime,taxNo); } if(businessList != null && businessList.size() > 0){ datalist.addAll(businessList); @@ -505,10 +522,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); @@ -522,19 +589,53 @@ 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"); + String fileName = null; + // 尝试从Content-Disposition中提取文件名 + if (contentDisposition != null) { + fileName = extractFileNameFromContentDisposition(contentDisposition); + } + + try (InputStream inputStream = connection.getInputStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { byte[] buffer = new byte[4096]; @@ -545,6 +646,22 @@ 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(1); + + 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()); } } @@ -769,7 +945,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-buildpackage/src/main/resources/application-ht.yml b/base-buildpackage/src/main/resources/application-ht.yml index afbc5086..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,15 +39,17 @@ 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\ #税务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/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/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 @@ + 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-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 - 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 select * - from formmain_0533 + from v_hzya_invoice_import where push_status is not null and yd_result is not null and import_result is null @@ -115,6 +124,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/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 e9535a6d..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 @@ -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; @@ -16,6 +17,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; @@ -74,6 +76,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) { @@ -179,7 +183,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 +235,19 @@ 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, "zip"); + String xmlSavePath = invoiceXmlUrl + xmlFileName; + File fileXml = downloadXml(xmlUrl, xmlSavePath); + logger.info("========xml文件保存到本地完成========"); + //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"); } } }else{ @@ -240,8 +257,30 @@ 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"); } } + //开票成功,提交流程 + //查询待办,退回流程用,这里只处理退回的情况,如果要处理提交,要等开票成功后才能提交,去定时查开票结果的定时任务里做 +// 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"); +// } } } } @@ -267,7 +306,8 @@ 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()); + logger.info("=====调用杭泰税务查询发票批量录入结果的请求参数为:{}===========",jsonObject.toJSONString()); //发送数据 String result = HttpRequest.post(url). header("appId", "800060"). @@ -280,7 +320,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.getId(), entity.getBill_code(), jsonObject.toJSONString(), resultJson.toJSONString(), false,"QueryInputInvoiceResultPluginInitializer"); } else { JSONObject attribute = resultJson.getJSONObject("attribute"); if("0".equals(attribute.getString("code"))) { @@ -288,14 +328,14 @@ 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(InvoiceImportState.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,""); + saveTaskLivingDetails(entity.getId(),entity.getBill_code(),jsonObject.toJSONString(), resultJson.toJSONString(), true,"QueryInputInvoiceResultPluginInitializer"); } } } @@ -444,6 +484,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() { @@ -577,7 +631,7 @@ public class InvoiceServiceImpl extends BaseService imple taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); } }catch (Exception e){ - logger.info("抽取杭泰付款单保存日志到集成任务日志明细中失败:{}",e.getMessage()); + logger.info("发票保存日志到集成任务日志明细中失败:{}",e.getMessage()); e.printStackTrace(); } } 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/ISeeYonInterFace.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java index fd29f738..ca248d97 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/ISeeYonInterFace.java @@ -91,7 +91,7 @@ public interface ISeeYonInterFace { * @return * @throws Exception */ - JsonResultEntity colEventPost(String jsonStr, String formAppId, String eventType) throws Exception; + JsonResultEntity colEventPost(String jsonStr, String formAppId, String eventType,String summaryId) throws Exception; JsonResultEntity chengeBody(JSONObject jsonObject) throws Exception; 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 - update ${tabName} set ${receiptFiled} =#{receipt} where id=#{id} + update ${tabName} set ${receiptFiled} =#{receipt} where id=#{dataId} 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());