diff --git a/.gitignore b/.gitignore index b252f4db..eb7f9414 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk ./idea/ +/.idea/ /buildpackage/src/main/resources/banner.txt /webapp/target/ /service/target/ @@ -66,3 +67,4 @@ $RECYCLE.BIN/ /base-webapp/target/classes/com/hzya/frame/ /fw-weixin/target/ /E:/yongansystem/log/2024-10-15/ +/D:/ diff --git a/base-buildpackage/pom.xml b/base-buildpackage/pom.xml index f4f9b259..c9143ecf 100644 --- a/base-buildpackage/pom.xml +++ b/base-buildpackage/pom.xml @@ -18,6 +18,11 @@ base-webapp ${revision} + + com.hzya.frame + fw-oa + 0.0.1-SNAPSHOT + @@ -32,8 +37,30 @@ true - - + + httest + + httest + + + + dev + + dev + + + + xel + + xel + + + + llg + + llg + + kangarooDataCenterV3 diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/BusInvoiceAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/BusInvoiceAssembler.java new file mode 100644 index 00000000..348651ca --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/BusInvoiceAssembler.java @@ -0,0 +1,48 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import com.alibaba.fastjson.JSONObject; + +/** + * @Description 客运汽车(a3) + * @Author xiangerlin + * @Date 2025/4/21 11:41 + **/ +public class BusInvoiceAssembler implements ParamAssembler{ + + private JSONObject jsonObject; + + public BusInvoiceAssembler(JSONObject jsonObject) { + this.jsonObject = jsonObject; + } + + /** + * 组装参数 + * + * @return + */ + @Override + public JSONObject assembleParam() { + JSONObject param = new JSONObject(); + // 发票代码,必填 + param.put("fpdm", ""); + // 发票号码,必填 + param.put("fphm", ""); + // 乘车日期/开票时间,格式为 yyyy-MM-dd,必填 + param.put("ccrq", ""); + // 乘车时间,格式为 HH:mm,非必填 + param.put("ccsj", ""); + // 出发地,非必填 + param.put("cfd", ""); + // 到达地,非必填 + param.put("ddd", ""); + // 乘车人姓名,非必填 + param.put("ccrxm", ""); + // 身份证号,非必填 + param.put("sfzh", ""); + // 金额,必填 + param.put("je", ""); + // 发票消费类型,非必填 + param.put("fpxflx", ""); + return param; + } +} 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 new file mode 100644 index 00000000..83e06759 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecFlightInvoiceAssembler.java @@ -0,0 +1,119 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.dto.FlightItemInfo; +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.util.LinkedList; +import java.util.List; + +/** + * @Description 400-电子发票(航空运输客票电子行程单) + * @Author xiangerlin + * @Date 2025/4/21 14:30 + **/ +public class ElecFlightInvoiceAssembler implements ParamAssembler{ + + private JSONObject jsonObject; + + public ElecFlightInvoiceAssembler(JSONObject jsonObject) { + this.jsonObject = jsonObject; + } + + /** + * 组装参数 + * + * @return + */ + @Override + public JSONObject assembleParam() { + JSONObject param = new JSONObject(); + String planeticketHStr = jsonObject.getString("planeticketH"); + String planeticketBListStr = jsonObject.getString("planeticketBList"); + if (StrUtil.isNotEmpty(planeticketHStr)){ + LexmiscivPlaneticketEntity planeticketH = JSONObject.parseObject(planeticketHStr, LexmiscivPlaneticketEntity.class); + List planeticketBList = JSONObject.parseArray(planeticketBListStr, LexmiscivPlaneticketsEntity.class); + // 1. 单据号码/电子客票号码,必填 + param.put("djhm", planeticketH.getPT_ETICKETNO()); + // 2. 验证码,非必填 + param.put("yzm", planeticketH.getPT_VALIDCODE()); + // 3. 开票日期,格式为 yyyy-MM-dd,必填 + param.put("kprq", planeticketH.getPT_DATE()); + // 4. 销售单位代号,非必填 + param.put("xsdwdh", planeticketH.getPT_SALERCODE()); + // 5. 填开单位,非必填 + param.put("tkdw", planeticketH.getPT_SALERNAME()); + // 6. 乘车人姓名,非必填 + param.put("cjrxm", planeticketH.getPT_CUSTOMER()); + // 7. 身份证号,非必填 + param.put("sfzh", planeticketH.getPT_IDNO()); + // 8. 票价,必填 + param.put("pj", planeticketH.getPT_PRICE()); + // 9. 民航发展基金,非必填 + param.put("mhfzjj", planeticketH.getPT_FUNDSAMOUNT()); + // 10. 保险费,非必填 + param.put("bxf", planeticketH.getPT_INSURANCE()); + // 11. 总额,必填 + param.put("ze", planeticketH.getPT_AMOUNT()); + // 12. 发票消费类型,非必填 + param.put("fpxflx", ""); + // 13. 国内国际标签,非必填 + param.put("gngjbq", planeticketH.getPT_INTERNATIONALFLAG()); + // 14. 印刷序号,非必填 + param.put("ysxh", planeticketH.getPT_SERIALNO()); + // 15. 燃油附加费,非必填 + param.put("ryfjf", planeticketH.getPT_FUELAMOUNT()); + if ("1".equals(planeticketH.getPT_ELECTRONICMARK())){ + //电子票需要的字段 + // 16. 购方税号,非必填 + param.put("gfsh", planeticketH.getPT_BUYERTAXNO()); + // 17. 购方名称,非必填 + param.put("gfmc", planeticketH.getPT_BUYERNAME()); + // 18. 签注,非必填 + param.put("xcdqz", planeticketH.getPT_MARKDESC()); + // 19. 开票状态,非必填 + param.put("kpzt", planeticketH.getPT_ISSUINGSTATE()); + // 20. 行程单提示信息,非必填 + param.put("xcdtsxx", planeticketH.getPT_PROMPTINFO()); + // 21. 增值税税率,非必填 + param.put("zzssl", planeticketH.getPT_TAXRATE()); + // 22. 增值税税额,非必填 + param.put("zzsse", planeticketH.getPT_TAXRATEAMOUNT()); + // 23. 合计,非必填 + param.put("hj", planeticketH.getPT_NOTAXAMOUNT()); + } + List filightItemList = new LinkedList<>(); + param.put("flightInfos",filightItemList); + if (CollectionUtils.isNotEmpty(planeticketBList)){ + for (LexmiscivPlaneticketsEntity b : planeticketBList) { + //for循环 + FlightItemInfo flightItem = new FlightItemInfo(); + flightItem.setCfz(b.getPTS_FSTATION());//出发站 + flightItem.setDdz(b.getPTS_TSTATION());//到达站 + flightItem.setHbh(b.getPTS_NO());//航班号 + flightItem.setCjsj(b.getPTS_TIME());//乘机时间 + flightItem.setZwdj(b.getPTS_CLASS());//座位等级 + flightItem.setCyr(b.getPTS_CARRIER());//承运人 + flightItem.setCwdj(b.getPTS_CLASSNAME());//舱位等级 + if ("1".equals(planeticketH.getPT_ELECTRONICMARK())){ + //电子票需要的字段 + flightItem.setSsflbm("");//税收分类编码 + flightItem.setXmmc("");//项目名称 + flightItem.setGgxh("");//规格型号 + flightItem.setDw("");//单位 + flightItem.setSl("");//数量 + flightItem.setDj("");//单价 + flightItem.setJe(String.valueOf(planeticketH.getPT_PRICE()));//金额 + flightItem.setSlv(planeticketH.getPT_TAXRATE());//税率 + flightItem.setSe(planeticketH.getPT_TAXAMOUNT());//税额 + } + filightItemList.add(flightItem); + } + } + } + return param; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecTrainInvoiceAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecTrainInvoiceAssembler.java new file mode 100644 index 00000000..a1ca24d5 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ElecTrainInvoiceAssembler.java @@ -0,0 +1,109 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivTrainticketEntity; + +/** + * @Description 200-电子发票(铁路电子客票) + * @Author xiangerlin + * @Date 2025/4/21 14:08 + **/ +public class ElecTrainInvoiceAssembler implements ParamAssembler{ + + private JSONObject jsonObject; + + public ElecTrainInvoiceAssembler(JSONObject jsonObject) { + this.jsonObject = jsonObject; + } + + /** + * 组装参数 + * + * @return + */ + @Override + public JSONObject assembleParam() { + JSONObject param = new JSONObject(); + String trainInvoice = jsonObject.getString("trainInvoice"); + if (StrUtil.isNotEmpty(trainInvoice)){ + LexmiscivTrainticketEntity trainticketEntity = JSONObject.parseObject(trainInvoice, LexmiscivTrainticketEntity.class); + if (null != trainticketEntity){ + // 1. 火车票号,必填 + param.put("hcph", trainticketEntity.getTT_CODE()); + // 2. 乘车日期,格式为 yyyy-MM-dd,必填 + param.put("ccrq", trainticketEntity.getTT_DATE()); + // 3. 乘车时间,格式为 HH:mm,非必填 + param.put("ccsj", trainticketEntity.getTT_TIME()); + // 4. 出发地,非必填 + param.put("cfd", trainticketEntity.getTT_FSTATION()); + // 5. 到达地,非必填 + param.put("ddd", trainticketEntity.getTT_TSTATION()); + // 6. 车次,非必填 + param.put("cc", trainticketEntity.getTT_NO()); + // 7. 乘车人姓名,非必填 + param.put("ccrxm", trainticketEntity.getTT_CUSTOMER()); + // 8. 身份证号,非必填 + param.put("sfzh", trainticketEntity.getTT_IDNO()); + // 9. 座位类型,非必填 + param.put("zwlx", trainticketEntity.getTT_CLASS()); + // 10. 金额,必填 + param.put("je", trainticketEntity.getTT_AMOUNT()); + // 11. 发票消费类型,非必填 + param.put("fpxflx", ""); + // 12. 序列号,非必填 + param.put("xlh", trainticketEntity.getTT_SERIALNO()); + // 13. 开票日期,格式为 yyyy-MM-dd,必填 + param.put("kprq", trainticketEntity.getTT_OUTDATE()); + // 14. 不含税金额,非必填 + param.put("bhsje", trainticketEntity.getTT_NOTAXAMOUNT()); + // 15. 税额,非必填 + param.put("se", trainticketEntity.getTT_TAXRATEAMOUNT()); + // 16. 税率,非必填 + param.put("slv", trainticketEntity.getTT_TAXRATE()); + // 17. 销方税号,非必填 + param.put("xfsh", ""); + // 18. 销方名称,非必填 + param.put("xfmc", ""); + // 19. 购方税号,非必填 + param.put("gfsh", trainticketEntity.getTT_BUYERTAXNO()); + // 20. 购方名称,非必填 + param.put("gfmc", trainticketEntity.getTT_BUYERNAME()); + // 21. 出发站拼音,非必填 + param.put("cfzpy", ""); + // 22. 到达站拼音,非必填 + param.put("ddzpy", ""); + // 23. 车厢,非必填 + param.put("cx", trainticketEntity.getTT_CARRIAGE()); + // 24. 厢位,非必填 + param.put("xw", trainticketEntity.getTT_SEAT()); + // 25. 电子客票号,非必填 + param.put("dzkph", trainticketEntity.getTT_SERIALNO()); + // 26. 发票明细信息,非必填,这里先创建一个空的 JSONArray + JSONArray qdHcpInfosArray = new JSONArray(); + param.put("qdHcpInfos", qdHcpInfosArray); + JSONObject qdHcpInfo = new JSONObject(); + // 27. 税收分类编码,非必填 + qdHcpInfo.put("ssflbm", ""); + // 28. 项目名称,非必填 + qdHcpInfo.put("xmmc", ""); + // 29. 规格型号,非必填 + qdHcpInfo.put("ggxh", ""); + // 30. 单位,非必填 + qdHcpInfo.put("dw", ""); + // 31. 数量,非必填 + qdHcpInfo.put("sl", ""); + // 32. 单价,非必填 + qdHcpInfo.put("dj", ""); + // 33. 金额,非必填 + qdHcpInfo.put("je", trainticketEntity.getTT_AMOUNT()); + // 34. 税率,非必填 + qdHcpInfo.put("slv", trainticketEntity.getTT_TAXRATE()); + // 35. 税额,非必填 + qdHcpInfo.put("se", trainticketEntity.getTT_TAXRATEAMOUNT()); + } + } + return param; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/FlightInvoiceAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/FlightInvoiceAssembler.java new file mode 100644 index 00000000..b21165e2 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/FlightInvoiceAssembler.java @@ -0,0 +1,73 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.dto.FlightItemInfo; +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.util.LinkedList; +import java.util.List; + +/** + * @Description 航空运输电子客票行程单(a4) 参数组装 + * @Author xiangerlin + * @Date 2025/4/21 10:57 + **/ +public class FlightInvoiceAssembler implements ParamAssembler{ + + private JSONObject jsonObject; + + public FlightInvoiceAssembler(JSONObject jsonObject) { + this.jsonObject = jsonObject; + } + + /** + * 组装参数 + * + * @return + */ + @Override + public JSONObject assembleParam() { + JSONObject params = new JSONObject(); + String planeticketHStr = jsonObject.getString("planeticketH"); + String planeticketBListStr = jsonObject.getString("planeticketBList"); + if (StrUtil.isNotEmpty(planeticketHStr)){ + LexmiscivPlaneticketEntity planeticketH = JSONObject.parseObject(planeticketHStr, LexmiscivPlaneticketEntity.class); + List planeticketBList = JSONObject.parseArray(planeticketBListStr, LexmiscivPlaneticketsEntity.class); + params.put("djhm", planeticketH.getPT_ETICKETNO()); // 单据号码/电子客票号码 + params.put("yzm", planeticketH.getPT_VALIDCODE()); // 验证码 + params.put("kprq", planeticketH.getPT_DATE()); // 开票日期,yyyy-MM-dd + params.put("xsdwdh", planeticketH.getPT_SALERCODE()); // 销售单位代号 + params.put("tkdw", planeticketH.getPT_SALERNAME()); // 填开单位 + params.put("cjrxm", planeticketH.getPT_CUSTOMER()); // 乘车人姓名 + params.put("sfzh", planeticketH.getPT_IDNO()); // 身份证号 + params.put("pj", planeticketH.getPT_PRICE()); // 票价 + params.put("mhfzjj", planeticketH.getPT_FUNDSAMOUNT()); // 民航发展基金 + params.put("bxf", planeticketH.getPT_INSURANCE()); // 保险费 + params.put("ze", planeticketH.getPT_AMOUNT()); // 总额 + params.put("fpxflx", ""); // 发票消费类型 + params.put("gngjbq", planeticketH.getPT_INTERNATIONALFLAG()); // 国内国际标签 + params.put("ysxh", planeticketH.getPT_SERIALNO()); // 印刷序号 + params.put("ryfjf", planeticketH.getPT_FUELAMOUNT()); // 燃油附加费 + List filightItemList = new LinkedList<>(); + params.put("flightInfos",filightItemList); + //for循环 + if (CollectionUtils.isNotEmpty(planeticketBList)){ + for (LexmiscivPlaneticketsEntity b : planeticketBList) { + FlightItemInfo flightItem = new FlightItemInfo(); + flightItem.setCfz(b.getPTS_FSTATION());//出发站 + flightItem.setDdz(b.getPTS_TSTATION());//到达站 + flightItem.setHbh(b.getPTS_NO());//航班号 + flightItem.setCjsj(b.getPTS_TIME());//乘机时间 + flightItem.setZwdj(b.getPTS_CLASS());//座位等级 + flightItem.setCyr(b.getPTS_CARRIER());//承运人 + flightItem.setCwdj(b.getPTS_CLASSNAME());//舱位等级 + filightItemList.add(flightItem); + } + } + } + return params; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssembler.java new file mode 100644 index 00000000..73739c1d --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssembler.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import com.alibaba.fastjson.JSONObject; + +/** + * @Description 定义组装参数的接口 + * @Author xiangerlin + * @Date 2025/4/21 09:22 + **/ +public interface ParamAssembler { + + /** + * 组装参数 + * @return + */ + JSONObject assembleParam(); +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssemblerContext.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssemblerContext.java new file mode 100644 index 00000000..3b664946 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ParamAssemblerContext.java @@ -0,0 +1,20 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import com.alibaba.fastjson.JSONObject; + +/** + * @Description 上下文类,根据发票类型选择相应的组装策略 + * @Author xiangerlin + * @Date 2025/4/21 14:51 + **/ +public class ParamAssemblerContext { + + private ParamAssembler assembler; + + public ParamAssemblerContext(ParamAssembler assembler) { + this.assembler = assembler; + } + public JSONObject assemble(){ + return assembler.assembleParam(); + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/TrainInvoiceAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/TrainInvoiceAssembler.java new file mode 100644 index 00000000..cb516f2a --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/TrainInvoiceAssembler.java @@ -0,0 +1,48 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivTrainticketEntity; + +/** + * @Description a2 纸质火车票参数组装 + * @Author xiangerlin + * @Date 2025/4/21 10:20 + **/ +public class TrainInvoiceAssembler implements ParamAssembler{ + + private JSONObject jsonObject; + + public TrainInvoiceAssembler(JSONObject jsonObject) { + this.jsonObject = jsonObject; + } + + /** + * 组装参数 + * + * @return + */ + @Override + public JSONObject assembleParam() { + JSONObject param = new JSONObject(); + String trainInvoice = jsonObject.getString("trainInvoice"); + if (StrUtil.isNotEmpty(trainInvoice)){ + LexmiscivTrainticketEntity trainticketEntity = JSONObject.parseObject(trainInvoice, LexmiscivTrainticketEntity.class); + if (null != trainticketEntity){ + param.put("hcph", trainticketEntity.getTT_CODE()); // 火车票号 + param.put("ccrq", trainticketEntity.getTT_DATE()); // 乘车日期,yyyy-MM-dd + param.put("ccsj", trainticketEntity.getTT_TIME()); // 乘车时间,HH:mm + param.put("cfd", trainticketEntity.getTT_FSTATION()); // 出发地 + param.put("ddd", trainticketEntity.getTT_TSTATION()); // 到达地 + param.put("cc", trainticketEntity.getTT_NO()); // 车次 + param.put("ccrxm", trainticketEntity.getTT_CUSTOMER()); // 乘车人姓名 + param.put("sfzh", trainticketEntity.getTT_IDNO()); // 身份证号 + param.put("zwlx", trainticketEntity.getTT_CLASS()); // 座位类型 + param.put("je", trainticketEntity.getTT_AMOUNT()); // 金额 + param.put("fpxflx", ""); // 发票消费类型 + param.put("xlh", trainticketEntity.getTT_SERIALNO()); // 序列号 + } + } + return param; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ZzsInvoiceAssembler.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ZzsInvoiceAssembler.java new file mode 100644 index 00000000..6949e750 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/assembler/ZzsInvoiceAssembler.java @@ -0,0 +1,88 @@ +package com.hzya.frame.plugin.cinvoice.assembler; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.dto.ZzsItemInfo; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicedetailEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity; +import org.apache.commons.collections.CollectionUtils; + +import java.util.LinkedList; +import java.util.List; + +/** + * @Description 增值税类发票参数 + * 增值税类发票(01增值税专票,04增值税普票,08增值税电子专票,10增值税电子普票,11增值税普票(票卷),31电子发票(增值税专票),32电子发票(普票)) + * @Author xiangerlin + * @Date 2025/4/21 09:27 + **/ +public class ZzsInvoiceAssembler implements ParamAssembler{ + + private JSONObject jsonObject; + + public ZzsInvoiceAssembler(JSONObject jsonObject) { + this.jsonObject = jsonObject; + } + + /** + * 增值税类发票参数组装 + * + * @return + */ + @Override + public JSONObject assembleParam() { + JSONObject param = new JSONObject(); + String zzsInvoiceHStr = jsonObject.getString("zzsInvoiceH"); + String zzsInvoiceBListStr = jsonObject.getString("zzsInvoiceBList"); + if (StrUtil.isNotEmpty(zzsInvoiceHStr) && StrUtil.isNotEmpty(zzsInvoiceBListStr)){ + LexmiscivInvoicemainEntity zzsInvoiceH = JSONObject.parseObject(zzsInvoiceHStr, LexmiscivInvoicemainEntity.class); + List zzsInvoiceBList = JSONObject.parseArray(zzsInvoiceBListStr, LexmiscivInvoicedetailEntity.class); + if (null != zzsInvoiceH){ + param.put("fpdm", zzsInvoiceH.getIM_FPDM());//发票代码 + param.put("fphm", zzsInvoiceH.getIM_FPHM());//发票号码 + param.put("kprq", zzsInvoiceH.getIM_DATE());//开票日期 yyyy-MM-dd + param.put("xfsh", zzsInvoiceH.getIM_SALERTAXNO());//销方税号 + param.put("xfmc", zzsInvoiceH.getIM_SALERNAME());//销方名称 + param.put("gfsh", zzsInvoiceH.getIM_BUYERTAXNO());//购方税号 + param.put("gfmc", zzsInvoiceH.getIM_BUYERNAME());//购方名称 + param.put("hjje", zzsInvoiceH.getIM_NOTAXAMOUNT());//合计金额(不含税) + param.put("hjse", zzsInvoiceH.getIM_TAXAMOUNT());//合计税额 + param.put("jshj", zzsInvoiceH.getIM_TOTALAMOUNT());//价税合计,发票类型为31电子发票(增值税专票),32电子发票(普票) 时必填 + param.put("jym", zzsInvoiceH.getIM_CHECKCODE());//校验码,发票类型为04增值税普票、10增值税电子普票,11增值税普票(票卷) 时必填 + param.put("xfdzdh", zzsInvoiceH.getIM_SALERADDRESS());//销售方地址,电话 + param.put("xfyhzh", zzsInvoiceH.getIM_SALERBANKNO());//销售方开户行及账号 + param.put("gfdzdh", zzsInvoiceH.getIM_BUYERADDRESS());//购买方地址、电话 + param.put("gfyhzh", zzsInvoiceH.getIM_BUYERBANKNO());//购买方开户行及账号 + param.put("mmq", zzsInvoiceH.getIM_ENCRYPTIONCODE());//密码区 + param.put("bz", zzsInvoiceH.getIM_MEMO());//备注 + param.put("jqbh", zzsInvoiceH.getIM_MACHINENO());//机器编号 + param.put("jdhm", zzsInvoiceH.getIM_PRINTEDFPHM());//机打号码,发票类型为11增值税普票(票卷) 时必填 + param.put("kpr", zzsInvoiceH.getIM_MAKERNM());//开票人 + param.put("skr", zzsInvoiceH.getIM_PAYEE());//收款人 + param.put("fhr", zzsInvoiceH.getIM_AUDITOR());//复核人 + // 发票明细信息 + List zzsItemInfoList = new LinkedList<>(); + param.put("zzsItemInfos", zzsItemInfoList); + if (CollectionUtils.isNotEmpty(zzsInvoiceBList)){ + for (LexmiscivInvoicedetailEntity b : zzsInvoiceBList) { + ZzsItemInfo zzsItemInfo = new ZzsItemInfo(); + // 发票明细项 + zzsItemInfo.setXh(b.getID_ROWID());//序号 + zzsItemInfo.setSsflbm("");//税收分类编码 + zzsItemInfo.setXmmc(b.getID_SERVICENM());//项目名称 + zzsItemInfo.setGgxh(b.getID_SERVICETYPE());//规格型号 + zzsItemInfo.setDw(b.getID_UNIT());//单位 + zzsItemInfo.setSl(b.getID_NUM());//数量 + zzsItemInfo.setDj(b.getID_PRICE());//单价 + zzsItemInfo.setJe(b.getID_NOTAXAMOUNT());//金额 + zzsItemInfo.setSlv(b.getID_TAX());//税率 + zzsItemInfo.setSe(b.getID_TAXAMOUNT());//税额 + zzsItemInfoList.add(zzsItemInfo); + } + } + } + } + + return param; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportBDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportBDao.java new file mode 100644 index 00000000..0429933f --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportBDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.cinvoice.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportBEntity; + +/** + * @Description 发票批量导入有度税务 表体dao + * @Author xiangerlin + * @Date 2025/4/18 15:27 + **/ +public interface ICInvoiceImportBDao extends IBaseDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportHDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportHDao.java new file mode 100644 index 00000000..8251dd42 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/ICInvoiceImportHDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.cinvoice.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportHEntity; + +/** + * @Description 发票批量导入有度税务 表头dao + * @Author xiangerlin + * @Date 2025/4/18 15:25 + **/ +public interface ICInvoiceImportHDao extends IBaseDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportBDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportBDaoImpl.java new file mode 100644 index 00000000..52992ce6 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportBDaoImpl.java @@ -0,0 +1,16 @@ +package com.hzya.frame.plugin.cinvoice.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.dao.ICInvoiceImportBDao; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportBEntity; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportHEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description 发票批量导入有度税务 表体dao + * @Author xiangerlin + * @Date 2025/4/18 15:32 + **/ +@Repository +public class CInvoiceImportBDaoImpl extends MybatisGenericDao implements ICInvoiceImportBDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportHDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportHDaoImpl.java new file mode 100644 index 00000000..e46fa21b --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dao/impl/CInvoiceImportHDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.cinvoice.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.dao.ICInvoiceImportHDao; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportHEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description 发票批量导入有度税务 表头dao + * @Author xiangerlin + * @Date 2025/4/18 15:31 + **/ +@Repository +public class CInvoiceImportHDaoImpl extends MybatisGenericDao implements ICInvoiceImportHDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/FlightItemInfo.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/FlightItemInfo.java new file mode 100644 index 00000000..e0139e53 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/FlightItemInfo.java @@ -0,0 +1,154 @@ +package com.hzya.frame.plugin.cinvoice.dto; + +/** + * @Description 航空运输电子客票行程单明细 + * @Author xiangerlin + * @Date 2025/4/21 10:36 + **/ +public class FlightItemInfo { + private String cfz;//出发站 + private String ddz;//到达站 + private String hbh;//航班号 + private String cjsj;//乘机时间 + private String zwdj;//座位等级 + private String cyr;//承运人 + private String cwdj;//仓位等级 + + + private String ssflbm;//税收分类编码 + private String xmmc;//项目名称 + private String ggxh;//规格型号 + private String dw;//单位 + private String sl;//数量 + private String dj;//单价 + private String je;//金额 + private String slv;//税率 + private String se;//税额 + public String getCfz() { + return cfz; + } + + public void setCfz(String cfz) { + this.cfz = cfz; + } + + public String getDdz() { + return ddz; + } + + public void setDdz(String ddz) { + this.ddz = ddz; + } + + public String getHbh() { + return hbh; + } + + public void setHbh(String hbh) { + this.hbh = hbh; + } + + public String getCjsj() { + return cjsj; + } + + public void setCjsj(String cjsj) { + this.cjsj = cjsj; + } + + public String getZwdj() { + return zwdj; + } + + public void setZwdj(String zwdj) { + this.zwdj = zwdj; + } + + public String getCyr() { + return cyr; + } + + public void setCyr(String cyr) { + this.cyr = cyr; + } + + public String getCwdj() { + return cwdj; + } + + public void setCwdj(String cwdj) { + this.cwdj = cwdj; + } + + public String getSsflbm() { + return ssflbm; + } + + public void setSsflbm(String ssflbm) { + this.ssflbm = ssflbm; + } + + public String getXmmc() { + return xmmc; + } + + public void setXmmc(String xmmc) { + this.xmmc = xmmc; + } + + public String getGgxh() { + return ggxh; + } + + public void setGgxh(String ggxh) { + this.ggxh = ggxh; + } + + public String getDw() { + return dw; + } + + public void setDw(String dw) { + this.dw = dw; + } + + public String getSl() { + return sl; + } + + public void setSl(String sl) { + this.sl = sl; + } + + public String getDj() { + return dj; + } + + public void setDj(String dj) { + this.dj = dj; + } + + public String getJe() { + return je; + } + + public void setJe(String je) { + this.je = je; + } + + public String getSlv() { + return slv; + } + + public void setSlv(String slv) { + this.slv = slv; + } + + public String getSe() { + return se; + } + + public void setSe(String se) { + this.se = se; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/ZzsItemInfo.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/ZzsItemInfo.java new file mode 100644 index 00000000..aa3b26d4 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/dto/ZzsItemInfo.java @@ -0,0 +1,99 @@ +package com.hzya.frame.plugin.cinvoice.dto; + +/** + * @Description 增值税发票明细表 + * @Author xiangerlin + * @Date 2025/4/21 09:56 + **/ +public class ZzsItemInfo { + private String xh;//序号 + private String ssflbm; // 税收分类编码 + private String xmmc; // 项目名称 + private String ggxh; // 规格型号 + private String dw; // 单位 + private String sl; // 数量 + private String dj; // 单价 + private String je; // 金额 + private String slv; // 税率 + private String se; // 税额 + + public String getXh() { + return xh; + } + + public void setXh(String xh) { + this.xh = xh; + } + + public String getSsflbm() { + return ssflbm; + } + + public void setSsflbm(String ssflbm) { + this.ssflbm = ssflbm; + } + + public String getXmmc() { + return xmmc; + } + + public void setXmmc(String xmmc) { + this.xmmc = xmmc; + } + + public String getGgxh() { + return ggxh; + } + + public void setGgxh(String ggxh) { + this.ggxh = ggxh; + } + + public String getDw() { + return dw; + } + + public void setDw(String dw) { + this.dw = dw; + } + + public String getSl() { + return sl; + } + + public void setSl(String sl) { + this.sl = sl; + } + + public String getDj() { + return dj; + } + + public void setDj(String dj) { + this.dj = dj; + } + + public String getJe() { + return je; + } + + public void setJe(String je) { + this.je = je; + } + + public String getSlv() { + return slv; + } + + public void setSlv(String slv) { + this.slv = slv; + } + + public String getSe() { + return se; + } + + public void setSe(String se) { + this.se = se; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.java new file mode 100644 index 00000000..6086433c --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.java @@ -0,0 +1,81 @@ +package com.hzya.frame.plugin.cinvoice.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description 发票批量导入有度税务表体 + * @Author xiangerlin + * @Date 2025/4/18 15:20 + **/ +public class CInvoiceImportBEntity extends BaseEntity { + //主表id + private String formmain_id; + //主表名称 + private String formmain_tab_name; + //发票号 + private String cinvoice_number; + //发票代码 + private String cinvoice_code; + //发票类型 + private String cinvoice_type; + //发票日期 + private String cinvoice_date; + //发票金额 + private String cinvoice_amount; + + public String getFormmain_id() { + return formmain_id; + } + + public void setFormmain_id(String formmain_id) { + this.formmain_id = formmain_id; + } + + public String getFormmain_tab_name() { + return formmain_tab_name; + } + + public void setFormmain_tab_name(String formmain_tab_name) { + this.formmain_tab_name = formmain_tab_name; + } + + public String getCinvoice_number() { + return cinvoice_number; + } + + public void setCinvoice_number(String cinvoice_number) { + this.cinvoice_number = cinvoice_number; + } + + public String getCinvoice_code() { + return cinvoice_code; + } + + public void setCinvoice_code(String cinvoice_code) { + this.cinvoice_code = cinvoice_code; + } + + public String getCinvoice_type() { + return cinvoice_type; + } + + public void setCinvoice_type(String cinvoice_type) { + this.cinvoice_type = cinvoice_type; + } + + public String getCinvoice_date() { + return cinvoice_date; + } + + public void setCinvoice_date(String cinvoice_date) { + this.cinvoice_date = cinvoice_date; + } + + public String getCinvoice_amount() { + return cinvoice_amount; + } + + public void setCinvoice_amount(String cinvoice_amount) { + this.cinvoice_amount = cinvoice_amount; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.xml new file mode 100644 index 00000000..85a66cdb --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportBEntity.xml @@ -0,0 +1,26 @@ + + + + + + + + + + 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 new file mode 100644 index 00000000..77da27ba --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.java @@ -0,0 +1,41 @@ +package com.hzya.frame.plugin.cinvoice.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description 发票批量导入有度税务表头 + * @Author xiangerlin + * @Date 2025/4/18 15:19 + **/ +public class CInvoiceImportHEntity extends BaseEntity { + //表名称 + private String tab_name; + //单据类型 + private String bill_type; + //单据编码 + private String bill_code; + + public String getTab_name() { + return tab_name; + } + + public void setTab_name(String tab_name) { + this.tab_name = tab_name; + } + + public String getBill_type() { + return bill_type; + } + + public void setBill_type(String bill_type) { + this.bill_type = bill_type; + } + + public String getBill_code() { + return bill_code; + } + + public void setBill_code(String bill_code) { + this.bill_code = bill_code; + } +} 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 new file mode 100644 index 00000000..3a492e25 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/entity/CInvoiceImportHEntity.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmisPublicinfoDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmisPublicinfoDao.java new file mode 100644 index 00000000..50f8e5e2 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmisPublicinfoDao.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity; +/** + * @description: 迈锐思-公共信息表 dao + * @tableName: LEXMISCIV_PUBLICINFO + * @entityName: LexmisPublicinfoEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmisPublicinfoDao extends IBaseDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicedetailDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicedetailDao.java new file mode 100644 index 00000000..cb084086 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicedetailDao.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicedetailEntity; +/** + * @description: 迈锐思-增值税发票子表 dao + * @tableName: LEXMISCIV_INVOICEDETAIL + * @entityName: LexmiscivInvoicedetailEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivInvoicedetailDao extends IBaseDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicemainDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicemainDao.java new file mode 100644 index 00000000..ab5251be --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivInvoicemainDao.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity; +/** + * @description: 迈锐思-增值税发票主表 dao + * @tableName: LEXMISCIV_INVOICEMAIN + * @entityName: LexmiscivInvoicemainEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivInvoicemainDao extends IBaseDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketDao.java new file mode 100644 index 00000000..877ebd5e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketDao.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketEntity; +/** + * @description: 迈锐思-飞机行程单 dao + * @tableName: LEXMISCIV_PLANETICKET + * @entityName: LexmiscivPlaneticketEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivPlaneticketDao extends IBaseDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketsDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketsDao.java new file mode 100644 index 00000000..c562e89d --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivPlaneticketsDao.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity; +/** + * @description: 迈锐思-飞机行程单明细 dao + * @tableName: LEXMISCIV_PLANETICKETS + * @entityName: LexmiscivPlaneticketsEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivPlaneticketsDao extends IBaseDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivTrainticketDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivTrainticketDao.java new file mode 100644 index 00000000..caf1275d --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/ILexmiscivTrainticketDao.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivTrainticketEntity; +/** + * @description: 迈锐思-火车票 dao + * @tableName: LEXMISCIV_TRAINTICKET + * @entityName: LexmiscivTrainticketEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivTrainticketDao extends IBaseDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmisPublicinfoDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmisPublicinfoDaoImpl.java new file mode 100644 index 00000000..101a3d35 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmisPublicinfoDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmisPublicinfoDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; + +/** + * @description: 迈锐思-公共信息表 dao + * @tableName: LEXMISCIV_PUBLICINFO + * @entityName: LexmisPublicinfoEntity + * @author: gjh + * @history:1.0 + */ +@Repository("LEXMISCIV_PUBLICINFOdao") +public class LexmisPublicinfoDaoImpl extends MybatisGenericDao implements ILexmisPublicinfoDao { + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicedetailDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicedetailDaoImpl.java new file mode 100644 index 00000000..14e78a7f --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicedetailDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicedetailEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivInvoicedetailDao; + +/** + * @description: 迈锐思-增值税发票子表 dao + * @tableName: LEXMISCIV_INVOICEDETAIL + * @entityName: LexmiscivInvoicedetailEntity + * @author: gjh + * @history:1.0 + */ +@Repository("LEXMISCIV_INVOICEDETAILdao") +public class LexmiscivInvoicedetailDaoImpl extends MybatisGenericDao implements ILexmiscivInvoicedetailDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicemainDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicemainDaoImpl.java new file mode 100644 index 00000000..d08812e1 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivInvoicemainDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivInvoicemainDao; + +/** + * @description: 迈锐思-增值税发票主表 dao + * @tableName: LEXMISCIV_INVOICEMAIN + * @entityName: LexmiscivInvoicemainEntity + * @author: gjh + * @history:1.0 + */ +@Repository("LEXMISCIV_INVOICEMAINdao") +public class LexmiscivInvoicemainDaoImpl extends MybatisGenericDao implements ILexmiscivInvoicemainDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketDaoImpl.java new file mode 100644 index 00000000..a962fcb0 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivPlaneticketDao; + +/** + * @description: 迈锐思-飞机行程单 dao + * @tableName: LEXMISCIV_PLANETICKET + * @entityName: LexmiscivPlaneticketEntity + * @author: gjh + * @history:1.0 + */ +@Repository("LEXMISCIV_PLANETICKETdao") +public class LexmiscivPlaneticketDaoImpl extends MybatisGenericDao implements ILexmiscivPlaneticketDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketsDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketsDaoImpl.java new file mode 100644 index 00000000..33546d45 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivPlaneticketsDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivPlaneticketsDao; + +/** + * @description: 迈锐思-飞机行程单明细 dao + * @tableName: LEXMISCIV_PLANETICKETS + * @entityName: LexmiscivPlaneticketsEntity + * @author: gjh + * @history:1.0 + */ +@Repository("LEXMISCIV_PLANETICKETSdao") +public class LexmiscivPlaneticketsDaoImpl extends MybatisGenericDao implements ILexmiscivPlaneticketsDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivTrainticketDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivTrainticketDaoImpl.java new file mode 100644 index 00000000..ab34b7cb --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/dao/impl/LexmiscivTrainticketDaoImpl.java @@ -0,0 +1,17 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.dao.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivTrainticketEntity; +import org.springframework.stereotype.Repository; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivTrainticketDao; + +/** + * @description: 迈锐思-火车票 dao + * @tableName: LEXMISCIV_TRAINTICKET + * @entityName: LexmiscivTrainticketEntity + * @author: gjh + * @history:1.0 + */ +@Repository("LEXMISCIV_TRAINTICKETdao") +public class LexmiscivTrainticketDaoImpl extends MybatisGenericDao implements ILexmiscivTrainticketDao{ + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.java new file mode 100644 index 00000000..d21943e5 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.java @@ -0,0 +1,2080 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.entity; + +import java.util.Date; + +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; + + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @description: 迈锐思-公共信息表 + * @tableName: LEXMISCIV_PUBLICINFO + * @entityName: LexmisPublicinfoEntity + * @author: gjh + * @history: 1.0 + */ +public class LexmisPublicinfoEntity extends BaseEntity { + public LexmisPublicinfoEntity() { + + } + + public LexmisPublicinfoEntity(String PI_FORMDATAID,String dataSourceCode) { + this.PI_FORMDATAID = PI_FORMDATAID; + this.setDataSourceCode(dataSourceCode); + } + + private String PI_BELONGID; + /** + * 无备注 + */ + private String PI_ID; + /** + * 无备注 + */ + private String PI_KEY; + /** + * 无备注 + */ + private String PI_KEY_NEW; + /** + * 无备注 + */ + private String PI_DATAKEY; + /** + * 无备注 + */ + private String PI_MAINCONFIGID; + /** + * 无备注 + */ + private String PI_TAXNO; + /** + * 无备注 + */ + private String PI_TABLENAME; + /** + * 无备注 + */ + private String PI_BILLKIND; + /** + * 无备注 + */ + private String PI_BILLNAME; + /** + * 无备注 + */ + private String PI_AMOUNT; + /** + * 无备注 + */ + private String PI_STATE; + /** + * 无备注 + */ + private String PI_FILEID; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_FILEDATE; + /** + * 无备注 + */ + private String PI_IMAGEPATH; + /** + * 无备注 + */ + private String PI_UPDATEDATA; + /** + * 无备注 + */ + private String PI_TYPE; + /** + * 无备注 + */ + private String PI_MEMBERID; + /** + * 无备注 + */ + private String PI_MEMBERNM; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_MAKEDATE; + /** + * 无备注 + */ + private String PI_BEStringID; + /** + * 无备注 + */ + private String PI_BEStringNM; + /** + * 无备注 + */ + private String PI_USEACCOUNTID; + /** + * 无备注 + */ + private String PI_USEACCOUNTNM; + /** + * 无备注 + */ + private String PI_USEDEPARTMENTID; + /** + * 无备注 + */ + private String PI_USEDEPARTMENTNM; + /** + * 无备注 + */ + private String PI_USEID; + /** + * 无备注 + */ + private String PI_USENM; + /** + * 无备注 + */ + private String PI_USESTATE; + /** + * 无备注 + */ + private String PI_SUMMARYID; + /** + * 无备注 + */ + private String PI_SUBJECT; + /** + * 无备注 + */ + private String PI_FORMID; + /** + * 无备注 + */ + private String PI_FORMDATAID; + /** + * 无备注 + */ + private String PI_TEMPLATEID; + /** + * 无备注 + */ + private String PI_STARTACCOUNTID; + /** + * 无备注 + */ + private String PI_STARTDEPARTMENTID; + /** + * 无备注 + */ + private String PI_STARTMEMBERID; + /** + * 无备注 + */ + private String PI_STARTMEMBERNM; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_STARTDATE; + /** + * 无备注 + */ + private String PI_DEALACCOUNTID; + /** + * 无备注 + */ + private String PI_DEALDEPARTMENTID; + /** + * 无备注 + */ + private String PI_DEALMEMBERID; + /** + * 无备注 + */ + private String PI_DEALMEMBERNM; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_DEALDATE; + /** + * 无备注 + */ + private String PI_DEALSTATE; + /** + * 无备注 + */ + private String PI_DEALPOLICY; + /** + * 无备注 + */ + private String PI_DEALINFO; + /** + * 无备注 + */ + private String PI_SHAREID; + /** + * 无备注 + */ + private String PI_SHARENM; + /** + * 无备注 + */ + private String PI_APITYPE; + /** + * 无备注 + */ + private String PI_ISVALID; + /** + * 无备注 + */ + private String PI_VALIDRESULT; + /** + * 无备注 + */ + private String PI_RESULTNM; + /** + * 无备注 + */ + private String PI_VALIDSTATE; + /** + * 无备注 + */ + private String PI_CLASSTYPE; + /** + * 无备注 + */ + private String PI_CLASSNAME; + /** + * 无备注 + */ + private String PI_RECOVERSTATE; + /** + * 无备注 + */ + private String PI_RECOVERMEMBERID; + /** + * 无备注 + */ + private String PI_RECOVERMEMBERNM; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_RECOVERDATE; + /** + * 无备注 + */ + private String PI_ORGID; + /** + * 无备注 + */ + private String PI_ORGNM; + /** + * 无备注 + */ + private String PI_YEAR; + /** + * 无备注 + */ + private String PI_MONTH; + /** + * 无备注 + */ + private String PI_QUARTER; + /** + * 无备注 + */ + private String PI_HALFYEAR; + /** + * 无备注 + */ + private String PI_XMMC; + /** + * 无备注 + */ + private String PI_FPDM; + /** + * 无备注 + */ + private String PI_FPHM; + /** + * 无备注 + */ + private String PI_SALERTAXNO; + /** + * 无备注 + */ + private String PI_SALERNAME; + /** + * 无备注 + */ + private String PI_BUYERTAXNO; + /** + * 无备注 + */ + private String PI_BUYERNAME; + /** + * 无备注 + */ + private String PI_INVOICETYPE; + /** + * 无备注 + */ + private String PI_INVOICENAME; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_INVOICEDATE; + /** + * 无备注 + */ + private String PI_FSTATION; + /** + * 无备注 + */ + private String PI_TSTATION; + /** + * 无备注 + */ + private String PI_USERNAME; + /** + * 无备注 + */ + private String PI_TRAINNO; + /** + * 无备注 + */ + private String PI_TRAINCODE; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_STARTDATETIME; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_ENDDATETIME; + /** + * 无备注 + */ + private String PI_STARTTIME; + /** + * 无备注 + */ + private String PI_ENDTIME; + /** + * 无备注 + */ + private String PI_TAXRATE; + /** + * 无备注 + */ + private String PI_TAXAMOUNT; + /** + * 无备注 + */ + private String PI_NOTAXAMOUNT; + /** + * 无备注 + */ + private String PI_DEDUCTIONAMOUNT; + /** + * 无备注 + */ + private String PI_FILEURL; + /** + * 无备注 + */ + private String PI_MATTERID; + /** + * 无备注 + */ + private String PI_VOUCHER; + /** + * 无备注 + */ + private String PI_VOUCHERINFO; + /** + * 无备注 + */ + private String PI_FIELD0001; + /** + * 无备注 + */ + private String PI_FIELD0002; + /** + * 无备注 + */ + private String PI_FIELD0003; + /** + * 无备注 + */ + private String PI_FIELD0004; + /** + * 无备注 + */ + private String PI_FIELD0005; + /** + * 无备注 + */ + private String PI_INVOICEVALIDSTATE; + /** + * 无备注 + */ + private String PI_MODIFYSTATE; + /** + * 无备注 + */ + private String PI_USAGEAMOUNT; + /** + * 无备注 + */ + private String PI_VERIFYAMOUNT; + /** + * 无备注 + */ + private String PI_UNUSEDAMOUNT; + /** + * 无备注 + */ + private String PI_USECOUNT; + /** + * 无备注 + */ + private String PI_FILENAME; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_UPDATEDATE; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_VOUCHERDATE; + /** + * 无备注 + */ + private String PI_CPAY_STATE; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date PI_CPAY_DATE; + + + /** + * 无备注 + */ + public void setPI_ID(String PI_ID) { + this.PI_ID = PI_ID; + } + + /** + * 无备注 + */ + public String getPI_ID() { + return PI_ID; + } + + + /** + * 无备注 + */ + public void setPI_KEY(String PI_KEY) { + this.PI_KEY = PI_KEY; + } + + /** + * 无备注 + */ + public String getPI_KEY() { + return PI_KEY; + } + + + /** + * 无备注 + */ + public void setPI_KEY_NEW(String PI_KEY_NEW) { + this.PI_KEY_NEW = PI_KEY_NEW; + } + + /** + * 无备注 + */ + public String getPI_KEY_NEW() { + return PI_KEY_NEW; + } + + + /** + * 无备注 + */ + public void setPI_DATAKEY(String PI_DATAKEY) { + this.PI_DATAKEY = PI_DATAKEY; + } + + /** + * 无备注 + */ + public String getPI_DATAKEY() { + return PI_DATAKEY; + } + + + /** + * 无备注 + */ + public void setPI_MAINCONFIGID(String PI_MAINCONFIGID) { + this.PI_MAINCONFIGID = PI_MAINCONFIGID; + } + + /** + * 无备注 + */ + public String getPI_MAINCONFIGID() { + return PI_MAINCONFIGID; + } + + + /** + * 无备注 + */ + public void setPI_TAXNO(String PI_TAXNO) { + this.PI_TAXNO = PI_TAXNO; + } + + /** + * 无备注 + */ + public String getPI_TAXNO() { + return PI_TAXNO; + } + + + /** + * 无备注 + */ + public void setPI_TABLENAME(String PI_TABLENAME) { + this.PI_TABLENAME = PI_TABLENAME; + } + + /** + * 无备注 + */ + public String getPI_TABLENAME() { + return PI_TABLENAME; + } + + + /** + * 无备注 + */ + public void setPI_BILLKIND(String PI_BILLKIND) { + this.PI_BILLKIND = PI_BILLKIND; + } + + /** + * 无备注 + */ + public String getPI_BILLKIND() { + return PI_BILLKIND; + } + + + /** + * 无备注 + */ + public void setPI_BILLNAME(String PI_BILLNAME) { + this.PI_BILLNAME = PI_BILLNAME; + } + + /** + * 无备注 + */ + public String getPI_BILLNAME() { + return PI_BILLNAME; + } + + + /** + * 无备注 + */ + public void setPI_AMOUNT(String PI_AMOUNT) { + this.PI_AMOUNT = PI_AMOUNT; + } + + /** + * 无备注 + */ + public String getPI_AMOUNT() { + return PI_AMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_STATE(String PI_STATE) { + this.PI_STATE = PI_STATE; + } + + /** + * 无备注 + */ + public String getPI_STATE() { + return PI_STATE; + } + + + /** + * 无备注 + */ + public void setPI_FILEID(String PI_FILEID) { + this.PI_FILEID = PI_FILEID; + } + + /** + * 无备注 + */ + public String getPI_FILEID() { + return PI_FILEID; + } + + + /** + * 无备注 + */ + public void setPI_FILEDATE(Date PI_FILEDATE) { + this.PI_FILEDATE = PI_FILEDATE; + } + + /** + * 无备注 + */ + public Date getPI_FILEDATE() { + return PI_FILEDATE; + } + + + /** + * 无备注 + */ + public void setPI_IMAGEPATH(String PI_IMAGEPATH) { + this.PI_IMAGEPATH = PI_IMAGEPATH; + } + + /** + * 无备注 + */ + public String getPI_IMAGEPATH() { + return PI_IMAGEPATH; + } + + + /** + * 无备注 + */ + public void setPI_UPDATEDATA(String PI_UPDATEDATA) { + this.PI_UPDATEDATA = PI_UPDATEDATA; + } + + /** + * 无备注 + */ + public String getPI_UPDATEDATA() { + return PI_UPDATEDATA; + } + + + /** + * 无备注 + */ + public void setPI_TYPE(String PI_TYPE) { + this.PI_TYPE = PI_TYPE; + } + + /** + * 无备注 + */ + public String getPI_TYPE() { + return PI_TYPE; + } + + + /** + * 无备注 + */ + public void setPI_MEMBERID(String PI_MEMBERID) { + this.PI_MEMBERID = PI_MEMBERID; + } + + /** + * 无备注 + */ + public String getPI_MEMBERID() { + return PI_MEMBERID; + } + + + /** + * 无备注 + */ + public void setPI_MEMBERNM(String PI_MEMBERNM) { + this.PI_MEMBERNM = PI_MEMBERNM; + } + + /** + * 无备注 + */ + public String getPI_MEMBERNM() { + return PI_MEMBERNM; + } + + + /** + * 无备注 + */ + public void setPI_MAKEDATE(Date PI_MAKEDATE) { + this.PI_MAKEDATE = PI_MAKEDATE; + } + + /** + * 无备注 + */ + public Date getPI_MAKEDATE() { + return PI_MAKEDATE; + } + + + /** + * 无备注 + */ + public void setPI_BEStringID(String PI_BEStringID) { + this.PI_BEStringID = PI_BEStringID; + } + + /** + * 无备注 + */ + public String getPI_BEStringID() { + return PI_BEStringID; + } + + + /** + * 无备注 + */ + public void setPI_BEStringNM(String PI_BEStringNM) { + this.PI_BEStringNM = PI_BEStringNM; + } + + /** + * 无备注 + */ + public String getPI_BEStringNM() { + return PI_BEStringNM; + } + + + /** + * 无备注 + */ + public void setPI_USEACCOUNTID(String PI_USEACCOUNTID) { + this.PI_USEACCOUNTID = PI_USEACCOUNTID; + } + + /** + * 无备注 + */ + public String getPI_USEACCOUNTID() { + return PI_USEACCOUNTID; + } + + + /** + * 无备注 + */ + public void setPI_USEACCOUNTNM(String PI_USEACCOUNTNM) { + this.PI_USEACCOUNTNM = PI_USEACCOUNTNM; + } + + /** + * 无备注 + */ + public String getPI_USEACCOUNTNM() { + return PI_USEACCOUNTNM; + } + + + /** + * 无备注 + */ + public void setPI_USEDEPARTMENTID(String PI_USEDEPARTMENTID) { + this.PI_USEDEPARTMENTID = PI_USEDEPARTMENTID; + } + + public String getPI_BELONGID() { + return PI_BELONGID; + } + + public void setPI_BELONGID(String PI_BELONGID) { + this.PI_BELONGID = PI_BELONGID; + } + + /** + * 无备注 + */ + public String getPI_USEDEPARTMENTID() { + return PI_USEDEPARTMENTID; + } + + + /** + * 无备注 + */ + public void setPI_USEDEPARTMENTNM(String PI_USEDEPARTMENTNM) { + this.PI_USEDEPARTMENTNM = PI_USEDEPARTMENTNM; + } + + /** + * 无备注 + */ + public String getPI_USEDEPARTMENTNM() { + return PI_USEDEPARTMENTNM; + } + + + /** + * 无备注 + */ + public void setPI_USEID(String PI_USEID) { + this.PI_USEID = PI_USEID; + } + + /** + * 无备注 + */ + public String getPI_USEID() { + return PI_USEID; + } + + + /** + * 无备注 + */ + public void setPI_USENM(String PI_USENM) { + this.PI_USENM = PI_USENM; + } + + /** + * 无备注 + */ + public String getPI_USENM() { + return PI_USENM; + } + + + /** + * 无备注 + */ + public void setPI_USESTATE(String PI_USESTATE) { + this.PI_USESTATE = PI_USESTATE; + } + + /** + * 无备注 + */ + public String getPI_USESTATE() { + return PI_USESTATE; + } + + + /** + * 无备注 + */ + public void setPI_SUMMARYID(String PI_SUMMARYID) { + this.PI_SUMMARYID = PI_SUMMARYID; + } + + /** + * 无备注 + */ + public String getPI_SUMMARYID() { + return PI_SUMMARYID; + } + + + /** + * 无备注 + */ + public void setPI_SUBJECT(String PI_SUBJECT) { + this.PI_SUBJECT = PI_SUBJECT; + } + + /** + * 无备注 + */ + public String getPI_SUBJECT() { + return PI_SUBJECT; + } + + + /** + * 无备注 + */ + public void setPI_FORMID(String PI_FORMID) { + this.PI_FORMID = PI_FORMID; + } + + /** + * 无备注 + */ + public String getPI_FORMID() { + return PI_FORMID; + } + + + /** + * 无备注 + */ + public void setPI_FORMDATAID(String PI_FORMDATAID) { + this.PI_FORMDATAID = PI_FORMDATAID; + } + + /** + * 无备注 + */ + public String getPI_FORMDATAID() { + return PI_FORMDATAID; + } + + + /** + * 无备注 + */ + public void setPI_TEMPLATEID(String PI_TEMPLATEID) { + this.PI_TEMPLATEID = PI_TEMPLATEID; + } + + /** + * 无备注 + */ + public String getPI_TEMPLATEID() { + return PI_TEMPLATEID; + } + + + /** + * 无备注 + */ + public void setPI_STARTACCOUNTID(String PI_STARTACCOUNTID) { + this.PI_STARTACCOUNTID = PI_STARTACCOUNTID; + } + + /** + * 无备注 + */ + public String getPI_STARTACCOUNTID() { + return PI_STARTACCOUNTID; + } + + + /** + * 无备注 + */ + public void setPI_STARTDEPARTMENTID(String PI_STARTDEPARTMENTID) { + this.PI_STARTDEPARTMENTID = PI_STARTDEPARTMENTID; + } + + /** + * 无备注 + */ + public String getPI_STARTDEPARTMENTID() { + return PI_STARTDEPARTMENTID; + } + + + /** + * 无备注 + */ + public void setPI_STARTMEMBERID(String PI_STARTMEMBERID) { + this.PI_STARTMEMBERID = PI_STARTMEMBERID; + } + + /** + * 无备注 + */ + public String getPI_STARTMEMBERID() { + return PI_STARTMEMBERID; + } + + + /** + * 无备注 + */ + public void setPI_STARTMEMBERNM(String PI_STARTMEMBERNM) { + this.PI_STARTMEMBERNM = PI_STARTMEMBERNM; + } + + /** + * 无备注 + */ + public String getPI_STARTMEMBERNM() { + return PI_STARTMEMBERNM; + } + + + /** + * 无备注 + */ + public void setPI_STARTDATE(Date PI_STARTDATE) { + this.PI_STARTDATE = PI_STARTDATE; + } + + /** + * 无备注 + */ + public Date getPI_STARTDATE() { + return PI_STARTDATE; + } + + + /** + * 无备注 + */ + public void setPI_DEALACCOUNTID(String PI_DEALACCOUNTID) { + this.PI_DEALACCOUNTID = PI_DEALACCOUNTID; + } + + /** + * 无备注 + */ + public String getPI_DEALACCOUNTID() { + return PI_DEALACCOUNTID; + } + + + /** + * 无备注 + */ + public void setPI_DEALDEPARTMENTID(String PI_DEALDEPARTMENTID) { + this.PI_DEALDEPARTMENTID = PI_DEALDEPARTMENTID; + } + + /** + * 无备注 + */ + public String getPI_DEALDEPARTMENTID() { + return PI_DEALDEPARTMENTID; + } + + + /** + * 无备注 + */ + public void setPI_DEALMEMBERID(String PI_DEALMEMBERID) { + this.PI_DEALMEMBERID = PI_DEALMEMBERID; + } + + /** + * 无备注 + */ + public String getPI_DEALMEMBERID() { + return PI_DEALMEMBERID; + } + + + /** + * 无备注 + */ + public void setPI_DEALMEMBERNM(String PI_DEALMEMBERNM) { + this.PI_DEALMEMBERNM = PI_DEALMEMBERNM; + } + + /** + * 无备注 + */ + public String getPI_DEALMEMBERNM() { + return PI_DEALMEMBERNM; + } + + + /** + * 无备注 + */ + public void setPI_DEALDATE(Date PI_DEALDATE) { + this.PI_DEALDATE = PI_DEALDATE; + } + + /** + * 无备注 + */ + public Date getPI_DEALDATE() { + return PI_DEALDATE; + } + + + /** + * 无备注 + */ + public void setPI_DEALSTATE(String PI_DEALSTATE) { + this.PI_DEALSTATE = PI_DEALSTATE; + } + + /** + * 无备注 + */ + public String getPI_DEALSTATE() { + return PI_DEALSTATE; + } + + + /** + * 无备注 + */ + public void setPI_DEALPOLICY(String PI_DEALPOLICY) { + this.PI_DEALPOLICY = PI_DEALPOLICY; + } + + /** + * 无备注 + */ + public String getPI_DEALPOLICY() { + return PI_DEALPOLICY; + } + + + /** + * 无备注 + */ + public void setPI_DEALINFO(String PI_DEALINFO) { + this.PI_DEALINFO = PI_DEALINFO; + } + + /** + * 无备注 + */ + public String getPI_DEALINFO() { + return PI_DEALINFO; + } + + + /** + * 无备注 + */ + public void setPI_SHAREID(String PI_SHAREID) { + this.PI_SHAREID = PI_SHAREID; + } + + /** + * 无备注 + */ + public String getPI_SHAREID() { + return PI_SHAREID; + } + + + /** + * 无备注 + */ + public void setPI_SHARENM(String PI_SHARENM) { + this.PI_SHARENM = PI_SHARENM; + } + + /** + * 无备注 + */ + public String getPI_SHARENM() { + return PI_SHARENM; + } + + + /** + * 无备注 + */ + public void setPI_APITYPE(String PI_APITYPE) { + this.PI_APITYPE = PI_APITYPE; + } + + /** + * 无备注 + */ + public String getPI_APITYPE() { + return PI_APITYPE; + } + + + /** + * 无备注 + */ + public void setPI_ISVALID(String PI_ISVALID) { + this.PI_ISVALID = PI_ISVALID; + } + + /** + * 无备注 + */ + public String getPI_ISVALID() { + return PI_ISVALID; + } + + + /** + * 无备注 + */ + public void setPI_VALIDRESULT(String PI_VALIDRESULT) { + this.PI_VALIDRESULT = PI_VALIDRESULT; + } + + /** + * 无备注 + */ + public String getPI_VALIDRESULT() { + return PI_VALIDRESULT; + } + + + /** + * 无备注 + */ + public void setPI_RESULTNM(String PI_RESULTNM) { + this.PI_RESULTNM = PI_RESULTNM; + } + + /** + * 无备注 + */ + public String getPI_RESULTNM() { + return PI_RESULTNM; + } + + + /** + * 无备注 + */ + public void setPI_VALIDSTATE(String PI_VALIDSTATE) { + this.PI_VALIDSTATE = PI_VALIDSTATE; + } + + /** + * 无备注 + */ + public String getPI_VALIDSTATE() { + return PI_VALIDSTATE; + } + + + /** + * 无备注 + */ + public void setPI_CLASSTYPE(String PI_CLASSTYPE) { + this.PI_CLASSTYPE = PI_CLASSTYPE; + } + + /** + * 无备注 + */ + public String getPI_CLASSTYPE() { + return PI_CLASSTYPE; + } + + + /** + * 无备注 + */ + public void setPI_CLASSNAME(String PI_CLASSNAME) { + this.PI_CLASSNAME = PI_CLASSNAME; + } + + /** + * 无备注 + */ + public String getPI_CLASSNAME() { + return PI_CLASSNAME; + } + + + /** + * 无备注 + */ + public void setPI_RECOVERSTATE(String PI_RECOVERSTATE) { + this.PI_RECOVERSTATE = PI_RECOVERSTATE; + } + + /** + * 无备注 + */ + public String getPI_RECOVERSTATE() { + return PI_RECOVERSTATE; + } + + + /** + * 无备注 + */ + public void setPI_RECOVERMEMBERID(String PI_RECOVERMEMBERID) { + this.PI_RECOVERMEMBERID = PI_RECOVERMEMBERID; + } + + /** + * 无备注 + */ + public String getPI_RECOVERMEMBERID() { + return PI_RECOVERMEMBERID; + } + + + /** + * 无备注 + */ + public void setPI_RECOVERMEMBERNM(String PI_RECOVERMEMBERNM) { + this.PI_RECOVERMEMBERNM = PI_RECOVERMEMBERNM; + } + + /** + * 无备注 + */ + public String getPI_RECOVERMEMBERNM() { + return PI_RECOVERMEMBERNM; + } + + + /** + * 无备注 + */ + public void setPI_RECOVERDATE(Date PI_RECOVERDATE) { + this.PI_RECOVERDATE = PI_RECOVERDATE; + } + + /** + * 无备注 + */ + public Date getPI_RECOVERDATE() { + return PI_RECOVERDATE; + } + + + /** + * 无备注 + */ + public void setPI_ORGID(String PI_ORGID) { + this.PI_ORGID = PI_ORGID; + } + + /** + * 无备注 + */ + public String getPI_ORGID() { + return PI_ORGID; + } + + + /** + * 无备注 + */ + public void setPI_ORGNM(String PI_ORGNM) { + this.PI_ORGNM = PI_ORGNM; + } + + /** + * 无备注 + */ + public String getPI_ORGNM() { + return PI_ORGNM; + } + + + /** + * 无备注 + */ + public void setPI_YEAR(String PI_YEAR) { + this.PI_YEAR = PI_YEAR; + } + + /** + * 无备注 + */ + public String getPI_YEAR() { + return PI_YEAR; + } + + + /** + * 无备注 + */ + public void setPI_MONTH(String PI_MONTH) { + this.PI_MONTH = PI_MONTH; + } + + /** + * 无备注 + */ + public String getPI_MONTH() { + return PI_MONTH; + } + + + /** + * 无备注 + */ + public void setPI_QUARTER(String PI_QUARTER) { + this.PI_QUARTER = PI_QUARTER; + } + + /** + * 无备注 + */ + public String getPI_QUARTER() { + return PI_QUARTER; + } + + + /** + * 无备注 + */ + public void setPI_HALFYEAR(String PI_HALFYEAR) { + this.PI_HALFYEAR = PI_HALFYEAR; + } + + /** + * 无备注 + */ + public String getPI_HALFYEAR() { + return PI_HALFYEAR; + } + + + /** + * 无备注 + */ + public void setPI_XMMC(String PI_XMMC) { + this.PI_XMMC = PI_XMMC; + } + + /** + * 无备注 + */ + public String getPI_XMMC() { + return PI_XMMC; + } + + + /** + * 无备注 + */ + public void setPI_FPDM(String PI_FPDM) { + this.PI_FPDM = PI_FPDM; + } + + /** + * 无备注 + */ + public String getPI_FPDM() { + return PI_FPDM; + } + + + /** + * 无备注 + */ + public void setPI_FPHM(String PI_FPHM) { + this.PI_FPHM = PI_FPHM; + } + + /** + * 无备注 + */ + public String getPI_FPHM() { + return PI_FPHM; + } + + + /** + * 无备注 + */ + public void setPI_SALERTAXNO(String PI_SALERTAXNO) { + this.PI_SALERTAXNO = PI_SALERTAXNO; + } + + /** + * 无备注 + */ + public String getPI_SALERTAXNO() { + return PI_SALERTAXNO; + } + + + /** + * 无备注 + */ + public void setPI_SALERNAME(String PI_SALERNAME) { + this.PI_SALERNAME = PI_SALERNAME; + } + + /** + * 无备注 + */ + public String getPI_SALERNAME() { + return PI_SALERNAME; + } + + + /** + * 无备注 + */ + public void setPI_BUYERTAXNO(String PI_BUYERTAXNO) { + this.PI_BUYERTAXNO = PI_BUYERTAXNO; + } + + /** + * 无备注 + */ + public String getPI_BUYERTAXNO() { + return PI_BUYERTAXNO; + } + + + /** + * 无备注 + */ + public void setPI_BUYERNAME(String PI_BUYERNAME) { + this.PI_BUYERNAME = PI_BUYERNAME; + } + + /** + * 无备注 + */ + public String getPI_BUYERNAME() { + return PI_BUYERNAME; + } + + + /** + * 无备注 + */ + public void setPI_INVOICETYPE(String PI_INVOICETYPE) { + this.PI_INVOICETYPE = PI_INVOICETYPE; + } + + /** + * 无备注 + */ + public String getPI_INVOICETYPE() { + return PI_INVOICETYPE; + } + + + /** + * 无备注 + */ + public void setPI_INVOICENAME(String PI_INVOICENAME) { + this.PI_INVOICENAME = PI_INVOICENAME; + } + + /** + * 无备注 + */ + public String getPI_INVOICENAME() { + return PI_INVOICENAME; + } + + + /** + * 无备注 + */ + public void setPI_INVOICEDATE(Date PI_INVOICEDATE) { + this.PI_INVOICEDATE = PI_INVOICEDATE; + } + + /** + * 无备注 + */ + public Date getPI_INVOICEDATE() { + return PI_INVOICEDATE; + } + + + /** + * 无备注 + */ + public void setPI_FSTATION(String PI_FSTATION) { + this.PI_FSTATION = PI_FSTATION; + } + + /** + * 无备注 + */ + public String getPI_FSTATION() { + return PI_FSTATION; + } + + + /** + * 无备注 + */ + public void setPI_TSTATION(String PI_TSTATION) { + this.PI_TSTATION = PI_TSTATION; + } + + /** + * 无备注 + */ + public String getPI_TSTATION() { + return PI_TSTATION; + } + + + /** + * 无备注 + */ + public void setPI_USERNAME(String PI_USERNAME) { + this.PI_USERNAME = PI_USERNAME; + } + + /** + * 无备注 + */ + public String getPI_USERNAME() { + return PI_USERNAME; + } + + + /** + * 无备注 + */ + public void setPI_TRAINNO(String PI_TRAINNO) { + this.PI_TRAINNO = PI_TRAINNO; + } + + /** + * 无备注 + */ + public String getPI_TRAINNO() { + return PI_TRAINNO; + } + + + /** + * 无备注 + */ + public void setPI_TRAINCODE(String PI_TRAINCODE) { + this.PI_TRAINCODE = PI_TRAINCODE; + } + + /** + * 无备注 + */ + public String getPI_TRAINCODE() { + return PI_TRAINCODE; + } + + + /** + * 无备注 + */ + public void setPI_STARTDATETIME(Date PI_STARTDATETIME) { + this.PI_STARTDATETIME = PI_STARTDATETIME; + } + + /** + * 无备注 + */ + public Date getPI_STARTDATETIME() { + return PI_STARTDATETIME; + } + + + /** + * 无备注 + */ + public void setPI_ENDDATETIME(Date PI_ENDDATETIME) { + this.PI_ENDDATETIME = PI_ENDDATETIME; + } + + /** + * 无备注 + */ + public Date getPI_ENDDATETIME() { + return PI_ENDDATETIME; + } + + + /** + * 无备注 + */ + public void setPI_STARTTIME(String PI_STARTTIME) { + this.PI_STARTTIME = PI_STARTTIME; + } + + /** + * 无备注 + */ + public String getPI_STARTTIME() { + return PI_STARTTIME; + } + + + /** + * 无备注 + */ + public void setPI_ENDTIME(String PI_ENDTIME) { + this.PI_ENDTIME = PI_ENDTIME; + } + + /** + * 无备注 + */ + public String getPI_ENDTIME() { + return PI_ENDTIME; + } + + + /** + * 无备注 + */ + public void setPI_TAXRATE(String PI_TAXRATE) { + this.PI_TAXRATE = PI_TAXRATE; + } + + /** + * 无备注 + */ + public String getPI_TAXRATE() { + return PI_TAXRATE; + } + + + /** + * 无备注 + */ + public void setPI_TAXAMOUNT(String PI_TAXAMOUNT) { + this.PI_TAXAMOUNT = PI_TAXAMOUNT; + } + + /** + * 无备注 + */ + public String getPI_TAXAMOUNT() { + return PI_TAXAMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_NOTAXAMOUNT(String PI_NOTAXAMOUNT) { + this.PI_NOTAXAMOUNT = PI_NOTAXAMOUNT; + } + + /** + * 无备注 + */ + public String getPI_NOTAXAMOUNT() { + return PI_NOTAXAMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_DEDUCTIONAMOUNT(String PI_DEDUCTIONAMOUNT) { + this.PI_DEDUCTIONAMOUNT = PI_DEDUCTIONAMOUNT; + } + + /** + * 无备注 + */ + public String getPI_DEDUCTIONAMOUNT() { + return PI_DEDUCTIONAMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_FILEURL(String PI_FILEURL) { + this.PI_FILEURL = PI_FILEURL; + } + + /** + * 无备注 + */ + public String getPI_FILEURL() { + return PI_FILEURL; + } + + + /** + * 无备注 + */ + public void setPI_MATTERID(String PI_MATTERID) { + this.PI_MATTERID = PI_MATTERID; + } + + /** + * 无备注 + */ + public String getPI_MATTERID() { + return PI_MATTERID; + } + + + /** + * 无备注 + */ + public void setPI_VOUCHER(String PI_VOUCHER) { + this.PI_VOUCHER = PI_VOUCHER; + } + + /** + * 无备注 + */ + public String getPI_VOUCHER() { + return PI_VOUCHER; + } + + + /** + * 无备注 + */ + public void setPI_VOUCHERINFO(String PI_VOUCHERINFO) { + this.PI_VOUCHERINFO = PI_VOUCHERINFO; + } + + /** + * 无备注 + */ + public String getPI_VOUCHERINFO() { + return PI_VOUCHERINFO; + } + + + /** + * 无备注 + */ + public void setPI_FIELD0001(String PI_FIELD0001) { + this.PI_FIELD0001 = PI_FIELD0001; + } + + /** + * 无备注 + */ + public String getPI_FIELD0001() { + return PI_FIELD0001; + } + + + /** + * 无备注 + */ + public void setPI_FIELD0002(String PI_FIELD0002) { + this.PI_FIELD0002 = PI_FIELD0002; + } + + /** + * 无备注 + */ + public String getPI_FIELD0002() { + return PI_FIELD0002; + } + + + /** + * 无备注 + */ + public void setPI_FIELD0003(String PI_FIELD0003) { + this.PI_FIELD0003 = PI_FIELD0003; + } + + /** + * 无备注 + */ + public String getPI_FIELD0003() { + return PI_FIELD0003; + } + + + /** + * 无备注 + */ + public void setPI_FIELD0004(String PI_FIELD0004) { + this.PI_FIELD0004 = PI_FIELD0004; + } + + /** + * 无备注 + */ + public String getPI_FIELD0004() { + return PI_FIELD0004; + } + + + /** + * 无备注 + */ + public void setPI_FIELD0005(String PI_FIELD0005) { + this.PI_FIELD0005 = PI_FIELD0005; + } + + /** + * 无备注 + */ + public String getPI_FIELD0005() { + return PI_FIELD0005; + } + + + /** + * 无备注 + */ + public void setPI_INVOICEVALIDSTATE(String PI_INVOICEVALIDSTATE) { + this.PI_INVOICEVALIDSTATE = PI_INVOICEVALIDSTATE; + } + + /** + * 无备注 + */ + public String getPI_INVOICEVALIDSTATE() { + return PI_INVOICEVALIDSTATE; + } + + + /** + * 无备注 + */ + public void setPI_MODIFYSTATE(String PI_MODIFYSTATE) { + this.PI_MODIFYSTATE = PI_MODIFYSTATE; + } + + /** + * 无备注 + */ + public String getPI_MODIFYSTATE() { + return PI_MODIFYSTATE; + } + + + /** + * 无备注 + */ + public void setPI_USAGEAMOUNT(String PI_USAGEAMOUNT) { + this.PI_USAGEAMOUNT = PI_USAGEAMOUNT; + } + + /** + * 无备注 + */ + public String getPI_USAGEAMOUNT() { + return PI_USAGEAMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_VERIFYAMOUNT(String PI_VERIFYAMOUNT) { + this.PI_VERIFYAMOUNT = PI_VERIFYAMOUNT; + } + + /** + * 无备注 + */ + public String getPI_VERIFYAMOUNT() { + return PI_VERIFYAMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_UNUSEDAMOUNT(String PI_UNUSEDAMOUNT) { + this.PI_UNUSEDAMOUNT = PI_UNUSEDAMOUNT; + } + + /** + * 无备注 + */ + public String getPI_UNUSEDAMOUNT() { + return PI_UNUSEDAMOUNT; + } + + + /** + * 无备注 + */ + public void setPI_USECOUNT(String PI_USECOUNT) { + this.PI_USECOUNT = PI_USECOUNT; + } + + /** + * 无备注 + */ + public String getPI_USECOUNT() { + return PI_USECOUNT; + } + + + /** + * 无备注 + */ + public void setPI_FILENAME(String PI_FILENAME) { + this.PI_FILENAME = PI_FILENAME; + } + + /** + * 无备注 + */ + public String getPI_FILENAME() { + return PI_FILENAME; + } + + + /** + * 无备注 + */ + public void setPI_UPDATEDATE(Date PI_UPDATEDATE) { + this.PI_UPDATEDATE = PI_UPDATEDATE; + } + + /** + * 无备注 + */ + public Date getPI_UPDATEDATE() { + return PI_UPDATEDATE; + } + + + /** + * 无备注 + */ + public void setPI_VOUCHERDATE(Date PI_VOUCHERDATE) { + this.PI_VOUCHERDATE = PI_VOUCHERDATE; + } + + /** + * 无备注 + */ + public Date getPI_VOUCHERDATE() { + return PI_VOUCHERDATE; + } + + + /** + * 无备注 + */ + public void setPI_CPAY_STATE(String PI_CPAY_STATE) { + this.PI_CPAY_STATE = PI_CPAY_STATE; + } + + /** + * 无备注 + */ + public String getPI_CPAY_STATE() { + return PI_CPAY_STATE; + } + + + /** + * 无备注 + */ + public void setPI_CPAY_DATE(Date PI_CPAY_DATE) { + this.PI_CPAY_DATE = PI_CPAY_DATE; + } + + /** + * 无备注 + */ + public Date getPI_CPAY_DATE() { + return PI_CPAY_DATE; + } + + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.xml new file mode 100644 index 00000000..c997a976 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmisPublicinfoEntity.xml @@ -0,0 +1,432 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + PI_ID, + PI_KEY, + PI_KEY_NEW, + PI_DATAKEY, + PI_MAINCONFIGID, + PI_TAXNO, + PI_TABLENAME, + PI_BILLKIND, + PI_AMOUNT, + PI_USESTATE, + PI_SUMMARYID, + PI_SUBJECT, + PI_FORMID, + PI_FORMDATAID + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.java new file mode 100644 index 00000000..4440c786 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.java @@ -0,0 +1,170 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.entity; +import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import com.hzya.frame.web.entity.BaseEntity; +/** + * @description: 迈锐思-增值税发票子表 + * @tableName: LEXMISCIV_INVOICEDETAIL + * @entityName: LexmiscivInvoicedetailEntity + * @author: gjh + * @history: 1.0 + */ +public class LexmiscivInvoicedetailEntity extends BaseEntity { + public LexmiscivInvoicedetailEntity() { + + } + + public LexmiscivInvoicedetailEntity(String ID_MAINID,String dataSourceCode) { + this.ID_MAINID = ID_MAINID; + this.setDataSourceCode(dataSourceCode); + } + + /** 无备注 */ +private String ID_ID; +/** 无备注 */ +private String ID_MAINID; +/** 无备注 */ +private String ID_ROWID; +/** 无备注 */ +private String ID_ACCOUNTNAME; +/** 无备注 */ +private String ID_SERVICENM; +/** 无备注 */ +private String ID_SERVICETYPE; +/** 无备注 */ +private String ID_PRICE; +/** 无备注 */ +private String ID_UNIT; +/** 无备注 */ +private String ID_NUM; +/** 无备注 */ +private String ID_NOTAXAMOUNT; +/** 无备注 */ +private String ID_TAX; +/** 无备注 */ +private String ID_TAXAMOUNT; + + +/** 无备注 */ +public void setID_ID(String ID_ID) { + this.ID_ID = ID_ID; + } +/** 无备注 */ +public String getID_ID() { + return ID_ID; + } + + +/** 无备注 */ +public void setID_MAINID(String ID_MAINID) { + this.ID_MAINID = ID_MAINID; + } +/** 无备注 */ +public String getID_MAINID() { + return ID_MAINID; + } + + +/** 无备注 */ +public void setID_ROWID(String ID_ROWID) { + this.ID_ROWID = ID_ROWID; + } +/** 无备注 */ +public String getID_ROWID() { + return ID_ROWID; + } + + +/** 无备注 */ +public void setID_ACCOUNTNAME(String ID_ACCOUNTNAME) { + this.ID_ACCOUNTNAME = ID_ACCOUNTNAME; + } +/** 无备注 */ +public String getID_ACCOUNTNAME() { + return ID_ACCOUNTNAME; + } + + +/** 无备注 */ +public void setID_SERVICENM(String ID_SERVICENM) { + this.ID_SERVICENM = ID_SERVICENM; + } +/** 无备注 */ +public String getID_SERVICENM() { + return ID_SERVICENM; + } + + +/** 无备注 */ +public void setID_SERVICETYPE(String ID_SERVICETYPE) { + this.ID_SERVICETYPE = ID_SERVICETYPE; + } +/** 无备注 */ +public String getID_SERVICETYPE() { + return ID_SERVICETYPE; + } + + +/** 无备注 */ +public void setID_PRICE(String ID_PRICE) { + this.ID_PRICE = ID_PRICE; + } +/** 无备注 */ +public String getID_PRICE() { + return ID_PRICE; + } + + +/** 无备注 */ +public void setID_UNIT(String ID_UNIT) { + this.ID_UNIT = ID_UNIT; + } +/** 无备注 */ +public String getID_UNIT() { + return ID_UNIT; + } + + +/** 无备注 */ +public void setID_NUM(String ID_NUM) { + this.ID_NUM = ID_NUM; + } +/** 无备注 */ +public String getID_NUM() { + return ID_NUM; + } + + +/** 无备注 */ +public void setID_NOTAXAMOUNT(String ID_NOTAXAMOUNT) { + this.ID_NOTAXAMOUNT = ID_NOTAXAMOUNT; + } +/** 无备注 */ +public String getID_NOTAXAMOUNT() { + return ID_NOTAXAMOUNT; + } + + +/** 无备注 */ +public void setID_TAX(String ID_TAX) { + this.ID_TAX = ID_TAX; + } +/** 无备注 */ +public String getID_TAX() { + return ID_TAX; + } + + +/** 无备注 */ +public void setID_TAXAMOUNT(String ID_TAXAMOUNT) { + this.ID_TAXAMOUNT = ID_TAXAMOUNT; + } +/** 无备注 */ +public String getID_TAXAMOUNT() { + return ID_TAXAMOUNT; + } + + + } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.xml new file mode 100644 index 00000000..e4e1aca9 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicedetailEntity.xml @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ID_ID, + ID_MAINID, + ID_ROWID, + ID_ACCOUNTNAME, + ID_SERVICENM, + ID_SERVICETYPE, + ID_PRICE, + ID_UNIT, + ID_NUM, + ID_NOTAXAMOUNT, + ID_TAX, + ID_TAXAMOUNT + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.java new file mode 100644 index 00000000..fd42a97e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.java @@ -0,0 +1,651 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.entity; +import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import com.hzya.frame.web.entity.BaseEntity; +/** + * @description: 迈锐思-增值税发票主表 + * @tableName: LEXMISCIV_INVOICEMAIN + * @entityName: LexmiscivInvoicemainEntity + * @author: gjh + * @history: 1.0 + */ +public class LexmiscivInvoicemainEntity extends BaseEntity { + public LexmiscivInvoicemainEntity() { + + } + + public LexmiscivInvoicemainEntity(String IM_ID,String dataSourceCode) { + this.IM_ID = IM_ID; + this.setDataSourceCode(dataSourceCode); + } + + /** 无备注 */ +private String IM_ID; +/** 无备注 */ +private String IM_FPDM; +/** 无备注 */ +private String IM_FPHM; +@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") +@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") +private Date IM_DATE; +/** 无备注 */ +private String IM_CHECKCODE; +/** 无备注 */ +private String IM_SALERTAXNO; +/** 无备注 */ +private String IM_SALERNAME; +/** 无备注 */ +private String IM_SALERADDRESS; +/** 无备注 */ +private String IM_SALERBANKNO; +/** 无备注 */ +private String IM_SALERBANKNM; +/** 无备注 */ +private String IM_BUYERTAXNO; +/** 无备注 */ +private String IM_BUYERNAME; +/** 无备注 */ +private String IM_BUYERADDRESS; +/** 无备注 */ +private String IM_BUYERBANKNO; +/** 无备注 */ +private String IM_BUYERBANKNM; +/** 无备注 */ +private String IM_MAKERNM; +/** 无备注 */ +private String IM_PAYEE; +/** 无备注 */ +private String IM_AUDITOR; +/** 无备注 */ +private BigDecimal IM_NOTAXAMOUNT; +/** 无备注 */ +private BigDecimal IM_TAXAMOUNT; +/** 无备注 */ +private BigDecimal IM_TOTALAMOUNT; +/** 无备注 */ +private String IM_TAX; +/** 无备注 */ +private String IM_MACHINENO; +/** 无备注 */ +private String IM_MEMO; +/** 无备注 */ +private String IM_ENCRYPTIONCODE; +/** 无备注 */ +private String IM_TYPE; +/** 无备注 */ +private String IM_TYPENAME; +/** 无备注 */ +private String IM_XMMC; +/** 无备注 */ +private String IM_KEY; +/** 无备注 */ +private String IM_AREACODE; +/** 无备注 */ +private String IM_AREANAME; +/** 无备注 */ +private String IM_PRINTEDFPDM; +/** 无备注 */ +private String IM_PRINTEDFPHM; +/** 无备注 */ +private Integer IM_COUNT; +/** 无备注 */ +private Integer IM_AGENCY; +/** 无备注 */ +private Integer IM_BLOCKCHAIN; +/** 无备注 */ +private Integer IM_COMPANYSEAL; +/** 无备注 */ +private String IM_COMPANYSEALDEPT; +/** 无备注 */ +private String IM_COMPANYSEALNUM; +/** 无备注 */ +private String IM_SADDRESS; +/** 无备注 */ +private String IM_STEL; +/** 无备注 */ +private String IM_SBANKNM; +/** 无备注 */ +private String IM_SBANKNO; +/** 无备注 */ +private String IM_BADDRESS; +/** 无备注 */ +private String IM_BTEL; +/** 无备注 */ +private String IM_BBANKNM; +/** 无备注 */ +private String IM_BBANKNO; +/** 无备注 */ +private String IM_DATETIME; +/** 无备注 */ +private String IM_EDATETIME; +/** 无备注 */ +private BigDecimal IM_TOTALAMOUNTOCR; +/** 无备注 */ +private Integer IM_PAGER_ELECTRONIC; +/** 无备注 */ +private String IM_ELECTRONIC_NUMBER; + + +/** 无备注 */ +public void setIM_ID(String IM_ID) { + this.IM_ID = IM_ID; + } +/** 无备注 */ +public String getIM_ID() { + return IM_ID; + } + + +/** 无备注 */ +public void setIM_FPDM(String IM_FPDM) { + this.IM_FPDM = IM_FPDM; + } +/** 无备注 */ +public String getIM_FPDM() { + return IM_FPDM; + } + + +/** 无备注 */ +public void setIM_FPHM(String IM_FPHM) { + this.IM_FPHM = IM_FPHM; + } +/** 无备注 */ +public String getIM_FPHM() { + return IM_FPHM; + } + + +/** 无备注 */ +public void setIM_DATE(Date IM_DATE) { + this.IM_DATE = IM_DATE; + } +/** 无备注 */ +public Date getIM_DATE() { + return IM_DATE; + } + + +/** 无备注 */ +public void setIM_CHECKCODE(String IM_CHECKCODE) { + this.IM_CHECKCODE = IM_CHECKCODE; + } +/** 无备注 */ +public String getIM_CHECKCODE() { + return IM_CHECKCODE; + } + + +/** 无备注 */ +public void setIM_SALERTAXNO(String IM_SALERTAXNO) { + this.IM_SALERTAXNO = IM_SALERTAXNO; + } +/** 无备注 */ +public String getIM_SALERTAXNO() { + return IM_SALERTAXNO; + } + + +/** 无备注 */ +public void setIM_SALERNAME(String IM_SALERNAME) { + this.IM_SALERNAME = IM_SALERNAME; + } +/** 无备注 */ +public String getIM_SALERNAME() { + return IM_SALERNAME; + } + + +/** 无备注 */ +public void setIM_SALERADDRESS(String IM_SALERADDRESS) { + this.IM_SALERADDRESS = IM_SALERADDRESS; + } +/** 无备注 */ +public String getIM_SALERADDRESS() { + return IM_SALERADDRESS; + } + + +/** 无备注 */ +public void setIM_SALERBANKNO(String IM_SALERBANKNO) { + this.IM_SALERBANKNO = IM_SALERBANKNO; + } +/** 无备注 */ +public String getIM_SALERBANKNO() { + return IM_SALERBANKNO; + } + + +/** 无备注 */ +public void setIM_SALERBANKNM(String IM_SALERBANKNM) { + this.IM_SALERBANKNM = IM_SALERBANKNM; + } +/** 无备注 */ +public String getIM_SALERBANKNM() { + return IM_SALERBANKNM; + } + + +/** 无备注 */ +public void setIM_BUYERTAXNO(String IM_BUYERTAXNO) { + this.IM_BUYERTAXNO = IM_BUYERTAXNO; + } +/** 无备注 */ +public String getIM_BUYERTAXNO() { + return IM_BUYERTAXNO; + } + + +/** 无备注 */ +public void setIM_BUYERNAME(String IM_BUYERNAME) { + this.IM_BUYERNAME = IM_BUYERNAME; + } +/** 无备注 */ +public String getIM_BUYERNAME() { + return IM_BUYERNAME; + } + + +/** 无备注 */ +public void setIM_BUYERADDRESS(String IM_BUYERADDRESS) { + this.IM_BUYERADDRESS = IM_BUYERADDRESS; + } +/** 无备注 */ +public String getIM_BUYERADDRESS() { + return IM_BUYERADDRESS; + } + + +/** 无备注 */ +public void setIM_BUYERBANKNO(String IM_BUYERBANKNO) { + this.IM_BUYERBANKNO = IM_BUYERBANKNO; + } +/** 无备注 */ +public String getIM_BUYERBANKNO() { + return IM_BUYERBANKNO; + } + + +/** 无备注 */ +public void setIM_BUYERBANKNM(String IM_BUYERBANKNM) { + this.IM_BUYERBANKNM = IM_BUYERBANKNM; + } +/** 无备注 */ +public String getIM_BUYERBANKNM() { + return IM_BUYERBANKNM; + } + + +/** 无备注 */ +public void setIM_MAKERNM(String IM_MAKERNM) { + this.IM_MAKERNM = IM_MAKERNM; + } +/** 无备注 */ +public String getIM_MAKERNM() { + return IM_MAKERNM; + } + + +/** 无备注 */ +public void setIM_PAYEE(String IM_PAYEE) { + this.IM_PAYEE = IM_PAYEE; + } +/** 无备注 */ +public String getIM_PAYEE() { + return IM_PAYEE; + } + + +/** 无备注 */ +public void setIM_AUDITOR(String IM_AUDITOR) { + this.IM_AUDITOR = IM_AUDITOR; + } +/** 无备注 */ +public String getIM_AUDITOR() { + return IM_AUDITOR; + } + + +/** 无备注 */ +public void setIM_NOTAXAMOUNT(BigDecimal IM_NOTAXAMOUNT) { + this.IM_NOTAXAMOUNT = IM_NOTAXAMOUNT; + } +/** 无备注 */ +public BigDecimal getIM_NOTAXAMOUNT() { + return IM_NOTAXAMOUNT; + } + + +/** 无备注 */ +public void setIM_TAXAMOUNT(BigDecimal IM_TAXAMOUNT) { + this.IM_TAXAMOUNT = IM_TAXAMOUNT; + } +/** 无备注 */ +public BigDecimal getIM_TAXAMOUNT() { + return IM_TAXAMOUNT; + } + + +/** 无备注 */ +public void setIM_TOTALAMOUNT(BigDecimal IM_TOTALAMOUNT) { + this.IM_TOTALAMOUNT = IM_TOTALAMOUNT; + } +/** 无备注 */ +public BigDecimal getIM_TOTALAMOUNT() { + return IM_TOTALAMOUNT; + } + + +/** 无备注 */ +public void setIM_TAX(String IM_TAX) { + this.IM_TAX = IM_TAX; + } +/** 无备注 */ +public String getIM_TAX() { + return IM_TAX; + } + + +/** 无备注 */ +public void setIM_MACHINENO(String IM_MACHINENO) { + this.IM_MACHINENO = IM_MACHINENO; + } +/** 无备注 */ +public String getIM_MACHINENO() { + return IM_MACHINENO; + } + + +/** 无备注 */ +public void setIM_MEMO(String IM_MEMO) { + this.IM_MEMO = IM_MEMO; + } +/** 无备注 */ +public String getIM_MEMO() { + return IM_MEMO; + } + + +/** 无备注 */ +public void setIM_ENCRYPTIONCODE(String IM_ENCRYPTIONCODE) { + this.IM_ENCRYPTIONCODE = IM_ENCRYPTIONCODE; + } +/** 无备注 */ +public String getIM_ENCRYPTIONCODE() { + return IM_ENCRYPTIONCODE; + } + + +/** 无备注 */ +public void setIM_TYPE(String IM_TYPE) { + this.IM_TYPE = IM_TYPE; + } +/** 无备注 */ +public String getIM_TYPE() { + return IM_TYPE; + } + + +/** 无备注 */ +public void setIM_TYPENAME(String IM_TYPENAME) { + this.IM_TYPENAME = IM_TYPENAME; + } +/** 无备注 */ +public String getIM_TYPENAME() { + return IM_TYPENAME; + } + + +/** 无备注 */ +public void setIM_XMMC(String IM_XMMC) { + this.IM_XMMC = IM_XMMC; + } +/** 无备注 */ +public String getIM_XMMC() { + return IM_XMMC; + } + + +/** 无备注 */ +public void setIM_KEY(String IM_KEY) { + this.IM_KEY = IM_KEY; + } +/** 无备注 */ +public String getIM_KEY() { + return IM_KEY; + } + + +/** 无备注 */ +public void setIM_AREACODE(String IM_AREACODE) { + this.IM_AREACODE = IM_AREACODE; + } +/** 无备注 */ +public String getIM_AREACODE() { + return IM_AREACODE; + } + + +/** 无备注 */ +public void setIM_AREANAME(String IM_AREANAME) { + this.IM_AREANAME = IM_AREANAME; + } +/** 无备注 */ +public String getIM_AREANAME() { + return IM_AREANAME; + } + + +/** 无备注 */ +public void setIM_PRINTEDFPDM(String IM_PRINTEDFPDM) { + this.IM_PRINTEDFPDM = IM_PRINTEDFPDM; + } +/** 无备注 */ +public String getIM_PRINTEDFPDM() { + return IM_PRINTEDFPDM; + } + + +/** 无备注 */ +public void setIM_PRINTEDFPHM(String IM_PRINTEDFPHM) { + this.IM_PRINTEDFPHM = IM_PRINTEDFPHM; + } +/** 无备注 */ +public String getIM_PRINTEDFPHM() { + return IM_PRINTEDFPHM; + } + + +/** 无备注 */ +public void setIM_COUNT(Integer IM_COUNT) { + this.IM_COUNT = IM_COUNT; + } +/** 无备注 */ +public Integer getIM_COUNT() { + return IM_COUNT; + } + + +/** 无备注 */ +public void setIM_AGENCY(Integer IM_AGENCY) { + this.IM_AGENCY = IM_AGENCY; + } +/** 无备注 */ +public Integer getIM_AGENCY() { + return IM_AGENCY; + } + + +/** 无备注 */ +public void setIM_BLOCKCHAIN(Integer IM_BLOCKCHAIN) { + this.IM_BLOCKCHAIN = IM_BLOCKCHAIN; + } +/** 无备注 */ +public Integer getIM_BLOCKCHAIN() { + return IM_BLOCKCHAIN; + } + + +/** 无备注 */ +public void setIM_COMPANYSEAL(Integer IM_COMPANYSEAL) { + this.IM_COMPANYSEAL = IM_COMPANYSEAL; + } +/** 无备注 */ +public Integer getIM_COMPANYSEAL() { + return IM_COMPANYSEAL; + } + + +/** 无备注 */ +public void setIM_COMPANYSEALDEPT(String IM_COMPANYSEALDEPT) { + this.IM_COMPANYSEALDEPT = IM_COMPANYSEALDEPT; + } +/** 无备注 */ +public String getIM_COMPANYSEALDEPT() { + return IM_COMPANYSEALDEPT; + } + + +/** 无备注 */ +public void setIM_COMPANYSEALNUM(String IM_COMPANYSEALNUM) { + this.IM_COMPANYSEALNUM = IM_COMPANYSEALNUM; + } +/** 无备注 */ +public String getIM_COMPANYSEALNUM() { + return IM_COMPANYSEALNUM; + } + + +/** 无备注 */ +public void setIM_SADDRESS(String IM_SADDRESS) { + this.IM_SADDRESS = IM_SADDRESS; + } +/** 无备注 */ +public String getIM_SADDRESS() { + return IM_SADDRESS; + } + + +/** 无备注 */ +public void setIM_STEL(String IM_STEL) { + this.IM_STEL = IM_STEL; + } +/** 无备注 */ +public String getIM_STEL() { + return IM_STEL; + } + + +/** 无备注 */ +public void setIM_SBANKNM(String IM_SBANKNM) { + this.IM_SBANKNM = IM_SBANKNM; + } +/** 无备注 */ +public String getIM_SBANKNM() { + return IM_SBANKNM; + } + + +/** 无备注 */ +public void setIM_SBANKNO(String IM_SBANKNO) { + this.IM_SBANKNO = IM_SBANKNO; + } +/** 无备注 */ +public String getIM_SBANKNO() { + return IM_SBANKNO; + } + + +/** 无备注 */ +public void setIM_BADDRESS(String IM_BADDRESS) { + this.IM_BADDRESS = IM_BADDRESS; + } +/** 无备注 */ +public String getIM_BADDRESS() { + return IM_BADDRESS; + } + + +/** 无备注 */ +public void setIM_BTEL(String IM_BTEL) { + this.IM_BTEL = IM_BTEL; + } +/** 无备注 */ +public String getIM_BTEL() { + return IM_BTEL; + } + + +/** 无备注 */ +public void setIM_BBANKNM(String IM_BBANKNM) { + this.IM_BBANKNM = IM_BBANKNM; + } +/** 无备注 */ +public String getIM_BBANKNM() { + return IM_BBANKNM; + } + + +/** 无备注 */ +public void setIM_BBANKNO(String IM_BBANKNO) { + this.IM_BBANKNO = IM_BBANKNO; + } +/** 无备注 */ +public String getIM_BBANKNO() { + return IM_BBANKNO; + } + + +/** 无备注 */ +public void setIM_DATETIME(String IM_DATETIME) { + this.IM_DATETIME = IM_DATETIME; + } +/** 无备注 */ +public String getIM_DATETIME() { + return IM_DATETIME; + } + + +/** 无备注 */ +public void setIM_EDATETIME(String IM_EDATETIME) { + this.IM_EDATETIME = IM_EDATETIME; + } +/** 无备注 */ +public String getIM_EDATETIME() { + return IM_EDATETIME; + } + + +/** 无备注 */ +public void setIM_TOTALAMOUNTOCR(BigDecimal IM_TOTALAMOUNTOCR) { + this.IM_TOTALAMOUNTOCR = IM_TOTALAMOUNTOCR; + } +/** 无备注 */ +public BigDecimal getIM_TOTALAMOUNTOCR() { + return IM_TOTALAMOUNTOCR; + } + + +/** 无备注 */ +public void setIM_PAGER_ELECTRONIC(Integer IM_PAGER_ELECTRONIC) { + this.IM_PAGER_ELECTRONIC = IM_PAGER_ELECTRONIC; + } +/** 无备注 */ +public Integer getIM_PAGER_ELECTRONIC() { + return IM_PAGER_ELECTRONIC; + } + + +/** 无备注 */ +public void setIM_ELECTRONIC_NUMBER(String IM_ELECTRONIC_NUMBER) { + this.IM_ELECTRONIC_NUMBER = IM_ELECTRONIC_NUMBER; + } +/** 无备注 */ +public String getIM_ELECTRONIC_NUMBER() { + return IM_ELECTRONIC_NUMBER; + } + + + } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.xml new file mode 100644 index 00000000..398e3843 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivInvoicemainEntity.xml @@ -0,0 +1,427 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IM_ID, + IM_FPDM, + IM_FPHM, + IM_DATE, + IM_CHECKCODE, + IM_SALERTAXNO, + IM_SALERNAME, + IM_SALERADDRESS, + IM_SALERBANKNO, + IM_SALERBANKNM, + IM_BUYERTAXNO, + IM_BUYERNAME, + IM_BUYERADDRESS, + IM_BUYERBANKNO, + IM_BUYERBANKNM, + IM_MAKERNM, + IM_PAYEE, + IM_AUDITOR, + IM_NOTAXAMOUNT, + IM_TAXAMOUNT, + IM_TOTALAMOUNT, + IM_TAX, + IM_MACHINENO, + IM_MEMO, + IM_ENCRYPTIONCODE, + IM_TYPE, + IM_TYPENAME, + IM_XMMC, + IM_KEY, + IM_AREACODE, + IM_AREANAME, + IM_PRINTEDFPDM, + IM_PRINTEDFPHM, + IM_COUNT, + IM_AGENCY, + IM_BLOCKCHAIN, + IM_COMPANYSEAL, + IM_COMPANYSEALDEPT, + IM_COMPANYSEALNUM, + IM_SADDRESS, + IM_STEL, + IM_SBANKNM, + IM_SBANKNO, + IM_BADDRESS, + IM_BTEL, + IM_BBANKNM, + IM_BBANKNO, + IM_DATETIME, + IM_EDATETIME, + IM_TOTALAMOUNTOCR, + IM_PAGER_ELECTRONIC, + IM_ELECTRONIC_NUMBER + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 00000000..aba49e43 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.java @@ -0,0 +1,575 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.entity; +import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import com.hzya.frame.web.entity.BaseEntity; +/** + * @description: 迈锐思-飞机行程单 + * @tableName: LEXMISCIV_PLANETICKET + * @entityName: LexmiscivPlaneticketEntity + * @author: gjh + * @history: 1.0 + */ +public class LexmiscivPlaneticketEntity extends BaseEntity { + public LexmiscivPlaneticketEntity(String PT_ID,String dataSourceCode) { + this.PT_ID = PT_ID; + this.setDataSourceCode(dataSourceCode); + } + + /** 无备注 */ +private String PT_ID; +/** 无备注 */ +private String PT_ETICKETNO; +/** 无备注 */ +private String PT_NO; +/** 无备注 */ +private String PT_FSTATION; +/** 无备注 */ +private String PT_TSTATION; +/** 无备注 */ +private String PT_TSTATION1; +/** 无备注 */ +private String PT_TSTATION2; +/** 无备注 */ +private String PT_TSTATION3; +/** 无备注 */ +private BigDecimal PT_PRICE; +/** 无备注 */ +private String PT_FUNDSAMOUNT; +/** 无备注 */ +private String PT_FUELAMOUNT; +/** 无备注 */ +private String PT_TAXAMOUNT; +/** 无备注 */ +private BigDecimal PT_AMOUNT; +/** 无备注 */ +private String PT_TAXRATE; +/** 无备注 */ +private BigDecimal PT_TAXRATEAMOUNT; +/** 无备注 */ +private BigDecimal PT_NOTAXAMOUNT; +@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") +@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") +private Date PT_DATE; +/** 无备注 */ +private String PT_TIME; +/** 无备注 */ +private String PT_SERIALNO; +/** 无备注 */ +private String PT_IDNO; +/** 无备注 */ +private String PT_CUSTOMER; +/** 无备注 */ +private String PT_CARRIER; +/** 无备注 */ +private String PT_CLASS; +/** 无备注 */ +private String PT_VALIDDATE; +/** 无备注 */ +private String PT_INVALIDDATE; +/** 无备注 */ +private String PT_ALLOW; +/** 无备注 */ +private String PT_VALIDCODE; +/** 无备注 */ +private String PT_INSURANCE; +/** 无备注 */ +private String PT_SALERCODE; +/** 无备注 */ +private String PT_SALERNAME; +/** 无备注 */ +private Date PT_MAKEDATE; +/** 无备注 */ +private String PT_KEY; +/** 无备注 */ +private Integer PT_COUNT; +/** 无备注 */ +private String PT_DATETIME; +/** 无备注 */ +private String PT_EDATETIME; +/** 无备注 */ +private String PT_INTERNATIONALFLAG; +/** 无备注 */ +private String PT_MARKDESC; +/** 无备注 */ +private String PT_GPNUMBER; +/** 无备注 */ +private String PT_ISSUINGSTATE; +/** 无备注 */ +private String PT_FPHM; +/** 无备注 */ +private String PT_PROMPTINFO; +/** 无备注 */ +private String PT_BUYERNAME; +/** 无备注 */ +private String PT_BUYERTAXNO; +/** 无备注 */ +private String PT_ORIGINALNUMBER; +/** 无备注 */ +private String PT_RUSHREDREASON; +/** 无备注 */ +private String PT_ELECTRONICMARK; + + +/** 无备注 */ +public void setPT_ID(String PT_ID) { + this.PT_ID = PT_ID; + } +/** 无备注 */ +public String getPT_ID() { + return PT_ID; + } + + +/** 无备注 */ +public void setPT_ETICKETNO(String PT_ETICKETNO) { + this.PT_ETICKETNO = PT_ETICKETNO; + } +/** 无备注 */ +public String getPT_ETICKETNO() { + return PT_ETICKETNO; + } + + +/** 无备注 */ +public void setPT_NO(String PT_NO) { + this.PT_NO = PT_NO; + } +/** 无备注 */ +public String getPT_NO() { + return PT_NO; + } + + +/** 无备注 */ +public void setPT_FSTATION(String PT_FSTATION) { + this.PT_FSTATION = PT_FSTATION; + } +/** 无备注 */ +public String getPT_FSTATION() { + return PT_FSTATION; + } + + +/** 无备注 */ +public void setPT_TSTATION(String PT_TSTATION) { + this.PT_TSTATION = PT_TSTATION; + } +/** 无备注 */ +public String getPT_TSTATION() { + return PT_TSTATION; + } + + +/** 无备注 */ +public void setPT_TSTATION1(String PT_TSTATION1) { + this.PT_TSTATION1 = PT_TSTATION1; + } +/** 无备注 */ +public String getPT_TSTATION1() { + return PT_TSTATION1; + } + + +/** 无备注 */ +public void setPT_TSTATION2(String PT_TSTATION2) { + this.PT_TSTATION2 = PT_TSTATION2; + } +/** 无备注 */ +public String getPT_TSTATION2() { + return PT_TSTATION2; + } + + +/** 无备注 */ +public void setPT_TSTATION3(String PT_TSTATION3) { + this.PT_TSTATION3 = PT_TSTATION3; + } +/** 无备注 */ +public String getPT_TSTATION3() { + return PT_TSTATION3; + } + + +/** 无备注 */ +public void setPT_PRICE(BigDecimal PT_PRICE) { + this.PT_PRICE = PT_PRICE; + } +/** 无备注 */ +public BigDecimal getPT_PRICE() { + return PT_PRICE; + } + + +/** 无备注 */ +public void setPT_FUNDSAMOUNT(String PT_FUNDSAMOUNT) { + this.PT_FUNDSAMOUNT = PT_FUNDSAMOUNT; + } +/** 无备注 */ +public String getPT_FUNDSAMOUNT() { + return PT_FUNDSAMOUNT; + } + + +/** 无备注 */ +public void setPT_FUELAMOUNT(String PT_FUELAMOUNT) { + this.PT_FUELAMOUNT = PT_FUELAMOUNT; + } +/** 无备注 */ +public String getPT_FUELAMOUNT() { + return PT_FUELAMOUNT; + } + + +/** 无备注 */ +public void setPT_TAXAMOUNT(String PT_TAXAMOUNT) { + this.PT_TAXAMOUNT = PT_TAXAMOUNT; + } +/** 无备注 */ +public String getPT_TAXAMOUNT() { + return PT_TAXAMOUNT; + } + + +/** 无备注 */ +public void setPT_AMOUNT(BigDecimal PT_AMOUNT) { + this.PT_AMOUNT = PT_AMOUNT; + } +/** 无备注 */ +public BigDecimal getPT_AMOUNT() { + return PT_AMOUNT; + } + + +/** 无备注 */ +public void setPT_TAXRATE(String PT_TAXRATE) { + this.PT_TAXRATE = PT_TAXRATE; + } +/** 无备注 */ +public String getPT_TAXRATE() { + return PT_TAXRATE; + } + + +/** 无备注 */ +public void setPT_TAXRATEAMOUNT(BigDecimal PT_TAXRATEAMOUNT) { + this.PT_TAXRATEAMOUNT = PT_TAXRATEAMOUNT; + } +/** 无备注 */ +public BigDecimal getPT_TAXRATEAMOUNT() { + return PT_TAXRATEAMOUNT; + } + + +/** 无备注 */ +public void setPT_NOTAXAMOUNT(BigDecimal PT_NOTAXAMOUNT) { + this.PT_NOTAXAMOUNT = PT_NOTAXAMOUNT; + } +/** 无备注 */ +public BigDecimal getPT_NOTAXAMOUNT() { + return PT_NOTAXAMOUNT; + } + + +/** 无备注 */ +public void setPT_DATE(Date PT_DATE) { + this.PT_DATE = PT_DATE; + } +/** 无备注 */ +public Date getPT_DATE() { + return PT_DATE; + } + + +/** 无备注 */ +public void setPT_TIME(String PT_TIME) { + this.PT_TIME = PT_TIME; + } +/** 无备注 */ +public String getPT_TIME() { + return PT_TIME; + } + + +/** 无备注 */ +public void setPT_SERIALNO(String PT_SERIALNO) { + this.PT_SERIALNO = PT_SERIALNO; + } +/** 无备注 */ +public String getPT_SERIALNO() { + return PT_SERIALNO; + } + + +/** 无备注 */ +public void setPT_IDNO(String PT_IDNO) { + this.PT_IDNO = PT_IDNO; + } +/** 无备注 */ +public String getPT_IDNO() { + return PT_IDNO; + } + + +/** 无备注 */ +public void setPT_CUSTOMER(String PT_CUSTOMER) { + this.PT_CUSTOMER = PT_CUSTOMER; + } +/** 无备注 */ +public String getPT_CUSTOMER() { + return PT_CUSTOMER; + } + + +/** 无备注 */ +public void setPT_CARRIER(String PT_CARRIER) { + this.PT_CARRIER = PT_CARRIER; + } +/** 无备注 */ +public String getPT_CARRIER() { + return PT_CARRIER; + } + + +/** 无备注 */ +public void setPT_CLASS(String PT_CLASS) { + this.PT_CLASS = PT_CLASS; + } +/** 无备注 */ +public String getPT_CLASS() { + return PT_CLASS; + } + + +/** 无备注 */ +public void setPT_VALIDDATE(String PT_VALIDDATE) { + this.PT_VALIDDATE = PT_VALIDDATE; + } +/** 无备注 */ +public String getPT_VALIDDATE() { + return PT_VALIDDATE; + } + + +/** 无备注 */ +public void setPT_INVALIDDATE(String PT_INVALIDDATE) { + this.PT_INVALIDDATE = PT_INVALIDDATE; + } +/** 无备注 */ +public String getPT_INVALIDDATE() { + return PT_INVALIDDATE; + } + + +/** 无备注 */ +public void setPT_ALLOW(String PT_ALLOW) { + this.PT_ALLOW = PT_ALLOW; + } +/** 无备注 */ +public String getPT_ALLOW() { + return PT_ALLOW; + } + + +/** 无备注 */ +public void setPT_VALIDCODE(String PT_VALIDCODE) { + this.PT_VALIDCODE = PT_VALIDCODE; + } +/** 无备注 */ +public String getPT_VALIDCODE() { + return PT_VALIDCODE; + } + + +/** 无备注 */ +public void setPT_INSURANCE(String PT_INSURANCE) { + this.PT_INSURANCE = PT_INSURANCE; + } +/** 无备注 */ +public String getPT_INSURANCE() { + return PT_INSURANCE; + } + + +/** 无备注 */ +public void setPT_SALERCODE(String PT_SALERCODE) { + this.PT_SALERCODE = PT_SALERCODE; + } +/** 无备注 */ +public String getPT_SALERCODE() { + return PT_SALERCODE; + } + + +/** 无备注 */ +public void setPT_SALERNAME(String PT_SALERNAME) { + this.PT_SALERNAME = PT_SALERNAME; + } +/** 无备注 */ +public String getPT_SALERNAME() { + return PT_SALERNAME; + } + + +/** 无备注 */ +public void setPT_MAKEDATE(Date PT_MAKEDATE) { + this.PT_MAKEDATE = PT_MAKEDATE; + } +/** 无备注 */ +public Date getPT_MAKEDATE() { + return PT_MAKEDATE; + } + + +/** 无备注 */ +public void setPT_KEY(String PT_KEY) { + this.PT_KEY = PT_KEY; + } +/** 无备注 */ +public String getPT_KEY() { + return PT_KEY; + } + + +/** 无备注 */ +public void setPT_COUNT(Integer PT_COUNT) { + this.PT_COUNT = PT_COUNT; + } +/** 无备注 */ +public Integer getPT_COUNT() { + return PT_COUNT; + } + + +/** 无备注 */ +public void setPT_DATETIME(String PT_DATETIME) { + this.PT_DATETIME = PT_DATETIME; + } +/** 无备注 */ +public String getPT_DATETIME() { + return PT_DATETIME; + } + + +/** 无备注 */ +public void setPT_EDATETIME(String PT_EDATETIME) { + this.PT_EDATETIME = PT_EDATETIME; + } +/** 无备注 */ +public String getPT_EDATETIME() { + return PT_EDATETIME; + } + + +/** 无备注 */ +public void setPT_INTERNATIONALFLAG(String PT_INTERNATIONALFLAG) { + this.PT_INTERNATIONALFLAG = PT_INTERNATIONALFLAG; + } +/** 无备注 */ +public String getPT_INTERNATIONALFLAG() { + return PT_INTERNATIONALFLAG; + } + + +/** 无备注 */ +public void setPT_MARKDESC(String PT_MARKDESC) { + this.PT_MARKDESC = PT_MARKDESC; + } +/** 无备注 */ +public String getPT_MARKDESC() { + return PT_MARKDESC; + } + + +/** 无备注 */ +public void setPT_GPNUMBER(String PT_GPNUMBER) { + this.PT_GPNUMBER = PT_GPNUMBER; + } +/** 无备注 */ +public String getPT_GPNUMBER() { + return PT_GPNUMBER; + } + + +/** 无备注 */ +public void setPT_ISSUINGSTATE(String PT_ISSUINGSTATE) { + this.PT_ISSUINGSTATE = PT_ISSUINGSTATE; + } +/** 无备注 */ +public String getPT_ISSUINGSTATE() { + return PT_ISSUINGSTATE; + } + + +/** 无备注 */ +public void setPT_FPHM(String PT_FPHM) { + this.PT_FPHM = PT_FPHM; + } +/** 无备注 */ +public String getPT_FPHM() { + return PT_FPHM; + } + + +/** 无备注 */ +public void setPT_PROMPTINFO(String PT_PROMPTINFO) { + this.PT_PROMPTINFO = PT_PROMPTINFO; + } +/** 无备注 */ +public String getPT_PROMPTINFO() { + return PT_PROMPTINFO; + } + + +/** 无备注 */ +public void setPT_BUYERNAME(String PT_BUYERNAME) { + this.PT_BUYERNAME = PT_BUYERNAME; + } +/** 无备注 */ +public String getPT_BUYERNAME() { + return PT_BUYERNAME; + } + + +/** 无备注 */ +public void setPT_BUYERTAXNO(String PT_BUYERTAXNO) { + this.PT_BUYERTAXNO = PT_BUYERTAXNO; + } +/** 无备注 */ +public String getPT_BUYERTAXNO() { + return PT_BUYERTAXNO; + } + + +/** 无备注 */ +public void setPT_ORIGINALNUMBER(String PT_ORIGINALNUMBER) { + this.PT_ORIGINALNUMBER = PT_ORIGINALNUMBER; + } +/** 无备注 */ +public String getPT_ORIGINALNUMBER() { + return PT_ORIGINALNUMBER; + } + + +/** 无备注 */ +public void setPT_RUSHREDREASON(String PT_RUSHREDREASON) { + this.PT_RUSHREDREASON = PT_RUSHREDREASON; + } +/** 无备注 */ +public String getPT_RUSHREDREASON() { + return PT_RUSHREDREASON; + } + + +/** 无备注 */ +public void setPT_ELECTRONICMARK(String PT_ELECTRONICMARK) { + this.PT_ELECTRONICMARK = PT_ELECTRONICMARK; + } +/** 无备注 */ +public String getPT_ELECTRONICMARK() { + return PT_ELECTRONICMARK; + } + + + } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.xml new file mode 100644 index 00000000..17956bbf --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketEntity.xml @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PT_ID, + PT_ETICKETNO, + PT_NO, + PT_FSTATION, + PT_TSTATION, + PT_TSTATION1, + PT_TSTATION2, + PT_TSTATION3, + PT_PRICE, + PT_FUNDSAMOUNT, + PT_FUELAMOUNT, + PT_TAXAMOUNT, + PT_AMOUNT, + PT_TAXRATE, + PT_TAXRATEAMOUNT, + PT_NOTAXAMOUNT, + PT_DATE, + PT_TIME, + PT_SERIALNO, + PT_IDNO, + PT_CUSTOMER, + PT_CARRIER, + PT_CLASS, + PT_VALIDDATE, + PT_INVALIDDATE, + PT_ALLOW, + PT_VALIDCODE, + PT_INSURANCE, + PT_SALERCODE, + PT_SALERNAME, + PT_MAKEDATE, + PT_KEY, + PT_COUNT, + PT_DATETIME, + PT_EDATETIME, + PT_INTERNATIONALFLAG, + PT_MARKDESC, + PT_GPNUMBER, + PT_ISSUINGSTATE, + PT_FPHM, + PT_PROMPTINFO, + PT_BUYERNAME, + PT_BUYERTAXNO, + PT_ORIGINALNUMBER, + PT_RUSHREDREASON, + PT_ELECTRONICMARK + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.java new file mode 100644 index 00000000..68a92a86 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.java @@ -0,0 +1,219 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.entity; +import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import com.hzya.frame.web.entity.BaseEntity; +/** + * @description: 迈锐思-飞机行程单明细 + * @tableName: LEXMISCIV_PLANETICKETS + * @entityName: LexmiscivPlaneticketsEntity + * @author: gjh + * @history: 1.0 + */ +public class LexmiscivPlaneticketsEntity extends BaseEntity { + public LexmiscivPlaneticketsEntity() { + + } + + public LexmiscivPlaneticketsEntity(String PTS_MAINID, String dataSourceCode) { + this.PTS_MAINID = PTS_MAINID; + this.setDataSourceCode(dataSourceCode); + } + + /** 无备注 */ +private String PTS_ID; +/** 无备注 */ +private String PTS_MAINID; +/** 无备注 */ +private Integer PTS_SORTNUM; +@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") +@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") +private Date PTS_DATE; +/** 无备注 */ +private String PTS_TIME; +/** 无备注 */ +private String PTS_CLASS; +/** 无备注 */ +private String PTS_CARRIER; +/** 无备注 */ +private String PTS_NO; +/** 无备注 */ +private String PTS_FSTATION; +/** 无备注 */ +private String PTS_TSTATION; +/** 无备注 */ +private String PTS_CLASSNAME; +/** 无备注 */ +private String PTS_FAREBASIS; +/** 无备注 */ +private String PTS_ALLOW; +/** 无备注 */ +private String PTS_DATETIME; +/** 无备注 */ +private String PTS_NOTVALIDAFTER; +/** 无备注 */ +private String PTS_NOTVALIDBEFORE; + + +/** 无备注 */ +public void setPTS_ID(String PTS_ID) { + this.PTS_ID = PTS_ID; + } +/** 无备注 */ +public String getPTS_ID() { + return PTS_ID; + } + + +/** 无备注 */ +public void setPTS_MAINID(String PTS_MAINID) { + this.PTS_MAINID = PTS_MAINID; + } +/** 无备注 */ +public String getPTS_MAINID() { + return PTS_MAINID; + } + + +/** 无备注 */ +public void setPTS_SORTNUM(Integer PTS_SORTNUM) { + this.PTS_SORTNUM = PTS_SORTNUM; + } +/** 无备注 */ +public Integer getPTS_SORTNUM() { + return PTS_SORTNUM; + } + + +/** 无备注 */ +public void setPTS_DATE(Date PTS_DATE) { + this.PTS_DATE = PTS_DATE; + } +/** 无备注 */ +public Date getPTS_DATE() { + return PTS_DATE; + } + + +/** 无备注 */ +public void setPTS_TIME(String PTS_TIME) { + this.PTS_TIME = PTS_TIME; + } +/** 无备注 */ +public String getPTS_TIME() { + return PTS_TIME; + } + + +/** 无备注 */ +public void setPTS_CLASS(String PTS_CLASS) { + this.PTS_CLASS = PTS_CLASS; + } +/** 无备注 */ +public String getPTS_CLASS() { + return PTS_CLASS; + } + + +/** 无备注 */ +public void setPTS_CARRIER(String PTS_CARRIER) { + this.PTS_CARRIER = PTS_CARRIER; + } +/** 无备注 */ +public String getPTS_CARRIER() { + return PTS_CARRIER; + } + + +/** 无备注 */ +public void setPTS_NO(String PTS_NO) { + this.PTS_NO = PTS_NO; + } +/** 无备注 */ +public String getPTS_NO() { + return PTS_NO; + } + + +/** 无备注 */ +public void setPTS_FSTATION(String PTS_FSTATION) { + this.PTS_FSTATION = PTS_FSTATION; + } +/** 无备注 */ +public String getPTS_FSTATION() { + return PTS_FSTATION; + } + + +/** 无备注 */ +public void setPTS_TSTATION(String PTS_TSTATION) { + this.PTS_TSTATION = PTS_TSTATION; + } +/** 无备注 */ +public String getPTS_TSTATION() { + return PTS_TSTATION; + } + + +/** 无备注 */ +public void setPTS_CLASSNAME(String PTS_CLASSNAME) { + this.PTS_CLASSNAME = PTS_CLASSNAME; + } +/** 无备注 */ +public String getPTS_CLASSNAME() { + return PTS_CLASSNAME; + } + + +/** 无备注 */ +public void setPTS_FAREBASIS(String PTS_FAREBASIS) { + this.PTS_FAREBASIS = PTS_FAREBASIS; + } +/** 无备注 */ +public String getPTS_FAREBASIS() { + return PTS_FAREBASIS; + } + + +/** 无备注 */ +public void setPTS_ALLOW(String PTS_ALLOW) { + this.PTS_ALLOW = PTS_ALLOW; + } +/** 无备注 */ +public String getPTS_ALLOW() { + return PTS_ALLOW; + } + + +/** 无备注 */ +public void setPTS_DATETIME(String PTS_DATETIME) { + this.PTS_DATETIME = PTS_DATETIME; + } +/** 无备注 */ +public String getPTS_DATETIME() { + return PTS_DATETIME; + } + + +/** 无备注 */ +public void setPTS_NOTVALIDAFTER(String PTS_NOTVALIDAFTER) { + this.PTS_NOTVALIDAFTER = PTS_NOTVALIDAFTER; + } +/** 无备注 */ +public String getPTS_NOTVALIDAFTER() { + return PTS_NOTVALIDAFTER; + } + + +/** 无备注 */ +public void setPTS_NOTVALIDBEFORE(String PTS_NOTVALIDBEFORE) { + this.PTS_NOTVALIDBEFORE = PTS_NOTVALIDBEFORE; + } +/** 无备注 */ +public String getPTS_NOTVALIDBEFORE() { + return PTS_NOTVALIDBEFORE; + } + + + } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.xml new file mode 100644 index 00000000..f0e0bf3f --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivPlaneticketsEntity.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PTS_ID, + PTS_MAINID, + PTS_SORTNUM, + PTS_DATE, + PTS_TIME, + PTS_CLASS, + PTS_CARRIER, + PTS_NO, + PTS_FSTATION, + PTS_TSTATION, + PTS_CLASSNAME, + PTS_FAREBASIS, + PTS_ALLOW, + PTS_DATETIME, + PTS_NOTVALIDAFTER, + PTS_NOTVALIDBEFORE + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.java new file mode 100644 index 00000000..d87bc3b5 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.java @@ -0,0 +1,388 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.entity; +import java.util.Date; +import org.springframework.format.annotation.DateTimeFormat; +import com.fasterxml.jackson.annotation.JsonFormat; +import java.math.BigDecimal; +import com.hzya.frame.web.entity.BaseEntity; +/** + * @description: 迈锐思-火车票 + * @tableName: LEXMISCIV_TRAINTICKET + * @entityName: LexmiscivTrainticketEntity + * @author: gjh + * @history: 1.0 + */ +public class LexmiscivTrainticketEntity extends BaseEntity { + public LexmiscivTrainticketEntity() { + + } + + public LexmiscivTrainticketEntity(String TT_ID,String dataSourceCode) { + this.TT_ID = TT_ID; + this.setDataSourceCode(dataSourceCode); + } + + /** 无备注 */ +private String TT_ID; +/** 无备注 */ +private String TT_CODE; +/** 无备注 */ +private String TT_NO; +/** 无备注 */ +private String TT_FSTATION; +/** 无备注 */ +private String TT_TSTATION; +/** 无备注 */ +private BigDecimal TT_AMOUNT; +/** 无备注 */ +private String TT_TAXRATE; +/** 无备注 */ +private BigDecimal TT_TAXRATEAMOUNT; +/** 无备注 */ +private BigDecimal TT_NOTAXAMOUNT; +@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") +@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") +private Date TT_DATE; +/** 无备注 */ +private String TT_TIME; +/** 无备注 */ +private String TT_SERIALNO; +/** 无备注 */ +private String TT_IDNO; +/** 无备注 */ +private String TT_CUSTOMER; +/** 无备注 */ +private String TT_SALESTATION; +/** 无备注 */ +private String TT_SALETYPE; +/** 无备注 */ +private String TT_CARRIAGE; +/** 无备注 */ +private String TT_SEAT; +/** 无备注 */ +private String TT_CLASS; +/** 无备注 */ +private String TT_TICKETCHECKING; +/** 无备注 */ +private String TT_KEY; +/** 无备注 */ +private Integer TT_COUNT; +/** 无备注 */ +private String TT_DATETIME; +/** 无备注 */ +private String TT_EDATETIME; +@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") +@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") +private Date TT_OUTDATE; +/** 无备注 */ +private Integer TT_ELECTRONIC; +/** 无备注 */ +private Integer TT_BUSINESSTYPE; +/** 无备注 */ +private String TT_BUYERNAME; +/** 无备注 */ +private String TT_BUYERTAXNO; +/** 无备注 */ +private String TT_ORIGINALINVOICE; + + +/** 无备注 */ +public void setTT_ID(String TT_ID) { + this.TT_ID = TT_ID; + } +/** 无备注 */ +public String getTT_ID() { + return TT_ID; + } + + +/** 无备注 */ +public void setTT_CODE(String TT_CODE) { + this.TT_CODE = TT_CODE; + } +/** 无备注 */ +public String getTT_CODE() { + return TT_CODE; + } + + +/** 无备注 */ +public void setTT_NO(String TT_NO) { + this.TT_NO = TT_NO; + } +/** 无备注 */ +public String getTT_NO() { + return TT_NO; + } + + +/** 无备注 */ +public void setTT_FSTATION(String TT_FSTATION) { + this.TT_FSTATION = TT_FSTATION; + } +/** 无备注 */ +public String getTT_FSTATION() { + return TT_FSTATION; + } + + +/** 无备注 */ +public void setTT_TSTATION(String TT_TSTATION) { + this.TT_TSTATION = TT_TSTATION; + } +/** 无备注 */ +public String getTT_TSTATION() { + return TT_TSTATION; + } + + +/** 无备注 */ +public void setTT_AMOUNT(BigDecimal TT_AMOUNT) { + this.TT_AMOUNT = TT_AMOUNT; + } +/** 无备注 */ +public BigDecimal getTT_AMOUNT() { + return TT_AMOUNT; + } + + +/** 无备注 */ +public void setTT_TAXRATE(String TT_TAXRATE) { + this.TT_TAXRATE = TT_TAXRATE; + } +/** 无备注 */ +public String getTT_TAXRATE() { + return TT_TAXRATE; + } + + +/** 无备注 */ +public void setTT_TAXRATEAMOUNT(BigDecimal TT_TAXRATEAMOUNT) { + this.TT_TAXRATEAMOUNT = TT_TAXRATEAMOUNT; + } +/** 无备注 */ +public BigDecimal getTT_TAXRATEAMOUNT() { + return TT_TAXRATEAMOUNT; + } + + +/** 无备注 */ +public void setTT_NOTAXAMOUNT(BigDecimal TT_NOTAXAMOUNT) { + this.TT_NOTAXAMOUNT = TT_NOTAXAMOUNT; + } +/** 无备注 */ +public BigDecimal getTT_NOTAXAMOUNT() { + return TT_NOTAXAMOUNT; + } + + +/** 无备注 */ +public void setTT_DATE(Date TT_DATE) { + this.TT_DATE = TT_DATE; + } +/** 无备注 */ +public Date getTT_DATE() { + return TT_DATE; + } + + +/** 无备注 */ +public void setTT_TIME(String TT_TIME) { + this.TT_TIME = TT_TIME; + } +/** 无备注 */ +public String getTT_TIME() { + return TT_TIME; + } + + +/** 无备注 */ +public void setTT_SERIALNO(String TT_SERIALNO) { + this.TT_SERIALNO = TT_SERIALNO; + } +/** 无备注 */ +public String getTT_SERIALNO() { + return TT_SERIALNO; + } + + +/** 无备注 */ +public void setTT_IDNO(String TT_IDNO) { + this.TT_IDNO = TT_IDNO; + } +/** 无备注 */ +public String getTT_IDNO() { + return TT_IDNO; + } + + +/** 无备注 */ +public void setTT_CUSTOMER(String TT_CUSTOMER) { + this.TT_CUSTOMER = TT_CUSTOMER; + } +/** 无备注 */ +public String getTT_CUSTOMER() { + return TT_CUSTOMER; + } + + +/** 无备注 */ +public void setTT_SALESTATION(String TT_SALESTATION) { + this.TT_SALESTATION = TT_SALESTATION; + } +/** 无备注 */ +public String getTT_SALESTATION() { + return TT_SALESTATION; + } + + +/** 无备注 */ +public void setTT_SALETYPE(String TT_SALETYPE) { + this.TT_SALETYPE = TT_SALETYPE; + } +/** 无备注 */ +public String getTT_SALETYPE() { + return TT_SALETYPE; + } + + +/** 无备注 */ +public void setTT_CARRIAGE(String TT_CARRIAGE) { + this.TT_CARRIAGE = TT_CARRIAGE; + } +/** 无备注 */ +public String getTT_CARRIAGE() { + return TT_CARRIAGE; + } + + +/** 无备注 */ +public void setTT_SEAT(String TT_SEAT) { + this.TT_SEAT = TT_SEAT; + } +/** 无备注 */ +public String getTT_SEAT() { + return TT_SEAT; + } + + +/** 无备注 */ +public void setTT_CLASS(String TT_CLASS) { + this.TT_CLASS = TT_CLASS; + } +/** 无备注 */ +public String getTT_CLASS() { + return TT_CLASS; + } + + +/** 无备注 */ +public void setTT_TICKETCHECKING(String TT_TICKETCHECKING) { + this.TT_TICKETCHECKING = TT_TICKETCHECKING; + } +/** 无备注 */ +public String getTT_TICKETCHECKING() { + return TT_TICKETCHECKING; + } + + +/** 无备注 */ +public void setTT_KEY(String TT_KEY) { + this.TT_KEY = TT_KEY; + } +/** 无备注 */ +public String getTT_KEY() { + return TT_KEY; + } + + +/** 无备注 */ +public void setTT_COUNT(Integer TT_COUNT) { + this.TT_COUNT = TT_COUNT; + } +/** 无备注 */ +public Integer getTT_COUNT() { + return TT_COUNT; + } + + +/** 无备注 */ +public void setTT_DATETIME(String TT_DATETIME) { + this.TT_DATETIME = TT_DATETIME; + } +/** 无备注 */ +public String getTT_DATETIME() { + return TT_DATETIME; + } + + +/** 无备注 */ +public void setTT_EDATETIME(String TT_EDATETIME) { + this.TT_EDATETIME = TT_EDATETIME; + } +/** 无备注 */ +public String getTT_EDATETIME() { + return TT_EDATETIME; + } + + +/** 无备注 */ +public void setTT_OUTDATE(Date TT_OUTDATE) { + this.TT_OUTDATE = TT_OUTDATE; + } +/** 无备注 */ +public Date getTT_OUTDATE() { + return TT_OUTDATE; + } + + +/** 无备注 */ +public void setTT_ELECTRONIC(Integer TT_ELECTRONIC) { + this.TT_ELECTRONIC = TT_ELECTRONIC; + } +/** 无备注 */ +public Integer getTT_ELECTRONIC() { + return TT_ELECTRONIC; + } + + +/** 无备注 */ +public void setTT_BUSINESSTYPE(Integer TT_BUSINESSTYPE) { + this.TT_BUSINESSTYPE = TT_BUSINESSTYPE; + } +/** 无备注 */ +public Integer getTT_BUSINESSTYPE() { + return TT_BUSINESSTYPE; + } + + +/** 无备注 */ +public void setTT_BUYERNAME(String TT_BUYERNAME) { + this.TT_BUYERNAME = TT_BUYERNAME; + } +/** 无备注 */ +public String getTT_BUYERNAME() { + return TT_BUYERNAME; + } + + +/** 无备注 */ +public void setTT_BUYERTAXNO(String TT_BUYERTAXNO) { + this.TT_BUYERTAXNO = TT_BUYERTAXNO; + } +/** 无备注 */ +public String getTT_BUYERTAXNO() { + return TT_BUYERTAXNO; + } + + +/** 无备注 */ +public void setTT_ORIGINALINVOICE(String TT_ORIGINALINVOICE) { + this.TT_ORIGINALINVOICE = TT_ORIGINALINVOICE; + } +/** 无备注 */ +public String getTT_ORIGINALINVOICE() { + return TT_ORIGINALINVOICE; + } + + + } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.xml new file mode 100644 index 00000000..105b4b75 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/entity/LexmiscivTrainticketEntity.xml @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TT_ID, + TT_CODE, + TT_NO, + TT_FSTATION, + TT_TSTATION, + TT_AMOUNT, + TT_TAXRATE, + TT_TAXRATEAMOUNT, + TT_NOTAXAMOUNT, + TT_DATE, + TT_TIME, + TT_SERIALNO, + TT_IDNO, + TT_CUSTOMER, + TT_SALESTATION, + TT_SALETYPE, + TT_CARRIAGE, + TT_SEAT, + TT_CLASS, + TT_TICKETCHECKING, + TT_KEY, + TT_COUNT, + TT_DATETIME, + TT_EDATETIME, + TT_OUTDATE, + TT_ELECTRONIC, + TT_BUSINESSTYPE, + TT_BUYERNAME, + TT_BUYERTAXNO, + TT_ORIGINALINVOICE + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmisPublicinfoService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmisPublicinfoService.java new file mode 100644 index 00000000..21eb3c4e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmisPublicinfoService.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity; +/** + * @description: 迈锐思-公共信息表 service + * @tableName: LEXMISCIV_PUBLICINFO + * @entityName: LexmisPublicinfoEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmisPublicinfoService extends IBaseService { + +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicedetailService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicedetailService.java new file mode 100644 index 00000000..79b54882 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicedetailService.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicedetailEntity; +/** + * @description: 迈锐思-增值税发票子表 service + * @tableName: LEXMISCIV_INVOICEDETAIL + * @entityName: LexmiscivInvoicedetailEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivInvoicedetailService extends IBaseService { + +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicemainService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicemainService.java new file mode 100644 index 00000000..6f9b4abe --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivInvoicemainService.java @@ -0,0 +1,19 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity; +/** + * @description: 迈锐思-增值税发票主表 service + * @tableName: LEXMISCIV_INVOICEMAIN + * @entityName: LexmiscivInvoicemainEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivInvoicemainService extends IBaseService { + + /** + * 根据主键查查增值税发票主表信息 + * @param entity + * @return + */ + LexmiscivInvoicemainEntity getByImId(LexmiscivInvoicemainEntity entity); +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketService.java new file mode 100644 index 00000000..e6d3b0ee --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketService.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketEntity; +/** + * @description: 迈锐思-飞机行程单 service + * @tableName: LEXMISCIV_PLANETICKET + * @entityName: LexmiscivPlaneticketEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivPlaneticketService extends IBaseService { + +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketsService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketsService.java new file mode 100644 index 00000000..011c8e9e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivPlaneticketsService.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity; +/** + * @description: 迈锐思-飞机行程单明细 service + * @tableName: LEXMISCIV_PLANETICKETS + * @entityName: LexmiscivPlaneticketsEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivPlaneticketsService extends IBaseService { + +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivTrainticketService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivTrainticketService.java new file mode 100644 index 00000000..2b88b128 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/ILexmiscivTrainticketService.java @@ -0,0 +1,13 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivTrainticketEntity; +/** + * @description: 迈锐思-火车票 service + * @tableName: LEXMISCIV_TRAINTICKET + * @entityName: LexmiscivTrainticketEntity + * @author: gjh + * @history: 1.0 + */ +public interface ILexmiscivTrainticketService extends IBaseService { + +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmisPublicinfoServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmisPublicinfoServiceImpl.java new file mode 100644 index 00000000..76ff2d22 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmisPublicinfoServiceImpl.java @@ -0,0 +1,26 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service.impl; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmisPublicinfoDao; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmisPublicinfoEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.service.ILexmisPublicinfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * @description: 迈锐思-公共信息表 service + * @tableName: LEXMISCIV_PUBLICINFO + * @entityName: LexmisPublicinfoEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="LEXMISCIV_PUBLICINFOService") +public class LexmisPublicinfoServiceImpl extends BaseService implements ILexmisPublicinfoService { + + protected ILexmisPublicinfoDao lexmispublicinfoDao; + + @Autowired + public void setLexmisPublicinfoDao(ILexmisPublicinfoDao dao) { + this.lexmispublicinfoDao = dao; + this.dao=dao; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicedetailServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicedetailServiceImpl.java new file mode 100644 index 00000000..469eb285 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicedetailServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service.impl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicedetailEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.service.ILexmiscivInvoicedetailService; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivInvoicedetailDao; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * @description: 迈锐思-增值税发票子表 service + * @tableName: LEXMISCIV_INVOICEDETAIL + * @entityName: LexmiscivInvoicedetailEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="LEXMISCIV_INVOICEDETAILService") +public class LexmiscivInvoicedetailServiceImpl extends BaseService< LexmiscivInvoicedetailEntity,String> implements ILexmiscivInvoicedetailService{ + + protected ILexmiscivInvoicedetailDao lexmiscivinvoicedetailDao; + + @Autowired + public void setLexmiscivInvoicedetailDao(ILexmiscivInvoicedetailDao dao) { + this.lexmiscivinvoicedetailDao = dao; + this.dao=dao; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicemainServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicemainServiceImpl.java new file mode 100644 index 00000000..9b2507f0 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivInvoicemainServiceImpl.java @@ -0,0 +1,39 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service.impl; +import com.baomidou.dynamic.datasource.annotation.DS; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivInvoicemainEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.service.ILexmiscivInvoicemainService; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivInvoicemainDao; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * @description: 迈锐思-增值税发票主表 service + * @tableName: LEXMISCIV_INVOICEMAIN + * @entityName: LexmiscivInvoicemainEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="LEXMISCIV_INVOICEMAINService") +public class LexmiscivInvoicemainServiceImpl extends BaseService< LexmiscivInvoicemainEntity,String> implements ILexmiscivInvoicemainService{ + + protected ILexmiscivInvoicemainDao lexmiscivinvoicemainDao; + + @Autowired + public void setLexmiscivInvoicemainDao(ILexmiscivInvoicemainDao dao) { + this.lexmiscivinvoicemainDao = dao; + this.dao=dao; + } + + /** + * 根据主键查查增值税发票主表信息 + * + * @param entity + * @return + */ + @DS("#entity.dataSourceCode") + @Override + public LexmiscivInvoicemainEntity getByImId(LexmiscivInvoicemainEntity entity) { + LexmiscivInvoicemainEntity lexmiscivInvoicemainEntity = lexmiscivinvoicemainDao.queryOne(entity); + return lexmiscivInvoicemainEntity; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketServiceImpl.java new file mode 100644 index 00000000..a1e7fb1a --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service.impl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.service.ILexmiscivPlaneticketService; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivPlaneticketDao; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * @description: 迈锐思-飞机行程单 service + * @tableName: LEXMISCIV_PLANETICKET + * @entityName: LexmiscivPlaneticketEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="LEXMISCIV_PLANETICKETService") +public class LexmiscivPlaneticketServiceImpl extends BaseService< LexmiscivPlaneticketEntity,String> implements ILexmiscivPlaneticketService{ + + protected ILexmiscivPlaneticketDao lexmiscivplaneticketDao; + + @Autowired + public void setLexmiscivPlaneticketDao(ILexmiscivPlaneticketDao dao) { + this.lexmiscivplaneticketDao = dao; + this.dao=dao; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketsServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketsServiceImpl.java new file mode 100644 index 00000000..18531a6b --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivPlaneticketsServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service.impl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivPlaneticketsEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.service.ILexmiscivPlaneticketsService; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivPlaneticketsDao; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * @description: 迈锐思-飞机行程单明细 service + * @tableName: LEXMISCIV_PLANETICKETS + * @entityName: LexmiscivPlaneticketsEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="LEXMISCIV_PLANETICKETSService") +public class LexmiscivPlaneticketsServiceImpl extends BaseService< LexmiscivPlaneticketsEntity,String> implements ILexmiscivPlaneticketsService{ + + protected ILexmiscivPlaneticketsDao lexmiscivplaneticketsDao; + + @Autowired + public void setLexmiscivPlaneticketsDao(ILexmiscivPlaneticketsDao dao) { + this.lexmiscivplaneticketsDao = dao; + this.dao=dao; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivTrainticketServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivTrainticketServiceImpl.java new file mode 100644 index 00000000..d95c8562 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/lexmis/service/impl/LexmiscivTrainticketServiceImpl.java @@ -0,0 +1,25 @@ +package com.hzya.frame.plugin.cinvoice.lexmis.service.impl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.LexmiscivTrainticketEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.service.ILexmiscivTrainticketService; +import com.hzya.frame.plugin.cinvoice.lexmis.dao.ILexmiscivTrainticketDao; +import com.hzya.frame.basedao.service.impl.BaseService; +/** + * @description: 迈锐思-火车票 service + * @tableName: LEXMISCIV_TRAINTICKET + * @entityName: LexmiscivTrainticketEntity + * @author: gjh + * @history: 1.0 + */ +@Service(value="LEXMISCIV_TRAINTICKETService") +public class LexmiscivTrainticketServiceImpl extends BaseService< LexmiscivTrainticketEntity,String> implements ILexmiscivTrainticketService{ + + protected ILexmiscivTrainticketDao lexmiscivtrainticketDao; + + @Autowired + public void setLexmiscivTrainticketDao(ILexmiscivTrainticketDao dao) { + this.lexmiscivtrainticketDao = dao; + this.dao=dao; + } +} 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 new file mode 100644 index 00000000..65865947 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/plugin/CInvoiceImportPluginInitializer.java @@ -0,0 +1,101 @@ +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.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Description 发票批量导入有度税务 + * @Author xiangerlin + * @Date 2025/4/18 15:12 + **/ +public class CInvoiceImportPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private ICInvoiceImportPluginService pluginService; + /*** + * 插件初始化方法 + * @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 "CInvoiceImportPluginInitializer"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "OA发票导入有度税务"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "OA发票导入有度税务"; + } + + /*** + * 插件类型 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("======开始执OA发票批量导入有度税务插件======"); + pluginService.importInvoice(requestJson); + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportBService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportBService.java new file mode 100644 index 00000000..1a1d5445 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportBService.java @@ -0,0 +1,21 @@ +package com.hzya.frame.plugin.cinvoice.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportBEntity; + +import java.util.List; + +/** + * @Description 发票批量导入有度税务 表体service + * @Author xiangerlin + * @Date 2025/4/18 15:35 + **/ +public interface ICInvoiceImportBService extends IBaseService { + + /*** + * 查询子表数据 + * @param entity + * @return + */ + List queryInvoiceDetails(CInvoiceImportBEntity entity)throws Exception; +} 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 new file mode 100644 index 00000000..5ce1a532 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportHService.java @@ -0,0 +1,22 @@ +package com.hzya.frame.plugin.cinvoice.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportHEntity; + +import java.util.List; + +/** + * @Description 发票批量导入有度税务 表头service + * @Author xiangerlin + * @Date 2025/4/18 15:34 + **/ +public interface ICInvoiceImportHService extends IBaseService { + + /** + * 查询发票列表 + * @param entity + * @return + * @throws Exception + */ + List queryInvoiceList(CInvoiceImportHEntity entity) throws Exception; +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportPluginService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportPluginService.java new file mode 100644 index 00000000..be268219 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/ICInvoiceImportPluginService.java @@ -0,0 +1,18 @@ +package com.hzya.frame.plugin.cinvoice.service; + +import com.alibaba.fastjson.JSONObject; + +/** + * @Description 税务发票批量导入 + * @Author xiangerlin + * @Date 2025/4/21 17:29 + **/ +public interface ICInvoiceImportPluginService { + /** + * 发票导入 + * @param requestJson + * @return + * @throws Exception + */ + String importInvoice(JSONObject requestJson)throws Exception; +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportBServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportBServiceImpl.java new file mode 100644 index 00000000..6f33923b --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportBServiceImpl.java @@ -0,0 +1,43 @@ +package com.hzya.frame.plugin.cinvoice.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.cinvoice.dao.ICInvoiceImportBDao; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportBEntity; +import com.hzya.frame.plugin.cinvoice.service.ICInvoiceImportBService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description 发票批量导入有度税务 表体service + * @Author xiangerlin + * @Date 2025/4/18 15:39 + **/ +@Service() +public class CInvoiceImportBServiceImpl extends BaseService implements ICInvoiceImportBService { + Logger logger = LogManager.getLogger(getClass()); + + private ICInvoiceImportBDao cInvoiceImportBDao; + + @Autowired + public void setcInvoiceImportBDao(ICInvoiceImportBDao dao) { + this.cInvoiceImportBDao = dao; + this.dao = dao; + } + + /*** + * 查询子表数据 + * @param entity + * @return + */ + @DS("#entity.dataSourceCode") + @Override + public List queryInvoiceDetails(CInvoiceImportBEntity entity) throws Exception { + List list = cInvoiceImportBDao.queryList(entity, "com.hzya.frame.plugin.cinvoice.dao.impl.CInvoiceImportBDaoImpl.entity_list_base"); + return list; + } +} 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 new file mode 100644 index 00000000..c6edb605 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportHServiceImpl.java @@ -0,0 +1,45 @@ +package com.hzya.frame.plugin.cinvoice.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.cinvoice.dao.ICInvoiceImportHDao; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportHEntity; +import com.hzya.frame.plugin.cinvoice.service.ICInvoiceImportHService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description 发票批量导入有度税务 表头service + * @Author xiangerlin + * @Date 2025/4/18 15:38 + **/ +@Service() +public class CInvoiceImportHServiceImpl extends BaseService implements ICInvoiceImportHService { + Logger logger = LogManager.getLogger(getClass()); + + private ICInvoiceImportHDao cInvoiceImportHDao; + + @Autowired + public void setcInvoiceImportHDao(ICInvoiceImportHDao dao) { + this.cInvoiceImportHDao = dao; + this.dao = dao; + } + + /** + * 查询发票列表 + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List queryInvoiceList(CInvoiceImportHEntity entity) throws Exception { + List list = cInvoiceImportHDao.queryList(entity, "com.hzya.frame.plugin.cinvoice.dao.impl.CInvoiceImportHDaoImpl.entity_list_base"); + return list; + } +} 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 new file mode 100644 index 00000000..dcc9d89d --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/service/impl/CInvoiceImportPluginServiceImpl.java @@ -0,0 +1,327 @@ +package com.hzya.frame.plugin.cinvoice.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.lang.Assert; +import cn.hutool.core.map.MapBuilder; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.assembler.*; +import com.hzya.frame.plugin.cinvoice.entity.CInvoiceImportHEntity; +import com.hzya.frame.plugin.cinvoice.lexmis.entity.*; +import com.hzya.frame.plugin.cinvoice.lexmis.service.*; +import com.hzya.frame.plugin.cinvoice.service.ICInvoiceImportHService; +import com.hzya.frame.plugin.cinvoice.service.ICInvoiceImportPluginService; +import com.hzya.frame.seeyon.util.YzfSignUtil; +import org.apache.commons.collections.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @Description 有度税务发票批量导入 + * @Author xiangerlin + * @Date 2025/4/21 17:30 + **/ +@Service() +public class CInvoiceImportPluginServiceImpl implements ICInvoiceImportPluginService { + Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private ILexmisPublicinfoService lexmisPublicinfoService; + @Autowired + private ICInvoiceImportHService cInvoiceImportHService; + @Autowired + private ILexmiscivInvoicemainService lexmiscivInvoicemainService; + @Autowired + private ILexmiscivInvoicedetailService lexmiscivInvoicedetailService; + @Autowired + private ILexmiscivTrainticketService lexmiscivTrainticketService; + @Autowired + private ILexmiscivPlaneticketService lexmiscivPlaneticketService; + @Autowired + ILexmiscivPlaneticketsService lexmiscivPlaneticketsService; + + @Value("${zt.url:}") + private String url; + @Value("${yzf.accessSecret:}") + private String accessSecret; + @Value("${yzf.accesskey:}") + private String accesskey; + /** + * 发票导入 + * + * @param requestJson + * @return + * @throws Exception + */ + @Override + public String importInvoice(JSONObject requestJson) throws Exception { + + + //1、 查OA主表 + requestJson.get(""); + String dataSourceCode = "HT-OA"; + CInvoiceImportHEntity importHEntity = new CInvoiceImportHEntity(); + importHEntity.setDataSourceCode(dataSourceCode); + importHEntity.setId("3922481031277596479"); + List cInvoiceImportHList = cInvoiceImportHService.queryInvoiceList(importHEntity); + if (CollectionUtils.isNotEmpty(cInvoiceImportHList)){ + ParamAssembler assembler = null; + CInvoiceImportHEntity cInvoiceH = cInvoiceImportHList.get(0); + //2、 查OA明细表 + //3、 查迈瑞思发票表 + //迈锐思发票公共信息表 + List lexmisPublicinfoEntityList = lexmisPublicinfoService.query(new LexmisPublicinfoEntity(cInvoiceH.getId(),dataSourceCode)); + if (CollectionUtils.isNotEmpty(lexmisPublicinfoEntityList)){ + //税务接口每次最多传50张发票 + int size = lexmisPublicinfoEntityList.size(); + int batchSize = 50; + for (int i = 0; i < size; i += batchSize){ + int no = 1;//序号 + //4、 根据发票类型,组装不同参数 + long timestamp = System.currentTimeMillis(); + Map parametersMap = new HashMap<>(); + parametersMap.put("accessKey",accesskey); + parametersMap.put("timestamp",timestamp); + String sign = YzfSignUtil.signRequest(parametersMap, accessSecret); + JSONObject head = new JSONObject(); + head.put("accessKey","6X3B526P5HqE6ums");//密钥 + head.put("sign",sign);//签名 + head.put("timestamp",timestamp);//时间戳 + head.put("taxNo","91330110MAC5FPUY2U");//当前企业税号 + 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(); + ParamAssemblerContext context = null;//策略上下文类 + 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); + + 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; + default: + System.out.println("没有匹配到类型"); + break; + } + no++; + } + } + 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(); + logger.info("调用有度发票批量导入接口响应参数:{}",body); + } + } + } + + + return null; + } + + /** + * 机票 + * @param dataSourceCode + * @param info + * @param invoiceInfo + * @param baseInfo + */ + private void planeInvoice(String dataSourceCode, LexmisPublicinfoEntity info, JSONObject invoiceInfo, JSONObject baseInfo) { + ParamAssemblerContext context; + JSONObject contentInfo; + ParamAssembler assembler; + LexmiscivPlaneticketEntity planeticketH = lexmiscivPlaneticketService.queryOne(new LexmiscivPlaneticketEntity(info.getPI_DATAKEY(), dataSourceCode)); + 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)); + //1表示电子行程单 先不区分试试,策略类内部判断来实现区分 + 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",DateUtil.format(planeticketH.getPT_MAKEDATE(),"yyyy-MM-dd"));//开票日期 + baseInfo.put("bhszje",planeticketH.getPT_NOTAXAMOUNT());//不含税总金额 + baseInfo.put("jym","");//校验码 + 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); + } + } + + /** + * 火车票发票 + * @param dataSourceCode + * @param inputInfos + * @param info + * @param inputInfo + * @param invoiceInfo + * @param baseInfo + */ + private void trainInvoice(String dataSourceCode, JSONArray inputInfos, LexmisPublicinfoEntity info, JSONObject inputInfo, JSONObject invoiceInfo, JSONObject baseInfo) { + JSONObject contentInfo; + ParamAssembler assembler; + ParamAssemblerContext context; + 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){ + JSONObject trainObj = new JSONObject(); + trainObj.put("trainInvoice",JSONObject.toJSONString(trainticket)); + String fplx = "a2"; + //1是电子票 + if ("1".equals(trainticket.getTT_ELECTRONIC())){ + assembler = new ElecTrainInvoiceAssembler(trainObj); + fplx = "200"; + }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_OUTDATE(),"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 { + inputInfos.remove(inputInfo); + logger.info("根据pi_datakey没有查到火车票发票信息:{},发票号:{}", info.getPI_DATAKEY()); + } + } + + /** + * 增值税发票 + * @param dataSourceCode 数据源编码 + * @param info 发票公共表 + * @param invoiceInfo 发票信息对象 + * @param baseInfo 发票基本数据对象 + */ + private void zzsInvoice(String dataSourceCode, LexmisPublicinfoEntity info, JSONObject invoiceInfo, JSONObject baseInfo) { + ParamAssemblerContext context; + JSONObject contentInfo; + ParamAssembler assembler; + LexmiscivInvoicemainEntity zzsInvoiceH = lexmiscivInvoicemainService.queryOne(new LexmiscivInvoicemainEntity(info.getPI_DATAKEY(), dataSourceCode)); + //增值税发票表体 + 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)); + 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 + invoiceInfo.put("baseInfo", baseInfo); + invoiceInfo.put("contentInfo",contentInfo); + } + + + /** + * 迈锐思增值税类发票类型转换成有度发票类型 + * @param fplx 迈锐思发票类型 + * @return + */ + private String convertZzsFplx(String fplx){ + if (StrUtil.isNotEmpty(fplx)){ + String youduFplx = null; + switch (fplx){ + case "01"://增值税专用发票 + youduFplx = "01"; + break; + case "04"://增值税普通发票 + youduFplx = "04"; + break; + case "10"://增值税电子普票 + youduFplx = "10"; + break; + case "20"://增值税电子专票 + youduFplx = "08"; + break; + case "31"://电子发票(增值税专票) + youduFplx = "31"; + break; + case "32"://电子发票(增值税普票) + youduFplx = "32"; + break; + } + return youduFplx; + } + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/util/YzfUtils.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/util/YzfUtils.java new file mode 100644 index 00000000..b1811548 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/cinvoice/util/YzfUtils.java @@ -0,0 +1,99 @@ +package com.hzya.frame.plugin.cinvoice.util; + +import cn.hutool.core.lang.Assert; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; + +import java.time.Instant; + +/** + * @Description 云帐房accessToken + * @Author xiangerlin + * @Date 2025/4/24 10:03 + **/ +public class YzfUtils { + static Logger logger = LoggerFactory.getLogger(YzfUtils.class); + //token + private static String accessToken; + //过期时间 + private static Instant expireTime; + private static final Long CACHE_EXPIRY_TIME = 7000L; // 缓存有效时间(秒) + //应用key + private static String accessKey; + //应用密钥 + private static String accessSecret; + //接口地址 + private static String baseUrl; + @Value("${yzf.accessKey:}") + public static void setaccessKey(String accessKey) { + YzfUtils.accessKey = accessKey; + } + @Value("${yzf.accessSecret:}") + public static void setaccessSecret(String accessSecret) { + YzfUtils.accessSecret = accessSecret; + } + @Value("${yzf.baseUrl:}") + public static void setBaseUrl(String baseUrl){ + YzfUtils.baseUrl = baseUrl; + } + /** + * 获取token + * @return + */ + public static String getAccessToken(){ + return getAccessToken(accessKey,accessSecret); + } + + /** + * 获取accessToken + * + * @param accessKey + * @param accessSecret + * @return + */ + public static String getAccessToken(String accessKey,String accessSecret) { + //判断是否过期 如果没过期直接返回 + if (null != accessToken && expireTime != null && Instant.now().isBefore(expireTime)) { + return accessToken; + } + //获取新的accessToken + accessToken = fetchNewAccessToken(accessKey,accessSecret); + //过期时间设置成当前事件+7000s,预留200s的时间 + expireTime = Instant.now().plusSeconds(CACHE_EXPIRY_TIME); + return accessToken; + } + /** + * 获取新的accessToken + * + * @return + */ + private static String fetchNewAccessToken(String accessKey,String accessSecret) { + try { + + if (StrUtil.isNotEmpty(accessKey) && StrUtil.isNotEmpty(accessSecret)) { + JSONObject param = new JSONObject(); + param.put("accessKey", YzfUtils.accessKey); + param.put("accessSecret", YzfUtils.accessSecret); + String res = HttpRequest.post(YzfUtils.baseUrl+"/api/getToken").body(param.toString()).execute().body(); + logger.info("调用云帐房token返回参数:{}",res); + if (StrUtil.isNotEmpty(res)){ + JSONObject tokenObj = JSONObject.parseObject(res); + String code = tokenObj.getString("code"); + if ("0".equals(code)){ + JSONObject resultObj = tokenObj.getJSONObject("result"); + if (null != resultObj){ + return resultObj.getString("accessToken"); + } + } + } + } + } catch (Exception _err) { + logger.error("获取oken出错:{}", _err); + } + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/IContractAuditDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/IContractAuditDao.java new file mode 100644 index 00000000..ca94f335 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/IContractAuditDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.contract.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.contract.entity.ContractAuditEntity; + +/** + * @Description 合同评审 + * @Author xiangerlin + * @Date 2025/3/31 14:55 + **/ +public interface IContractAuditDao extends IBaseDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/impl/ContractAuditDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/impl/ContractAuditDaoImpl.java new file mode 100644 index 00000000..981ed004 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/dao/impl/ContractAuditDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.contract.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.contract.dao.IContractAuditDao; +import com.hzya.frame.plugin.contract.entity.ContractAuditEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description 合同评审 + * @Author xiangerlin + * @Date 2025/3/31 14:56 + **/ +@Repository() +public class ContractAuditDaoImpl extends MybatisGenericDao implements IContractAuditDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.java new file mode 100644 index 00000000..5d3b3cbe --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.java @@ -0,0 +1,144 @@ +package com.hzya.frame.plugin.contract.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description + * @Author xiangerlin + * @Date 2025/3/31 11:22 + **/ +public class ContractAuditEntity extends BaseEntity { + + //表单id + private String id; + //单据号 + private String field0168; + //合同编号 + private String field0239; + //合同名称 + private String field0005; + //流程id + private String col_summary_id; + //待办id + private String affairId; + //待办表体 + private String subject; + //节点名称 + private String node_name; + //节点权限 + private String node_policy; + //待办接收时间 + private String receive_time; + //待办完成时间 + private String complete_time; + //待办状态 + private String state; + //待办人登录名 + private String login_name; + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + 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 getAffairId() { + return affairId; + } + + public void setAffairId(String affairId) { + this.affairId = affairId; + } + + public String getField0168() { + return field0168; + } + + public void setField0168(String field0168) { + this.field0168 = field0168; + } + + public String getField0239() { + return field0239; + } + + public void setField0239(String field0239) { + this.field0239 = field0239; + } + + public String getField0005() { + return field0005; + } + + public void setField0005(String field0005) { + this.field0005 = field0005; + } + + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public String getNode_name() { + return node_name; + } + + public void setNode_name(String node_name) { + this.node_name = node_name; + } + + public String getNode_policy() { + return node_policy; + } + + public void setNode_policy(String node_policy) { + this.node_policy = node_policy; + } + + public String getReceive_time() { + return receive_time; + } + + public void setReceive_time(String receive_time) { + this.receive_time = receive_time; + } + + public String getComplete_time() { + return complete_time; + } + + public void setComplete_time(String complete_time) { + this.complete_time = complete_time; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getLogin_name() { + return login_name; + } + + public void setLogin_name(String login_name) { + this.login_name = login_name; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.xml new file mode 100644 index 00000000..5f5f918e --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/entity/ContractAuditEntity.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/plugin/ContractAuditPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/plugin/ContractAuditPluginInitializer.java new file mode 100644 index 00000000..6f7ae7e7 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/plugin/ContractAuditPluginInitializer.java @@ -0,0 +1,160 @@ +package com.hzya.frame.plugin.contract.plugin; + +import cn.hutool.core.map.MapBuilder; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.contract.entity.ContractAuditEntity; +import com.hzya.frame.plugin.contract.service.IContractAuditService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.commons.collections.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @Description 合同评审,超过60天流程未审批的,把流程终止掉 + * @Author xiangerlin + * @Date 2025/3/31 11:07 + **/ +public class ContractAuditPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + + @Resource + private IContractAuditService contractAuditService; + /*** + * 插件初始化方法 + * @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 "ContractAuditPluginInitializer"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "OA合同评审流程检测插件"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "OA合同评审流程检测插件"; + } + + /*** + * 插件类型 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("======开始执行合同评审流程检测插件定时任务======"); + //1、查询超期的合同 + ContractAuditEntity contractAuditEntity = new ContractAuditEntity(); + contractAuditEntity.setDataSourceCode(requestJson.getString("sourceCode")); + //contractAuditEntity.setField0168("PS202503270198"); + List contractAuditList = contractAuditService.queryOverdueList(contractAuditEntity); + if (CollectionUtils.isNotEmpty(contractAuditList)){ + String token = getToken(); + for (ContractAuditEntity auditEntity : contractAuditList) { + //2、更新流程状态为终止状态 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("affairId",auditEntity.getAffairId());//待办id + jsonObject.put("member",auditEntity.getLogin_name());//当前待办登录名 + //jsonObject.put("affairId","9022465059383233743");//待办id + //jsonObject.put("member","yonyou");//当前待办登录名 + String reqParams = jsonObject.toString(); + logger.info("合同评审流程终止接口请求参数:{}",reqParams); + //调用wms接口 + Map headerMap = MapBuilder.create(true) + .put("apiCode", "8000590002") + .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") + .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800059") + .put("token",token) + .build(); + String body = HttpRequest.post("http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(reqParams).timeout(60000).execute().body(); + logger.info("合同评审流程终止接口返回参数:{}",body); + } + } + return null; + } + + //获取token + private String getToken(){ + String token = null; + JSONObject tokenObj = new JSONObject(); + tokenObj.put("userName","rest0331"); + tokenObj.put("password","27db12a6-e09d-488f-90fb-143d9f45938d"); + tokenObj.put("loginName","yonyou"); + String tokenReqParams = tokenObj.toString(); + Map tokenHeaderMap = MapBuilder.create(true) + .put("apiCode", "8000590001") + .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") + .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") + .put("appId","800059") + .build(); + String tokenBody = HttpRequest.post("http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(tokenHeaderMap).body(tokenReqParams).timeout(60000).execute().body(); + if (StrUtil.isNotEmpty(tokenBody)){ + JsonResultEntity jsonResultEntity = JSONObject.parseObject(tokenBody, JsonResultEntity.class); + JSONObject jsonObject = (JSONObject) jsonResultEntity.getAttribute(); + token = jsonObject.getString("id"); + } + return token; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/IContractAuditService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/IContractAuditService.java new file mode 100644 index 00000000..8d216ac0 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/IContractAuditService.java @@ -0,0 +1,22 @@ +package com.hzya.frame.plugin.contract.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.contract.entity.ContractAuditEntity; + +import java.util.List; + +/** + * @Description 合同评审 + * @Author xiangerlin + * @Date 2025/3/31 11:15 + **/ +public interface IContractAuditService extends IBaseService { + + /** + * 查询超过60天还没审批的逾期合同 + * @param entity + * @return + * @throws Exception + */ + List queryOverdueList(ContractAuditEntity entity)throws Exception; +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/impl/ContractAuditServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/impl/ContractAuditServiceImpl.java new file mode 100644 index 00000000..5d953f29 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/contract/service/impl/ContractAuditServiceImpl.java @@ -0,0 +1,46 @@ +package com.hzya.frame.plugin.contract.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.contract.dao.IContractAuditDao; +import com.hzya.frame.plugin.contract.entity.ContractAuditEntity; +import com.hzya.frame.plugin.contract.service.IContractAuditService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description 合同评审 + * @Author xiangerlin + * @Date 2025/3/31 11:16 + **/ +@Service() +public class ContractAuditServiceImpl extends BaseService implements IContractAuditService { + + Logger logger = LogManager.getLogger(getClass()); + + private IContractAuditDao contractAuditDao; + + @Autowired + public void setContractAuditDao(IContractAuditDao dao) { + this.contractAuditDao = dao; + this.dao = dao; + } + + /** + * 查询超过60天还没审批的逾期合同 + * + * @param entity + * @return + * @throws Exception + */ + @DS("#entity.dataSourceCode") + @Override + public List queryOverdueList(ContractAuditEntity entity) throws Exception { + List query = contractAuditDao.query(entity); + return query; + } +} 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 new file mode 100644 index 00000000..14fc3fe7 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/InvoiceDistributePluginInitializer.java @@ -0,0 +1,1550 @@ +package com.hzya.frame.plugin.ht.plugin; + +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpRequest; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.mdm.mdmModule.dao.IMdmModuleDao; +import com.hzya.frame.mdm.mdmModule.entity.MdmModuleEntity; +import com.hzya.frame.mdm.mdmModuleDb.entity.MdmModuleDbEntity; +import com.hzya.frame.mdm.mdmModuleDbFileds.entity.MdmModuleDbFiledsEntity; +import com.hzya.frame.mdm.mdmModuleDbFiledsRule.dao.IMdmModuleDbFiledsRuleDao; +import com.hzya.frame.mdm.mdmModuleDbFiledsRule.entity.MdmModuleDbFiledsRuleEntity; +import com.hzya.frame.mdm.mdmModuleDistribute.dao.IMdmModuleDistributeDao; +import com.hzya.frame.mdm.mdmModuleDistribute.entity.MdmModuleDistributeEntity; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.dao.IMdmModuleDistributeDetailDao; +import com.hzya.frame.mdm.mdmModuleDistributeDetail.entity.MdmModuleDistributeDetailEntity; +import com.hzya.frame.mdm.mdmModuleDistributeTripartite.dao.IMdmModuleDistributeTripartiteDao; +import com.hzya.frame.mdm.mdmModuleDistributeTripartite.entity.MdmModuleDistributeTripartiteEntity; +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.sys.sysenum.SysEnum; +import com.hzya.frame.sysnew.application.api.dao.ISysApplicationApiDao; +import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; +import com.hzya.frame.sysnew.application.dao.ISysApplicationDao; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.application.script.dao.ISysApplicationScriptDao; +import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntity; +import com.hzya.frame.sysnew.grovy.service.IGroovyIntegrationService; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.http.HttpEntity; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.impl.client.CloseableHttpClient; +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.Value; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.*; + +public class InvoiceDistributePluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + + @Resource + private IMdmModuleDistributeDetailDao mdmModuleDistributeDetailDao; + @Resource + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Resource + private ISysApplicationApiDao sysApplicationApiDao; + @Resource + private ISysApplicationDao sysApplicationDao; + @Resource + private ISysApplicationScriptDao sysApplicationScriptDao; + @Resource + private IMdmModuleDistributeDao mdmModuleDistributeDao; + @Resource + private IGroovyIntegrationService groovyIntegrationService; + @Resource + private IMdmModuleDbFiledsRuleDao mdmModuleDbFiledsRuleDao; + @Resource + private IMdmModuleDao mdmModuleDao; + @Resource + private IMdmServiceCache mdmServiceCache; + @Resource + private IMdmModuleSendLogDao mdmModuleSendLogDao; + @Resource + private IMdmModuleDistributeTripartiteDao mdmModuleDistributeTripartiteDao; + @Value("${zt.url}") + private String url ; + + private final Object lock = new Object(); + + /*** + * 插件初始化方法 + * @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 "InvoiceDistributePluginInitializer"; + } + + /**** + * 插件的名称 + * @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 { + try{ + //重试方法 + if (null != requestJson) { + //如果这个id不为空,说明是重试的 + String id = requestJson.getString("integration_task_living_details_id"); + //执行重新发送 + if (StrUtil.isNotEmpty(id)) { + //查询日志表 + IntegrationTaskLivingDetailsEntity taskDetailEntity = taskLivingDetailsService.get(id); + if (null != taskDetailEntity && JSONUtil.isTypeJSON(taskDetailEntity.getRootAppPk())){ + //拿到这张表的源系统ID + JSONObject jsonObject = JSONObject.parseObject(taskDetailEntity.getRootAppPk()); + Long mdmCode = jsonObject.getLong("mdmCode");//主数据编码 + String documentRule = jsonObject.getString("documentRule");//行数据的单据规则编码 + String distributeId = jsonObject.getString("distributeId");//发送表id + String type = jsonObject.getString("type");//发送类型,1、新增2、修改3、删除 + if(mdmCode == null || documentRule == null || distributeId == null || type == null + || "".equals(mdmCode) || "".equals(documentRule) || "".equals(distributeId) || "".equals(type)){ + taskDetailEntity.setResult("系统保存参数错误"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("系统保存参数错误"); + } + String apiId = null; + String scriptId = null; + //查找对应数据,组装数据发送 + + //获取主数据信息 + MdmModuleEntity mdmModuleEntity = mdmServiceCache.getMdmModuleEntity(mdmCode); + if(mdmModuleEntity == null || mdmModuleEntity.getId() == null ){ + taskDetailEntity.setResult("主数据不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("主数据不存在"); + + } + + //获取主数据db + MdmModuleDbEntity mdmModuleDbEntity = new MdmModuleDbEntity(); + mdmModuleDbEntity.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(mdmModuleDbEntity); + if(mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0){ + taskDetailEntity.setResult("主数据数据源不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("主数据数据源不存在"); + + } + + //获取分发表 + //获取分发的接口 + MdmModuleDistributeEntity mdmModuleDistributeEntity = mdmModuleDistributeDao.get(distributeId); + if(mdmModuleDistributeEntity == null || mdmModuleDistributeEntity.getId() == null ){ + taskDetailEntity.setResult("分发不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("分发不存在"); + + } + // 启用停用 0、停用 + if("0".equals(mdmModuleDistributeEntity.getEnabledState())){ + taskDetailEntity.setResult("分发已停用"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("分发已停用"); + + } + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(distributeId); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + + // 启用停用 0、停用 + //if("1".equals(mdmModuleDistributeEntity.getEnabledType())){ + // taskDetailEntity.setResult("分发为手动下发"); + // taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + // return BaseResult.getFailureMessageEntity("分发为手动下发"); + //} + //1、新增2、修改3、删除 + if("1".equals(type)){ + apiId = mdmModuleDistributeEntity.getAddApi(); + scriptId = mdmModuleDistributeEntity.getAddScript(); + }else if("2".equals(type)){ + apiId = mdmModuleDistributeEntity.getUpdateApi(); + scriptId = mdmModuleDistributeEntity.getUpdateScript(); + + }else if("3".equals(type)){ + apiId = mdmModuleDistributeEntity.getDeleteApi(); + scriptId = mdmModuleDistributeEntity.getDeleteScript(); + } + if(apiId == null || "".equals(apiId)){ + taskDetailEntity.setResult("分发接口未选择,请先选择"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("分发接口未选择,请先选择"); + + } + SysApplicationScriptEntity scriptEntity = null; + if(scriptId != null && !"".equals(scriptId)){ + scriptEntity = sysApplicationScriptDao.get(scriptId); + if(scriptEntity == null || scriptEntity.getId() == null ){ + taskDetailEntity.setResult("分发接口脚本不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("分发接口脚本不存在"); + } + } + SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(apiId); + if(apiEntity == null || apiEntity.getId() == null ){ + taskDetailEntity.setResult("分发接口不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("分发接口不存在"); + + } + SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); + if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ + taskDetailEntity.setResult("应用不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("应用不存在"); + } + + //获取主数据db字段,以及字段的规则 + MdmModuleDbFiledsEntity queryFild = new MdmModuleDbFiledsEntity(); + queryFild.setMdmId(mdmModuleEntity.getId()); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryFild); + MdmModuleDbFiledsRuleEntity queryFildRule = new MdmModuleDbFiledsRuleEntity(); + queryFildRule.setMdmId(mdmModuleEntity.getId()); + queryFildRule.setRuleCode("service"); + List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule); + + //获取主数据db对应的实体表的数据 + JSONObject object = new JSONObject(); + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("1".equals(mdmModuleDbEntities.get(i).getDbType())){ + Map map = new HashMap<>(); + map.put("tableName",mdmModuleDbEntities.get(i).getDbName()); + map.put("documentRule",documentRule); + object = mdmModuleDao.queryMdmST(map); + object = toLowerCaseKeys(object); + if(object.getString("id") == null || "".equals(object.getString("id")) ){ + taskDetailEntity.setResult("当前数据不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("当前数据不存在"); + } + if(mdmModuleDistributeDetailEntities != null && mdmModuleDistributeDetailEntities.size() > 0){ + Map checkData = new HashMap<>(); + checkData.put("tableName",mdmModuleDbEntities.get(i).getDbName()); + checkData.put("documentRule",documentRule); + checkData.put("mdmModuleDistributeDetailEntities",mdmModuleDistributeDetailEntities); + JSONObject object1 = mdmModuleDao.queryMdmST(checkData); + object1 = toLowerCaseKeys(object1); + + if(object1.getString("id") == null || "".equals(object1.getString("id")) ){ + taskDetailEntity.setResult("当前数据不符合规则不发送"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("当前数据不符合规则不发送"); + } + } + //查看主表是否有字段是关联的 + if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ + for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())){ + if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ + for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){ + if(object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){ + Map mapDetail = new HashMap<>(); + mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); + String ids = object.getString(mdmModuleDbFiledsEntities.get(i2).getEnName()); + String[] idss = ids.split(","); + mapDetail.put("id", idss[idss.length-1]); + JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + objectDetail = toLowerCaseKeys(objectDetail); + object.put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail); + } + } + } + } + } + } + } + } + } + + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("2".equals(mdmModuleDbEntities.get(i).getDbType())){ + Map map = new HashMap<>(); + map.put("tableName",mdmModuleDbEntities.get(i).getDbName()); + map.put("formmainId",object.getString("id")); + List detail = mdmModuleDao.queryMdmSTDetail(map); + detail = toLowerCaseKeys(detail); + + //查看主表是否有字段是关联的 + if(detail != null && detail.size() > 0){ + if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ + for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())){ + if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ + for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){ + for (int i3 = 0; i3 < detail.size(); i3++) { + if(detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){ + Map mapDetail = new HashMap<>(); + mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); + String ids = detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()); + String[] idss = ids.split(","); + mapDetail.put("id", idss[idss.length-1]); + + JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + objectDetail = toLowerCaseKeys(objectDetail); + + detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail); + } + + } + } + } + } + } + } + } + } + object.put(mdmModuleDbEntities.get(i).getDbName(),detail); + } + } + //执行脚本 + JSONObject groovy = new JSONObject(); + JSONObject parameterJson = new JSONObject(); + parameterJson.put("header",apiEntity.getHeaderIn()); + parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("query",apiEntity.getQueryIn()); + parameterJson.put("data",object); + + if (!"1".equals(type)) {//删除或者修改情况,查询三方id,有就设置,没有就设置空 + //1、根据主数据id、数据id、应用ID默认查询主数据应用下发三方id表,只查询最新的一条数据 + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity.setSts("Y"); + mdmModuleDistributeTripartiteEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDistributeTripartiteEntity.setDataId(object.getString("id")); + mdmModuleDistributeTripartiteEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity = mdmModuleDistributeTripartiteDao.queryOneTripartite(mdmModuleDistributeTripartiteEntity); + String tripartiteId = ""; + if(mdmModuleDistributeTripartiteEntity != null && mdmModuleDistributeTripartiteEntity.getTripartiteId() != null ){ + tripartiteId = mdmModuleDistributeTripartiteEntity.getTripartiteId(); + } + parameterJson.put("tripartiteId", tripartiteId); + } + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = object.toJSONString(); + if(scriptEntity != null && scriptEntity.getId() != null ){ + groovy.put("code",scriptEntity.getScriptCode()); + groovy.put("className",scriptEntity.getClassName()); + groovy.put("name",scriptEntity.getScriptName()); + groovy.put("methodStr",scriptEntity.getScriptData()); + groovy.put("parameterJson",parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr",groovy); + try { + Object str = groovyIntegrationService.groovyScriptExecution(groovyStr); + JSONObject jsonResultEntity = JSONObject.parseObject(str.toString()); + header = (Map) jsonResultEntity.get("header"); + querys = jsonResultEntity.getString("querys"); + bodys = jsonResultEntity.getString("bodys"); + }catch (Exception e){ + taskDetailEntity.setResult("分发脚本转换错误"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("分发脚本转换错误"); + } + } + Map headers = new HashMap<>(); + headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headers.put("appId",sysApplicationEntity.getAppId().toString()); + headers.put("apiCode",apiEntity.getApiCode().toString()); + if(header != null){ + headers.putAll(header); + } + if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) { + //找到登陆接口 + SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); + if (null == loginApi) { + taskDetailEntity.setResult("发送错误,认证接口不存在"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("发送错误,认证接口不存在"); + } + String rzquerys = getQuery(loginApi,null,null); + Map headersa = new HashMap<>(); + headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headersa.put("appId", sysApplicationEntity.getAppId().toString()); + headersa.put("apiCode", loginApi.getApiCode().toString()); + Map rzheaders = getHeaders(loginApi,headersa,null); + String rzbodys = getBodys(loginApi,null,null); + JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); + if (!rzjsonResultEntity.isFlag()) { + taskDetailEntity.setResult("发送错误,认证接口错误"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("发送错误:"+rzjsonResultEntity.getMsg()); + } + JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + logger.info("认证接口返回信息:"+ attritube.toJSONString()); + querys = getQuery(apiEntity,querys,attritube); + headers = getHeaders(apiEntity,headers,attritube); + + bodys = getBodys(apiEntity,bodys,attritube); + } + //组装数据发送 + JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + if(jsonResultEntity.isFlag()){ + if ("1".equals(type)) {//保存三方返回id + if (scriptEntity != null && scriptEntity.getId() != null && scriptEntity.getBackScriptData() != null ) { + JSONObject backScriptJson = new JSONObject(); + backScriptJson.put("data", jsonResultEntity.getAttribute()); + groovy.put("code", scriptEntity.getScriptCode()+"back"); + groovy.put("className", scriptEntity.getClassName()+"back"); + groovy.put("name", scriptEntity.getScriptName()+"back"); + groovy.put("methodStr", scriptEntity.getBackScriptData()); + groovy.put("parameterJson", backScriptJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr", groovy); + try { + Object str = groovyIntegrationService.groovyScriptExecution(groovyStr); + if(str != null){ + JSONObject backJsonResultEntity = JSONObject.parseObject(str.toString()); + if(backJsonResultEntity != null && backJsonResultEntity.getString("success") != null && "true".equals(backJsonResultEntity.getString("success"))){ + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity.setCreate(); + mdmModuleDistributeTripartiteEntity.setMdmId(mdmModuleEntity.getId()); + mdmModuleDistributeTripartiteEntity.setDataId(object.getString("id")); + mdmModuleDistributeTripartiteEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity.setTripartiteId(backJsonResultEntity.getString("tripartiteId")); + mdmModuleDistributeTripartiteDao.save(mdmModuleDistributeTripartiteEntity); + } + } + } catch (Exception e) { + logger.info("执行异常错误原因:"+e); + logger.error("新增返回脚本解析保存三方id错误"+jsonResultEntity.getAttribute()); + taskDetailEntity.setResult("新增返回脚本解析保存三方id错误"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("发送错误"); + } + } + } + taskDetailEntity.setResult("发送成功"); + taskLivingDetailsService.saveLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("发送成功"); + }else { + taskDetailEntity.setResult("发送错误"); + taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity); + return BaseResult.getFailureMessageEntity("发送错误"); + } + } + }else {//执行正常下发 + logger.info("==========开始执行正常蓝字发票申请单申请数据下发============="); + //查询主数据 + MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity(); + queryMdmModuleEntity.setSts("Y"); + queryMdmModuleEntity.setMdmCode(Long.valueOf("10049")); + List mdmModuleEntities = mdmModuleDao.queryBase(queryMdmModuleEntity); + if(mdmModuleEntities == null || mdmModuleEntities.size() == 0){ + return BaseResult.getSuccessMessageEntity("蓝字发票申请单申请数据未设置,不需要下发"); + } + //查询下发的配置 没有直接跳过 + for (int i = 0; i < mdmModuleEntities.size(); i++) { + Long mdmCode = mdmModuleEntities.get(i).getMdmCode(); + MdmModuleDistributeEntity queryMdmModuleDistributeEntity = new MdmModuleDistributeEntity(); + queryMdmModuleDistributeEntity.setMdmId(mdmModuleEntities.get(i).getId()); + queryMdmModuleDistributeEntity.setEnabledType("1"); + queryMdmModuleDistributeEntity.setEnabledState("1"); + List mdmModuleDistributeEntities = mdmModuleDistributeDao.queryBase(queryMdmModuleDistributeEntity); + if(mdmModuleDistributeEntities == null || mdmModuleDistributeEntities.size() == 0){ + continue; + } + //查询主数据db + MdmModuleDbEntity queryMdmModuleDbEntity = new MdmModuleDbEntity(); + queryMdmModuleDbEntity.setMdmId(mdmModuleEntities.get(i).getId()); + List mdmModuleDbEntities = mdmServiceCache.queryMdmModuleDb(queryMdmModuleDbEntity); + if(mdmModuleDbEntities == null || mdmModuleDbEntities.size() == 0){ + continue; + } + //查询主数据字段 + MdmModuleDbFiledsEntity queryFild = new MdmModuleDbFiledsEntity(); + queryFild.setMdmId(mdmModuleEntities.get(i).getId()); + List mdmModuleDbFiledsEntities = mdmServiceCache.queryMdmModuleDbFileds(queryFild); + if(mdmModuleDbFiledsEntities == null || mdmModuleDbFiledsEntities.size() == 0){ + continue; + } + //字段的规则 + MdmModuleDbFiledsRuleEntity queryFildRule = new MdmModuleDbFiledsRuleEntity(); + queryFildRule.setMdmId(mdmModuleEntities.get(i).getId()); + queryFildRule.setRuleCode("service"); + List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule); + //新增 + doAdd(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + //修改 + doUpdate(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + //删除 + doDelete(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + } + + } + } + logger.info("执行成功"); + return BaseResult.getSuccessMessageEntity("执行成功"); + } catch (Exception e) { + logger.error("执行失败{}",e.getMessage()); + } + return BaseResult.getSuccessMessageEntity("执行成功"); + } + + private void doDelete(String mdmId,Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities, List mdmModuleDbFiledsRuleEntities, List mdmModuleDbFiledsEntities) throws Exception { + //查询一千条数据 + String mainDb = null; + List objects = new ArrayList<>(); + for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) { + if("1".equals(mdmModuleDbEntities.get(i2).getDbType())) { + mainDb = mdmModuleDbEntities.get(i2).getDbName(); + } + } + if(mainDb == null){ + return; + } + Map map1 = new HashMap<>(); + map1.put("tableName",mainDb); + map1.put("dataStatus", "N"); + map1.put("deleteStatus", "0"); + map1.put("size", 50); + objects = mdmModuleDao.queryMdmSTs(map1); + objects = toLowerCaseKeys(objects); + + if(objects == null || objects.size() == 0){ + return; + } + for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) { + //查询下发的配置 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + //查询这一千条数据是否符合规则 + Map map = new HashMap<>(); + map.put("tableName", mainDb); + map.put("dataStatus", "N"); + map.put("deleteStatus", "0"); + map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); + map.put("ids", objects); + List doObjects = mdmModuleDao.queryMdmSTs(map); + doObjects = toLowerCaseKeys(doObjects); + + if(doObjects == null || doObjects.size() == 0){ + continue; + } + if(mdmModuleDistributeEntities.get(i1).getDeleteApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getDeleteApi())){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","删除接口未设置",mainDb,objects.get(i).getString("id"),null,null,null,null,doObjects.get(i).toJSONString(),"3"); + } + return ; + } + SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getDeleteApi()); + if(apiEntity == null || apiEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","删除接口未找到",mainDb,objects.get(i).getString("id"),null,null,null,null,doObjects.get(i).toJSONString(),"3"); + } + return ; + } + SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); + if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","删除接口的应用未找到",mainDb,objects.get(i).getString("id"),null,null,apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3"); + } + return ; + } + + SysApplicationScriptEntity scriptEntity = null; + if(mdmModuleDistributeEntities.get(i1).getDeleteScript() != null && !"".equals(mdmModuleDistributeEntities.get(i1).getDeleteScript())){ + scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getDeleteScript()); + if(scriptEntity == null || scriptEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","删除接口脚本未找到",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3"); + } + return ; + } + } + + for (int i = 0; i < doObjects.size(); i++) { + //查询发送日志是否已经有这条数据 + MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity(); + mdmModuleSendLogEntity.setTableName(mainDb+"_send_log"); + mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id")); + mdmModuleSendLogEntity.setSts("Y"); + mdmModuleSendLogEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleSendLogEntity.setApiId(apiEntity.getId()); + //mdmModuleSendLogEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleSendLogEntity.setOptionType("3"); + Integer num = mdmModuleSendLogDao.getCount(mdmModuleSendLogEntity); + if(num > 0){//已经过不发送 + continue; + } + getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + + //执行脚本 + JSONObject groovy = new JSONObject(); + JSONObject parameterJson = new JSONObject(); + parameterJson.put("header",apiEntity.getHeaderIn()); + parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("query",apiEntity.getQueryIn()); + parameterJson.put("data",doObjects.get(i)); + + //1、根据主数据id、数据id、应用ID默认查询主数据应用下发三方id表,只查询最新的一条数据 + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity.setSts("Y"); + mdmModuleDistributeTripartiteEntity.setMdmId(mdmId); + mdmModuleDistributeTripartiteEntity.setDataId(objects.get(i).getString("id")); + mdmModuleDistributeTripartiteEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity = mdmModuleDistributeTripartiteDao.queryOneTripartite(mdmModuleDistributeTripartiteEntity); + String tripartiteId = ""; + if(mdmModuleDistributeTripartiteEntity != null && mdmModuleDistributeTripartiteEntity.getTripartiteId() != null ){ + tripartiteId = mdmModuleDistributeTripartiteEntity.getTripartiteId(); + } + parameterJson.put("tripartiteId", tripartiteId); + + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = doObjects.get(i).toJSONString(); + if(scriptEntity != null && scriptEntity.getId() != null ){ + groovy.put("code",scriptEntity.getScriptCode()); + groovy.put("className",scriptEntity.getClassName()); + groovy.put("name",scriptEntity.getScriptName()); + groovy.put("methodStr",scriptEntity.getScriptData()); + groovy.put("parameterJson",parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr",groovy); + try { + Object str = groovyIntegrationService.groovyScriptExecution(groovyStr); + JSONObject jsonResultEntity = JSONObject.parseObject(str.toString()); + header = (Map) jsonResultEntity.get("header"); + querys = jsonResultEntity.getString("querys"); + bodys = jsonResultEntity.getString("bodys"); + }catch (Exception e){ + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3"); + continue; + } + } + Map headers = new HashMap<>(); + headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headers.put("appId",sysApplicationEntity.getAppId().toString()); + headers.put("apiCode",apiEntity.getApiCode().toString()); + if(header != null){ + headers.putAll(header); + } + if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) { + //找到登陆接口 + SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); + if (null == loginApi) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + String rzquerys = getQuery(loginApi,null,null); + Map headersa = new HashMap<>(); + headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headersa.put("appId", sysApplicationEntity.getAppId().toString()); + headersa.put("apiCode", loginApi.getApiCode().toString()); + Map rzheaders = getHeaders(loginApi,headersa,null); + String rzbodys = getBodys(loginApi,null,null); + JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); + if (!rzjsonResultEntity.isFlag()) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + querys = getQuery(apiEntity,querys,attritube); + headers = getHeaders(apiEntity,headers,attritube); + bodys = getBodys(apiEntity,bodys,attritube); + } + //组装数据发送 + JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + if(jsonResultEntity.isFlag()){ + //保存日志 + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3"); + continue; + }else { + //保存日志 + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"3"); + continue; + } + } + + } + + //所有下发发送完成,修改数据状态 + for (int i = 0; i < objects.size(); i++) { + Map updateMap = new HashMap<>(); + updateMap.put("tableName",mainDb); + updateMap.put("dataStatus", "N"); + updateMap.put("deleteStatus", "1"); + updateMap.put("id", objects.get(i).getString("id")); + mdmModuleDao.updateMdmSTs(updateMap); + } + } + + private void doUpdate(String mdmId,Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities, List mdmModuleDbFiledsRuleEntities, List mdmModuleDbFiledsEntities) throws Exception { + //查询一千条数据 + String mainDb = null; + List objects = new ArrayList<>(); + for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) { + if("1".equals(mdmModuleDbEntities.get(i2).getDbType())) { + mainDb = mdmModuleDbEntities.get(i2).getDbName(); + } + } + if(mainDb == null){ + return; + } + Map map1 = new HashMap<>(); + map1.put("tableName",mainDb); + //map1.put("dataStatus", "F"); + map1.put("updateStatus", "0"); + map1.put("size", 50); + objects = mdmModuleDao.queryMdmSTs(map1); + objects = toLowerCaseKeys(objects); + + if(objects == null || objects.size() == 0){ + return; + } + for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) { + //查询下发的配置 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + //查询这一千条数据是否符合规则 + Map map = new HashMap<>(); + map.put("tableName", mainDb); + //map.put("dataStatus", "F"); + map.put("updateStatus", "0"); + map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); + map.put("ids", objects); + List doObjects = mdmModuleDao.queryMdmSTs(map); + doObjects = toLowerCaseKeys(doObjects); + + if(doObjects == null || doObjects.size() == 0){ + continue; + } + if(mdmModuleDistributeEntities.get(i1).getUpdateApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getUpdateApi())){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","修改接口未设置",mainDb,objects.get(i).getString("id"),null,null,null,null,doObjects.get(i).toJSONString(),"2"); + } + return ; + } + SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getUpdateApi()); + if(apiEntity == null || apiEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","修改接口未查找到",mainDb,objects.get(i).getString("id"),null,null,null,null,doObjects.get(i).toJSONString(),"2"); + } + return ; + } + SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); + if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","应用未查找到",mainDb,objects.get(i).getString("id"),null,null,apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); + } + return ; + } + + SysApplicationScriptEntity scriptEntity = null; + if(mdmModuleDistributeEntities.get(i1).getUpdateScript() != null && !"".equals(mdmModuleDistributeEntities.get(i1).getUpdateScript())){ + scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getUpdateScript()); + if(scriptEntity == null || scriptEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本未查找到",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); + } + return ; + } + } + + for (int i = 0; i < doObjects.size(); i++) { + + getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + + //执行脚本 + JSONObject groovy = new JSONObject(); + JSONObject parameterJson = new JSONObject(); + parameterJson.put("header",apiEntity.getHeaderIn()); + parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("query",apiEntity.getQueryIn()); + parameterJson.put("data",doObjects.get(i)); + //1、根据主数据id、数据id、应用ID默认查询主数据应用下发三方id表,只查询最新的一条数据 + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity.setSts("Y"); + mdmModuleDistributeTripartiteEntity.setMdmId(mdmId); + mdmModuleDistributeTripartiteEntity.setDataId(objects.get(i).getString("id")); + mdmModuleDistributeTripartiteEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity = mdmModuleDistributeTripartiteDao.queryOneTripartite(mdmModuleDistributeTripartiteEntity); + String tripartiteId = ""; + if(mdmModuleDistributeTripartiteEntity != null && mdmModuleDistributeTripartiteEntity.getTripartiteId() != null ){ + tripartiteId = mdmModuleDistributeTripartiteEntity.getTripartiteId(); + } + parameterJson.put("tripartiteId", tripartiteId); + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = doObjects.get(i).toJSONString(); + if(scriptEntity != null && scriptEntity.getId() != null ){ + logger.info("=========开始执行正常开票申请单申请数据修改下发脚本,第一次=============="); + groovy.put("code",scriptEntity.getScriptCode()); + groovy.put("className",scriptEntity.getClassName()); + groovy.put("name",scriptEntity.getScriptName()); + groovy.put("methodStr",scriptEntity.getScriptData()); + groovy.put("parameterJson",parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr",groovy); + try { + Object str = groovyIntegrationService.groovyScriptExecution(groovyStr); + JSONObject jsonResultEntity = JSONObject.parseObject(str.toString()); + header = (Map) jsonResultEntity.get("header"); + querys = jsonResultEntity.getString("querys"); + bodys = jsonResultEntity.getString("bodys"); + }catch (Exception e){ + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); + continue; + } + } + Map headers = new HashMap<>(); + headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headers.put("appId",sysApplicationEntity.getAppId().toString()); + headers.put("apiCode",apiEntity.getApiCode().toString()); + if(header != null){ + headers.putAll(header); + } + if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) { + logger.info("=========正常开票申请单申请数据修改开始执行登录接口=============="); + //找到登陆接口 + SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); + if (null == loginApi) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + String rzquerys = getQuery(loginApi,null,null); + Map headersa = new HashMap<>(); + headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headersa.put("appId", sysApplicationEntity.getAppId().toString()); + headersa.put("apiCode", loginApi.getApiCode().toString()); + Map rzheaders = getHeaders(loginApi,headersa,null); + String rzbodys = getBodys(loginApi,null,null); + JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); + if (!rzjsonResultEntity.isFlag()) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + logger.info("=======开票申请单申请数据正常修改下发登录返回数据:{}========",attritube.toJSONString()); + querys = getQuery(apiEntity,querys,attritube); + headers = getHeaders(apiEntity,headers,attritube); + bodys = getBodys(apiEntity,bodys,attritube); + } + //组装数据发送 + logger.info("=========开始执行开票申请单申请业务修改数据下发脚本,第二次=============="); + JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + logger.info("=====开票申请单申请数据修改下发返回结果为:{}",JSONObject.parseObject(jsonResultEntity.getAttribute().toString()).toJSONString()); + if(jsonResultEntity.isFlag()){ + //保存日志 + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); + continue; + }else { + //保存日志 + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); + continue; + } + } + } + + //所有下发发送完成,修改数据状态 + for (int i = 0; i < objects.size(); i++) { + Map updateMap = new HashMap<>(); + updateMap.put("tableName",mainDb); + //updateMap.put("dataStatus", "F"); + updateMap.put("updateStatus", "1"); + updateMap.put("id", objects.get(i).getString("id")); + mdmModuleDao.updateMdmSTs(updateMap); + } + } + + private void doAdd(String mdmId,Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities,List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities ) throws Exception { + //查询一千条数据 + String mainDb = null; + List objects = new ArrayList<>(); + for (int i2 = 0; i2 < mdmModuleDbEntities.size(); i2++) { + if("1".equals(mdmModuleDbEntities.get(i2).getDbType())) { + mainDb = mdmModuleDbEntities.get(i2).getDbName(); + } + } + if(mainDb == null){ + return; + } + Map map1 = new HashMap<>(); + map1.put("tableName",mainDb); + //map1.put("dataStatus", "Y"); + map1.put("addStatus", "0"); + objects = mdmModuleDao.queryMdmSTs(map1); + objects = toLowerCaseKeys(objects); + + if(objects == null || objects.size() == 0){ + return; + } + for (int i1 = 0; i1 < mdmModuleDistributeEntities.size(); i1++) { + //查询下发的配置 + MdmModuleDistributeDetailEntity mdmModuleDistributeDetailEntity = new MdmModuleDistributeDetailEntity() ; + mdmModuleDistributeDetailEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleDistributeDetailEntity.setSts("Y"); + List mdmModuleDistributeDetailEntities = mdmModuleDistributeDetailDao.queryBase(mdmModuleDistributeDetailEntity); + //查询这一千条数据是否符合规则 + Map map = new HashMap<>(); + map.put("tableName", mainDb); + //map.put("dataStatus", "Y"); + map.put("addStatus", "0"); + map.put("mdmModuleDistributeDetailEntities", mdmModuleDistributeDetailEntities); + map.put("ids", objects); + List doObjects = mdmModuleDao.queryMdmSTs(map); + doObjects = toLowerCaseKeys(doObjects); + + if(doObjects == null || doObjects.size() == 0){ + continue; + } + if(mdmModuleDistributeEntities.get(i1).getAddApi() == null || "".equals(mdmModuleDistributeEntities.get(i1).getAddApi())){ + for (int i = 0; i < doObjects.size(); i++) { + //taskLivingDetailsService.saveLogToSuccess(); + saveMdmModuleSendLogEntity( mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","新增接口未设置",mainDb,objects.get(i).getString("id"),null,null,null,null,doObjects.get(i).toJSONString(),"1"); + } + return ; + } + SysApplicationApiEntity apiEntity = sysApplicationApiDao.get(mdmModuleDistributeEntities.get(i1).getAddApi()); + if(apiEntity == null || apiEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","新增接口未查找到",mainDb,objects.get(i).getString("id"),null,null,null,null,doObjects.get(i).toJSONString(),"1"); + } + return ; + } + SysApplicationEntity sysApplicationEntity = sysApplicationDao.get(apiEntity.getAppId()); + if(sysApplicationEntity == null || sysApplicationEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","应用未查找到",mainDb,objects.get(i).getString("id"),null,null,apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + } + return ; + } + + SysApplicationScriptEntity scriptEntity = null; + if(mdmModuleDistributeEntities.get(i1).getAddScript() != null && !"".equals(mdmModuleDistributeEntities.get(i1).getAddScript())){ + scriptEntity = sysApplicationScriptDao.get(mdmModuleDistributeEntities.get(i1).getAddScript()); + if(scriptEntity == null || scriptEntity.getId() == null ){ + for (int i = 0; i < doObjects.size(); i++) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本未查找到",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + } + return ; + } + } + + for (int i = 0; i < doObjects.size(); i++) { + //查询是否已经手动发送过。只有新增校验,查询发送日志是否已经有这条数据 + MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity(); + mdmModuleSendLogEntity.setTableName(mainDb+"_send_log"); + mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id")); + mdmModuleSendLogEntity.setSts("Y"); + mdmModuleSendLogEntity.setDataType("1"); + mdmModuleSendLogEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleSendLogEntity.setApiId(apiEntity.getId()); + //mdmModuleSendLogEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId()); + mdmModuleSendLogEntity.setOptionType("1"); + Integer num = mdmModuleSendLogDao.getCount(mdmModuleSendLogEntity); + if(num > 0){//已经新增过不发送 + continue; + } + getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + + //执行脚本 + JSONObject groovy = new JSONObject(); + JSONObject parameterJson = new JSONObject(); + parameterJson.put("header",apiEntity.getHeaderIn()); + parameterJson.put("body",apiEntity.getBodyIn()); + parameterJson.put("query",apiEntity.getQueryIn()); + parameterJson.put("data",doObjects.get(i)); + //1、根据主数据id、数据id、应用ID默认查询主数据应用下发三方id表,只查询最新的一条数据 + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity1 = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity1.setSts("Y"); + mdmModuleDistributeTripartiteEntity1.setMdmId(mdmId); + mdmModuleDistributeTripartiteEntity1.setDataId(objects.get(i).getString("id")); + mdmModuleDistributeTripartiteEntity1.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity1 = mdmModuleDistributeTripartiteDao.queryOneTripartite(mdmModuleDistributeTripartiteEntity1); + String tripartiteId = ""; + if(mdmModuleDistributeTripartiteEntity1 != null && mdmModuleDistributeTripartiteEntity1.getTripartiteId() != null ){ + tripartiteId = mdmModuleDistributeTripartiteEntity1.getTripartiteId(); + } + parameterJson.put("tripartiteId", tripartiteId); + /** head */ + Map header = null; + /** query */ + String querys = null; + /** body */ + String bodys = doObjects.get(i).toJSONString(); + if(scriptEntity != null && scriptEntity.getId() != null ){ + logger.info("=========开始执行正常开票申请单申请数据新增下发脚本,第一次=============="); + groovy.put("code",scriptEntity.getScriptCode()); + groovy.put("className",scriptEntity.getClassName()); + groovy.put("name",scriptEntity.getScriptName()); + groovy.put("methodStr",scriptEntity.getScriptData()); + groovy.put("parameterJson",parameterJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr",groovy); + try { + Object str = groovyIntegrationService.groovyScriptExecution(groovyStr); + JSONObject jsonResultEntity = JSONObject.parseObject(str.toString()); + header = (Map) jsonResultEntity.get("header"); + querys = jsonResultEntity.getString("querys"); + bodys = jsonResultEntity.getString("bodys"); + }catch (Exception e){ + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","脚本处理失败",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + } + Map headers = new HashMap<>(); + headers.put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headers.put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headers.put("appId",sysApplicationEntity.getAppId().toString()); + headers.put("apiCode",apiEntity.getApiCode().toString()); + if(header != null){ + headers.putAll(header); + } + if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) { + /* logger.info("=========正常开票申请单申请数据新增开始执行登录接口=============="); + //找到登陆接口 + SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); + if (null == loginApi) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口不存在",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + String rzquerys = getQuery(loginApi,null,null); + Map headersa = new HashMap<>(); + headersa.put("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"); + headersa.put("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="); + headersa.put("appId", sysApplicationEntity.getAppId().toString()); + headersa.put("apiCode", loginApi.getApiCode().toString()); + Map rzheaders = getHeaders(loginApi,headersa,null); + String rzbodys = getBodys(loginApi,null,null); + JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); + if (!rzjsonResultEntity.isFlag()) { + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","发送错误,认证接口错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + }*/ + JSONObject jsonObject=new JSONObject(); + jsonObject.put("accessKey","6X3B526P5HqE6ums"); + jsonObject.put("accessSecret","34e5fc32ac894a2ba2ade8c3852c7a0a"); + //获取TOKEN + String tokenResult = HttpRequest.post(url). + header("appId", "800060"). + header("apiCode", "8000600004"). + header("publicKey", "ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj"). + header("secretKey", "fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(jsonObject.toJSONString()). + execute(). + body(); + logger.error("开票申请推送BIPtoken返回结果:"+tokenResult); + JSONObject attritube = JSONObject.parseObject(JSONObject.parseObject(tokenResult).getString("attribute")); + logger.info("=======开票申请单申请数据正常新增下发登录返回数据:{}========",attritube.toJSONString()); + querys = getQuery(apiEntity,querys,attritube); + headers = getHeaders(apiEntity,headers,attritube); + headers.remove(""); + bodys = getBodys(apiEntity,bodys,attritube); + } + + //组装数据发送 + logger.info("=========开始执行开票申请单申请新增数据下发脚本,第二次=============="); + JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + logger.info("=====开票申请单申请数据新增下发返回结果为:{}",JSONObject.parseObject(jsonResultEntity.getAttribute().toString()).toJSONString()); + if(jsonResultEntity.isFlag()){ + if (scriptEntity != null && scriptEntity.getId() != null && scriptEntity.getBackScriptData() != null ) { + logger.info("=========开始执行开票申请单申请数据新增返回脚本=============="); + JSONObject backScriptJson = new JSONObject(); + backScriptJson.put("data", jsonResultEntity.getAttribute()); + groovy.put("code", scriptEntity.getScriptCode()+"back"); + groovy.put("className", scriptEntity.getClassName()+"back"); + groovy.put("name", scriptEntity.getScriptName()+"back"); + groovy.put("methodStr", scriptEntity.getBackScriptData()); + groovy.put("parameterJson", backScriptJson); + JSONObject groovyStr = new JSONObject(); + groovyStr.put("jsonStr", groovy); + try { + Object str = groovyIntegrationService.groovyScriptExecution(groovyStr); + if(str != null){ + JSONObject backJsonResultEntity = JSONObject.parseObject(str.toString()); + if(backJsonResultEntity != null && backJsonResultEntity.getString("success") != null && "true".equals(backJsonResultEntity.getString("success"))){ + MdmModuleDistributeTripartiteEntity mdmModuleDistributeTripartiteEntity = new MdmModuleDistributeTripartiteEntity(); + mdmModuleDistributeTripartiteEntity.setId(UUIDUtils.getUUID()); + mdmModuleDistributeTripartiteEntity.setSts("Y"); + mdmModuleDistributeTripartiteEntity.setCreate_user_id("1"); + mdmModuleDistributeTripartiteEntity.setModify_user_id("1"); + mdmModuleDistributeTripartiteEntity.setCreate_time(new Date()); + mdmModuleDistributeTripartiteEntity.setModify_time(new Date()); + mdmModuleDistributeTripartiteEntity.setOrg_id("0"); + mdmModuleDistributeTripartiteEntity.setCompanyId("0"); + mdmModuleDistributeTripartiteEntity.setMdmId(mdmId); + mdmModuleDistributeTripartiteEntity.setDataId(objects.get(i).getString("id")); + mdmModuleDistributeTripartiteEntity.setAppId(sysApplicationEntity.getId()); + mdmModuleDistributeTripartiteEntity.setTripartiteId(backJsonResultEntity.getString("tripartiteId")); + mdmModuleDistributeTripartiteDao.save(mdmModuleDistributeTripartiteEntity); + } + } + } catch (Exception e) { + logger.error("开票申请单申请下发新增返回脚本解析保存三方id错误"+jsonResultEntity.getAttribute()); + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","新增返回脚本解析保存三方id错误",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + continue; + } + } + //保存日志 + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + objects.get(i).put("sendsanfzt123",true); + logger.info("========开票申请单申请数据新增下发完成,日志保存为成功============"); + continue; + }else { + //保存日志 + saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); + objects.get(i).put("sendsanfzt123",false); + logger.info("========开票申请单申请数据新增下发完成,日志保存为失败============"); + continue; + } + } + } + + //所有下发发送完成,修改数据状态 + for (int i = 0; i < objects.size(); i++) { + if(objects.get(i).getBoolean("sendsanfzt123")){ + Map updateMap = new HashMap<>(); + updateMap.put("tableName",mainDb); + //updateMap.put("dataStatus", "Y"); + updateMap.put("addStatus", "1"); + updateMap.put("id", objects.get(i).getString("id")); + mdmModuleDao.updateMdmSTs(updateMap); + } + } + } + + 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"); + mdmModuleSendLogEntity.setId(UUIDUtils.getUUID()); + mdmModuleSendLogEntity.setSts("Y"); + mdmModuleSendLogEntity.setDistributeId(distributeId); + mdmModuleSendLogEntity.setAppId(appId); + mdmModuleSendLogEntity.setApiId(apiID); + mdmModuleSendLogEntity.setCreate_user_id("1"); + mdmModuleSendLogEntity.setModify_user_id("1"); + mdmModuleSendLogEntity.setCreate_time(new Date()); + mdmModuleSendLogEntity.setModify_time(new Date()); + mdmModuleSendLogEntity.setOrg_id("0"); + mdmModuleSendLogEntity.setCompanyId("0"); + mdmModuleSendLogEntity.setFormmainId(formmain_id); + mdmModuleSendLogEntity.setTargetApp(target_app); + mdmModuleSendLogEntity.setTargetApi(target_api); + mdmModuleSendLogEntity.setSourceData(source_data); + mdmModuleSendLogEntity.setOptionType(option_type); + mdmModuleSendLogEntity.setDataType(dataType); + mdmModuleSendLogEntity.setRemark(remark); + mdmModuleSendLogDao.save(mdmModuleSendLogEntity); + + + JSONObject jsonObject = JSONObject.parseObject(source_data); + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID()); + integrationTaskLivingDetailsEntity.setSts("Y"); + integrationTaskLivingDetailsEntity.setCreate_user_id("1"); + integrationTaskLivingDetailsEntity.setModify_user_id("1"); + integrationTaskLivingDetailsEntity.setCreate_time(new Date()); + integrationTaskLivingDetailsEntity.setModify_time(new Date()); + integrationTaskLivingDetailsEntity.setOrg_id("0"); + integrationTaskLivingDetailsEntity.setCompanyId("0"); + JSONObject aa = new JSONObject(); + aa.put("mdmCode",mdmCode);//主数据编码 + aa.put("documentRule",jsonObject.getString("document_rule"));//行数据的单据规则编码 + aa.put("distributeId",distributeId);//发送表id + aa.put("type",option_type);//发送类型,1、新增2、修改3、删除 + integrationTaskLivingDetailsEntity.setRootAppPk(aa.toJSONString()); + integrationTaskLivingDetailsEntity.setRootAppBill(jsonObject.getString("document_rule")); + integrationTaskLivingDetailsEntity.setPluginId("MdmModulePlugin"); + integrationTaskLivingDetailsEntity.setRootAppNewData(source_data); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(remark); + if("1".equals(dataType)){ + taskLivingDetailsService.saveLogToSuccess(integrationTaskLivingDetailsEntity); + }else { + taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); + + } + + } + + private JSONObject getDetailData(List mdmModuleDbEntities, JSONObject object, List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities) { + + for (int i = 0; i < mdmModuleDbEntities.size(); i++) { + if("2".equals(mdmModuleDbEntities.get(i).getDbType())){ + Map map = new HashMap<>(); + map.put("tableName",mdmModuleDbEntities.get(i).getDbName()); + map.put("formmainId",object.getString("id")); + List detail = mdmModuleDao.queryMdmSTDetail(map); + detail = toLowerCaseKeys(detail); + + //查看主表是否有字段是关联的 + if(detail != null && detail.size() > 0){ + if(mdmModuleDbFiledsRuleEntities != null && mdmModuleDbFiledsRuleEntities.size() > 0){ + for (int i1 = 0; i1 < mdmModuleDbFiledsRuleEntities.size(); i1++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getDbId().equals(mdmModuleDbEntities.get(i).getId())){ + if(mdmModuleDbFiledsEntities != null && mdmModuleDbFiledsEntities.size() > 0){ + for (int i2 = 0; i2 < mdmModuleDbFiledsEntities.size(); i2++) { + if(mdmModuleDbFiledsRuleEntities.get(i1).getFiledId().equals(mdmModuleDbFiledsEntities.get(i2).getId())){ + for (int i3 = 0; i3 < detail.size(); i3++) { + if(detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()) != null){ + Map mapDetail = new HashMap<>(); + mapDetail.put("tableName",mdmModuleDbFiledsRuleEntities.get(i1).getRuleValue()); + String ids = detail.get(i3).getString(mdmModuleDbFiledsEntities.get(i2).getEnName()); + String[] idss = ids.split(","); + mapDetail.put("id", idss[idss.length-1]); + JSONObject objectDetail = mdmModuleDao.queryMdmST(mapDetail); + objectDetail = toLowerCaseKeys(objectDetail); + + detail.get(i3).put(mdmModuleDbFiledsEntities.get(i2).getEnName(),objectDetail); + } + } + } + } + } + } + } + } + } + object.put(mdmModuleDbEntities.get(i).getDbName(),detail); + } + } + + return object; + } + + + private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map headers ,String bodys ,String querys) { + StringBuffer urls = new StringBuffer(url); + if (querys != null) { + urls.append("?"); + urls.append(querys); + } + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpPost post = new HttpPost(urls.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(Integer.valueOf(applicationApiEntity.getTimeoutPeriod())).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + boolean flag = true; + 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(); + synchronized (lock) { + body.append(EntityUtils.toString(entity,"UTF-8")); + } + flag = true; + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + flag = false; + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + if (flag) { + if (JSONUtil.isTypeJSON(body.toString())) { + JsonResultEntity jsonResultEntity = JSONObject.parseObject(body.toString(),JsonResultEntity.class); + if(jsonResultEntity.isFlag()){ + return BaseResult.getSuccessMessageEntity("转发成功", body); + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + + + private Map getHeaders(SysApplicationApiEntity loginApi,Map map,JSONObject loginData) { + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getHeaderIn() != null && !"".equals(loginApi.getHeaderIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getHeaderIn())) { + JSONArray headerArray = JSON.parseArray(loginApi.getHeaderIn()); + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + JSONArray example = JSONArray.parseArray(query); + String logValue = getObjectValue(loginData, example); + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue); + } + } else { + if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue())); + } + } else {//没有值直接拼接 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), ""); + } + } + } + } + } + } + return map; + + + + + } + + + private String getQuery(SysApplicationApiEntity loginApi,String sendDatastr,JSONObject loginData) { + Map map = new HashMap<>(); + if(sendDatastr != null){ + String[] parts = sendDatastr.split("&"); + if(parts != null && parts.length > 0){ + for (int i = 0; i < parts.length; i++) { + String[] part = parts[i].split("="); + if(part != null && part.length >=2 ){ + for (int a = 0; a < part.length; a++) { + map.put(part[0],part[1]); + } + } + } + } + } + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getQueryIn() != null && !"".equals(loginApi.getQueryIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getQueryIn())) { + JSONArray headerArray = JSON.parseArray(loginApi.getQueryIn()); + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + JSONArray example = JSONArray.parseArray(query); + String logValue = getObjectValue(loginData, example); + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue); + } + } else { + //不是认证类型直接取值 + if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue())); + } + } else {//没有值直接拼接 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), ""); + } + } + } + } + } + } + StringBuffer returnStr = new StringBuffer(); + if(map != null && map.size() > 0){ + for (String key : map.keySet()) { + if("".equals(returnStr)){ + returnStr.append(key).append("=").append(map.get(key)); + }else { + returnStr.append("&").append(key).append("=").append(map.get(key)); + } + } + } + return returnStr.toString(); + } + /** + * @param loginData + * @param example + * @return java.lang.String + * @Author lvleigang + * @Description 根据jsonArray 获取jsonobject中的值 + * @Date 11:47 上午 2023/8/31 + **/ + private String getObjectValue(JSONObject loginData, JSONArray example) { + String values = ""; + if (example != null && example.size() > 0) { + for (int i = 0; i < example.size(); i++) { + if (loginData.getString(example.getString(i)) != null && !"".equals(loginData.getString(example.getString(i)))) { + if (i == (example.size() - 1)) { + values = loginData.getString(example.getString(i)); + } else { + loginData = JSONObject.parseObject(loginData.getString(example.getString(i))); + } + } else { + return values; + } + } + } + return values; + } + private String getBodys(SysApplicationApiEntity loginApi,String sendDatastr, JSONObject loginData) { + JSONObject sendData = new JSONObject(); + if(sendDatastr != null ){ + sendData = JSONObject.parseObject(sendDatastr); + } + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getBodyIn() != null && !"".equals(loginApi.getBodyIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getBodyIn())) { + JSONArray headerArray = JSON.parseArray(loginApi.getBodyIn()); + for (int i = 0; i < headerArray.size(); i++) { + //获取到第一个数据 + JSONObject querys = headerArray.getJSONObject(i); + if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + JSONArray example = JSONArray.parseArray(query); + String logValue = getObjectValue(loginData, example); + sendData.put(querys.getString(SysEnum.PARAMETERNAME.getValue()),logValue); + } + } + } + } + } + return sendData.toString(); + } + public JSONObject toLowerCaseKeys(JSONObject jsonObject) { + JSONObject lowerCaseJson = new JSONObject(); + if (jsonObject != null) { + for (String key : jsonObject.keySet()) { + Object value = jsonObject.get(key); + lowerCaseJson.put(key.toLowerCase(), value); + } + } + return lowerCaseJson; + } + public List toLowerCaseKeys(List list) { + List jsonObjects = new ArrayList<>(); + if (list != null && list.size() > 0) { + for (int i = 0; i < list.size(); i++) { + jsonObjects.add(toLowerCaseKeys(list.get(i))); + } + } + return jsonObjects; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/MakeInvoicePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/MakeInvoicePluginInitializer.java index 3504ca4c..6ce63b2d 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/MakeInvoicePluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/MakeInvoicePluginInitializer.java @@ -2,7 +2,7 @@ package com.hzya.frame.plugin.ht.plugin; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; -//import com.hzya.frame.seeyon.makeinvoice.service.IMakeInvoiceService; +import com.hzya.frame.seeyon.invoice.service.impl.InvoiceServiceImpl; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; @@ -15,9 +15,10 @@ import org.springframework.beans.factory.annotation.Autowired; * @Date 2024/8/22 16:39 **/ public class MakeInvoicePluginInitializer extends PluginBaseEntity { - Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired -// private IMakeInvoiceService makeInvoiceService; + private InvoiceServiceImpl invoiceService; + Logger logger = LoggerFactory.getLogger(getClass()); /*** * 插件初始化方法 * @Author 👻👻👻👻👻👻👻👻 gjh @@ -95,7 +96,13 @@ public class MakeInvoicePluginInitializer extends PluginBaseEntity { **/ @Override public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { -// JsonResultEntity result = makeInvoiceService.sendMakeInvoiceSw(requestJson); - return BaseResult.getSuccessMessageEntity("操作成功"); + try { + logger.info("======开始执行杭泰开票申请单同步========"); + return invoiceService.queryArchives(requestJson); + }catch (Exception e){ + logger.info("======执行杭泰开票申请单同步失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; } } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInputInvoiceResultPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInputInvoiceResultPluginInitializer.java new file mode 100644 index 00000000..52cd42ca --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInputInvoiceResultPluginInitializer.java @@ -0,0 +1,58 @@ +package com.hzya.frame.plugin.ht.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.zxBank.plugin.ZxBankResultPluginInitializer; +import com.hzya.frame.seeyon.invoice.service.impl.InvoiceServiceImpl; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +public class QueryInputInvoiceResultPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(QueryInputInvoiceResultPluginInitializer.class); + + @Autowired + private InvoiceServiceImpl invoiceService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "QueryInputInvoiceResultPluginInitializer"; + } + + @Override + public String getPluginName() { + return "查询发票批量录入返回结果插件"; + } + + @Override + public String getPluginLabel() { + return "QueryInputInvoiceResultPluginInitializer"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行查询税务进项发票批量录入返回结果========"); + return invoiceService.queryInputInvoiceResult(requestJson); + }catch (Exception e){ + logger.info("======执行查询税务进项发票批量录入返回结果失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInvoiceResultPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInvoiceResultPluginInitializer.java new file mode 100644 index 00000000..f688f5be --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/ht/plugin/QueryInvoiceResultPluginInitializer.java @@ -0,0 +1,58 @@ +package com.hzya.frame.plugin.ht.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.zxBank.plugin.ZxBankResultPluginInitializer; +import com.hzya.frame.seeyon.invoice.service.impl.InvoiceServiceImpl; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +public class QueryInvoiceResultPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(ZxBankResultPluginInitializer.class); + + @Autowired + private InvoiceServiceImpl invoiceService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "QueryInvoiceResultPluginInitializer"; + } + + @Override + public String getPluginName() { + return "查询开票申请详情插件"; + } + + @Override + public String getPluginLabel() { + return "QueryInvoiceResultPluginInitializer"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行查询税务开票申请详情返回结果========"); + return invoiceService.queryInvoiceResult(requestJson); + }catch (Exception e){ + logger.info("======执行查询税务开票申请详情返回结果失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java new file mode 100644 index 00000000..8fb161da --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/IIncomeInvoiceDao.java @@ -0,0 +1,36 @@ +package com.hzya.frame.plugin.incomeInvoiceData.dao; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity; + +import java.util.List; + +/** + * 客户档案(mdm_customer: table)表数据库访问层 + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public interface IIncomeInvoiceDao extends IBaseDao { + + + List queryData(JSONObject saveData); + + int saveDetailData(JSONObject saveDetailData); + + int saveData(JSONObject saveData); + + List queryOaZb(IncomeInvoiceEntity incomeInvoiceEntity); + + List queryOaMx(IncomeInvoiceEntity incomeInvoiceEntity); + + int updateMx(IncomeInvoiceEntity incomeInvoiceEntity); + + int saveMx(IncomeInvoiceEntity incomeInvoiceEntity); + + List queryZtzz(IncomeInvoiceEntity entity); + + List queryByAloneId(IncomeInvoiceEntity jnquerydata); +} + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java new file mode 100644 index 00000000..8582aab4 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/dao/impl/IncomeInvoiceDaoImpl.java @@ -0,0 +1,70 @@ +package com.hzya.frame.plugin.incomeInvoiceData.dao.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.incomeInvoiceData.dao.IIncomeInvoiceDao; +import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity; + +import java.util.List; + + +/** + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class IncomeInvoiceDaoImpl extends MybatisGenericDao implements IIncomeInvoiceDao { + + @Override + public List queryData(JSONObject saveData) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryData", saveData); + return o; + } + @Override + public int saveData(JSONObject saveData) { + return super.insert(getSqlIdPrifx() + "saveData", saveData); + } + @Override + public int saveDetailData(JSONObject saveData) { + return super.insert(getSqlIdPrifx() + "saveDetailData", saveData); + } + + @DS("#entity.dataSourceCode") + @Override + public List queryOaZb(IncomeInvoiceEntity entity) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryOaZb", entity); + return o; + } + @DS("#entity.dataSourceCode") + @Override + public List queryOaMx(IncomeInvoiceEntity entity) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryOaMx", entity); + return o; + } + @DS("#entity.dataSourceCode") + @Override + public int updateMx(IncomeInvoiceEntity entity) { + return super.update(getSqlIdPrifx() + "updateMx", entity); + } + @DS("#entity.dataSourceCode") + @Override + public int saveMx(IncomeInvoiceEntity entity) { + return super.insert(getSqlIdPrifx() + "saveMx", entity); + } + + @DS("#entity.dataSourceCode") + @Override + public List queryZtzz(IncomeInvoiceEntity entity) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryZtzz", entity); + return o; + } + + @DS("#entity.dataSourceCode") + @Override + public List queryByAloneId(IncomeInvoiceEntity entity) { + List o = (List) super.selectList(getSqlIdPrifx() + "queryByAloneId", entity); + return o; + } +} + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java new file mode 100644 index 00000000..27f90943 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.java @@ -0,0 +1,125 @@ +package com.hzya.frame.plugin.incomeInvoiceData.entity; + +import com.hzya.frame.web.entity.BaseEntity; +/** + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class IncomeInvoiceEntity extends BaseEntity { + + //发票字段 + private Integer dataId; + private Integer formmainId; + private String field0127; + private String field0128; + private String field0129; + private String field0130; + private String field0003; + + + //财报数据 字段 + private String aloneId; + private String sysData; + private String orgCode; + private String orgName; + private String iufoVer; + + + public String getAloneId() { + return aloneId; + } + + public void setAloneId(String aloneId) { + this.aloneId = aloneId; + } + + public String getSysData() { + return sysData; + } + + public void setSysData(String sysData) { + this.sysData = sysData; + } + + public String getOrgCode() { + return orgCode; + } + + public void setOrgCode(String orgCode) { + this.orgCode = orgCode; + } + + public String getOrgName() { + return orgName; + } + + public void setOrgName(String orgName) { + this.orgName = orgName; + } + + public String getIufoVer() { + return iufoVer; + } + + public void setIufoVer(String iufoVer) { + this.iufoVer = iufoVer; + } + + public Integer getDataId() { + return dataId; + } + + public void setDataId(Integer dataId) { + this.dataId = dataId; + } + + public Integer getFormmainId() { + return formmainId; + } + + public void setFormmainId(Integer formmainId) { + this.formmainId = formmainId; + } + + public String getField0127() { + return field0127; + } + + public void setField0127(String field0127) { + this.field0127 = field0127; + } + + public String getField0128() { + return field0128; + } + + public void setField0128(String field0128) { + this.field0128 = field0128; + } + + public String getField0129() { + return field0129; + } + + public void setField0129(String field0129) { + this.field0129 = field0129; + } + + public String getField0130() { + return field0130; + } + + public void setField0130(String field0130) { + this.field0130 = field0130; + } + + public String getField0003() { + return field0003; + } + + public void setField0003(String field0003) { + this.field0003 = field0003; + } +} + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml new file mode 100644 index 00000000..4646593b --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/entity/IncomeInvoiceEntity.xml @@ -0,0 +1,538 @@ + + + + + + + + insert into mdm_fp( + + id , + document_rule , + document_rule_num , + data_status , + add_status , + update_status , + delete_status , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + + fphm , + fpdm , + kprq , + xfsh , + xfmc , + gfsh , + gfmc , + hjje , + hjse , + jshj , + jym , + xfdzdh , + xfyhzh , + gfdzdh , + gfyhzh , + mmq , + bz , + jqbh , + jdhm , + kpr , + skr , + fhr , + url , + ofdurl , + xmlurl , + htbh , + + + + )values + ( + + #{id} , + #{document_rule} , + #{document_rule_num} , + #{data_status} , + #{add_status} , + #{update_status} , + #{delete_status} , + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{company_id} , + + #{fphm} , + #{fpdm} , + #{kprq} , + #{xfsh} , + #{xfmc} , + #{gfsh} , + #{gfmc} , + #{hjje} , + #{hjse} , + #{jshj} , + #{jym} , + #{xfdzdh} , + #{xfyhzh} , + #{gfdzdh} , + #{gfyhzh} , + #{mmq} , + #{bz} , + #{jqbh} , + #{jdhm} , + #{kpr} , + #{skr} , + #{fhr} , + #{url} , + #{ofdurl} , + #{xmlurl} , + #{htbh} , + + + ) + + + insert into mdm_fp_detail( + + id , + formmain_id , + data_status , + sorts , + create_user_id , + create_time , + modify_user_id , + modify_time , + sts , + org_id , + company_id , + remark , + + xh , + ssflbm , + xmmc , + ggxh , + dw , + sl , + dj , + je , + slv , + se , + + + + + )values + ( + + #{id} , + #{formmain_id} , + #{data_status}, + #{sorts} , + #{create_user_id} , + #{create_time} , + #{modify_user_id} , + #{modify_time} , + #{sts} , + #{org_id} , + #{company_id} , + #{remark} , + + #{xh} , + #{ssflbm} , + #{xmmc} , + #{ggxh} , + #{dw} , + #{sl} , + #{dj} , + #{je} , + #{slv} , + #{se} , + + + ) + + + + + + + update formson_0702 set + + field0127 = #{field0127}, + field0128 = #{field0128}, + field0129 = #{field0129}, + field0130 = #{field0130}, + + where id = #{dataId} + + + + insert into formson_0702( + + id , + formmain_id , + field0127 , + field0128 , + field0129 , + field0130 , + + + )values( + + #{dataId} , + #{formmainId} , + #{field0127} , + #{field0128} , + #{field0129} , + #{field0130} , + + ) + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java new file mode 100644 index 00000000..d1b275a1 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/FinancialReportPluginInitializer.java @@ -0,0 +1,65 @@ +package com.hzya.frame.plugin.incomeInvoiceData.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 主数据同步 + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class FinancialReportPluginInitializer extends PluginBaseEntity{ + Logger logger = LoggerFactory.getLogger(FinancialReportPluginInitializer.class); + + @Autowired + private IIncomeInvoiceService incomeInvoiceService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "执行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "执行销毁方法destroy()"); + } + + @Override + public String getPluginId() { + return "FinancialReportPlugin"; + } + + @Override + public String getPluginName() { + return "FinancialReportPlugin插件"; + } + + @Override + public String getPluginLabel() { + return "FinancialReportPlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行财务信息同步========"); + //return BaseResult.getSuccessMessageEntity("数据获取成功"); + return incomeInvoiceService.sendFinancialReportPlugin(requestJson); + }catch (Exception e){ + logger.info("======执行财务同步失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/IncomeInvoicePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/IncomeInvoicePluginInitializer.java new file mode 100644 index 00000000..8c966920 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/plugin/IncomeInvoicePluginInitializer.java @@ -0,0 +1,63 @@ +package com.hzya.frame.plugin.incomeInvoiceData.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 主数据同步 + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class IncomeInvoicePluginInitializer extends PluginBaseEntity{ + Logger logger = LoggerFactory.getLogger(IncomeInvoicePluginInitializer.class); + + @Autowired + private IIncomeInvoiceService incomeInvoiceService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "执行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "执行销毁方法destroy()"); + } + + @Override + public String getPluginId() { + return "IncomeInvoicePlugin"; + } + + @Override + public String getPluginName() { + return "IncomeInvoicePlugin插件"; + } + + @Override + public String getPluginLabel() { + return "IncomeInvoicePlugin"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行进项全量发票主数据信息同步========"); + return incomeInvoiceService.getIncomeInvoiceData(requestJson); + }catch (Exception e){ + logger.info("======执行进项全量发票主数据同步失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java new file mode 100644 index 00000000..2276deeb --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/IIncomeInvoiceService.java @@ -0,0 +1,26 @@ +package com.hzya.frame.plugin.incomeInvoiceData.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +/** + * + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public interface IIncomeInvoiceService extends IBaseService { + /** + * @Author lvleigang + * @Description 全量发票数据 + * @Date 4:28 下午 2025/4/16 + * @param requestJson + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + JsonResultEntity getIncomeInvoiceData(JSONObject requestJson); + SysExtensionApiEntity setData(SysExtensionApiEntity entity) throws Exception; + + JsonResultEntity sendFinancialReportPlugin(JSONObject requestJson); +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java new file mode 100644 index 00000000..276820a3 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/incomeInvoiceData/service/impl/IncomeInvoiceServiceImpl.java @@ -0,0 +1,1019 @@ +package com.hzya.frame.plugin.incomeInvoiceData.service.impl; + +import cn.hutool.core.date.DateUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.plugin.incomeInvoiceData.dao.IIncomeInvoiceDao; +import com.hzya.frame.plugin.incomeInvoiceData.entity.IncomeInvoiceEntity; +import com.hzya.frame.plugin.incomeInvoiceData.service.IIncomeInvoiceService; +import com.hzya.frame.seeyon.util.YzfSignUtil; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.sysnew.comparison.controlsLog.dao.impl.ControlsLogDaoImpl; +import com.hzya.frame.sysnew.comparison.controlsLog.entity.ControlsLogEntity; +import com.hzya.frame.sysnew.comparison.dao.IComparisonDao; +import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity; +import com.hzya.frame.uuid.UUIDLong; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.apache.http.HttpEntity; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.TrustAllStrategy; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.ssl.SSLContextBuilder; +import org.apache.http.util.EntityUtils; +import org.checkerframework.checker.units.qual.A; +import org.springframework.beans.factory.annotation.Autowired; +import com.hzya.frame.basedao.service.impl.BaseService; +import org.springframework.core.task.TaskExecutor; + +import javax.annotation.Resource; +import javax.net.ssl.SSLContext; +import java.io.IOException; +import java.math.BigDecimal; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author makejava + * @since 2024-06-21 13:52:35 + */ +public class IncomeInvoiceServiceImpl extends BaseService implements IIncomeInvoiceService { + + private IIncomeInvoiceDao incomeInvoiceDao; + @Autowired + private ControlsLogDaoImpl controlsLogDaoimpl; + @Autowired + private IComparisonDao comparisonDao; + @Autowired + public void setIncomeInvoiceDao(IIncomeInvoiceDao dao) { + this.incomeInvoiceDao = dao; + this.dao = dao; + } + String cbUrl = "http://oapi.nanofintax.com/api/collect/uploadFinancialReport?accessToken="; + String dataUrl = "http://oapi.nanofintax.com/api/invoice_receive/fp/v1/query?accessToken="; + String tokenUrl = "http://oapi.nanofintax.com/api/getToken"; + String accessKey = "6X3B526P5HqE6ums"; + String accessSecret = "34e5fc32ac894a2ba2ade8c3852c7a0a"; + String taxNo = "91330110MAC5FPUY2U"; + Integer size = 50; + @Resource + private TaskExecutor taskExecutor; + /** + * @Author lvleigang + * @Description 全量发票数据 + * @Date 4:28 下午 2025/4/16 + * @param requestJson + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + @Override + public JsonResultEntity getIncomeInvoiceData(JSONObject requestJson) { + //1、调用token + String access_token = getToken(); + if (access_token == null) { + return BaseResult.getFailureMessageEntity("token获取失败"); + } + Date date = new Date(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String times = sdf.format(date); + //2、调用接口获取数据 + Integer queryCursor = 1; + JSONArray datalist = new JSONArray(); + sendBusinessData(datalist, access_token, queryCursor,times); + + if(datalist != null && datalist.size() > 0){ + for (int i = 0; i < datalist.size(); i++) { + JSONObject saveData = new JSONObject(); + //3、对照数据 + JSONObject jsonObject = datalist.getJSONObject(i); + JSONObject content = jsonObject.getJSONObject("content"); + + //发票号码 + String fphm = jsonObject.getString("fphm"); + if(fphm == null || "".equals(fphm) ){ + continue; + } + saveData.put("fphm",fphm); + //判断是否有这个数据 + List checkData = incomeInvoiceDao.queryData(saveData); + if(checkData != null && checkData.size() > 0){ + continue; + } + saveData.put("id", String.valueOf(UUIDLong.longUUID())); + saveData.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + saveData.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + saveData.put("org_id", "0"); + saveData.put("create_time", new Date()); + saveData.put("modify_time", new Date()); + saveData.put("sts", "Y"); + saveData.put("data_status", "Y");//新增状态 + saveData.put("add_status", "0");//新增状态 + saveData.put("update_status", "1");//修改状态 + saveData.put("delete_status", "1");//删除状态 + ComparisonEntity comparisonEntityRule = new ComparisonEntity(); + comparisonEntityRule.setRulePrefix("FP"); + comparisonEntityRule.setRuleMiddle("%Y-%m-%d"); + comparisonEntityRule.setRuleSuffix(5); + comparisonEntityRule.setDbName("mdm_fp"); + ComparisonEntity comparisonEntityRuleGz = comparisonDao.queryComparisonRule(comparisonEntityRule); + saveData.put("document_rule", comparisonEntityRuleGz.getDocumentRule());//单据规则 + saveData.put("document_rule_num", comparisonEntityRuleGz.getDocumentRuleNum());//单据规则流水号 + + saveData.put("fphm",fphm); + saveData.put("fpdm",content.getString("fpdm")); + saveData.put("kprq",jsonObject.getString("kprq")); + saveData.put("xfsh",content.getString("xfsh")); + saveData.put("xfmc",content.getString("xfmc")); + saveData.put("gfsh",content.getString("gfsh")); + saveData.put("gfmc",content.getString("gfmc")); + saveData.put("hjje",content.getString("hjje")); + saveData.put("hjse",content.getString("hjse")); + saveData.put("jshj",content.getString("jshj")); + saveData.put("jym",content.getString("jym")); + saveData.put("xfdzdh",content.getString("xfdzdh")); + saveData.put("xfyhzh",content.getString("xfyhzh")); + saveData.put("gfdzdh",content.getString("gfdzdh")); + saveData.put("gfyhzh",content.getString("gfyhzh")); + saveData.put("mmq",content.getString("mmq")); + saveData.put("bz",content.getString("bz")); + saveData.put("jqbh",content.getString("jqbh")); + saveData.put("jdhm",content.getString("jdhm")); + saveData.put("kpr",content.getString("kpr")); + saveData.put("skr",content.getString("skr")); + saveData.put("fhr",content.getString("fhr")); + saveData.put("url",content.getString("url")); + saveData.put("ofdurl",content.getString("ofdUrl")); + saveData.put("xmlurl",content.getString("xmlUrl")); + saveData.put("htbh",content.getString("contraceNumber")); + + JSONArray detaildata = content.getJSONArray("items"); + if(detaildata != null && detaildata.size() > 0){ + for (int i1 = 0; i1 < detaildata.size(); i1++) { + JSONObject saveDetailData = new JSONObject(); + + saveDetailData.put("id", String.valueOf(UUIDLong.longUUID())); + saveDetailData.put("formmain_id", saveData.getString("id")); + saveDetailData.put("data_status", "Y");//新增状态 + + saveDetailData.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + saveDetailData.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443"); + saveDetailData.put("org_id", "0"); + saveDetailData.put("create_time", new Date()); + saveDetailData.put("modify_time", new Date()); + saveDetailData.put("sts", "Y"); + saveDetailData.put("xh", detaildata.getJSONObject(i1).getString("xh")); + saveDetailData.put("ssflbm", detaildata.getJSONObject(i1).getString("ssflbm")); + saveDetailData.put("xmmc", detaildata.getJSONObject(i1).getString("xmmc")); + saveDetailData.put("ggxh", detaildata.getJSONObject(i1).getString("ggxh")); + saveDetailData.put("dw", detaildata.getJSONObject(i1).getString("dw")); + saveDetailData.put("sl", detaildata.getJSONObject(i1).getString("sl")); + saveDetailData.put("dj", detaildata.getJSONObject(i1).getString("dj")); + saveDetailData.put("je", detaildata.getJSONObject(i1).getString("je")); + saveDetailData.put("slv", detaildata.getJSONObject(i1).getString("slv")); + saveDetailData.put("se", detaildata.getJSONObject(i1).getString("se")); + + incomeInvoiceDao.saveDetailData(saveDetailData); + } + } + incomeInvoiceDao.saveData(saveData); + + //5、保存写入日志 + ControlsLogEntity controlsLogEntity=new ControlsLogEntity(); + controlsLogEntity.setId(UUIDUtils.getUUID()); + controlsLogEntity.setFormmainId(saveData.getString("id")); + controlsLogEntity.setSourceName("数智中台"); + controlsLogEntity.setCode("800004"); + controlsLogEntity.setSourceData(jsonObject.toString()); + controlsLogEntity.setOptionType("接口新增"); + controlsLogEntity.setOptionName("数智中台"); + controlsLogEntity.setDbName("mdm_fp_option_log"); + controlsLogEntity.setDataType("1"); + controlsLogEntity.setCreate_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + controlsLogEntity.setModify_user_id("c796fd9ba4c9f5ff3cc2fa41a040e443"); + controlsLogEntity.setOrg_id("0"); + controlsLogEntity.setRemark("插件新增"); + controlsLogDaoimpl.saveControlsLog(saveData.getString("id"), "数智中台", "800004", jsonObject.toJSONString(), "接口新增", "数智中台", "mdm_fp_option_log", "1"); + } + } + return BaseResult.getSuccessMessageEntity("处理成功"); + } + + + /** + * @Author lvleigang + * @Description 获取业务数据 + * @Date 4:31 下午 2025/4/9 + * @param datalist + * @param access_token + * @param queryCursor + * @param dataTime + * @return void + **/ + private void sendBusinessData(JSONArray datalist, String access_token, Integer queryCursor, String dataTime) { + String url = dataUrl+access_token; + JSONObject dayabody = new JSONObject(); + dayabody.put("accessKey",accessKey); + long timestamp = System.currentTimeMillis(); + dayabody.put("timestamp",timestamp); + JSONObject queryParams = new JSONObject(); + queryParams.put("page",queryCursor); + queryParams.put("size",size); + //queryParams.put("kprqq",dataTime); + //queryParams.put("kprqz",dataTime); + queryParams.put("taxNo",taxNo); + dayabody.put("queryParams",queryParams); + Map parametersMap = new HashMap<>(); + parametersMap.put("accessKey",accessKey); + parametersMap.put("timestamp",timestamp); + String a = YzfSignUtil.signRequest(parametersMap,accessSecret); + dayabody.put("sign",a); + Map headers = new HashMap<>(); + headers.put("Content-Type", "application/json; charset=utf-8"); + String returndata = sendPost(url, headers, dayabody.toJSONString()); + + if (returndata != null && JSONObject.isValidObject(returndata)) { + JSONObject dataJson = JSONObject.parseObject(returndata); + if(dataJson != null && dataJson.getString("code") != null && "0".equals( dataJson.getString("code"))){ + JSONObject data = dataJson.getJSONObject("result"); + if(data != null ){ + JSONArray businessList = data.getJSONArray("data"); + if(data.getInteger("total") > queryCursor*size){ + queryCursor = queryCursor+1; + sendBusinessData(datalist, access_token, queryCursor, dataTime); + } + if(businessList != null && businessList.size() > 0){ + datalist.addAll(businessList); + } + } + } + } + } + + private String getOAToken(String name) { + String url = "http://60.204.152.210/seeyon/rest/token"; + Map headers = null; + String bodys = "{\"password\":\"a5ce21b8-91db-4cec-b3e3-3e44719655fd\",\"userName\":\"hzyaRest\",\"loginName\":\""+name+"\"}"; + String tokenData = sendPost(url, headers, bodys); + String access_token = null; + if (tokenData != null && JSONObject.isValidObject(tokenData)) { + JSONObject tokendataJson = JSONObject.parseObject(tokenData); + if (tokendataJson != null && tokendataJson.getString("id") != null) { + access_token = tokendataJson.getString("id"); + } + } + return access_token; + } + /** + * @Author lvleigang + * @Description 获取token + * @Date 4:18 下午 2025/4/9 + * @param + * @return java.lang.String + **/ + private String getToken() { + String url = tokenUrl; + JSONObject tokenJson = new JSONObject(); + tokenJson.put("accessKey",accessKey); + tokenJson.put("accessSecret",accessSecret); + String bodys = tokenJson.toJSONString(); + StringBuilder body = new StringBuilder(); + SSLContext sslContext = null; + try { + sslContext = new SSLContextBuilder() + .loadTrustMaterial(null, TrustAllStrategy.INSTANCE) + .build(); + } catch (Exception e) { + return null; + } + CloseableHttpClient closeableHttpClient = HttpClients.custom() + .setSSLContext(sslContext) + .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + .build(); + + HttpPost post = new HttpPost(url); + CloseableHttpResponse response = null; + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(6000).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + post.setHeader("Content-Type", "application/json; charset=utf-8"); + try { + if (bodys != null && !"".equals(bodys)) { + ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + + HttpEntity entity = response.getEntity(); + body.append(EntityUtils.toString(entity, "UTF-8")); + } catch (Exception e) { + body.append(e.getMessage()); + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + logger.info("token返回结果{}",body); + JSONObject bodyJson = JSONObject.parseObject(body.toString()); + if(bodyJson.getString("code") == null || !"0".equals(bodyJson.getString("code"))){ + return null; + } + JSONObject resultJson = bodyJson.getJSONObject("result"); + if(resultJson == null){ + return null; + } + if(resultJson.getString("accessToken") != null && !"".equals(resultJson.getString("accessToken"))){ + return resultJson.getString("accessToken"); + } + return null; + } + + private String sendPost(String url, Map headers, String bodys) { + logger.info("url:"+url+"。bodys:"+bodys); + + SSLContext sslContext = null; + try { + sslContext = new SSLContextBuilder() + .loadTrustMaterial(null, TrustAllStrategy.INSTANCE) + .build(); + } catch (Exception e) { + + } + CloseableHttpClient closeableHttpClient = HttpClients.custom() + .setSSLContext(sslContext) + .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + .build(); + HttpPost post = new HttpPost(url); + CloseableHttpResponse response = null; + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + try { + if (bodys != null && !"".equals(bodys)) { + ByteArrayEntity entity = new ByteArrayEntity(bodys.getBytes("UTF-8")); + entity.setContentType("application/json"); + post.setEntity(entity); + } + response = closeableHttpClient.execute(post); + HttpEntity entity = response.getEntity(); + body.append(EntityUtils.toString(entity, "UTF-8")); + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body = new StringBuilder(); + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + logger.info("url:"+url+"。bodys:"+bodys+"。body"+body); + + return body.toString(); + } + private String sendGet(String url, Map headers) { + SSLContext sslContext = null; + try { + sslContext = new SSLContextBuilder() + .loadTrustMaterial(null, TrustAllStrategy.INSTANCE) + .build(); + } catch (Exception e) { + + } + CloseableHttpClient closeableHttpClient = HttpClients.custom() + .setSSLContext(sslContext) + .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE) + .build(); + // HttpClient + HttpGet get = new HttpGet(url); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(60000).build(); + get.setConfig(requestConfig);//设置请求参数【超时时间】 + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + get.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + + try { + response = closeableHttpClient.execute(get); + HttpEntity entity = response.getEntity(); + body.append(EntityUtils.toString(entity,"UTF-8")); + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + return body.toString(); + } + + + /** + * seeyon流程事件监听前置方法,绑定数据源 + * @param entity + * @return + * @throws Exception + */ + @Override + public SysExtensionApiEntity setData(SysExtensionApiEntity entity) throws Exception { + try { + JSONObject sendBody = new JSONObject(); + String bodys = entity.getBodys(); + Map headers = entity.getHeaders(); + JSONObject jsonObject = JSONObject.parseObject(bodys); + String loginName = "hzya"; + String dataXml = getXml(jsonObject); + //处理xml数据 + String oaToken = getOAToken(loginName); + headers.put("token",oaToken); + sendBody.put("token",oaToken); + sendBody.put("loginName",loginName); + sendBody.put("dataXml",dataXml); + entity.setBodys(sendBody.toJSONString()); + //修改明细表 + if(jsonObject.getString("htbh") != null){ + IncomeInvoiceEntity incomeInvoiceEntity = new IncomeInvoiceEntity(); + incomeInvoiceEntity.setDataSourceCode("master");//todo + //incomeInvoiceEntity.setDataSourceCode("HT-OA");//todo + incomeInvoiceEntity.setField0003(jsonObject.getString("htbh"));//合同号 + incomeInvoiceEntity.setField0127(jsonObject.getString("fpdm"));//发票代码 + incomeInvoiceEntity.setField0128(jsonObject.getString("fphm"));//发票号码 + incomeInvoiceEntity.setField0129(jsonObject.getString("jshj"));//发票总额 + incomeInvoiceEntity.setField0130(jsonObject.getString("fpwj"));//发票文件 todo + List list = incomeInvoiceDao.queryOaZb(incomeInvoiceEntity); + if(list != null && list.size() == 1){ + incomeInvoiceEntity.setFormmainId(list.get(0).getDataId()); + } + List mxlist = incomeInvoiceDao.queryOaMx(incomeInvoiceEntity); + if(mxlist != null && mxlist.size() == 1){ + incomeInvoiceEntity.setDataId(mxlist.get(0).getDataId()); + incomeInvoiceDao.updateMx(incomeInvoiceEntity); + } + if(mxlist == null || mxlist.size() == 0){ + incomeInvoiceEntity.setDataId(1); + incomeInvoiceDao.saveMx(incomeInvoiceEntity); + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return entity; + } + + + + private String getXml(JSONObject jsonObject) { + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("fpdm") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("fphm") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("kprq") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("xfsh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("xfmc") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("gfsh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("gfmc") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("hjje") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("hjse") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("jshj") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("jym") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("xfdzdh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("xfyhzh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("gfdzdh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("gfyhzh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("bz") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("jqbh") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("jdhm") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("kpr") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("skr") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("fhr") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("htbm") != null?"":""); + stringBuffer.append("").append(""); + + stringBuffer.append("").append(""); + stringBuffer.append(jsonObject.getString("fpwj") != null?"":""); + stringBuffer.append("").append(""); + + + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + + JSONArray jsonArray = JSONArray.parseArray(jsonObject.getString("mdm_fp_detail")); + if(jsonArray != null&& jsonArray.size() > 0){ + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject detailObject = jsonArray.getJSONObject(i); + stringBuffer.append(""); + stringBuffer.append("").append(detailObject.getString("xh") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("ssflbm") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("xmmc") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("ggxh") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("dw") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("sl") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("dj") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("je") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("slv") != null?"":"").append(""); + stringBuffer.append("").append(detailObject.getString("se") != null?"":"").append(""); + stringBuffer.append(""); + } + } + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + stringBuffer.append(""); + + return stringBuffer.toString(); + } + + + /** + * @Author lvleigang + * @Description 财报数据推送 + * @Date 4:28 下午 2025/4/16 + * @param requestJson + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + @Override + public JsonResultEntity sendFinancialReportPlugin(JSONObject requestJson) { + + logger.error("财报数据推送入参"+requestJson.toJSONString()); + JSONObject jsonStr = requestJson.getJSONObject("jsonStr"); + JSONObject businessDataStr = jsonStr.getJSONObject("businessDataStr"); + String eventType = jsonStr.getString("eventType"); + switch (eventType) { + case "onProcessFinished"://流程结束事件,同步物料到U8C + if(businessDataStr.getString("dataType") == null){//数据类型 + return BaseResult.getFailureMessageEntity("数据类型为空"); + } + if(businessDataStr.getString("dataType").equals("1")){//科目余额 + + } + if(businessDataStr.getString("dataType").equals("2")){//财报 + String ztbm = businessDataStr.getString("ztCode");//账套编码 + String cjzq = businessDataStr.getString("period");//采集账期 + String rwbm = businessDataStr.getString("taskNo");//任务编码 + if(ztbm == null || "".equals(ztbm)){ + return BaseResult.getFailureMessageEntity("账套编码为空"); + } + if(cjzq == null || "".equals(cjzq)){ + return BaseResult.getFailureMessageEntity("采集账期为空"); + } + if(rwbm == null || "".equals(rwbm)){ + return BaseResult.getFailureMessageEntity("任务编码为空"); + } + taskExecutor.execute(() -> sendFinancialReport(ztbm,cjzq,rwbm)); + return BaseResult.getSuccessMessageEntity("数据获取成功"); + } + if(businessDataStr.getString("dataType").equals("3")){//进项发票 + return BaseResult.getFailureMessageEntity("数据类型错误"); + } + if(businessDataStr.getString("dataType").equals("4")){//销项发票 + return BaseResult.getFailureMessageEntity("数据类型错误"); + } + return BaseResult.getSuccessMessageEntity("推送数据成功"); + default: + return BaseResult.getFailureMessageEntity("未匹配到流程监听事件!当前传入的eventType:" + eventType); + } + + + + } + + + /** + * @Author lvleigang + * @Description + * @Date 3:18 下午 2025/4/24 + * @param ztbm 账套编码 + * @param cjzq 采集账期 + * @param rwbm 任务编码 + * @return com.hzya.frame.web.entity.JsonResultEntity + **/ + private JsonResultEntity sendFinancialReport(String ztbm ,String cjzq,String rwbm) { + String access_token = getToken(); + if (access_token == null) { + return BaseResult.getFailureMessageEntity("token获取失败"); + } + String url = cbUrl+access_token; + + Date date = null; + String qncjzq = null; + IncomeInvoiceEntity dyAloneId = null; + JSONObject dydata = null; + JSONObject qndata = null; + IncomeInvoiceEntity qnAloneId = null; + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + try { + date = sdf.parse(cjzq); + } catch (ParseException e) { + return BaseResult.getSuccessMessageEntity("采集账期格式错误"); + } + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.YEAR, -1); + Date qn = calendar.getTime(); + qncjzq = sdf.format(qn); + + //查询当月帐套组织 + IncomeInvoiceEntity jnentity = new IncomeInvoiceEntity(); + jnentity.setDataSourceCode("htBip"); + jnentity.setSysData(cjzq); + jnentity.setOrgCode(ztbm); + List jnlist = incomeInvoiceDao.queryZtzz(jnentity); + if(jnlist != null && jnlist.size() == 1){ + dyAloneId = jnlist.get(0); + }else { + return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送"); + } + //查询去年当帐套组织 + IncomeInvoiceEntity qnentity = new IncomeInvoiceEntity(); + qnentity.setDataSourceCode("htBip"); + qnentity.setSysData(qncjzq); + qnentity.setOrgCode(ztbm); + List qnlist = incomeInvoiceDao.queryZtzz(qnentity); + if(qnlist != null && qnlist.size() == 1){ + qnAloneId = qnlist.get(0); + }else { + logger.info("未查询到去年当期的财报数据"); + } + + //查询当月的财报数据 + IncomeInvoiceEntity jnquerydata = new IncomeInvoiceEntity(); + jnquerydata.setDataSourceCode("htBip"); + jnquerydata.setAloneId(dyAloneId.getAloneId()); + List dydataList = incomeInvoiceDao.queryByAloneId(jnquerydata); + if(dydataList != null && dydataList.size() == 1){ + dydata = dydataList.get(0); + }else { + return BaseResult.getSuccessMessageEntity("未查询到当月的财报数据,不推送"); + } + //查询去年当期的财报数据 + if(qnAloneId != null){ + //查找去年数据 + IncomeInvoiceEntity qnquerydata = new IncomeInvoiceEntity(); + qnquerydata.setDataSourceCode("htBip"); + qnquerydata.setAloneId(qnAloneId.getAloneId()); + List qndataList = incomeInvoiceDao.queryByAloneId(qnquerydata); + if(qndataList != null && qndataList.size() == 1){ + qndata = qndataList.get(0); + } + } + //拼接数据 + JSONObject sendData = new JSONObject(); + sendData.put("accessKey",accessKey); + long timestamp = System.currentTimeMillis(); + sendData.put("timestamp",timestamp); + sendData.put("taskNo",rwbm); + sendData.put("period",cjzq); + + JSONArray reportList = new JSONArray(); + JSONObject zcfzb = new JSONObject();//资产负债表1:期末余额 2:年初余额 + zcfzb.put("period",cjzq); + zcfzb.put("reportType",1); + JSONArray reportSubjects1 = new JSONArray(); + setDataToArray("货币资金",dydata.getString("AM10251"),dydata.getString("AM10250"),reportSubjects1); + setDataToArray("短期借款",dydata.getString("AM10249"),dydata.getString("AM10248"),reportSubjects1); + setDataToArray("交易性金融资产",dydata.getString("BMPQW10U"),dydata.getString("BMP81A2Z"),reportSubjects1); + setDataToArray("以公允价值计量且其变动计入当期损益的金融负债",dydata.getString("AM10227"),dydata.getString("AM10226"),reportSubjects1); + setDataToArray("应收票据",dydata.getString("AM10189"),dydata.getString("AM10188"),reportSubjects1); + setDataToArray("应付票据",dydata.getString("AM10187"),dydata.getString("AM10186"),reportSubjects1); + setDataToArray("应收账款",dydata.getString("AM10171"),dydata.getString("AM10170"),reportSubjects1); + setDataToArray("应付账款",dydata.getString("AM10169"),dydata.getString("AM10168"),reportSubjects1); + setDataToArray("减:坏账准备",dydata.getString("AM10153"),dydata.getString("AM10152"),reportSubjects1); + setDataToArray("预收款项",dydata.getString("AM10151"),dydata.getString("AM10150"),reportSubjects1); + setDataToArray("预付款项",dydata.getString("AM10135"),dydata.getString("AM10134"),reportSubjects1); + setDataToArray("合同负债",dydata.getString("AM10133"),dydata.getString("AM10132"),reportSubjects1); + setDataToArray("应收利息",dydata.getString("AM10117"),dydata.getString("AM10116"),reportSubjects1); + setDataToArray("应付职工薪酬",dydata.getString("AM10115"),dydata.getString("AM10114"),reportSubjects1); + setDataToArray("应收股利",dydata.getString("AM10099"),dydata.getString("AM10098"),reportSubjects1); + setDataToArray("应交税费",dydata.getString("AM10097"),dydata.getString("AM10096"),reportSubjects1); + setDataToArray("其他应收款",dydata.getString("AM10081"),dydata.getString("AM10080"),reportSubjects1); + setDataToArray("应付利息",dydata.getString("AM10079"),dydata.getString("AM10078"),reportSubjects1); + setDataToArray("减:坏账准备",dydata.getString("AM10063"),dydata.getString("AM10062"),reportSubjects1); + setDataToArray("应付股利",dydata.getString("AM10061"),dydata.getString("AM10060"),reportSubjects1); + setDataToArray("存货",dydata.getString("AM10048"),dydata.getString("AM10047"),reportSubjects1); + setDataToArray("其他应付款",dydata.getString("AM10046"),dydata.getString("AM10045"),reportSubjects1); + setDataToArray("合同资产",dydata.getString("AM10033"),dydata.getString("AM10032"),reportSubjects1); + setDataToArray("其他流动资产",dydata.getString("AM10348"),dydata.getString("AM10347"),reportSubjects1); + setDataToArray("长期借款",dydata.getString("AM10316"),dydata.getString("AM10315"),reportSubjects1); + setDataToArray("应付债券",dydata.getString("AM10301"),dydata.getString("AM10300"),reportSubjects1); + setDataToArray("债权投资",dydata.getString("AM10288"),dydata.getString("AM10287"),reportSubjects1); + setDataToArray("长期应收款",dydata.getString("AM10268"),dydata.getString("AM10266"),reportSubjects1); + setDataToArray("长期股权投资",dydata.getString("AM10246"),dydata.getString("AM10244"),reportSubjects1); + setDataToArray("租赁负债",dydata.getString("AM10242"),dydata.getString("AM10241"),reportSubjects1); + setDataToArray("长期应付款",dydata.getString("AM10220"),dydata.getString("AM10219"),reportSubjects1); + setDataToArray("其他非流动金融资产",dydata.getString("BMS13DPL"),dydata.getString("BM6TFKPL"),reportSubjects1); + setDataToArray("专项应付款",dydata.getString("AM10198"),dydata.getString("AM10197"),reportSubjects1); + setDataToArray("投资性房地产",dydata.getString("AM10224"),dydata.getString("AM10222"),reportSubjects1); + setDataToArray("预计负债",dydata.getString("AM10180"),dydata.getString("AM10179"),reportSubjects1); + setDataToArray("递延收益",dydata.getString("AM10162"),dydata.getString("AM10161"),reportSubjects1); + setDataToArray("递延所得税负债",dydata.getString("AM10144"),dydata.getString("AM10143"),reportSubjects1); + setDataToArray("固定资产",dydata.getString("AM10202"),dydata.getString("AM10200"),reportSubjects1); + setDataToArray("减:累计折旧",dydata.getString("AM10184"),dydata.getString("AM10182"),reportSubjects1); + setDataToArray("减:固定资产减值准备",dydata.getString("AM10166"),dydata.getString("AM10164"),reportSubjects1); + setDataToArray("在建工程",dydata.getString("AM10148"),dydata.getString("AM10146"),reportSubjects1); + setDataToArray("实收资本(或股本)",dydata.getString("AM10054"),dydata.getString("AM10053"),reportSubjects1); + setDataToArray("工程物资",dydata.getString("AM10130"),dydata.getString("AM10128"),reportSubjects1); + setDataToArray("固定资产清理",dydata.getString("AM10112"),dydata.getString("AM10110"),reportSubjects1); + setDataToArray("资本公积",dydata.getString("AM10354"),dydata.getString("AM10352"),reportSubjects1); + setDataToArray("使用权资产",dydata.getString("AM10058"),dydata.getString("AM10056"),reportSubjects1); + setDataToArray("减:库存股",dydata.getString("AM10339"),dydata.getString("AM10337"),reportSubjects1); + setDataToArray("减:累计折旧",dydata.getString("AM10043"),dydata.getString("AM10041"),reportSubjects1); + setDataToArray("减:使用权资产减值准备",dydata.getString("AM10028"),dydata.getString("AM10026"),reportSubjects1); + setDataToArray("盈余公积",dydata.getString("AM10309"),dydata.getString("AM10307"),reportSubjects1); + setDataToArray("无形资产",dydata.getString("AM10013"),dydata.getString("AM10011"),reportSubjects1); + setDataToArray("未分配利润",dydata.getString("AM10294"),dydata.getString("AM10292"),reportSubjects1); + setDataToArray("减:累计摊销",dydata.getString("CM10002"),dydata.getString("CM10000"),reportSubjects1); + setDataToArray("减:无形资产减值准备",dydata.getString("AM10342"),dydata.getString("AM10340"),reportSubjects1); + setDataToArray("开发支出",dydata.getString("AM10327"),dydata.getString("AM10325"),reportSubjects1); + setDataToArray("商誉",dydata.getString("AM10312"),dydata.getString("AM10310"),reportSubjects1); + setDataToArray("长期待摊费用",dydata.getString("AM10297"),dydata.getString("AM10295"),reportSubjects1); + setDataToArray("递延所得税资产",dydata.getString("AM10283"),dydata.getString("AM10281"),reportSubjects1); + setDataToArray("其他非流动资产",dydata.getString("AM10259"),dydata.getString("AM10257"),reportSubjects1); + + + zcfzb.put("reportSubjects",reportSubjects1); + + JSONObject llb = new JSONObject();//利润表1:本年累计 2:上年累计 + llb.put("period",cjzq); + llb.put("reportType",2); + JSONArray reportSubjects2 = new JSONArray(); + + setDataToArray("一、营业收入",dydata.getString("AM10267"),qndata.getString("AM10267"),reportSubjects2); + setDataToArray("其中:主营业务收入",dydata.getString("AM10245"),qndata.getString("AM10245"),reportSubjects2); + setDataToArray("其他业务收入",dydata.getString("AM10223"),qndata.getString("AM10223"),reportSubjects2); + setDataToArray("减:营业成本",dydata.getString("AM10201"),qndata.getString("AM10201"),reportSubjects2); + setDataToArray("其中:主营业务成本",dydata.getString("AM10183"),qndata.getString("AM10183"),reportSubjects2); + setDataToArray("其他业务成本",dydata.getString("AM10165"),qndata.getString("AM10165"),reportSubjects2); + setDataToArray("税金及附加",dydata.getString("AM10147"),qndata.getString("AM10147"),reportSubjects2); + setDataToArray("销售费用",dydata.getString("AM10129"),qndata.getString("AM10129"),reportSubjects2); + setDataToArray("管理费用",dydata.getString("AM10111"),qndata.getString("AM10111"),reportSubjects2); + setDataToArray("财务费用(收益以\"-\"号填列)",dydata.getString("AM10093"),qndata.getString("AM10093"),reportSubjects2); + setDataToArray("其中:利息费用",dydata.getString("AM10075"),qndata.getString("AM10075"),reportSubjects2); + setDataToArray("利息收入",dydata.getString("AM10057"),qndata.getString("AM10057"),reportSubjects2); + setDataToArray("研发费用",dydata.getString("AM10042"),qndata.getString("AM10042"),reportSubjects2); + setDataToArray("资产减值损失",dydata.getString("AM10027"),qndata.getString("AM10027"),reportSubjects2); + setDataToArray("信用减值损失",dydata.getString("AM10012"),qndata.getString("AM10012"),reportSubjects2); + setDataToArray("加:公允价值变动净收益(净损失以\"-\"号填列)",dydata.getString("CM10003"),qndata.getString("CM10003"),reportSubjects2); + setDataToArray("投资净收益(净损失以\"-\"号填列)",dydata.getString("AM10343"),qndata.getString("AM10343"),reportSubjects2); + setDataToArray("资产处置收益(净损失以\"-\"号填列)",dydata.getString("AM10328"),qndata.getString("AM10328"),reportSubjects2); + setDataToArray("其他收益",dydata.getString("AM10313"),qndata.getString("AM10313"),reportSubjects2); + setDataToArray("二、营业利润",dydata.getString("AM10298"),qndata.getString("AM10298"),reportSubjects2); + setDataToArray("加:营业外收入",dydata.getString("AM10282"),qndata.getString("AM10282"),reportSubjects2); + setDataToArray("减:营业外支出",dydata.getString("AM10258"),qndata.getString("AM10258"),reportSubjects2); + setDataToArray("三、利润总额(亏损总额以“-”号填列)",dydata.getString("AM10236"),qndata.getString("AM10236"),reportSubjects2); + setDataToArray("减:所得税费用",dydata.getString("AM10214"),qndata.getString("AM10214"),reportSubjects2); + setDataToArray("四、净利润(净亏损以“-”号填列)",dydata.getString("AM10193"),qndata.getString("AM10193"),reportSubjects2); + + llb.put("reportSubjects",reportSubjects2); + + JSONObject xjll = new JSONObject();//现金流量表1:本年累计 2:上年累计 + xjll.put("period",cjzq); + xjll.put("reportType",3); + JSONArray reportSubjects3 = new JSONArray(); + setDataToArray("销售商品、提供劳务收到的现金",dydata.getString("AM10240"),qndata.getString("AM10240"),reportSubjects3); + setDataToArray("收到的税费返还",dydata.getString("AM10218"),qndata.getString("AM10218"),reportSubjects3); + setDataToArray("收到的其他与经营活动有关的现金",dydata.getString("AM10196"),qndata.getString("AM10196"),reportSubjects3); + setDataToArray("现金收入小计",dydata.getString("AM10160"),qndata.getString("AM10160"),reportSubjects3); + setDataToArray("购买商品、接受劳务支付的现金",dydata.getString("AM10142"),qndata.getString("AM10142"),reportSubjects3); + setDataToArray("支付给职工以及为职工支付的现金",dydata.getString("AM10124"),qndata.getString("AM10124"),reportSubjects3); + setDataToArray("支付的各项税费",dydata.getString("AM10106"),qndata.getString("AM10106"),reportSubjects3); + setDataToArray("支付的其他与经营活动有关的现金",dydata.getString("AM10088"),qndata.getString("AM10088"),reportSubjects3); + setDataToArray("现金流出小计",dydata.getString("AM10052"),qndata.getString("AM10052"),reportSubjects3); + setDataToArray("经营活动产生的现金流量净额",dydata.getString("AM10022"),qndata.getString("AM10022"),reportSubjects3); + setDataToArray("收回投资所收到的现金",dydata.getString("AM10353"),qndata.getString("AM10353"),reportSubjects3); + setDataToArray("取得投资收益所收到的现金",dydata.getString("AM10338"),qndata.getString("AM10338"),reportSubjects3); + setDataToArray("处置固定资产、无形资产和其他长期资产所收回的现金净额",dydata.getString("AM10323"),qndata.getString("AM10323"),reportSubjects3); + setDataToArray("处置子公司及其他营业单位收到的现金净额",dydata.getString("AM10308"),qndata.getString("AM10308"),reportSubjects3); + setDataToArray("收到的其他与投资活动有关的现金",dydata.getString("AM10293"),qndata.getString("AM10293"),reportSubjects3); + setDataToArray("现金流入小计",dydata.getString("AM10277"),qndata.getString("AM10277"),reportSubjects3); + setDataToArray("购建固定资产、无形资产和其他长期资产所支付的现金",dydata.getString("AM10253"),qndata.getString("AM10253"),reportSubjects3); + setDataToArray("投资所支付的现金",dydata.getString("AM10231"),qndata.getString("AM10231"),reportSubjects3); + setDataToArray("取得子公司及其他营业单位收到的现金净额",dydata.getString("AM10209"),qndata.getString("AM10209"),reportSubjects3); + setDataToArray("其他与投资有关",dydata.getString("AM10191"),qndata.getString("AM10191"),reportSubjects3); + setDataToArray("现金流出小计",dydata.getString("AM10173"),qndata.getString("AM10173"),reportSubjects3); + setDataToArray("投资活动产生的现金流量净额",dydata.getString("AM10155"),qndata.getString("AM10155"),reportSubjects3); + setDataToArray("吸收投资所收到的现金",dydata.getString("AM10119"),qndata.getString("AM10119"),reportSubjects3); + setDataToArray("子公司吸收少数股东投资收到的现金",dydata.getString("AM10101"),qndata.getString("AM10101"),reportSubjects3); + setDataToArray("借贷所收到现金",dydata.getString("AM10083"),qndata.getString("AM10083"),reportSubjects3); + setDataToArray("发行债券收到的现金",dydata.getString("AM10065"),qndata.getString("AM10065"),reportSubjects3); + setDataToArray("收到的其他与筹资活动有关的现金",dydata.getString("AM10050"),qndata.getString("AM10050"),reportSubjects3); + setDataToArray("现金流入小计",dydata.getString("AM10035"),qndata.getString("AM10035"),reportSubjects3); + setDataToArray("偿还债务所支付的现金",dydata.getString("AM10020"),qndata.getString("AM10020"),reportSubjects3); + setDataToArray("分配股利、利润、偿付利息所支付的现金",dydata.getString("AM10005"),qndata.getString("AM10005"),reportSubjects3); + setDataToArray("支付的其他与筹资活动有关的现金",dydata.getString("AM10350"),qndata.getString("AM10350"),reportSubjects3); + setDataToArray("现金流出小计",dydata.getString("AM10335"),qndata.getString("AM10335"),reportSubjects3); + setDataToArray("筹资活动产生的现金流量净额",dydata.getString("AM10320"),qndata.getString("AM10320"),reportSubjects3); + setDataToArray("四、汇率变动对现金流量的影响",dydata.getString("AM10305"),qndata.getString("AM10305"),reportSubjects3); + setDataToArray("五、现金及现金等价物净增加额",dydata.getString("AM10290"),qndata.getString("AM10290"),reportSubjects3); + + xjll.put("reportSubjects",reportSubjects3); + + reportList.add(zcfzb); + reportList.add(llb); + reportList.add(xjll); + + sendData.put("reportList",reportList); + String a = YzfSignUtil.signRequest(sendData,accessSecret); + sendData.put("sign",a); + + Map headers = new HashMap<>(); + headers.put("Content-Type", "application/json; charset=utf-8"); + String returndata = sendPost(url, headers, sendData.toJSONString()); + + if (returndata != null && JSONObject.isValidObject(returndata)) { + JSONObject dataJson = JSONObject.parseObject(returndata); + if(dataJson != null && dataJson.getString("code") != null && "0".equals( dataJson.getString("code"))){ + JSONObject data = dataJson.getJSONObject("result"); + if(data != null ){ + if(data != null && data.getString("resultCode") != null && "0".equals( data.getString("resultCode"))){ + return BaseResult.getSuccessMessageEntity("执行成功"); + }else { + return BaseResult.getFailureMessageEntity("发送失败:"+data.getString("message")); + } + }else { + return BaseResult.getFailureMessageEntity("发送失败:"+returndata); + } + }else { + return BaseResult.getFailureMessageEntity("发送失败:"+returndata); + } + }else { + return BaseResult.getFailureMessageEntity("发送失败:"+returndata); + } + } + + private void setDataToArray(String subjectName, String value,String value2, JSONArray reportSubjects) { + if(value != null && !"".equals(value)){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("subjectName",subjectName); + jsonObject.put("value",new BigDecimal(value)); + jsonObject.put("valueType",1); + reportSubjects.add(jsonObject); + } + if(value2 != null && !"".equals(value2)){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("subjectName",subjectName); + jsonObject.put("value",new BigDecimal(value2)); + jsonObject.put("valueType",2); + reportSubjects.add(jsonObject); + } + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java index beb4c48e..f79b7098 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/mdmDistribute/plugin/MdmModulePluginInitializer.java @@ -470,9 +470,10 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { } } }else {//执行正常下发 - + logger.info("==========开始执行正常主数据下发============="); //查询主数据 MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity(); + queryMdmModuleEntity.setMdmCode(10050L); queryMdmModuleEntity.setSts("Y"); List mdmModuleEntities = mdmModuleDao.queryBase(queryMdmModuleEntity); if(mdmModuleEntities == null || mdmModuleEntities.size() == 0){ @@ -509,13 +510,17 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { queryFildRule.setRuleCode("service"); List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule); - //新增 - doAdd(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); - //修改 - doUpdate(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); - //删除 - doDelete(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); - + if(mdmModuleEntities.get(i).getMdmCode()!= 10045L){ + //新增 + doAdd(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + //修改 + doUpdate(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + //删除 + doDelete(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); + }else{ + logger.info("主数据编码为10045,已经在业务数据下发执行,主数据下发不执行"); + continue; + } } } @@ -739,7 +744,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map1.put("tableName",mainDb); //map1.put("dataStatus", "F"); map1.put("updateStatus", "0"); - map1.put("size", 50); + //map1.put("size", 50); objects = mdmModuleDao.queryMdmSTs(map1); objects = toLowerCaseKeys(objects); @@ -827,6 +832,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { /** body */ String bodys = doObjects.get(i).toJSONString(); if(scriptEntity != null && scriptEntity.getId() != null ){ + logger.info("=========开始执行正常主数据修改下发脚本,第一次=============="); groovy.put("code",scriptEntity.getScriptCode()); groovy.put("className",scriptEntity.getClassName()); groovy.put("name",scriptEntity.getScriptName()); @@ -854,6 +860,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { headers.putAll(header); } if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) { + logger.info("=========正常主数据修改开始执行登录接口=============="); //找到登陆接口 SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); if (null == loginApi) { @@ -874,12 +881,15 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { continue; } JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + logger.info("=======主数据正常修改下发登录返回数据:{}========",attritube.toJSONString()); querys = getQuery(apiEntity,querys,attritube); headers = getHeaders(apiEntity,headers,attritube); bodys = getBodys(apiEntity,bodys,attritube); } //组装数据发送 + logger.info("=========开始执行主业务修改数据下发脚本,第二次=============="); JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + logger.info("=====主数据修改下发返回结果为:{}",JSONObject.parseObject(jsonResultEntity.getAttribute().toString()).toJSONString()); if(jsonResultEntity.isFlag()){ //保存日志 saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"2"); @@ -911,7 +921,8 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { * @param mdmModuleDistributeEntities * @return void **/ - private void doAdd(String mdmId,Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities,List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities ) throws Exception { + private void + doAdd(String mdmId,Long mainCode,List mdmModuleDbEntities, List mdmModuleDistributeEntities,List mdmModuleDbFiledsRuleEntities,List mdmModuleDbFiledsEntities ) throws Exception { //查询一千条数据 String mainDb = null; List objects = new ArrayList<>(); @@ -927,7 +938,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { map1.put("tableName",mainDb); //map1.put("dataStatus", "Y"); map1.put("addStatus", "0"); - map1.put("size", 50); + //map1.put("size", 50); objects = mdmModuleDao.queryMdmSTs(map1); objects = toLowerCaseKeys(objects); @@ -999,6 +1010,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { mdmModuleSendLogEntity.setOptionType("1"); Integer num = mdmModuleSendLogDao.getCount(mdmModuleSendLogEntity); if(num > 0){//已经新增过不发送 + objects.get(i).put("sendsanfzt123",true); continue; } getDetailData(mdmModuleDbEntities,doObjects.get(i),mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); @@ -1029,6 +1041,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { /** body */ String bodys = doObjects.get(i).toJSONString(); if(scriptEntity != null && scriptEntity.getId() != null ){ + logger.info("=========开始执行正常主数据新增下发脚本,第一次=============="); groovy.put("code",scriptEntity.getScriptCode()); groovy.put("className",scriptEntity.getClassName()); groovy.put("name",scriptEntity.getScriptName()); @@ -1056,6 +1069,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { headers.putAll(header); } if (SysEnum.NEED_LOGIN.getValue().equals(apiEntity.getNeedLogin())) { + logger.info("=========正常主数据新增开始执行登录接口=============="); //找到登陆接口 SysApplicationApiEntity loginApi = sysApplicationApiDao.get(apiEntity.getAuthenticationPort()); if (null == loginApi) { @@ -1076,15 +1090,19 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { continue; } JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + logger.info("=======主数据正常新增下发登录返回数据:{}========",attritube.toJSONString()); querys = getQuery(apiEntity,querys,attritube); headers = getHeaders(apiEntity,headers,attritube); bodys = getBodys(apiEntity,bodys,attritube); } //组装数据发送 + logger.info("=========开始执行主业务新增数据下发脚本,第二次=============="); JsonResultEntity jsonResultEntity = sendData(apiEntity,headers,bodys,querys); + logger.info("=====主数据新增下发返回结果为:{}",JSONObject.parseObject(jsonResultEntity.getAttribute().toString()).toJSONString()); if(jsonResultEntity.isFlag()){ if (scriptEntity != null && scriptEntity.getId() != null && scriptEntity.getBackScriptData() != null ) { + logger.info("=========开始执行主数据新增返回脚本=============="); JSONObject backScriptJson = new JSONObject(); backScriptJson.put("data", jsonResultEntity.getAttribute()); groovy.put("code", scriptEntity.getScriptCode()+"back"); @@ -1124,11 +1142,13 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { //保存日志 saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); objects.get(i).put("sendsanfzt123",true); + logger.info("========主数据新增下发完成,日志保存为成功============"); continue; }else { //保存日志 saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1"); objects.get(i).put("sendsanfzt123",false); + logger.info("========主数据新增下发完成,日志保存为失败============"); continue; } } @@ -1136,7 +1156,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { //所有下发发送完成,修改数据状态 for (int i = 0; i < objects.size(); i++) { - if(objects.get(i).getBoolean("sendsanfzt123")){ + if(objects.get(i).getString("sendsanfzt123") != null && objects.get(i).getBoolean("sendsanfzt123")){ Map updateMap = new HashMap<>(); updateMap.put("tableName",mainDb); //updateMap.put("dataStatus", "Y"); @@ -1490,4 +1510,4 @@ public class MdmModulePluginInitializer extends PluginBaseEntity { } return jsonObjects; } -} +} \ No newline at end of file diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/IZjgjDao.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/IZjgjDao.java new file mode 100644 index 00000000..4dc50e3a --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/IZjgjDao.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.zxBank.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.plugin.zxBank.entity.ZjgjEntity; + +/** + * @Description 资金归集 + * @Author xiangerlin + * @Date 2025/4/11 11:07 + **/ +public interface IZjgjDao extends IBaseDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/impl/ZjgjDaoImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/impl/ZjgjDaoImpl.java new file mode 100644 index 00000000..71655a29 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/dao/impl/ZjgjDaoImpl.java @@ -0,0 +1,15 @@ +package com.hzya.frame.plugin.zxBank.dao.impl; + +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.plugin.zxBank.dao.IZjgjDao; +import com.hzya.frame.plugin.zxBank.entity.ZjgjEntity; +import org.springframework.stereotype.Repository; + +/** + * @Description 资金归集 + * @Author xiangerlin + * @Date 2025/4/11 11:07 + **/ +@Repository() +public class ZjgjDaoImpl extends MybatisGenericDao implements IZjgjDao { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.java new file mode 100644 index 00000000..3df95f41 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.java @@ -0,0 +1,11 @@ +package com.hzya.frame.plugin.zxBank.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +/** + * @Description 资金归集 + * @Author xiangerlin + * @Date 2025/4/11 11:04 + **/ +public class ZjgjEntity extends BaseEntity { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.xml b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.xml new file mode 100644 index 00000000..fc6e9287 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/entity/ZjgjEntity.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZjgjPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZjgjPluginInitializer.java new file mode 100644 index 00000000..80ff4468 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZjgjPluginInitializer.java @@ -0,0 +1,97 @@ +package com.hzya.frame.plugin.zxBank.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * @Description 资金归集审批结果通知司库 + * @Author xiangerlin + * @Date 2025/4/11 09:48 + **/ +public class ZjgjPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(getClass()); + /*** + * 插件初始化方法 + * @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 "ZjgjPluginInitializer"; + } + + /**** + * 插件的名称 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginName() { + return "OA资金归集审批结果回传司库"; + } + + /**** + * 插件的显示值 + * @author 👻👻👻👻👻👻👻👻 gjh + * @date 2023-08-02 10:48 + * @return void + **/ + @Override + public String getPluginLabel() { + return "OA资金归集审批结果回传司库"; + } + + /*** + * 插件类型 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("======开始执OA资金归集审批结果回传司库插件======"); + + return null; + } +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankDistributePluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankDistributePluginInitializer.java index 7ace1f25..32edad78 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankDistributePluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankDistributePluginInitializer.java @@ -21,6 +21,7 @@ import com.hzya.frame.mdm.mdmModuleDistributeTripartite.entity.MdmModuleDistribu import com.hzya.frame.mdm.mdmModuleSendLog.dao.IMdmModuleSendLogDao; import com.hzya.frame.mdm.mdmModuleSendLog.entity.MdmModuleSendLogEntity; import com.hzya.frame.mdm.service.IMdmServiceCache; +import com.hzya.frame.seeyon.zxbank.service.IZxBankService; 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; @@ -31,7 +32,6 @@ import com.hzya.frame.sysnew.application.script.entity.SysApplicationScriptEntit import com.hzya.frame.sysnew.grovy.service.IGroovyIntegrationService; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; -import com.hzya.frame.sysnew.zxbank.service.IZxBankService; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; @@ -474,6 +474,7 @@ public class ZxBankDistributePluginInitializer extends PluginBaseEntity { //查询主数据 MdmModuleEntity queryMdmModuleEntity = new MdmModuleEntity(); queryMdmModuleEntity.setSts("Y"); + queryMdmModuleEntity.setMdmCode(Long.valueOf("10048")); List mdmModuleEntities = mdmModuleDao.queryBase(queryMdmModuleEntity); if(mdmModuleEntities == null || mdmModuleEntities.size() == 0){ return BaseResult.getSuccessMessageEntity("主数据未设置,不需要下发"); @@ -508,18 +509,12 @@ public class ZxBankDistributePluginInitializer extends PluginBaseEntity { queryFildRule.setMdmId(mdmModuleEntities.get(i).getId()); queryFildRule.setRuleCode("service"); List mdmModuleDbFiledsRuleEntities = mdmModuleDbFiledsRuleDao.queryBase(queryFildRule); - - if(mdmModuleEntities.get(i).getMdmCode()!= 10045L){ //新增 doAdd(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); //修改 doUpdate(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); //删除 doDelete(mdmModuleEntities.get(i).getId(),mdmCode,mdmModuleDbEntities,mdmModuleDistributeEntities,mdmModuleDbFiledsRuleEntities,mdmModuleDbFiledsEntities); - }else{ - logger.info("主数据编码为10045,已经在业务数据下发执行,主数据下发不执行"); - continue; - } } } diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankElecPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankElecPluginInitializer.java new file mode 100644 index 00000000..6c812a88 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankElecPluginInitializer.java @@ -0,0 +1,57 @@ +package com.hzya.frame.plugin.zxBank.plugin; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.seeyon.zxbank.service.IZxBankService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +public class ZxBankElecPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(ZxBankElecPluginInitializer.class); + @Autowired + private IZxBankService zxBankService; + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "ZxBankElecPluginInitializer"; + } + + @Override + public String getPluginName() { + return "ZxBankElecPluginInitializer插件"; + } + + @Override + public String getPluginLabel() { + return "ZxBankElecPluginInitializer"; + } + + @Override + public String getPluginType() { + return "1"; + } + @Override + public JsonResultEntity executeBusiness(JSONObject requestJson) { + try { + logger.info("======开始执行杭泰付款单查询电子回单并下载电子回单========"); + return zxBankService.queryArchivesElec(requestJson); + }catch (Exception e){ + logger.info("======执行杭泰付款单查询电子回单并下载电子回单失败:{}========",e.getMessage()); + e.printStackTrace(); + } + return null; + } + +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankPluginInitializer.java index 2eb03f95..65d0c3fc 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankPluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankPluginInitializer.java @@ -2,9 +2,7 @@ package com.hzya.frame.plugin.zxBank.plugin; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; -import com.hzya.frame.plugin.masterData.plugin.MdmPluginInitializer; -import com.hzya.frame.sysnew.comparison.masterData.service.IMasterDataService; -import com.hzya.frame.sysnew.zxbank.service.IZxBankService; +import com.hzya.frame.seeyon.zxbank.service.IZxBankService; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankResultPluginInitializer.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankResultPluginInitializer.java index 9a9c901a..399e1989 100644 --- a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankResultPluginInitializer.java +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/plugin/ZxBankResultPluginInitializer.java @@ -2,7 +2,7 @@ package com.hzya.frame.plugin.zxBank.plugin; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.base.PluginBaseEntity; -import com.hzya.frame.sysnew.zxbank.service.IZxBankService; +import com.hzya.frame.seeyon.zxbank.service.IZxBankService; import com.hzya.frame.web.entity.JsonResultEntity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/IZjgjService.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/IZjgjService.java new file mode 100644 index 00000000..a42a2557 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/IZjgjService.java @@ -0,0 +1,12 @@ +package com.hzya.frame.plugin.zxBank.service; + +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.plugin.zxBank.entity.ZjgjEntity; + +/** + * @Description 资金归集 + * @Author xiangerlin + * @Date 2025/4/11 11:03 + **/ +public interface IZjgjService extends IBaseService { +} diff --git a/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/impl/ZjgjServiceImpl.java b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/impl/ZjgjServiceImpl.java new file mode 100644 index 00000000..a257f567 --- /dev/null +++ b/base-buildpackage/src/main/java/com/hzya/frame/plugin/zxBank/service/impl/ZjgjServiceImpl.java @@ -0,0 +1,19 @@ +package com.hzya.frame.plugin.zxBank.service.impl; + +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.plugin.zxBank.entity.ZjgjEntity; +import com.hzya.frame.plugin.zxBank.service.IZjgjService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.stereotype.Service; + +/** + * @Description + * @Author xiangerlin + * @Date 2025/4/11 11:04 + **/ +@Service +public class ZjgjServiceImpl extends BaseService implements IZjgjService { + Logger logger = LogManager.getLogger(getClass()); + +} diff --git a/base-buildpackage/src/main/resources/application-dev.yml b/base-buildpackage/src/main/resources/application-dev.yml new file mode 100644 index 00000000..4121bb71 --- /dev/null +++ b/base-buildpackage/src/main/resources/application-dev.yml @@ -0,0 +1,42 @@ +#######################dev环境####################### +logging: + #日志级别 指定目录级别 + level: + root: warn + encodings: GBK + file: + # 日志保存路径 + path: /home/webservice/zt/log +spring: + datasource: + 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 + 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 + 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/ +cbs8: + appId: 1P4AGrpz + appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a + url: https://cbs8-openapi-reprd.csuat.cmburl.cn + # 测试用这个 这个是银行给的,和下面的公钥不是一对密钥 + ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44 + # 这个私钥到时候上传到cbs,和下面到是同一对 + #ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46 + ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde + cbs_public_key: 0469146F06BF3B01236E84632441E826 + #电子回单下载临时存放位置 + elec_path: /Users/xiangerlin/Downloads/ +OA: + data_source_code: yc_oa +zt: + url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface diff --git a/base-buildpackage/src/main/resources/application-ht.yml b/base-buildpackage/src/main/resources/application-ht.yml index 9188fd1d..3f014426 100644 --- a/base-buildpackage/src/main/resources/application-ht.yml +++ b/base-buildpackage/src/main/resources/application-ht.yml @@ -6,15 +6,15 @@ logging: encodings: UTF-8 file: # 日志保存路径 - path: /home/webservice/zt/log + path: D:\yongansystem\serverV3\log\zs spring: datasource: dynamic: datasource: master: - url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter_ht?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://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true username: root - password: 62e4295b615a30dbf3b8ee96f41c820b + password: bd993088e8a7c3dc5f44441617f9b4bf driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 savefile: # 文件保存路径 @@ -39,4 +39,21 @@ cbs8: OA: data_source_code: yc_oa zt: - url: http://127.0.0.1:9082/kangarooDataCenterV3/entranceController/externalCallInterface \ No newline at end of file + url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface +file_oa: + url: http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterfacefileUpload +#税务pdf附件下载存放路径 +invoice_pdf: + url: D:\yongansystem\invoice\pdf\ +#税务ofd附件下载存放路径 +invoice_ofd: + url: D:\yongansystem\invoice\ofd\ +zx: + # 生产用这个 这个是银行给的 + privateKey: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgOHOzaKWBWOAbslvtYtS8tcQiJ9W9DT2cGQM3KSgXpfygCgYIKoEcz1UBgi2hRANCAAQNPct0MHOuDrVJBIy0RI7JKx9/PTlFHZlkIJr0EqpC+b/+N+z3JKbCMZ/wcP1V36Q+DlfDJCY9Ai/Uk2PZ9ZaF + publicKey: MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEDT3LdDBzrg61SQSMtESOySsffz05RR2ZZCCa9BKqQvm//jfs9ySmwjGf8HD9Vd+kPg5XwyQmPQIv1JNj2fWWhQ== +# 云帐房配置 +yzf: + accessKey: 6X3B526P5HqE6ums + accessSecret: 34e5fc32ac894a2ba2ade8c3852c7a0a + baseUrl: http://oapi.nanofintax.com \ No newline at end of file diff --git a/base-buildpackage/src/main/resources/application-httest.yml b/base-buildpackage/src/main/resources/application-httest.yml new file mode 100644 index 00000000..e76f67c7 --- /dev/null +++ b/base-buildpackage/src/main/resources/application-httest.yml @@ -0,0 +1,46 @@ +#######################dev环境####################### +logging: + #日志级别 指定目录级别 + level: + root: INFO + encodings: UTF-8 + file: + # 日志保存路径 + path: D:\yongansystem\serverV3\log\test +spring: + datasource: + dynamic: + datasource: + master: + url: jdbc:mysql://127.0.0.1:3307/businesscenter_test?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 + 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/ +cbs8: + appId: 1P4AGrpz + appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a + url: https://cbs8-openapi-reprd.csuat.cmburl.cn + # 测试用这个 这个是银行给的,和下面的公钥不是一对密钥 + ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44 + # 这个私钥到时候上传到cbs,和下面到是同一对 + #ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46 + ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde + cbs_public_key: 0469146F06BF3B01236E84632441E826 + #电子回单下载临时存放位置 + elec_path: /Users/xiangerlin/Downloads/ +OA: + data_source_code: yc_oa +zt: + url: http://127.0.0.1:10087/kangarooDataCenterV3/entranceController/externalCallInterface +zx: + # 测试用这个 这个是银行给的 + privateKey: MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgtzMo2o6THK3yLIm+83Ch/560+02l2hjjBSFGieWY/Z6gCgYIKoEcz1UBgi2hRANCAATKhwZX4P3XI8vYTKeCOLMVbanUNbaXjrIEZynshwdOzRVgzRQSiPNWo6OBBkAPvqE+2RS+5ABpS82DSlKl81z0 + publicKey: MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEyocGV+D91yPL2EyngjizFW2p1DW2l46yBGcp7IcHTs0VYM0UEojzVqOjgQZAD76hPtkUvuQAaUvNg0pSpfNc9A== \ No newline at end of file diff --git a/base-buildpackage/src/main/resources/application-llg.yml b/base-buildpackage/src/main/resources/application-llg.yml new file mode 100644 index 00000000..03cdf7ee --- /dev/null +++ b/base-buildpackage/src/main/resources/application-llg.yml @@ -0,0 +1,82 @@ +#######################本地环境####################### +logging: + #日志级别 指定目录级别 + level: + root: info + encodings: UTF-8 + file: + # 日志保存路径 + path: /Users/apple/Desktop/log/local +spring: + data: + mongodb: +# host: 192.168.2.237 +# port: 27017 +# database: businesscenter +# auto-index-creation: true +# password: hzya1314 +# username: hzya + flyway: + # 启动flyway migration, 默认为true + enabled: false + datasource: + dynamic: + druid: + filters: stat,log4j2 + datasource: + master: +# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle +# username: hzyazt +# password: 62e4295b615a30dbf3b8ee96f41c820b +# driver-class-name: dm.jdbc.driver.DmDriver +# type: com.alibaba.druid.pool.DruidDataSource + url: jdbc:mysql://ufidahz.com.cn:9014/businesscenter?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF8&serverTimezone=GMT%2B8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowLoadLocalInfile=false&autoReconnect=true&failOverReadOnly=false&connectTimeout=30000&socketTimeout=30000&autoReconnectForPools=true + username: root + password: bd993088e8a7c3dc5f44441617f9b4bf + driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +# url: jdbc:dm://hzya.ufyct.com:9040/businesscenter?zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8 +# url: jdbc:dm://hzya.ufyct.com:9040?schema=businesscenter&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=utf-8&compatibleMode=oracle +# username: hzyazt +# password: 62e4295b615a30dbf3b8ee96f41c820b +# driver-class-name: dm.jdbc.driver.DmDriver +savefile: + # 文件保存路径 + path: /Users/apple/Desktop/log/local + tomcatpath: /Users/apple/Desktop/log/local + pluginpath: /Users/apple/Desktop/log/local +zt: + url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface +cbs8: + appId: 1P4AGrpz + appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a + url: https://cbs8-openapi-reprd.csuat.cmburl.cn + # 测试用这个 这个是银行给的,和下面的公钥不是一对密钥 + ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44 + # 这个私钥到时候上传到cbs,和下面到是同一对 + #ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46 + ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde + cbs_public_key: 0469146F06BF3B01236E84632441E826 + #电子回单下载临时存放位置 + elec_path: /Users/xiangerlin/Downloads/ +OA: + data_source_code: yc_oa +server: + port: 10086 + +# mysqldump -d mylm -hhzya.ufyct.com -p9096 -uroot -phzya1314 >%dirName%\table_view.sql + + +database: + databaseName: businesscenter + host: 192.168.2.237 + port: 3306 + username: root + password: hzya@1314 + filePase: /Users/apple/Desktop/log + fileName: data.sql +#sftp: +# host: 192.168.2.237 +# port: 9091 +# username: cs237 +# password: hzya@1314 +# filePase: /databaseBack diff --git a/base-buildpackage/src/main/resources/application-xel.yml b/base-buildpackage/src/main/resources/application-xel.yml new file mode 100644 index 00000000..32f34dbb --- /dev/null +++ b/base-buildpackage/src/main/resources/application-xel.yml @@ -0,0 +1,43 @@ +#######################本地环境####################### +logging: + #日志级别 指定目录级别 + level: + root: info + encodings: UTF-8 + file: +# 日志保存路径 + path: /Users/xiangerlin/work/app/logs/dev +spring: + datasource: + 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 + username: root + password: bd993088e8a7c3dc5f44441617f9b4bf + driver-class-name: com.mysql.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +savefile: + # 文件保存路径 + path: /Users/xiangerlin/work/app/file/dev + pluginpath: /Users/xiangerlin/work/app/file/dev + tomcatpath: /Users/xiangerlin/work/app/file/dev +cbs8: + appId: 1P4AGrpz + appSecret: 2c2369ae5dc04382844bbe3a5abf39e1bea9cd3a + url: https://cbs8-openapi-reprd.csuat.cmburl.cn + # 测试用这个 这个是银行给的,和下面的公钥不是一对密钥 + ya_private_key: 83BA7EC821D35F4CB31FF9A51C1EFA520FC52AF828C2337F88E91CF119B07F44 + # 这个私钥到时候上传到cbs,和下面到是同一对 + #ya_private_key: e1eacfdee9b8d4184437d5a2071e17ce31befc3d93395f9f05709ed562e8dc46 + ya_public_key: 044fa399d2223760f17b81b863cb482b009294c4516f8a605dea1475ec09e720eaa98468715e5ad509a592a0b426061551c5a3df236966c23253a7d894eac0dcde + cbs_public_key: 0469146F06BF3B01236E84632441E826F3067A6B93BC3839C836A06007869CD351FBBE388B51F742859388BBC1DE089923AAFBC69E448F15141DDF30EE6CE90185 + #电子回单下载临时存放位置 + elec_path: /Users/xiangerlin/Downloads/ +OA: + data_source_code: yc-test +zt: + url: http://127.0.0.1:10086/kangarooDataCenterV3/entranceController/externalCallInterface +yzf: + accessKey: 6X3B526P5HqE6ums + accessSecret: 34e5fc32ac894a2ba2ade8c3852c7a0a + baseUrl: http://oapi.nanofintax.com diff --git a/base-buildpackage/src/main/resources/application.yml b/base-buildpackage/src/main/resources/application.yml index b87e5bf7..a0bbeaae 100644 --- a/base-buildpackage/src/main/resources/application.yml +++ b/base-buildpackage/src/main/resources/application.yml @@ -1,5 +1,5 @@ server: - port: 10086 + port: 9999 servlet: context-path: /kangarooDataCenterV3 localIP: 127.0.0.1 diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/contract/pluginCfg.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/contract/pluginCfg.xml new file mode 100644 index 00000000..6c8f8261 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/contract/pluginCfg.xml @@ -0,0 +1,6 @@ + + +ContractAuditPluginInitializer +ContractAuditPluginInitializer插件 +25033101 + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/contract/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/contract/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..aea3fc4b --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/contract/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,5 @@ + + + + + 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 53c83b62..6758f61b 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 @@ -1,6 +1,9 @@ - + + + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/pluginCfg.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/pluginCfg.xml new file mode 100644 index 00000000..4fe837f2 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/pluginCfg.xml @@ -0,0 +1,6 @@ + + +IncomeInvoicePlugin +IncomeInvoicePlugin插件 +202404080001 + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-dao.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-dao.xml new file mode 100644 index 00000000..52a288d1 --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-dao.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml new file mode 100644 index 00000000..2c2856fe --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-plugin.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-service.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-service.xml new file mode 100644 index 00000000..68ce3bce --- /dev/null +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/incomeInvoiceData/spring/spring-buildpackage-service.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/base-buildpackage/src/main/resources/cfgHome/plugin/zxBank/spring/spring-buildpackage-plugin.xml b/base-buildpackage/src/main/resources/cfgHome/plugin/zxBank/spring/spring-buildpackage-plugin.xml index ca361062..845017ce 100644 --- a/base-buildpackage/src/main/resources/cfgHome/plugin/zxBank/spring/spring-buildpackage-plugin.xml +++ b/base-buildpackage/src/main/resources/cfgHome/plugin/zxBank/spring/spring-buildpackage-plugin.xml @@ -2,4 +2,7 @@ + + + diff --git a/base-buildpackage/src/test/java/com/hzya/frame/Test1.java b/base-buildpackage/src/test/java/com/hzya/frame/Test1.java new file mode 100644 index 00000000..2dc1c8ee --- /dev/null +++ b/base-buildpackage/src/test/java/com/hzya/frame/Test1.java @@ -0,0 +1,49 @@ +package com.hzya.frame; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.plugin.cinvoice.plugin.CInvoiceImportPluginInitializer; +import com.hzya.frame.plugin.contract.plugin.ContractAuditPluginInitializer; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +import org.junit.Test; + +import javax.annotation.Resource; + +/** + * @Description + * @Author xiangerlin + * @Date 2025/4/1 09:12 + **/ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = {WebappApplication.class}) +public class Test1 { + + + @Resource + private ContractAuditPluginInitializer contractPlugin; + @Resource + private CInvoiceImportPluginInitializer cInvoiceImportPluginInitializer; + @Test + public void contractAuditPluginTest(){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("sourceCode","HT-OA"); + try { + contractPlugin.executeBusiness(jsonObject); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + //发票批量导入 + @Test + public void cinvoicePluginTest(){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("sourceCode","HT-OA"); + try { + cInvoiceImportPluginInitializer.executeBusiness(jsonObject); + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} 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 825925b0..f801ee65 100644 --- a/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java +++ b/base-buildpackage/src/test/java/com/hzya/frame/temButtom.java @@ -2,23 +2,34 @@ package com.hzya.frame; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.seeyon.util.YzfSignUtil; +import com.hzya.frame.sysnew.messageManageLog.entity.SysMessageManageLogEntity; import com.hzya.frame.util.AESUtil; +import com.hzya.frame.web.entity.BaseResult; import org.apache.http.HttpEntity; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; +import org.apache.http.conn.ssl.NoopHostnameVerifier; +import org.apache.http.conn.ssl.TrustAllStrategy; +import org.apache.http.entity.ByteArrayEntity; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.http.impl.client.HttpClients; +import org.apache.http.ssl.SSLContextBuilder; import org.apache.http.util.EntityUtils; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; +import javax.net.ssl.SSLContext; import java.io.IOException; +import java.lang.reflect.Method; +import java.sql.Timestamp; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -36,7 +47,7 @@ public class temButtom { @Test public void test01() { - String a = AESUtil.encrypt("hzya@1314"); + String a = AESUtil.encrypt("hzya1314"); System.out.println(a); String b = AESUtil.decrypt("62e4295b615a30dbf3b8ee96f41c820b"); System.out.println(b); @@ -50,32 +61,31 @@ public class temButtom { // task7803207f54ff047d6008dcce31c2628f 新增成功! // 2024-10-24 2024-10-24 - String phone ="19357235324"; - String taskid ="task8b0c7ca72439bc9b0c1c89e8866c8275"; + String phone = "19357235324"; + String taskid = "task8b0c7ca72439bc9b0c1c89e8866c8275"; //token Map headers = new HashMap<>(); - String token ="https://oapi.dingtalk.com/gettoken?appkey=dingxewtjaserj292ggu&appsecret=DuRw6EEEvhGXfr6Q8wN_x4025qKjrffIGCXF9KeCKKIID-LVSsR6_8KWMei6sug1"; - String body = sendGet(token,headers); + String token = "https://oapi.dingtalk.com/gettoken?appkey=dingxewtjaserj292ggu&appsecret=DuRw6EEEvhGXfr6Q8wN_x4025qKjrffIGCXF9KeCKKIID-LVSsR6_8KWMei6sug1"; + String body = sendGet(token, headers); JSONObject tokenobject = JSONObject.parseObject(body); //钉钉id headers = new HashMap<>(); //https://oapi.dingtalk.com/user/get_by_mobile?access_token=9abd3996cb103ba48dd8c69fea5473e7&mobile=15700100840 - String ddid ="https://oapi.dingtalk.com/user/get_by_mobile?access_token="+tokenobject.get("access_token")+"&mobile="+phone; - String ddidbody = sendGet(ddid,headers); + String ddid = "https://oapi.dingtalk.com/user/get_by_mobile?access_token=" + tokenobject.get("access_token") + "&mobile=" + phone; + String ddidbody = sendGet(ddid, headers); JSONObject ddidobject = JSONObject.parseObject(ddidbody); //人员id headers = new HashMap<>(); //https://oapi.dingtalk.com/user/get?userid=111336474727636213&access_token=3d21a6614fb037a98542a537336e8149 - String userid ="https://oapi.dingtalk.com/user/get?userid="+ddidobject.get("userid")+"&access_token="+tokenobject.get("access_token"); - String useridbody = sendGet(userid,headers); + String userid = "https://oapi.dingtalk.com/user/get?userid=" + ddidobject.get("userid") + "&access_token=" + tokenobject.get("access_token"); + String useridbody = sendGet(userid, headers); JSONObject useridobject = JSONObject.parseObject(useridbody); - CloseableHttpClient httpClient = HttpClients.createDefault(); - HttpPut httpPut = new HttpPut("https://api.dingtalk.com/v1.0/todo/users/"+useridobject.get("unionid")+"/tasks/"+taskid); + HttpPut httpPut = new HttpPut("https://api.dingtalk.com/v1.0/todo/users/" + useridobject.get("unionid") + "/tasks/" + taskid); RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(35000).setConnectionRequestTimeout(35000).setSocketTimeout(60000).build(); httpPut.setConfig(requestConfig); httpPut.setHeader("Content-type", "application/json"); @@ -122,7 +132,7 @@ public class temButtom { response = closeableHttpClient.execute(get); HttpEntity entity = response.getEntity(); - body.append(EntityUtils.toString(entity,"UTF-8")); + body.append(EntityUtils.toString(entity, "UTF-8")); } catch (Exception e) { body.append(e.getMessage()); } finally { @@ -143,4 +153,154 @@ public class temButtom { } + @Test + public void test0111() { + //请求token + String accessToken = getToken(); + //请求分页查询全量进项发票 + String data = getdata(accessToken); + + + } + + @Test + public void youduTest(){ + long timestamp = System.currentTimeMillis(); + System.out.println("时间戳:"+timestamp); + Map parametersMap = new HashMap<>(); + parametersMap.put("accessKey","6X3B526P5HqE6ums"); + parametersMap.put("timestamp",timestamp); + + 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); + + 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; + } } diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/ApplicationCache.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/ApplicationCache.java index 16daadce..e8482db9 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/ApplicationCache.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/ApplicationCache.java @@ -64,6 +64,9 @@ public class ApplicationCache { case "2": // o = applicationApiMap.get(key); break; + case "5": // + o = applicationApiMap.get(key); + break; case "3": // o = applicationApiAuthMap.get(key); break; @@ -96,6 +99,7 @@ public class ApplicationCache { if(receiveApiList != null && receiveApiList.size() > 0){ for (int i = 0; i < receiveApiList.size(); i++) { applicationApiMap.put("appId"+receiveApiList.get(i).getAppId()+"apiCode"+receiveApiList.get(i).getApiCode(), receiveApiList.get(i)); + applicationApiMap.put("apiId"+receiveApiList.get(i).getId(), receiveApiList.get(i)); } } break; diff --git a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java index ad9976a0..caf670cc 100644 --- a/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java +++ b/base-service/src/main/java/com/hzya/frame/sysnew/application/service/impl/SysApplicationServiceImpl.java @@ -3055,8 +3055,13 @@ public class SysApplicationServiceImpl extends BaseServicefw-ningbobank--> - - - - - + + com.hzya.frame + fw-oa + ${revision} + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java new file mode 100644 index 00000000..e8304591 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDao.java @@ -0,0 +1,72 @@ +package com.hzya.frame.seeyon.invoice.dao; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity; + +import java.util.HashMap; +import java.util.List; + +public interface IInvoiceDao extends IBaseDao { + + /** + * + * @content 查询需要推送税务的数据 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-01 15:33 + * **/ + List> queryInvoice(String str , MdmModuleSourceEntity entity); + + /** + * + * @content 查询申请单详情 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-07 14:05 + * **/ + List queryInvoiceResult(InvoiceEntity entity); + + /** + * + * @content 更新推送标识 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-15 15:37 + * **/ + Integer updateInvoicePush(InvoiceEntity entity); + + /** + * + * @content 更新pdf和ofd附件到OA + * @Param + * @Return + * @Author hecan + * @Date 2025-04-14 10:27 + * **/ + Integer updateInvoiceUrl(InvoiceEntity entity); + + /** + * + * @content 更新发票代码,发票号码以及开票结果 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-14 16:35 + * **/ + Integer updateInvoiceResult(InvoiceEntity entity); + + /** + * + * @content 进项发票推送结果查询(查询发票批量录入结果) + * @Param + * @Return + * @Author hecan + * @Date 2025-04-17 15:19 + * **/ + List queryInputInvoiceResult(InvoiceEntity entity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDetailsDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDetailsDao.java new file mode 100644 index 00000000..8a61f896 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/IInvoiceDetailsDao.java @@ -0,0 +1,20 @@ +package com.hzya.frame.seeyon.invoice.dao; + +import com.hzya.frame.basedao.dao.IBaseDao; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.invoice.entity.InvoiceDetailsEntity; + +import java.util.HashMap; +import java.util.List; + +public interface IInvoiceDetailsDao extends IBaseDao { + /** + * + * @content 查询需要推送税务的数据 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-01 15:33 + * **/ + List> queryInvoiceDetails(String str , MdmModuleSourceEntity entity); +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java new file mode 100644 index 00000000..1d189240 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDaoImpl.java @@ -0,0 +1,65 @@ +package com.hzya.frame.seeyon.invoice.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.execsql.service.IExecSqlService; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.invoice.dao.IInvoiceDao; +import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.util.HashMap; +import java.util.List; + +@Repository(value = "InvoiceDaoImpl") +public class InvoiceDaoImpl extends MybatisGenericDao implements IInvoiceDao { + @Autowired + private IExecSqlService execSqlService; + + private Logger logger = LogManager.getLogger(super.getClass()); + + @DS("#entity.dataSourceCode") + @Override + public List> queryInvoice(String str, MdmModuleSourceEntity entity) { + try { + List> hashMaps = execSqlService.execSelectSql(str, ""); + return hashMaps; + }catch (Exception e){ + logger.info("没有需要推送税务的数据"); + return null; + } + } + + @DS("#entity.dataSourceCode") + @Override + public List queryInvoiceResult(InvoiceEntity entity) { + return (List) super.selectList("queryInvoiceResult",entity); + } + + @DS("#entity.dataSourceCode") + @Override + public Integer updateInvoicePush(InvoiceEntity entity) { + return super.update("updateInvoicePush",entity); + } + + @DS("#entity.dataSourceCode") + @Override + public Integer updateInvoiceUrl(InvoiceEntity entity) { + return super.update("updateInvoiceUrl",entity); + } + + @DS("#entity.dataSourceCode") + @Override + public Integer updateInvoiceResult(InvoiceEntity entity) { + return super.update("updateInvoiceResult",entity); + } + + @DS("#entity.dataSourceCode") + @Override + public List queryInputInvoiceResult(InvoiceEntity entity) { + return (List)super.selectList("queryInputInvoiceResult",entity); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDetailsDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDetailsDaoImpl.java new file mode 100644 index 00000000..55b1b481 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/dao/impl/InvoiceDetailsDaoImpl.java @@ -0,0 +1,35 @@ +package com.hzya.frame.seeyon.invoice.dao.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.hzya.frame.basedao.dao.MybatisGenericDao; +import com.hzya.frame.execsql.service.IExecSqlService; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.invoice.dao.IInvoiceDetailsDao; +import com.hzya.frame.seeyon.invoice.entity.InvoiceDetailsEntity; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Repository; + +import java.util.HashMap; +import java.util.List; + +@Repository(value ="InvoiceDetailsDaoImpl") +public class InvoiceDetailsDaoImpl extends MybatisGenericDao implements IInvoiceDetailsDao { + @Autowired + private IExecSqlService execSqlService; + + private Logger logger = LogManager.getLogger(super.getClass()); + + @DS("#entity.dataSourceCode") + @Override + public List> queryInvoiceDetails(String str, MdmModuleSourceEntity entity) { + try { + List> hashMaps = execSqlService.execSelectSql(str, ""); + return hashMaps; + }catch (Exception e){ + logger.info("没有需要推送税务的明细数据"); + return null; + } + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.java new file mode 100644 index 00000000..a7bc58fd --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.java @@ -0,0 +1,141 @@ +package com.hzya.frame.seeyon.invoice.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +public class InvoiceDetailsEntity extends BaseEntity { + private String item_no;//明细行编号 + private String item_name;//商品名称 + private String tax_cate_code;//税收分类编码,19位 + private String spec;//规格型号 + private String unit;//单位 + private String quantity;//数量 + private String unit_price;//单价 + private String price;//金额 + private String tax_rate;//税率 + private String zero_flag;//零税率 + private String tax;//税额 + private String include_tax_tag;//含税标识 + private String detail_type;//明细行性质 + private String enjoy_preferential_flag;//是否享受优惠0 否1是 + private String preferential_policy_type;//优惠政策类型 + + public String getItem_no() { + return item_no; + } + + public void setItem_no(String item_no) { + this.item_no = item_no; + } + + public String getItem_name() { + return item_name; + } + + public void setItem_name(String item_name) { + this.item_name = item_name; + } + + public String getTax_cate_code() { + return tax_cate_code; + } + + public void setTax_cate_code(String tax_cate_code) { + this.tax_cate_code = tax_cate_code; + } + + public String getSpec() { + return spec; + } + + public void setSpec(String spec) { + this.spec = spec; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public String getQuantity() { + return quantity; + } + + public void setQuantity(String quantity) { + this.quantity = quantity; + } + + public String getUnit_price() { + return unit_price; + } + + public void setUnit_price(String unit_price) { + this.unit_price = unit_price; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } + + public String getTax_rate() { + return tax_rate; + } + + public void setTax_rate(String tax_rate) { + this.tax_rate = tax_rate; + } + + public String getZero_flag() { + return zero_flag; + } + + public void setZero_flag(String zero_flag) { + this.zero_flag = zero_flag; + } + + public String getTax() { + return tax; + } + + public void setTax(String tax) { + this.tax = tax; + } + + public String getInclude_tax_tag() { + return include_tax_tag; + } + + public void setInclude_tax_tag(String include_tax_tag) { + this.include_tax_tag = include_tax_tag; + } + + public String getDetail_type() { + return detail_type; + } + + public void setDetail_type(String detail_type) { + this.detail_type = detail_type; + } + + public String getEnjoy_preferential_flag() { + return enjoy_preferential_flag; + } + + public void setEnjoy_preferential_flag(String enjoy_preferential_flag) { + this.enjoy_preferential_flag = enjoy_preferential_flag; + } + + public String getPreferential_policy_type() { + return preferential_policy_type; + } + + public void setPreferential_policy_type(String preferential_policy_type) { + this.preferential_policy_type = preferential_policy_type; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.xml new file mode 100644 index 00000000..4238f173 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceDetailsEntity.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + * + + + + + + + + + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java new file mode 100644 index 00000000..239b0659 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.java @@ -0,0 +1,646 @@ +package com.hzya.frame.seeyon.invoice.entity; + +import com.hzya.frame.web.entity.BaseEntity; + +public class InvoiceEntity extends BaseEntity { + private String sfhc;// 是否红冲 + private String xf;// 销方 + private String access_key;// 申请开放平台分配的accessKey + private String sign;// 加密签名 + private String timestamp;// 用户发起请求的时间 + private String serial_number;// 请求唯一流水号 + private String company_code;// 企业编码 + private String seller_tax_no;// 企业纳税人识别号 + private String template_id;// 模版ID,固定值: + private String business_no;// 业务单号 + private String superior_business_no;// 上级业务单号 + private String buyer_name;// 购买方名称 + private String buyer_tax_no;// 购买方纳税人识别号 + private String buyer_addr_phone;// 购买方地址、电话 + private String buyer_bank_account;// 购买方开户行及账号 + private String apply_person;// 申请人 + private String apply_email_notice;// 是否邮件通知申请人 1 是0 否 + private String buyer_email_notice;// 是否邮件通知购买方 1 是0 否 + private String workcode;// 申请人工号 + private String other_email;// 其他发票接收邮箱 + private String buyer_contact;// 购买方发票邮寄接收联系人名称 + private String buyer_mobile;// 购买方发票邮寄接收手机号 + private String buyer_recv_address;// 购买方发票邮寄接收地址 + private String application_remark;// 申请单其他说明 + private String attachments;// 附件,文件Url地址列表 + private String notify_url;// 回调通知地址 + private String special_invoice_mark;// 特殊票种标识 + private String seller_name;// 销售方名称 + private String seller_addr_phone;// 销售方地址、电话 + private String seller_bank_account;// 销售方银行账号 + private String extend_fields;// 自定义扩展字段 + private String invoice_type;// 发票种类示例值 + private String is_person;// 是否自然人1是默认为否 + private String levy_tax_type;// 征税方式 + private String deduction;// 扣除额,差额征税时必填 + private String remark;// 发票备注 + private String place;// 地址 + private String place_of_detail;// 详细地址 + private String construction_project_name;// 建筑项目名称 + private String kqysssxbgglbm;// 跨区域涉税事项报验管理編号 + private String product_no;// 土地增值税项目编号 + private String cross_distinct_city_flag;// 跨地(市)标志:是,否 + private String certificate_of_title;// 产权证书/不动产权证号 + private String area_unit;// 面积 + private String start_date;// 租赁开始,格式yyyy-MM-dd + private String end_date;// 租赁结束,格式yyyy-MM-dd + private String original_seller_name;// 原开票企业-销售方名称 + private String original_seller_tax_no;// 原开票企业-销售方纳税人识别号 + private String applicant;// 申请方 + private String deduction_status;// 抵扣状态 + private String original_invoice_code;// 原发票代码 + private String original_invoice_number;// 原发票号码 + private String original_invoice_date;// 原发票开票日期 + private String original_invoice_price;// 原发票不含税总金额 + private String red_flush_reason;// 红冲原因 + private String original_superior_business_no;// 原上级业务单号 + private String red_letter_info_sheet_no;// 红字信息表编号 + private String original_invoice_check_ode;// 原发票校验码 + private String push_status_filed;// 推送标识字段 + private String invoice_code_field;// 发票代码字段 + private String invoice_number_field;// 发票号码字段 + private String url_field;// 发票文件字段 + private String result_status_field;// 开票结果字段 + private String push_status;// 推送标识 + private String invoice_code;// 发票代码 + private String invoice_number;// 发票号码 + private String url;// 发票文件 + private String result_status;// 开票结果 + + private String summaryId;// + private String input_result_status_filed;//进项发票结果字段 + private String input_result_status;//进项发票结果 + + public String getInput_result_status_filed() { + return input_result_status_filed; + } + + public void setInput_result_status_filed(String input_result_status_filed) { + this.input_result_status_filed = input_result_status_filed; + } + + public String getInput_result_status() { + return input_result_status; + } + + public void setInput_result_status(String input_result_status) { + this.input_result_status = input_result_status; + } + + public String getSummaryId() { + return summaryId; + } + + public void setSummaryId(String summaryId) { + this.summaryId = summaryId; + } + + public String getPush_status_filed() { + return push_status_filed; + } + + public void setPush_status_filed(String push_status_filed) { + this.push_status_filed = push_status_filed; + } + + public String getInvoice_code_field() { + return invoice_code_field; + } + + public void setInvoice_code_field(String invoice_code_field) { + this.invoice_code_field = invoice_code_field; + } + + public String getInvoice_number_field() { + return invoice_number_field; + } + + public void setInvoice_number_field(String invoice_number_field) { + this.invoice_number_field = invoice_number_field; + } + + public String getUrl_field() { + return url_field; + } + + public void setUrl_field(String url_field) { + this.url_field = url_field; + } + + public String getResult_status_field() { + return result_status_field; + } + + public void setResult_status_field(String result_status_field) { + this.result_status_field = result_status_field; + } + + public String getPush_status() { + return push_status; + } + + public void setPush_status(String push_status) { + this.push_status = push_status; + } + + public String getInvoice_code() { + return invoice_code; + } + + public void setInvoice_code(String invoice_code) { + this.invoice_code = invoice_code; + } + + public String getInvoice_number() { + return invoice_number; + } + + public void setInvoice_number(String invoice_number) { + this.invoice_number = invoice_number; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getResult_status() { + return result_status; + } + + public void setResult_status(String result_status) { + this.result_status = result_status; + } + + public String getSfhc() { + return sfhc; + } + + public void setSfhc(String sfhc) { + this.sfhc = sfhc; + } + + public String getXf() { + return xf; + } + + public void setXf(String xf) { + this.xf = xf; + } + + public String getAccess_key() { + return access_key; + } + + public void setAccess_key(String access_key) { + this.access_key = access_key; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getTimestamp() { + return timestamp; + } + + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + public String getSerial_number() { + return serial_number; + } + + public void setSerial_number(String serial_number) { + this.serial_number = serial_number; + } + + public String getCompany_code() { + return company_code; + } + + public void setCompany_code(String company_code) { + this.company_code = company_code; + } + + public String getSeller_tax_no() { + return seller_tax_no; + } + + public void setSeller_tax_no(String seller_tax_no) { + this.seller_tax_no = seller_tax_no; + } + + public String getTemplate_id() { + return template_id; + } + + public void setTemplate_id(String template_id) { + this.template_id = template_id; + } + + public String getBusiness_no() { + return business_no; + } + + public void setBusiness_no(String business_no) { + this.business_no = business_no; + } + + public String getSuperior_business_no() { + return superior_business_no; + } + + public void setSuperior_business_no(String superior_business_no) { + this.superior_business_no = superior_business_no; + } + + public String getBuyer_name() { + return buyer_name; + } + + public void setBuyer_name(String buyer_name) { + this.buyer_name = buyer_name; + } + + public String getBuyer_tax_no() { + return buyer_tax_no; + } + + public void setBuyer_tax_no(String buyer_tax_no) { + this.buyer_tax_no = buyer_tax_no; + } + + public String getBuyer_addr_phone() { + return buyer_addr_phone; + } + + public void setBuyer_addr_phone(String buyer_addr_phone) { + this.buyer_addr_phone = buyer_addr_phone; + } + + public String getBuyer_bank_account() { + return buyer_bank_account; + } + + public void setBuyer_bank_account(String buyer_bank_account) { + this.buyer_bank_account = buyer_bank_account; + } + + public String getApply_person() { + return apply_person; + } + + public void setApply_person(String apply_person) { + this.apply_person = apply_person; + } + + public String getApply_email_notice() { + return apply_email_notice; + } + + public void setApply_email_notice(String apply_email_notice) { + this.apply_email_notice = apply_email_notice; + } + + public String getBuyer_email_notice() { + return buyer_email_notice; + } + + public void setBuyer_email_notice(String buyer_email_notice) { + this.buyer_email_notice = buyer_email_notice; + } + + public String getWorkcode() { + return workcode; + } + + public void setWorkcode(String workcode) { + this.workcode = workcode; + } + + public String getOther_email() { + return other_email; + } + + public void setOther_email(String other_email) { + this.other_email = other_email; + } + + public String getBuyer_contact() { + return buyer_contact; + } + + public void setBuyer_contact(String buyer_contact) { + this.buyer_contact = buyer_contact; + } + + public String getBuyer_mobile() { + return buyer_mobile; + } + + public void setBuyer_mobile(String buyer_mobile) { + this.buyer_mobile = buyer_mobile; + } + + public String getBuyer_recv_address() { + return buyer_recv_address; + } + + public void setBuyer_recv_address(String buyer_recv_address) { + this.buyer_recv_address = buyer_recv_address; + } + + public String getApplication_remark() { + return application_remark; + } + + public void setApplication_remark(String application_remark) { + this.application_remark = application_remark; + } + + public String getAttachments() { + return attachments; + } + + public void setAttachments(String attachments) { + this.attachments = attachments; + } + + public String getNotify_url() { + return notify_url; + } + + public void setNotify_url(String notify_url) { + this.notify_url = notify_url; + } + + public String getSpecial_invoice_mark() { + return special_invoice_mark; + } + + public void setSpecial_invoice_mark(String special_invoice_mark) { + this.special_invoice_mark = special_invoice_mark; + } + + public String getSeller_name() { + return seller_name; + } + + public void setSeller_name(String seller_name) { + this.seller_name = seller_name; + } + + public String getSeller_addr_phone() { + return seller_addr_phone; + } + + public void setSeller_addr_phone(String seller_addr_phone) { + this.seller_addr_phone = seller_addr_phone; + } + + public String getSeller_bank_account() { + return seller_bank_account; + } + + public void setSeller_bank_account(String seller_bank_account) { + this.seller_bank_account = seller_bank_account; + } + + public String getExtend_fields() { + return extend_fields; + } + + public void setExtend_fields(String extend_fields) { + this.extend_fields = extend_fields; + } + + public String getInvoice_type() { + return invoice_type; + } + + public void setInvoice_type(String invoice_type) { + this.invoice_type = invoice_type; + } + + public String getIs_person() { + return is_person; + } + + public void setIs_person(String is_person) { + this.is_person = is_person; + } + + public String getLevy_tax_type() { + return levy_tax_type; + } + + public void setLevy_tax_type(String levy_tax_type) { + this.levy_tax_type = levy_tax_type; + } + + public String getDeduction() { + return deduction; + } + + public void setDeduction(String deduction) { + this.deduction = deduction; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getPlace() { + return place; + } + + public void setPlace(String place) { + this.place = place; + } + + public String getPlace_of_detail() { + return place_of_detail; + } + + public void setPlace_of_detail(String place_of_detail) { + this.place_of_detail = place_of_detail; + } + + public String getConstruction_project_name() { + return construction_project_name; + } + + public void setConstruction_project_name(String construction_project_name) { + this.construction_project_name = construction_project_name; + } + + public String getKqysssxbgglbm() { + return kqysssxbgglbm; + } + + public void setKqysssxbgglbm(String kqysssxbgglbm) { + this.kqysssxbgglbm = kqysssxbgglbm; + } + + public String getProduct_no() { + return product_no; + } + + public void setProduct_no(String product_no) { + this.product_no = product_no; + } + + public String getCross_distinct_city_flag() { + return cross_distinct_city_flag; + } + + public void setCross_distinct_city_flag(String cross_distinct_city_flag) { + this.cross_distinct_city_flag = cross_distinct_city_flag; + } + + public String getCertificate_of_title() { + return certificate_of_title; + } + + public void setCertificate_of_title(String certificate_of_title) { + this.certificate_of_title = certificate_of_title; + } + + public String getArea_unit() { + return area_unit; + } + + public void setArea_unit(String area_unit) { + this.area_unit = area_unit; + } + + public String getStart_date() { + return start_date; + } + + public void setStart_date(String start_date) { + this.start_date = start_date; + } + + public String getEnd_date() { + return end_date; + } + + public void setEnd_date(String end_date) { + this.end_date = end_date; + } + + public String getOriginal_seller_name() { + return original_seller_name; + } + + public void setOriginal_seller_name(String original_seller_name) { + this.original_seller_name = original_seller_name; + } + + public String getOriginal_seller_tax_no() { + return original_seller_tax_no; + } + + public void setOriginal_seller_tax_no(String original_seller_tax_no) { + this.original_seller_tax_no = original_seller_tax_no; + } + + public String getApplicant() { + return applicant; + } + + public void setApplicant(String applicant) { + this.applicant = applicant; + } + + public String getDeduction_status() { + return deduction_status; + } + + public void setDeduction_status(String deduction_status) { + this.deduction_status = deduction_status; + } + + public String getOriginal_invoice_code() { + return original_invoice_code; + } + + public void setOriginal_invoice_code(String original_invoice_code) { + this.original_invoice_code = original_invoice_code; + } + + public String getOriginal_invoice_number() { + return original_invoice_number; + } + + public void setOriginal_invoice_number(String original_invoice_number) { + this.original_invoice_number = original_invoice_number; + } + + public String getOriginal_invoice_date() { + return original_invoice_date; + } + + public void setOriginal_invoice_date(String original_invoice_date) { + this.original_invoice_date = original_invoice_date; + } + + public String getOriginal_invoice_price() { + return original_invoice_price; + } + + public void setOriginal_invoice_price(String original_invoice_price) { + this.original_invoice_price = original_invoice_price; + } + + public String getRed_flush_reason() { + return red_flush_reason; + } + + public void setRed_flush_reason(String red_flush_reason) { + this.red_flush_reason = red_flush_reason; + } + + public String getOriginal_superior_business_no() { + return original_superior_business_no; + } + + public void setOriginal_superior_business_no(String original_superior_business_no) { + this.original_superior_business_no = original_superior_business_no; + } + + public String getRed_letter_info_sheet_no() { + return red_letter_info_sheet_no; + } + + public void setRed_letter_info_sheet_no(String red_letter_info_sheet_no) { + this.red_letter_info_sheet_no = red_letter_info_sheet_no; + } + + public String getOriginal_invoice_check_ode() { + return original_invoice_check_ode; + } + + public void setOriginal_invoice_check_ode(String original_invoice_check_ode) { + this.original_invoice_check_ode = original_invoice_check_ode; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml new file mode 100644 index 00000000..10213540 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceEntity.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * + + + + + + + + + + + + + update ${tabName} set ${url_field} =#{url} where id=#{id} + + + + + update formmain_0331 set field0206 =#{push_status} where id=#{id} + + + + + update ${tabName} set + + ${input_result_status_filed} = #{input_result_status}, + ${invoice_code_field} = #{invoice_code}, + ${invoice_number_field} = #{invoice_number}, + ${result_status_field} = #{result_status}, + + where id=#{id} + + + + + diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceState.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceState.java new file mode 100644 index 00000000..cf584ee3 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/entity/InvoiceState.java @@ -0,0 +1,51 @@ +package com.hzya.frame.seeyon.invoice.entity; + +import com.hzya.frame.seeyon.zxbank.entity.PayState; + +public enum InvoiceState { + zero("0","申请单被关闭"), + one("1","申请单开票成功"), + two("2","申请单处理中"), + three("3","申请单开具异常"), + 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; + } + + InvoiceState(String type, String value){ + this.type=type; + this.value=value; + } + + public static String invoiceStateGetValue(String type){ + for (InvoiceState invoiceState : InvoiceState.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/IInvoiceService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/IInvoiceService.java new file mode 100644 index 00000000..05d18405 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/IInvoiceService.java @@ -0,0 +1,39 @@ +package com.hzya.frame.seeyon.invoice.service; + +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.IBaseService; +import com.hzya.frame.seeyon.invoice.entity.InvoiceEntity; +import com.hzya.frame.web.entity.JsonResultEntity; + +public interface IInvoiceService extends IBaseService { + + /** + * + * @content 查询需要推送税务的数据 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-01 15:25 + * **/ + JsonResultEntity queryArchives(JSONObject jsonObject); + + /** + * + * @content 根据申请单查询开票结果 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-02 14:10 + * **/ + JsonResultEntity queryInvoiceResult(JSONObject json); + + /** + * + * @content 进项发票推送结果查询(查询发票批量录入结果) + * @Param + * @Return + * @Author hecan + * @Date 2025-04-17 15:11 + * **/ + JsonResultEntity queryInputInvoiceResult(JSONObject json); +} 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 new file mode 100644 index 00000000..dfbdd22f --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/invoice/service/impl/InvoiceServiceImpl.java @@ -0,0 +1,498 @@ +package com.hzya.frame.seeyon.invoice.service.impl; + +import cn.hutool.http.HttpRequest; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.basedao.service.impl.BaseService; +import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl; +import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.dao.ICtpAttachmentDao; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; +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.InvoiceState; +import com.hzya.frame.seeyon.invoice.service.IInvoiceService; +import com.hzya.frame.seeyon.util.OARestUtil; +import com.hzya.frame.seeyon.util.YzfSignUtil; +import com.hzya.frame.seeyon.zxbank.entity.PayState; +import com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity; +import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.uuid.UUIDLong; +import com.hzya.frame.uuid.UUIDUtils; +import com.hzya.frame.web.entity.BaseResult; +import com.hzya.frame.web.entity.JsonResultEntity; +import 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.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.*; + +@Service(value = "InvoiceServiceImpl") +public class InvoiceServiceImpl extends BaseService implements IInvoiceService { + @Autowired + private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl; + + @Autowired + private IInvoiceDao invoiceDao; + @Autowired + private IInvoiceDetailsDao invoiceDetailsDao; + + @Autowired + private IIntegrationTaskLivingDetailsService taskLivingDetailsService; + @Autowired + private ComparisonServiceImpl comparisonServiceimpl; + @Autowired + private ICtpAttachmentDao ctpAttachmentDao; + + @Value("${zt.url}") + private String url; + + @Value("${invoice_pdf.url:}") + private String invoicePdfUrl; + @Value("${invoice_ofd.url:}") + private String invoiceOfdUrl; + + @Override + public JsonResultEntity queryArchives(JSONObject json) { + JSONObject jsonObject = json.getJSONObject("jsonStr"); + //根据插件分类查询主数据来源表 + List list = mdmModuleSourceDaoImpl.MdmModuleSourceentityGroupByType(); + if (CollectionUtils.isEmpty(list)) { + logger.info("没有类型为插件得数据,无法获取数据"); + return BaseResult.getFailureMessageEntity("数据来源表无插件类型"); + } + for (MdmModuleSourceEntity mdmModuleSourceEntity : list) { + String tableName = ""; + List object=new ArrayList<>(); + List listAll = new ArrayList<>(); + try { + String appTyp = mdmModuleSourceEntity.getAppType();//系统类型 1、致远OA 2、用友U8C 3、用友BIP + String dbCode = mdmModuleSourceEntity.getDbCode();//数据源编码 + String mdmCode = mdmModuleSourceEntity.getMdmCode();//主数据编码 + switch (appTyp){ + case "1": + switch (mdmCode){ + case "10049"://杭泰开票申请单 + tableName = "mdm_invoice_application"; + listAll = bindingInvoice(jsonObject, mdmModuleSourceEntity, dbCode); + break; + default: + break; + } + break; + default: + break; + } + //将查询出来的数据进行组装,调用通用方法新增或者更新 + if (null != listAll && listAll.size() > 0) { + object = ParametricDocument(listAll, mdmCode, tableName); + if (CollectionUtils.isNotEmpty(object)) { + for (Object obj : object) { + //更新单据视图推送标识,不再抽取 + JSONObject attributeResult = (JSONObject) JSON.toJSON(obj); + if (attributeResult.getString("status").equals("200")) { + String resultString = attributeResult.getString("list"); + if ("10049".equals(mdmCode)) { + JSONArray jsonArray = JSONArray.parseArray(resultString); + if (CollectionUtils.isNotEmpty(jsonArray)) { + for (Object o : jsonArray) { + JSONObject attributeArray = (JSONObject) JSON.toJSON(o); + String cmpApply = attributeArray.getString(tableName); + JSONObject jsonObjectCmpApply = JSONObject.parseObject(cmpApply); + String id = jsonObjectCmpApply.getString("data_id");//主表id + String vdef1 = jsonObjectCmpApply.getString("business_no");//主表id + logger.info("=====开始根据单据id:{},单据号:{},更新表:formmain_0331的推送标识", id, vdef1); + InvoiceEntity invoiceEntity = new InvoiceEntity(); + invoiceEntity.setPush_status("1"); + invoiceEntity.setId(id); + invoiceEntity.setDataSourceCode(mdmModuleSourceEntity.getDataSourceCode()); + invoiceDao.updateInvoicePush(invoiceEntity); + //保存业务数据日志 + saveTaskLivingDetails(id, jsonObjectCmpApply.getString("business_no"), listAll.get(0).toString(), object.toString(), true,"MakeInvoicePluginInitializer"); + } + } + } + } else { + saveTaskLivingDetails(JSONObject.parseObject(listAll.get(0).getString("mdm_invoice_application")).getString("data_id"), JSONObject.parseObject(listAll.get(0).getString("mdm_invoice_application")).getString("business_no"), listAll.get(0).toString(), JSON.parseObject(JSON.toJSONString(object)).getString("msg"), false,"MakeInvoicePluginInitializer"); + } + } + } + } else { + logger.info("三维单据视图数据没有需要同步中台的数据"); + } + }catch (Exception e){ + logger.info("杭泰付款单同步失败:{}",e.getMessage()); + saveTaskLivingDetails(JSONObject.parseObject(listAll.get(0).getString("mdm_invoice_application")).getString("data_id"),JSONObject.parseObject(listAll.get(0).getString("mdm_invoice_application")).getString("business_no"),listAll.get(0).toString(),JSON.parseObject(JSON.toJSONString(object)).getString("msg")==null?JSON.parseObject(JSON.toJSONString(object)).getString("list"):JSON.parseObject(JSON.toJSONString(object)).getString("msg"),false,"MakeInvoicePluginInitializer"); + e.printStackTrace(); + } + } + return BaseResult.getSuccessMessageEntity("开票申请单同步成功"); + } + + @Override + public JsonResultEntity queryInvoiceResult(JSONObject json) { + try { + InvoiceEntity invoiceEntity = json.toJavaObject(InvoiceEntity.class); + invoiceEntity.setDataSourceCode("HT-OA"); + logger.info("=======开始查询杭泰税务的开票申请单返回结果========="); + List invoiceEntities = invoiceDao.queryInvoiceResult(invoiceEntity); + if(CollectionUtils.isEmpty(invoiceEntities)){ + logger.info("=====杭泰税务中没有需要查询申请单详情得数据========"); + return BaseResult.getSuccessMessageEntity("查询成功"); + } + for (InvoiceEntity entity : invoiceEntities) { + long timestamp = System.currentTimeMillis(); + Map parametersMap = new HashMap<>(); + parametersMap.put("accessKey","6X3B526P5HqE6ums"); + parametersMap.put("timestamp",timestamp); + String sign = YzfSignUtil.signRequest(parametersMap,"34e5fc32ac894a2ba2ade8c3852c7a0a"); + JSONObject jsonObject=new JSONObject(); + jsonObject.put("serialNumber",entity.getId()); + jsonObject.put("accessKey","6X3B526P5HqE6ums"); + jsonObject.put("sign",sign); + jsonObject.put("timestamp",timestamp); + logger.info("=======调用杭泰税务查询申请单详情的请求参数为:{}=======",jsonObject.toJSONString()); + //发送数据 + String result = HttpRequest.post(url). + header("appId", "800060"). + header("apiCode", "8000600003"). + header("publicKey", "ZJYAmRjjYEDgqw4UXWHZNicYclErG0hsrwKQcHukPlP0K1pCe7eDIk+3zDUT+v578prj"). + header("secretKey", "D6AHU3PL8UsNfK6A8I6mL4X1ma2NXckX/vM7AOzI/jmzJf+R1aY06Q6SBz7Y7drHj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(jsonObject.toJSONString()). + execute(). + body(); + logger.info("=====调用杭泰税务查询申请单详情的返回参数为:{}===========",result); + JSONObject resultJson = JSONObject.parseObject(result); + if (!resultJson.getBoolean("flag")) { + saveTaskLivingDetails(entity.getId(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false,""); + } else { + JSONObject attribute = resultJson.getJSONObject("attribute"); + if("0".equals(attribute.getString("code"))){ + JSONObject jsonResult=JSONObject.parseObject(attribute.getString("result")); + if(null !=jsonResult){ + JSONArray jsonArray = jsonResult.getJSONArray("invoiceInfoVOList"); + if(CollectionUtils.isNotEmpty(jsonArray)){ + for (int i = 0; i < jsonArray.size(); i++) { + //表单的附件字段=ctpAttachment的Sub_reference,表单的Summary_id=ctpAttachment的att_reference + String sub_reference = String.valueOf(UUIDLong.longUUID()); + String att_reference = entity.getSummaryId();//Summary_id + JSONObject invoiceInfo = jsonArray.getJSONObject(i); + String invoiceCode = invoiceInfo.getString("invoiceCode");//发票代码 + String invoiceNumber = invoiceInfo.getString("invoiceNumber");//发票号码 + String resultStatus = InvoiceState.invoiceStateGetValue(jsonResult.getString("resultStatus"));//开票结果 + entity.setInvoice_code(invoiceCode); + entity.setInvoice_number(invoiceNumber); + entity.setResult_status(resultStatus); + //将开票结果,发票号码,发票代码,回写OA + invoiceDao.updateInvoiceResult(entity); + if (null != invoiceInfo.getString("url") || null != invoiceInfo.getString("ofdUrl")) { + String pdfUrl = invoiceInfo.getString("url");//pdf文件 + String ofdUrl = invoiceInfo.getString("ofdUrl");//ofd文件 + String xmlUrl = invoiceInfo.getString("xmlUrl");//xml文件 + //获取pdf文件到本地 并为pdf取名,否则会报无法访问错误 + logger.info("========开始将pdf文件保存到本地========"); + String pdfFileName = generateFileName(pdfUrl, "pdf"); + String pdfSavePath = invoicePdfUrl + pdfFileName; + downloadPdf(pdfUrl, pdfSavePath); + logger.info("========pdf文件保存到本地完成========"); + File filePdf = new File(pdfSavePath); + logger.info("========开始将pdf文件上传OA========"); + ManyfileUpload(filePdf, entity, sub_reference, att_reference, jsonObject); + logger.info("========pdf文件上传OA完成========"); + //获取ofd文件到本地 + logger.info("========开始将ofd文件保存到本地========"); + String ofdFileName = generateFileName(ofdUrl, "ofd"); + String ofdSavePath = ofdUrl + ofdFileName; + downloadPdf(ofdUrl, ofdSavePath); + logger.info("========ofd文件保存到本地完成========"); + File fileOfd = new File(ofdSavePath); + logger.info("========开始将ofd文件上传OA========"); + ManyfileUpload(fileOfd, entity, sub_reference, att_reference, jsonObject); + logger.info("========ofd文件上传OA完成========"); + } + } + } + } + } + } + + } + }catch (Exception e){ + logger.info("======查询杭泰税务申请单详情失败====",e.getMessage()); + e.printStackTrace(); + } + return null; + } + + //进项发票推送结果查询(查询发票批量录入结果) + @Override + public JsonResultEntity queryInputInvoiceResult(JSONObject json) { + try { + InvoiceEntity invoiceEntity = json.toJavaObject(InvoiceEntity.class); + invoiceEntity.setDataSourceCode("HT-OA"); + logger.info("=======开始查询杭泰税务的发票批量录入返回结果========="); + List invoiceEntities = invoiceDao.queryInputInvoiceResult(invoiceEntity); + if(CollectionUtils.isEmpty(invoiceEntities)){ + logger.info("=====杭泰税务中没有需要查询发票批量录入返回结果的数据========"); + return BaseResult.getSuccessMessageEntity("查询成功"); + } + for (InvoiceEntity entity : invoiceEntities) { + long timestamp = System.currentTimeMillis(); + Map parametersMap = new HashMap<>(); + parametersMap.put("accessKey","6X3B526P5HqE6ums"); + parametersMap.put("timestamp",timestamp); + String sign = YzfSignUtil.signRequest(parametersMap,"34e5fc32ac894a2ba2ade8c3852c7a0a"); + JSONObject jsonObject=new JSONObject(); + jsonObject.put("serialNumber",entity.getId()); + jsonObject.put("accessKey","6X3B526P5HqE6ums"); + jsonObject.put("sign",sign); + jsonObject.put("timestamp",timestamp); + logger.info("=======调用杭泰税务查询发票批量录入结果的请求参数为:{}=======",jsonObject.toJSONString()); + //发送数据 + String result = HttpRequest.post(url). + header("appId", "800060"). + header("apiCode", "8000600006"). + header("publicKey", "ZJYAmRjjYEDgqw4UXWHZNicYclErG0hsrwKQcHukPlP0K1pCe7eDIk+3zDUT+v578prj"). + header("secretKey", "D6AHU3PL8UsNfK6A8I6mL4X1ma2NXckX/vM7AOzI/jmzJf+R1aY06Q6SBz7Y7drHj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(jsonObject.toJSONString()). + execute(). + body(); + logger.info("=====调用杭泰税务查询发票批量录入结果的返回参数为:{}===========",result); + JSONObject resultJson = JSONObject.parseObject(result); + if (!resultJson.getBoolean("flag")) { + saveTaskLivingDetails(entity.getId(), entity.getBusiness_no(), jsonObject.toJSONString(), resultJson.toJSONString(), false,""); + } else { + JSONObject attribute = resultJson.getJSONObject("attribute"); + if("0".equals(attribute.getString("code"))) { + JSONObject jsonResult = JSONObject.parseObject(attribute.getString("result")); + if (null != jsonResult) { + String serialNumber = jsonResult.getString("serialNumber");//流水号 + String status = jsonResult.getString("status");//发票批量录入返回结果状态 + if(serialNumber.equals(entity.getId())){ + //修改发票批量录入结果状态 + logger.info("=========开始更新进项发票的结果=========="); + entity.setInput_result_status(InvoiceState.invoiceStateGetValue(status)); + entity.setDataSourceCode("HT-OA"); + invoiceDao.updateInvoiceResult(entity); + logger.info("=========更新进项发票的结果完成=========="); + saveTaskLivingDetails(entity.getId(),entity.getBusiness_no(),jsonObject.toJSONString(), resultJson.toJSONString(), true,""); + } + } + } + } + } + }catch (Exception e){ + logger.info("======查询杭泰税务发票批量录入结果失败====",e.getMessage()); + e.printStackTrace(); + } + return null; + } + + private void ManyfileUpload(File file,InvoiceEntity entity,String sub_reference,String att_reference,JSONObject jsonObject){ + JSONObject jsonObjectOfd = OARestUtil.fileUpload(file,"8000590003","8000590001"); + if (jsonObjectOfd.getString("fileUrl") != null) { + entity.setUrl(sub_reference); + entity.setDataSourceCode("HT-OA"); + invoiceDao.updateInvoiceUrl(entity); + //根据附件id查询附件业务数据 + String file_url = jsonObjectOfd.getString("fileUrl"); + CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity(); + ctpAttachmentEntity.setFile_url(file_url); + ctpAttachmentEntity.setSub_reference(sub_reference); + ctpAttachmentEntity.setAtt_reference(att_reference); + ctpAttachmentEntity.setDataSourceCode("HT-OA"); + List ctpAttachmentEntities = ctpAttachmentDao.queryCtpAttachment(ctpAttachmentEntity); + //如果没有查询到数据,就新增附件业务,否则更新 + if (ctpAttachmentEntities.size() == 0) { + String category = jsonObject.getString("category"); + String type = jsonObject.getString("type"); + String filename = jsonObject.getString("filename"); + String mime_type = jsonObject.getString("mimeType"); + String attachment_size = jsonObject.getString("size"); + String id = String.valueOf(UUIDLong.longUUID()); + ctpAttachmentEntity.setCategory(category); + ctpAttachmentEntity.setFilename(filename); + ctpAttachmentEntity.setType(type); + ctpAttachmentEntity.setMime_type(mime_type); + ctpAttachmentEntity.setAttachment_size(attachment_size); + ctpAttachmentEntity.setId(id); + ctpAttachmentEntity.setCategory("66"); + ctpAttachmentEntity.setCreatedate(new Date()); + ctpAttachmentEntity.setDataSourceCode("HT-OA"); + ctpAttachmentDao.saveCtpAttachment(ctpAttachmentEntity); + } else { + if (ctpAttachmentEntities.size() > 1) { + throw new BaseSystemException("OA附件业务表中查到多条记录"); + } + //更新数据到OA附件业务表中 + ctpAttachmentDao.updateCtpAttachment(ctpAttachmentEntity); + } + logger.info("=====电子回单执行完毕======="); + } + file.delete(); + } + + private void downloadPdf(String pdfUrl, String savePath) { + try { + URL url = new URL(pdfUrl); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("Post"); + int responseCode = connection.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + InputStream inputStream = connection.getInputStream(); + FileOutputStream outputStream = new FileOutputStream(savePath); + + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + + outputStream.close(); + inputStream.close(); + } else { + logger.info("下载失败,响应码: {}" , responseCode); + } + connection.disconnect(); + }catch (Exception e){ + logger.info("====查询申请单详情获取税务pdf或ofd文件失败:{}========",e.getMessage()); + e.printStackTrace(); + } + } + + private String generateFileName(String url, String extension) { + // 这里简单根据 URL 的参数生成文件名,你可以根据实际需求调整 + String[] parts = url.split("&"); + String fphm = ""; + for (String part : parts) { + if (part.startsWith("fphm=")) { + fphm = part.substring(5); + break; + } + } + return fphm + "." + extension; + } + + private List bindingInvoice(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { + List list = new ArrayList<>(); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("select * from v_hzya_invoice where push_status is null "); + mdmModuleSourceEntity.setDataSourceCode(dbCode); + List> hashMaps = invoiceDao.queryInvoice(stringBuffer.toString(), mdmModuleSourceEntity); + int i = 0; + if (CollectionUtils.isNotEmpty(hashMaps)) { + for (HashMap hashMap : hashMaps) { + JSONObject main = new JSONObject(); + JSONObject invoice = new JSONObject(); + for (String key : hashMap.keySet()) { + invoice.put(key.toLowerCase(), hashMap.get(key)); + } + //获取明细信息 + Long formmainId = (Long) hashMap.get("data_id"); + StringBuffer stringBufferDetails = new StringBuffer(); + stringBufferDetails.append("SELECT * FROM v_hzya_invoice_details WHERE f_id = '"+formmainId+"' " ); + List> hashMapsDetails = invoiceDetailsDao.queryInvoiceDetails(stringBufferDetails.toString(),mdmModuleSourceEntity); + JSONArray invoiceDetails = new JSONArray(); + if(CollectionUtils.isNotEmpty(hashMapsDetails)){ + for (HashMap detailsMap : hashMapsDetails) { + JSONObject details = new JSONObject(); + for (String key : detailsMap.keySet()) { + details.put(key.toLowerCase(), detailsMap.get(key)); + } + invoiceDetails.add(details); + } + } + main.put("mdm_invoice_application_details", invoiceDetails); + main.put("mdm_invoice_application", invoice); + list.add(main); + } + } + return list; + } + + private List ParametricDocument(List hashMaps,String mdmCode,String tableName){ + JSONObject jsonObjectUser = new JSONObject(); + List result=new ArrayList<>(); + try { + for (JSONObject hashMap : hashMaps) { + JSONObject main = hashMap.getJSONObject(tableName); + JSONObject jsonStr = new JSONObject(); + jsonObjectUser.put("data_id", main.get("data_id")); + jsonObjectUser.put("mdmCode", mdmCode); + jsonStr.put("jsonStr", jsonObjectUser); + //先查询编码和名称查询是否存在 + Object attribute = comparisonServiceimpl.queryEntityPage(jsonStr); + logger.info("得到的attribute值为:{}", jsonStr.toJSONString(attribute)); + JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute); + JSONObject pageInfo = jsonObjectAttribute.getJSONObject("pageInfo"); + JSONArray jsonArrayList = pageInfo.getJSONArray("list"); + //如果jsonArrayList为null,说明没有值,在表中不存在 + if (jsonArrayList == null || jsonArrayList.size() == 0) { + hashMap.put("appName","数智中台"); + hashMap.put("appCode","800004"); + hashMap.put("mdmCode", mdmCode); + hashMap.put("optionName", "数智中台"); + jsonStr.put("jsonStr", hashMap); + Object object = comparisonServiceimpl.saveEntity(jsonStr); + logger.info("应付单新增结果为:{}", JSON.toJSONString(object)); + result.add(object); + } else { + hashMap.put("appName","数智中台"); + hashMap.put("appCode","800004"); + hashMap.put("mdmCode", mdmCode); + hashMap.put("optionName", "数智中台"); + jsonStr.put("jsonStr", hashMap); + Object object = comparisonServiceimpl.updateEntity(jsonStr); + logger.info("应付单更新结果为:{}", JSON.toJSONString(result)); + result.add(object); + } + } + return result; + }catch (Exception e){ + logger.info("将数据查询之后进行组装调用通用方法错误:{}",e.getMessage()); + //保存业务数据日志 + saveTaskLivingDetails(jsonObjectUser.getString("data_id"),hashMaps.get(0).getString("business_no"),hashMaps.get(0).toString(),result.toString(),false,"MakeInvoicePluginInitializer"); + e.printStackTrace(); + } + return null; + } + + private void saveTaskLivingDetails(String rootAppPk,String rootAppBill,String rootAppNewData,String newTransmitInfo,boolean flag,String plugin) { + try { + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = new IntegrationTaskLivingDetailsEntity(); + integrationTaskLivingDetailsEntity.setId(UUIDUtils.getUUID()); + integrationTaskLivingDetailsEntity.setSts("Y"); + integrationTaskLivingDetailsEntity.setCreate_user_id("1"); + integrationTaskLivingDetailsEntity.setModify_user_id("1"); + integrationTaskLivingDetailsEntity.setCreate_time(new Date()); + integrationTaskLivingDetailsEntity.setModify_time(new Date()); + integrationTaskLivingDetailsEntity.setOrg_id("0"); + integrationTaskLivingDetailsEntity.setCompanyId("0"); + integrationTaskLivingDetailsEntity.setRootAppPk(rootAppPk); + integrationTaskLivingDetailsEntity.setRootAppBill(rootAppBill); + integrationTaskLivingDetailsEntity.setPluginId(plugin); + integrationTaskLivingDetailsEntity.setRootAppNewData(rootAppNewData); + integrationTaskLivingDetailsEntity.setNewTransmitInfo(newTransmitInfo); + if(flag){ + taskLivingDetailsService.saveLogToSuccess(integrationTaskLivingDetailsEntity); + }else { + taskLivingDetailsService.saveLogToFail(integrationTaskLivingDetailsEntity); + } + }catch (Exception e){ + logger.info("抽取杭泰付款单保存日志到集成任务日志明细中失败:{}",e.getMessage()); + e.printStackTrace(); + } + } + +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java index 33ab73c8..a0ec8db8 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/IPayBillDao.java @@ -30,29 +30,4 @@ public interface IPayBillDao { */ int updateState(PayBillEntity pay); -/** - * - * @content 获取保证金付款单数据 - * @author laborer - * @className: Administrator - * @author laborer - * @date 2025-01-07 9:44 - * - */ - - List getMarginPayment(PayBillEntity entity); -/** - * - * @content 获取保证金付款单详情数据 - * @className: Administrator - * @author laborer - * @date 2025-01-07 10:44 - * - */ - - List getOaEngineerPayDetails(PayBillEntity details); - - List getReceived(PayBillEntity entity); - - List getReceivedDetails(PayBillEntity details); } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java index f01f543a..3a753554 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/dao/impl/PayBillDaoImpl.java @@ -24,29 +24,9 @@ public class PayBillDaoImpl extends MybatisGenericDao implements IPayBillDao { public List getOaEngineerPay(PayBillEntity entity) { return super.selectList("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_list_base",entity); } - @DS("#entity.dataSourceCode") + @DS("#pay.dataSourceCode") @Override - public int updateState(PayBillEntity entity) { - return super.update("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_update",entity); - } - @DS("#entity.dataSourceCode") - @Override - public List getMarginPayment(PayBillEntity entity) { - return super.selectList("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_list_base_margin",entity); - } - @DS("#entity.dataSourceCode") - @Override - public List getOaEngineerPayDetails(PayBillEntity entity) { - return super.selectList("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_list_base_margin_details",entity); - } - @DS("#entity.dataSourceCode") - @Override - public List getReceived(PayBillEntity entity) { - return super.selectList("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_list_base_received",entity); - } - @DS("#entity.dataSourceCode") - @Override - public List getReceivedDetails(PayBillEntity entity) { - return super.selectList("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_list_base_received_details",entity); + public int updateState(PayBillEntity pay) { + return super.update("com.hzya.frame.seeyon.paybill.dao.impl.PayBillDaoImpl.PayBillEntity_update",pay); } } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java index dd1c5065..1a9308de 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.java @@ -14,411 +14,12 @@ import java.util.Map; */ public class PayBillEntity extends BaseEntity { -private String c_bill_type;//单据类型 -private String formCode;//单据号 -private String receiptDetailsId;//BIP到款明细主键 -private String repaymentDate;//还款日期 -private String repaymentType;//还款类型 -private String repaymentAmount;//还款金额 -private String recType;//还款类型 -private String orgCode;//组织编码 -private String deptCode;//部门编码 -private String fklxName;//付款类型 -private String zffsName;//支付方式 -private String firstSubject;//科目编码 -private String bzjProjectName;//保证金项目名称 -private String expirationDate;//投标保证金到期日 -private String deptCode2;//归属部门编码 -private String isCustomer;//是否运营商客户 -private String applyAmount;//申请金额 -private String checkedAmount;//财务核实金额 -private String comments;//说明 -private String creator;//制单人 -private String supplierCode;//供应商编码 -private String openBank;//开户银行 -private String bankAccount;//银行账号 -private String dkAmount;//打款金额 -private String dkTime;//打款时间 -private String isDydj;//是否打印本单据 -private String fieldName;// -private String tableName;// -private String formmain_id;// -private String customerAddress;//客户地址 -private String linkMan;//联系人 -private String bhBeneficiary;//保函受益人 -private String beneficiaryPhone;//受益人电话 -private String beneficiaryAddress;//受益人地址 -private String projectNumber;//工程项目合同/标书号码 -private String projectAmount;//工程项目合同/标书总金额 -private String bhIndate;//保函有效期 -private String bhReceiver;//保函收件人 -private String contactType;//联系方式 -private String contactAddress;//联系地址 -private String bhProjectName;//保函项目名称 -private String lastBhDate;//最晚取得保函日期 -private String notes;//备注 -private String isBh;//是否取得保函原件 -private String contactNumber;//联系电话 - - public String getContactNumber() { - return contactNumber; - } - - public void setContactNumber(String contactNumber) { - this.contactNumber = contactNumber; - } - - public String getCustomerAddress() { - return customerAddress; - } - - public void setCustomerAddress(String customerAddress) { - this.customerAddress = customerAddress; - } - - public String getLinkMan() { - return linkMan; - } - - public void setLinkMan(String linkMan) { - this.linkMan = linkMan; - } - - public String getBhBeneficiary() { - return bhBeneficiary; - } - - public void setBhBeneficiary(String bhBeneficiary) { - this.bhBeneficiary = bhBeneficiary; - } - - public String getBeneficiaryPhone() { - return beneficiaryPhone; - } - - public void setBeneficiaryPhone(String beneficiaryPhone) { - this.beneficiaryPhone = beneficiaryPhone; - } - - public String getBeneficiaryAddress() { - return beneficiaryAddress; - } - - public void setBeneficiaryAddress(String beneficiaryAddress) { - this.beneficiaryAddress = beneficiaryAddress; - } - - public String getProjectNumber() { - return projectNumber; - } - - public void setProjectNumber(String projectNumber) { - this.projectNumber = projectNumber; - } - - public String getProjectAmount() { - return projectAmount; - } - - public void setProjectAmount(String projectAmount) { - this.projectAmount = projectAmount; - } - - public String getBhIndate() { - return bhIndate; - } - - public void setBhIndate(String bhIndate) { - this.bhIndate = bhIndate; - } - - public String getBhReceiver() { - return bhReceiver; - } - - public void setBhReceiver(String bhReceiver) { - this.bhReceiver = bhReceiver; - } - - public String getContactType() { - return contactType; - } - - public void setContactType(String contactType) { - this.contactType = contactType; - } - - public String getContactAddress() { - return contactAddress; - } - - public void setContactAddress(String contactAddress) { - this.contactAddress = contactAddress; - } - - public String getBhProjectName() { - return bhProjectName; - } - - public void setBhProjectName(String bhProjectName) { - this.bhProjectName = bhProjectName; - } - - public String getLastBhDate() { - return lastBhDate; - } - - public void setLastBhDate(String lastBhDate) { - this.lastBhDate = lastBhDate; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - public String getIsBh() { - return isBh; - } - - public void setIsBh(String isBh) { - this.isBh = isBh; - } - - public String getRecType() { - return recType; - } - - public void setRecType(String recType) { - this.recType = recType; - } - - public String getReceiptDetailsId() { - return receiptDetailsId; - } - - public void setReceiptDetailsId(String receiptDetailsId) { - this.receiptDetailsId = receiptDetailsId; - } - - public String getRepaymentDate() { - return repaymentDate; - } - - public void setRepaymentDate(String repaymentDate) { - this.repaymentDate = repaymentDate; - } - - public String getRepaymentType() { - return repaymentType; - } - - public void setRepaymentType(String repaymentType) { - this.repaymentType = repaymentType; - } - - public String getRepaymentAmount() { - return repaymentAmount; - } - - public void setRepaymentAmount(String repaymentAmount) { - this.repaymentAmount = repaymentAmount; - } - - public String getFormmain_id() { - return formmain_id; - } - - public void setFormmain_id(String formmain_id) { - this.formmain_id = formmain_id; - } - - public String getC_bill_type() { - return c_bill_type; - } - - public void setC_bill_type(String c_bill_type) { - this.c_bill_type = c_bill_type; - } - - public String getFormCode() { - return formCode; - } - - public void setFormCode(String formCode) { - this.formCode = formCode; - } - - public String getOrgCode() { - return orgCode; - } - - public void setOrgCode(String orgCode) { - this.orgCode = orgCode; - } - - public String getDeptCode() { - return deptCode; - } - - public void setDeptCode(String deptCode) { - this.deptCode = deptCode; - } - - public String getFklxName() { - return fklxName; - } - - public void setFklxName(String fklxName) { - this.fklxName = fklxName; - } - - public String getZffsName() { - return zffsName; - } - - public void setZffsName(String zffsName) { - this.zffsName = zffsName; - } - - public String getFirstSubject() { - return firstSubject; - } - - public void setFirstSubject(String firstSubject) { - this.firstSubject = firstSubject; - } - - public String getBzjProjectName() { - return bzjProjectName; - } - - public void setBzjProjectName(String bzjProjectName) { - this.bzjProjectName = bzjProjectName; - } - - public String getExpirationDate() { - return expirationDate; - } - - public void setExpirationDate(String expirationDate) { - this.expirationDate = expirationDate; - } - - public String getDeptCode2() { - return deptCode2; - } - - public void setDeptCode2(String deptCode2) { - this.deptCode2 = deptCode2; - } - - public String getIsCustomer() { - return isCustomer; - } - - public void setIsCustomer(String isCustomer) { - this.isCustomer = isCustomer; - } - - public String getApplyAmount() { - return applyAmount; - } - - public void setApplyAmount(String applyAmount) { - this.applyAmount = applyAmount; - } - - public String getCheckedAmount() { - return checkedAmount; - } - - public void setCheckedAmount(String checkedAmount) { - this.checkedAmount = checkedAmount; - } - - public String getComments() { - return comments; - } - - public void setComments(String comments) { - this.comments = comments; - } - - public String getCreator() { - return creator; - } - - public void setCreator(String creator) { - this.creator = creator; - } - - public String getSupplierCode() { - return supplierCode; - } - - public void setSupplierCode(String supplierCode) { - this.supplierCode = supplierCode; - } - - public String getOpenBank() { - return openBank; - } - - public void setOpenBank(String openBank) { - this.openBank = openBank; - } - - public String getBankAccount() { - return bankAccount; - } - - public void setBankAccount(String bankAccount) { - this.bankAccount = bankAccount; - } - - public String getDkAmount() { - return dkAmount; - } - - public void setDkAmount(String dkAmount) { - this.dkAmount = dkAmount; - } - - public String getDkTime() { - return dkTime; - } - - public void setDkTime(String dkTime) { - this.dkTime = dkTime; - } - - public String getIsDydj() { - return isDydj; - } - - public void setIsDydj(String isDydj) { - this.isDydj = isDydj; - } - - private ListpayBillDetailsEntityList; - - public List getPayBillDetailsEntityList() { - return payBillDetailsEntityList; - } - - public void setPayBillDetailsEntityList(List payBillDetailsEntityList) { - this.payBillDetailsEntityList = payBillDetailsEntityList; - } - private String billDate;//付款日期 private String primalMoney;//付款金额信息 private String pkOppaccount;//付款银行信息 private String pkSupplier;//供应商信息 - + private String tableName;//表名称 + private String fieldName;//字段名称 private String state;//推送状态 private String pkOrg;//组织 private String pkCustomer;//客户 diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml index cd82b26c..736d5914 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/entity/PayBillEntity.xml @@ -11,54 +11,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -99,67 +51,12 @@ LEFT JOIN formson_0223 body ON main.id = body.formmain_id WHERE field0053 IS NOT NULL and field0058 is null - - - - - - - update ${tableName} set ${fieldName} = #{state} where id = #{id} - - - + update ${tableName} set ${fieldName} = #{state} where id = #{id} - - - - - - - diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java index 9a50580b..caad27a7 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/IPayBillService.java @@ -25,27 +25,5 @@ public interface IPayBillService extends IBaseService { * */ JsonResultEntity sendEngineerPayBillToBip(JSONObject requestJson); -/** - * - * @content 推送保证金付款到BIP - * @param requestJson - * @return JsonResultEntity - * @author laborer - * @className: Administrator - * @author laborer - * @date 2025-01-07 9:39 - * - */ - JsonResultEntity sendMarginPaymentToBip(JSONObject requestJson); -/** - * - * @content 保证金付流程结束更新付款状态 - * @className: Administrator - * @author laborer - * @date 2025-01-08 10:18 - * - */ - - JsonResultEntity sendReceivedToBip(JSONObject requestJson); } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java index d0357a53..5bdf9b4b 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/paybill/service/impl/PayBillServiceImpl.java @@ -1,7 +1,5 @@ package com.hzya.frame.seeyon.paybill.service.impl; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; @@ -45,228 +43,32 @@ public class PayBillServiceImpl extends BaseService implem */ @Override public JsonResultEntity sendEngineerPayBillToBip(JSONObject requestJson) { -// PayBillEntity entity = new PayBillEntity(); -// requestJson.put("db_code","OA"); -// entity.setDataSourceCode(requestJson.getString("db_code")); -// ListpayBillEntityList = payBillDao.getOaEngineerPay(entity); -// if(CollectionUtils.isNotEmpty(payBillEntityList)){ -// for(PayBillEntity pay : payBillEntityList){ -// PayBillEntity details = new PayBillEntity(); -// ListpayDetailsList = payBillDao.getOaEngineerPayDetails(details); -// -// String token = OABipUtil.getBipToken("yonyou","8000230000"); -// JSONObject main = bindingAdd(pay); -// logger.info("工程付款单调用中台生成BIP付款结算单推送报文{}",main.toString()); -// String result = OABipUtil.sendOATOBipEsb(main.toString(),"8000230014",token); -// logger.info("工程付款单调用中台生成BIP付款结算单返回结果{}",result); -// JSONObject resultObj = JSON.parseObject(result); -// boolean flag = resultObj.getBoolean("success"); -// if(flag){ -// pay.setState("Y"); -// }else{ -// pay.setState("N"); -// } -// pay.setDataSourceCode(requestJson.getString("db_code")); -// payBillDao.updateState(pay); -// // todo 后续在写吧(没字段等OA开了外网在创建),修改推送状态,避免再次查询 -// } -// } - return null; - } - - @Override - public JsonResultEntity sendMarginPaymentToBip(JSONObject requestJson) { PayBillEntity entity = new PayBillEntity(); - requestJson.put("db_code","SW-OA"); + requestJson.put("db_code","OA"); entity.setDataSourceCode(requestJson.getString("db_code")); - ListpayBillEntityList = payBillDao.getMarginPayment(entity); + ListpayBillEntityList = payBillDao.getOaEngineerPay(entity); if(CollectionUtils.isNotEmpty(payBillEntityList)){ for(PayBillEntity pay : payBillEntityList){ - String datasourceCode = requestJson.getString("db_code"); - System.out.println("更新时的数据源编码为"+datasourceCode); - logger.info("更新时的数据源编码为"+datasourceCode); - pay.setDataSourceCode(datasourceCode); - try { -// PayBillEntity details = new PayBillEntity(); -// details.setFormmain_id(pay.getId()); -// details.setDataSourceCode(requestJson.getString("db_code")); -// ListpayDetailsList = payBillDao.getOaEngineerPayDetails(details); - String token = OABipUtil.getBipToken("yonyou","8000500003"); -// pay.setPayBillDetailsEntityList(payDetailsList); - JSONObject main = bindingMarginAdd(pay); - logger.info("保证金原始报文{}",JSON.toJSONString(pay)); - logger.info("保证金付款申请单推送BIP报文{}",main.toString()); - String result = OABipUtil.sendOATOBipEsb(main.toString(),"8000500007",token); - logger.info("保证金付款申请单推送BIP报文返回结果{}",result); - JSONObject resultObj = JSON.parseObject(result); - String resultFlag = resultObj.getString("Result"); - if("success".equals(resultFlag)){ - pay.setState("Y"); - }else{ - pay.setState("N"); - } - - payBillDao.updateState(pay); - } catch (Exception e) { + String token = OABipUtil.getBipToken("yonyou","8000230000"); + JSONObject main = bindingAdd(pay); + logger.info("工程付款单调用中台生成BIP付款结算单推送报文{}",main.toString()); + String result = OABipUtil.sendU9cTOBipEsb(main.toString(),"8000230014",token); + logger.info("工程付款单调用中台生成BIP付款结算单返回结果{}",result); + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getBoolean("success"); + if(flag){ + pay.setState("Y"); + }else{ pay.setState("N"); - payBillDao.updateState(pay); - logger.error("保证金同步BIP保证金付款失败,请联系管理员:{}",e); } - - } - } - return null; - } - - @Override - public JsonResultEntity sendReceivedToBip(JSONObject requestJson) { - PayBillEntity entity = new PayBillEntity(); - requestJson.put("db_code","SW-OA"); - entity.setDataSourceCode(requestJson.getString("db_code")); - ListpayBillEntityList = payBillDao.getReceived(entity); - if(CollectionUtils.isNotEmpty(payBillEntityList)){ - for(PayBillEntity pay : payBillEntityList){ pay.setDataSourceCode(requestJson.getString("db_code")); - try { - boolean flag = true; - StringBuffer sb = new StringBuffer(); -// PayBillEntity details = new PayBillEntity(); -// details.setFormmain_id(pay.getId()); -// details.setDataSourceCode(requestJson.getString("db_code")); -// ListpayDetailsList = payBillDao.getReceivedDetails(details); - String token = OABipUtil.getBipToken("yonyou","8000500003"); -// pay.setPayBillDetailsEntityList(payDetailsList); - //组装更新保证金还款信息 - JSONObject main = bindingReceivedAdd(pay); - logger.info("保证金付款申请单-还款推送BIP报文{}",main.toString()); - String result = OABipUtil.sendOATOBipEsb(main.toString(),"8000500015",token); - logger.info("保证金付款申请单-还款推送BIP报文返回结果{}",result); - JSONObject resultObj = JSON.parseObject(result); - flag = resultObj.getBoolean("Result"); - if(!flag){ - sb.append("更新保证金还款信息失败:错误原因"+resultObj.getString("Message")+pay.getReceiptDetailsId() +" "); - pay.setState("N"); - }else{ - pay.setState("Y"); - } - - //不单独更新数据到表中了,记录日志用 - logger.info("保证金流程结束事件出错"+sb.toString()); - payBillDao.updateState(pay); - } catch (Exception e) { - pay.setState("N"); - payBillDao.updateState(pay); - logger.info("保证金流程结束事件出错,请联系管理员:"+e); - logger.info("保证金流程结束事件出错,请联系管理员1:"+e.getMessage()); - - } + payBillDao.updateState(pay); + // todo 后续在写吧(没字段等OA开了外网在创建),修改推送状态,避免再次查询 } } return null; } -// private JSONObject bindingReceivedRLAdd(PayBillEntity pay) { -// JSONObject head = new JSONObject(); -// head.put("c_bill_type","F9");//单据类型 保证金付款申请单固定F9 -// head.put("formCode",pay.getFormCode());//单据号 -// head.put("receiptDetailsId","");//BIP到款明细主键 -// head.put("repaymentDate","");//还款日期 -// head.put("repaymentType","");//还款类型 -// head.put("repaymentAmount","");//还款金额 -// return head; -// } - - private JSONObject bindingReceivedAdd(PayBillEntity pay) { - JSONObject head = new JSONObject(); - head.put("c_bill_type",pay.getC_bill_type());//单据类型 保证金付款申请单固定F9 - head.put("formCode",pay.getFormCode());//单据号 - head.put("receiptDetailsId",pay.getReceiptDetailsId());//BIP到款明细主键 - String repaymentDate = pay.getRepaymentDate(); - if(StrUtil.isNotEmpty(repaymentDate)){ - head.put("repaymentDate",DateUtil.format(DateUtil.parse(repaymentDate), "yyyy-MM-dd HH:mm:ss"));//还款日期 - } - head.put("repaymentType",pay.getRepaymentType());//还款类型 - head.put("repaymentAmount",pay.getRepaymentAmount());//还款金额 - return head; - } - - private JSONObject bindingMarginAdd(PayBillEntity pay) { - - JSONObject head = new JSONObject(); - head.put("c_bill_type","F9");//单据类型 保证金付款申请单固定F9 - head.put("formCode",pay.getFormCode());//单据号(NC有重复校验) - head.put("orgCode",pay.getOrgCode());//公司编码 - head.put("deptCode",pay.getDeptCode());//事业部大类编码 - head.put("fklxName",pay.getFklxName());//付款类型 - head.put("zffsName",pay.getZffsName());//支付方式 - head.put("firstSubject",pay.getFirstSubject());//一级科目 - head.put("bzjProjectName",pay.getBzjProjectName());//保证金项目名称 - String expirationDate= pay.getExpirationDate(); - if(StrUtil.isNotEmpty(expirationDate)){ - head.put("expirationDate",DateUtil.format(DateUtil.parse(expirationDate), "yyyy-MM-dd"));//投标保证金到期日 - } - - head.put("deptCode2",pay.getDeptCode2());//归属部门编码 - head.put("isCustomer","Y");//是否运营商客户 - head.put("applyAmount",pay.getApplyAmount());//申请金额 - head.put("checkedAmount",pay.getCheckedAmount());//财务核实金额 - head.put("comments",pay.getComments());//说明 - head.put("creator",pay.getCreator());//制单人 - head.put("supplierCode",pay.getSupplierCode());//供应商编码 - head.put("openBank",pay.getOpenBank());//开户银行 - head.put("bankAccount",pay.getBankAccount());//银行账号 - head.put("customerAddress",pay.getCustomerAddress());//客户地址 - head.put("linkMan",pay.getLinkMan());//联系人 - head.put("contactNumber",pay.getContactNumber());//联系电话 - - head.put("bhBeneficiary",pay.getBhBeneficiary());//保函受益人 - head.put("beneficiaryPhone",pay.getBeneficiaryPhone());//受益人电话 - head.put("beneficiaryAddress",pay.getBeneficiaryAddress());//受益人地址 - head.put("projectNumber",pay.getProjectNumber());//工程项目合同/标书号码 - head.put("projectAmount",pay.getProjectAmount());//工程项目合同/标书总金额 - String bhIndate = pay.getBhIndate(); - if(StrUtil.isNotEmpty(bhIndate)){ - head.put("bhIndate",DateUtil.format(DateUtil.parse(bhIndate), "yyyy-MM-dd"));//保函有效期 - } - head.put("bhReceiver",pay.getBhReceiver());//保函收件人 - head.put("contactType",pay.getContactType());//联系方式 - head.put("contactAddress",pay.getContactAddress());//联系地址 - head.put("bhProjectName",pay.getBhProjectName());//保函项目名称 - - String lastBhDate = pay.getLastBhDate(); - if(StrUtil.isNotEmpty(lastBhDate)){ - head.put("lastBhDate",DateUtil.format(DateUtil.parse(lastBhDate), "yyyy-MM-dd"));//最晚取得保函日期 - } - head.put("notes",pay.getNotes());//备注 - head.put("isBh",pay.getIsBh());//是否取得保函原件 - - head.put("dkAmount",pay.getDkAmount());//打款金额 - String dkTime = pay.getDkTime(); - if(StrUtil.isNotEmpty(dkTime)){ - head.put("dkTime", DateUtil.format(DateUtil.parse(dkTime), "yyyy-MM-dd HH:mm:ss"));//打款时间 - } - - head.put("isDydj","Y");//是否打印本单据 - - //处理明细数据,按照明细付款 多个明细生成多个付款结算单 - JSONArray detailsArr = new JSONArray(); -// ListdetailsList = pay.getPayBillDetailsEntityList(); -// if(CollectionUtils.isNotEmpty(detailsList)){ -// detailsList.forEach(detail->{ -// JSONObject body = new JSONObject(); -// body.put("projectCode","");//项目编码 -// body.put("projectName","");//项目名称 -// body.put("wdContact","");//未定合同号 -// body.put("buildCost","");//工程造价 -// body.put("deptCode","");//承担部门编码 -// detailsArr.add(body); -// }); -// } - head.put("xmDetail",detailsArr);//明细数据 - head.put("hkDetail",detailsArr);//明细数据 - return head; - } - @NotNull private JSONObject bindingAdd(PayBillEntity pay) { JSONObject head = new JSONObject(); diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java index 41797f18..f65d2855 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/recbill/service/impl/RecBillServiceImpl.java @@ -42,29 +42,29 @@ public class RecBillServiceImpl extends BaseService implem */ @Override public JsonResultEntity sendRecBillToBip(JSONObject requestJson) { -// RecBillEntity entity = new RecBillEntity(); -// requestJson.put("db_code","OA"); -// entity.setDataSourceCode(requestJson.getString("db_code")); -// ListpayBillEntityList = payBillDao.getOaRecBill(entity); -// if(CollectionUtils.isNotEmpty(payBillEntityList)){ -// for(RecBillEntity pay : payBillEntityList){ -// String token = OABipUtil.getBipToken("yonyou","8000230000"); -// JSONObject main = bindingAdd(pay); -// logger.info("银行流水收款信息数据{}",main.toString()); -// String result = OABipUtil.sendU9cTOBipEsb(main.toString(),"8000230016",token); -// logger.info("银行流水收款信息数据{}",result); -// JSONObject resultObj = JSON.parseObject(result); -// boolean flag = resultObj.getBoolean("success"); -// if(flag){ -// pay.setState("Y"); -// }else{ -// pay.setState("N"); -// } -// pay.setDataSourceCode(requestJson.getString("db_code")); -// payBillDao.updateState(pay); -// // todo 后续在写吧(没字段等OA开了外网在创建),修改推送状态,避免再次查询 -// } -// } + RecBillEntity entity = new RecBillEntity(); + requestJson.put("db_code","OA"); + entity.setDataSourceCode(requestJson.getString("db_code")); + ListpayBillEntityList = payBillDao.getOaRecBill(entity); + if(CollectionUtils.isNotEmpty(payBillEntityList)){ + for(RecBillEntity pay : payBillEntityList){ + String token = OABipUtil.getBipToken("yonyou","8000230000"); + JSONObject main = bindingAdd(pay); + logger.info("银行流水收款信息数据{}",main.toString()); + String result = OABipUtil.sendU9cTOBipEsb(main.toString(),"8000230016",token); + logger.info("银行流水收款信息数据{}",result); + JSONObject resultObj = JSON.parseObject(result); + boolean flag = resultObj.getBoolean("success"); + if(flag){ + pay.setState("Y"); + }else{ + pay.setState("N"); + } + pay.setDataSourceCode(requestJson.getString("db_code")); + payBillDao.updateState(pay); + // todo 后续在写吧(没字段等OA开了外网在创建),修改推送状态,避免再次查询 + } + } return null; } 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 762023b7..fd29f738 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 @@ -6,6 +6,7 @@ import com.hzya.frame.web.entity.JsonResultEntity; /** * 致远OA接口类 + * * @author 👻👻👻👻👻👻👻👻👻👻 gjh * @version 1.0 * @content @@ -17,18 +18,17 @@ public interface ISeeYonInterFace { * 发起OA表单方法 * @content: * @author 👻👻👻👻👻👻👻👻 gjh - * @date 2023-08-22 9:31 + * @date 2023-08-22 9:31 * @param requestData 请求json * @return com.hzya.frame.web.entity.JsonResultEntity **/ JsonResultEntity thirdInterfaceSend(JSONObject requestData); - /*** * @Content: 提供给OA的标准接口方法,包含参数 entity 为OA 的data信息, , eventType 为事件类型 * @Author 👻👻👻👻👻👻👻👻 gjh - * @Date 2020-12-24 10:36 + * @Date 2020-12-24 10:36 * @Param [entity, eventType] * eventType: * 发起前事件 onBeforeStart , @@ -59,26 +59,43 @@ public interface ISeeYonInterFace { /** * seeyon流程事件监听前置方法,绑定数据源 + * * @param sysExtensionApi * @return * @throws Exception */ - SysExtensionApiEntity colEventPre(SysExtensionApiEntity sysExtensionApi)throws Exception; + SysExtensionApiEntity colEventPre(SysExtensionApiEntity sysExtensionApi) throws Exception; + + /** + * seeyon流程事件监听前置方法,绑定数据源 + * @param entity + * @return + * @throws Exception + */ + SysExtensionApiEntity getToken(SysExtensionApiEntity entity) throws Exception; /** * seeyon流程事件监听 + * * @param jsonObject * @return * @throws Exception */ - JsonResultEntity colEventListener(JSONObject jsonObject)throws Exception; + JsonResultEntity colEventListener(JSONObject jsonObject) throws Exception; /** * seeyon流程事件监听后置方法,调用三方接口 + * * @param jsonStr * @param formAppId * @param eventType * @return * @throws Exception */ - String colEventPost(String jsonStr,String formAppId,String eventType)throws Exception; + JsonResultEntity colEventPost(String jsonStr, String formAppId, String eventType) throws Exception; + + + JsonResultEntity chengeBody(JSONObject jsonObject) throws Exception; + + SysExtensionApiEntity chengeBodySetPlug(SysExtensionApiEntity entity); + } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java index 8e8be89e..d8c718ce 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/service/impl/SeeYonInterFaceImpl.java @@ -2,33 +2,49 @@ package com.hzya.frame.seeyon.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.map.MapBuilder; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; import com.hzya.frame.seeyon.dao.ISeeYonInterFaceDao; import com.hzya.frame.seeyon.entity.OAWorkflowEventDataEntity; import com.hzya.frame.seeyon.entity.SeeYonInterFaceEntity; import com.hzya.frame.seeyon.service.ISeeYonInterFace; +import com.hzya.frame.sys.sysenum.SysEnum; import com.hzya.frame.sysnew.application.api.entity.SysApplicationApiEntity; import com.hzya.frame.sysnew.application.api.service.ISysApplicationApiService; import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao; import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; +import com.hzya.frame.sysnew.application.service.impl.ApplicationCache; +import com.hzya.frame.util.PluginUtils; 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.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpEntity; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.impl.client.CloseableHttpClient; +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 org.springframework.stereotype.Service; + import javax.annotation.Resource; +import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -50,14 +66,34 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { private static final String sendUrl = "http://60.204.152.210/seeyon/"; //速网esb地址 private static final String baseUrl = "http://hzya.ufyct.com:9067/kangarooDataCenter/entranceController/externalCallInterface"; - @Resource - private ISysApplicationDatabaseDao sysApplicationDatabaseDao; - @Autowired - private ISysApplicationApiService sysApplicationApiService; /** * 定义所支持的事件静态代码块 */ private static final StringBuffer eventTypeBuffer = new StringBuffer(); + //基础档案类型 + private final String ARCHIVESTYPE = "archives"; + //流程表单类型 + private final String FLOWTYPE = "flow"; + //创建基础档案 + private final String CREATEARCHIVES = "create"; + //更新基础档案 + private final String UPDATEARCHIVES = "update"; + //创建基础档案 + private final String CREATEARCHIVESURL = "rest/form/import/"; + //创建基础档案 + private final String UPDATEARCHIVESURL = "rest/form/update"; + @Resource + private ISysApplicationDatabaseDao sysApplicationDatabaseDao; + @Autowired + private ISysApplicationApiService sysApplicationApiService; + @Resource + private ISeeYonInterFaceDao seeYonInterFaceDao; + //上一次同步时间 + private final String LAST_SYNCHRONISED_TIME = ""; + @Value("${zt.url}") + private String url ; + @Resource + private ApplicationCache applicationCache; { eventTypeBuffer.append("发起前事件 onBeforeStart ,"); @@ -75,24 +111,6 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { eventTypeBuffer.append("取回事件 onTakeBack,"); } - //基础档案类型 - private final String ARCHIVESTYPE = "archives"; - //流程表单类型 - private final String FLOWTYPE = "flow"; - //创建基础档案 - private final String CREATEARCHIVES = "create"; - //更新基础档案 - private final String UPDATEARCHIVES = "update"; - //创建基础档案 - private final String CREATEARCHIVESURL = "rest/form/import/"; - //创建基础档案 - private final String UPDATEARCHIVESURL = "rest/form/update"; - @Resource - private ISeeYonInterFaceDao seeYonInterFaceDao; - - - //上一次同步时间 - private String LAST_SYNCHRONISED_TIME = ""; /**** * @Content:发起无流程表单接口实现 * @Author 👻👻👻👻👻👻👻👻 gjh @@ -100,7 +118,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { * @Param [templateCode 模版编码, sendLoginName 发送人登录帐号 ,xmlData ] * @return java.lang.Integer **/ - public static JsonResultEntity saveNoProcess(String templateCode , String interfaceUrl,String sendLoginName, String xmlData) { + public static JsonResultEntity saveNoProcess(String templateCode, String interfaceUrl, String sendLoginName, String xmlData) { String token = getToken(RESTUSERNAME, RESTPASSWORD, sendLoginName); Map res = new HashMap(); res.put("loginName", sendLoginName); @@ -119,7 +137,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { res.put("token", token); res.put("moduleId", moduleId); res.put("templateCode", templateCode); - logger.info("更新无流程表单参数:{}",JSON.toJSONString(res)); + logger.info("更新无流程表单参数:{}", JSON.toJSONString(res)); String result = HttpRequest.put(sendUrl + interfaceUrl).header("token", token).body(JSON.toJSONString(res)).execute().body(); logger.info("更新无流程表单执行结果:" + result); return BaseResult.getFailureMessageEntity("执行成功", result); @@ -185,7 +203,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { List attributeArray = JSON.parseArray(attributeArrayStr, JSONObject.class); JsonResultEntity result = null; if (ARCHIVESTYPE.equalsIgnoreCase(type)) { - switch (templateCode){ + switch (templateCode) { //预留的 case "abc123": break; @@ -198,13 +216,13 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { @Override - public JsonResultEntity thirdInterfaceSeeYonPlugInInterfaceEntrance(JSONObject requestData){ + public JsonResultEntity thirdInterfaceSeeYonPlugInInterfaceEntrance(JSONObject requestData) { String jsonStr = requestData.getString("jsonStr"); JSONObject jsonObject = requestData.getJSONObject("jsonStr"); - OAWorkflowEventDataEntity entity = JSON.parseObject(jsonStr,OAWorkflowEventDataEntity.class); - logger.info("监听OA事件入参:"+jsonObject.toJSONString()); + OAWorkflowEventDataEntity entity = JSON.parseObject(jsonStr, OAWorkflowEventDataEntity.class); + logger.info("监听OA事件入参:" + jsonObject.toJSONString()); JSONObject formBeanData = jsonObject.getJSONObject("businessDataStr"); - String eventType = jsonObject.getString("eventType") ; + String eventType = jsonObject.getString("eventType"); /** 流程ID*/ String summaryId = entity.getSummaryId(); /** 节点ID*/ @@ -223,73 +241,74 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { //formApp 最好过滤一下 - String result = null; + JsonResultEntity result = null; try { //流程事件处理 result = colEventPost(jsonStr, formApp, eventType); - }catch (Exception e){ - return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); - } - try { - /** 根据事件类型处理相关事件*/ - switch (eventType) { - /** 发起前事件*/ - case "onBeforeStart": - break; - /** 发起事件*/ - case "onStart": - //流程发起 新增grpu8单据 - break; - /** 终止前事件*/ - case "onBeforeStop": - break; - /** 终止事件*/ - case "onStop": - //流程终止,更新grpu8单据 - break; - /** 撤销前事件*/ - case "onBeforeCancel": - break; - /** 撤销事件*/ - case "onCancel": - //流程撤销,更新grpu8单据 - break; - /** 结束事件*/ - case "onProcessFinished": - break; - /** 处理前事件*/ - case "onBeforeFinishWorkitem": - /** 根据form处理相关业务表单的数据*/ - switch (formApp) { - case "abc123": - break; - default: - return BaseResult.getFailureMessageEntity("未匹配到表单!当前formID:" + formApp, ""); - } - break; - /** 处理事件*/ - case "onFinishWorkitem": - break; - /** 回退前事件*/ - case "onBeforeStepBack": - break; - /** 回退事件*/ - case "onStepBack": - break; - /** 取回前事件*/ - case "onBeforeTakeBack": - break; - /** 取回事件*/ - case "onTakeBack": - break; - default: -// throw new RuntimeException("传入了非法事件类型!请参照:" + eventTypeBuffer.toString()); - return BaseResult.getFailureMessageEntity("传入了非法事件类型!请参照:" + eventTypeBuffer.toString(), "", ""); - } - return BaseResult.getSuccessMessageEntity("传递成功", result); - }catch (Exception e){ - return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); + } catch (Exception e) { + return BaseResult.getFailureMessageEntity("传递失败", e.getMessage()); } + return result; +// try { +// /** 根据事件类型处理相关事件*/ +// switch (eventType) { +// /** 发起前事件*/ +// case "onBeforeStart": +// break; +// /** 发起事件*/ +// case "onStart": +// //流程发起 新增grpu8单据 +// break; +// /** 终止前事件*/ +// case "onBeforeStop": +// break; +// /** 终止事件*/ +// case "onStop": +// //流程终止,更新grpu8单据 +// break; +// /** 撤销前事件*/ +// case "onBeforeCancel": +// break; +// /** 撤销事件*/ +// case "onCancel": +// //流程撤销,更新grpu8单据 +// break; +// /** 结束事件*/ +// case "onProcessFinished": +// break; +// /** 处理前事件*/ +// case "onBeforeFinishWorkitem": +// /** 根据form处理相关业务表单的数据*/ +// switch (formApp) { +// case "abc123": +// break; +// default: +// return BaseResult.getFailureMessageEntity("未匹配到表单!当前formID:" + formApp, ""); +// } +// break; +// /** 处理事件*/ +// case "onFinishWorkitem": +// break; +// /** 回退前事件*/ +// case "onBeforeStepBack": +// break; +// /** 回退事件*/ +// case "onStepBack": +// break; +// /** 取回前事件*/ +// case "onBeforeTakeBack": +// break; +// /** 取回事件*/ +// case "onTakeBack": +// break; +// default: +//// throw new RuntimeException("传入了非法事件类型!请参照:" + eventTypeBuffer.toString()); +// return BaseResult.getFailureMessageEntity("传入了非法事件类型!请参照:" + eventTypeBuffer.toString(), "", ""); +// } +// return BaseResult.getSuccessMessageEntity("传递成功", result); +// }catch (Exception e){ +// return BaseResult.getFailureMessageEntity("传递失败",e.getMessage()); +// } } @@ -297,8 +316,8 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { public JsonResultEntity thirdInterfaceSeeYonDefinitionRePush(JSONObject jsonObject) throws Exception { JSONObject requestData = jsonObject.getJSONObject("jsonStr"); JSONArray resultEntityArray = new JSONArray(); - if(null == requestData){ - throw new BaseSystemException("参数传递错误需要jsonStr!"); + if (null == requestData) { + throw new BaseSystemException("参数传递错误需要jsonStr!"); } //表单模版ID String formAppId = requestData.getString("formAppId"); @@ -308,24 +327,24 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { String dataSourceCode = requestData.getString("dataSourceCode"); //主表ID集合 formMainIds JSONArray formMainIds = requestData.getJSONArray("formMainIds"); - if(StrUtil.isEmpty(eventType)){ - throw new BaseSystemException("需要传递eventType 参照致远OA事件!"); + if (StrUtil.isEmpty(eventType)) { + throw new BaseSystemException("需要传递eventType 参照致远OA事件!"); } - if(StrUtil.isEmpty(formAppId)){ - throw new BaseSystemException("需要传递formAppId 参照致远OA 表 CAP_FORM_DEFINITION!"); + if (StrUtil.isEmpty(formAppId)) { + throw new BaseSystemException("需要传递formAppId 参照致远OA 表 CAP_FORM_DEFINITION!"); } - if(StrUtil.isEmpty(dataSourceCode)){ - throw new BaseSystemException("需要传递dataSourceCode 参照中台表 sys_data_source!"); + if (StrUtil.isEmpty(dataSourceCode)) { + throw new BaseSystemException("需要传递dataSourceCode 参照中台表 sys_data_source!"); } - if(null == formMainIds || formMainIds.size() == 0){ - throw new BaseSystemException("需要传递业务主表数据id集合,不允许全量推送!"); + if (null == formMainIds || formMainIds.size() == 0) { + throw new BaseSystemException("需要传递业务主表数据id集合,不允许全量推送!"); } SeeYonInterFaceEntity seeYonInterFaceEntity = new SeeYonInterFaceEntity(); - BeanUtil.copyProperties(requestData,seeYonInterFaceEntity); + BeanUtil.copyProperties(requestData, seeYonInterFaceEntity); List seeYonInterFaceEntityList = seeYonInterFaceDao.queryDefinitionInfo(seeYonInterFaceEntity); - if(null != seeYonInterFaceEntityList && seeYonInterFaceEntityList.size() >0){ - for(SeeYonInterFaceEntity interFaceEntity : seeYonInterFaceEntityList){ + if (null != seeYonInterFaceEntityList && seeYonInterFaceEntityList.size() > 0) { + for (SeeYonInterFaceEntity interFaceEntity : seeYonInterFaceEntityList) { String field_info = interFaceEntity.getField_info(); JSONObject infoJson = JSON.parseObject(field_info); //获取主表信息 @@ -338,7 +357,7 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { /** 设置主表查询条件*/ interFaceEntity.setTabName(formMainTableName); interFaceEntity.setDataSourceCode(dataSourceCode); - interFaceEntity.setFormMainIds( formMainIds.toJavaList(String.class) ); + interFaceEntity.setFormMainIds(formMainIds.toJavaList(String.class)); List> forMainList = seeYonInterFaceDao.queryDefinitionData(interFaceEntity); for (Map forMainRow : forMainList) { @@ -350,11 +369,11 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { String forMainId = String.valueOf(forMainRow.get("ID")); //组装主表数据 for (Map.Entry entry : forMainRow.entrySet()) { - formMainObj.put(entry.getKey().toLowerCase(),entry.getValue()); - } + formMainObj.put(entry.getKey().toLowerCase(), entry.getValue()); + } //组装明细表数据 - if(null != formSons && formSons.size() > 0){ - for(Object formSon : formSons){ + if (null != formSons && formSons.size() > 0) { + for (Object formSon : formSons) { JSONObject son = JSON.parseObject(JSON.toJSONString(formSon)); //明细数据 String sonTableName = son.getString("tableName"); @@ -368,38 +387,38 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { //组装明细数据 JSONObject forSonJson = new JSONObject(); for (Map.Entry entry : forSons.entrySet()) { - forSonJson.put(entry.getKey().toLowerCase(),entry.getValue()); - } + forSonJson.put(entry.getKey().toLowerCase(), entry.getValue()); + } jsonArray.add(forSonJson); } //设置明细表数据 - seeYonBean.put(sonTableName,jsonArray); + seeYonBean.put(sonTableName, jsonArray); } } - seeYonBean.put(formMainTableName,formMainObj); + seeYonBean.put(formMainTableName, formMainObj); JSONObject rePushRequestData = new JSONObject(); JSONObject object = new JSONObject(); - object.put("formApp",formAppId); - object.put("eventType",eventType); - object.put("businessDataStr",seeYonBean.toJSONString()); - object.put("affairId",""); - object.put("summaryId",requestData.getString("summaryId")); - object.put("currentActivityId",""); - object.put("id",forMainId); - object.put("hzyaExtData",requestData.getJSONObject("hzyaExtData")); - logger.info("Method:thirdInterfaceSeeYonDefinitionRePush 组装seeYonBean DATA: {}",seeYonBean.toJSONString()); + object.put("formApp", formAppId); + object.put("eventType", eventType); + object.put("businessDataStr", seeYonBean.toJSONString()); + object.put("affairId", ""); + object.put("summaryId", requestData.getString("summaryId")); + object.put("currentActivityId", ""); + object.put("id", forMainId); + object.put("hzyaExtData", requestData.getJSONObject("hzyaExtData")); + logger.info("Method:thirdInterfaceSeeYonDefinitionRePush 组装seeYonBean DATA: {}", seeYonBean.toJSONString()); - rePushRequestData.put("jsonStr",object); + rePushRequestData.put("jsonStr", object); - JsonResultEntity resultEntity = thirdInterfaceSeeYonPlugInInterfaceEntrance(rePushRequestData); - if(null != resultEntity){ + JsonResultEntity resultEntity = thirdInterfaceSeeYonPlugInInterfaceEntrance(rePushRequestData); + if (null != resultEntity) { resultEntityArray.add(resultEntity.getAttribute()); - }else{ - JSONObject jsonResultEntity = new JSONObject(); - jsonResultEntity.put("msg","从新推送失败"); - jsonResultEntity.put("id",forMainId); + } else { + JSONObject jsonResultEntity = new JSONObject(); + jsonResultEntity.put("msg", "从新推送失败"); + jsonResultEntity.put("id", forMainId); resultEntityArray.add(jsonResultEntity); } @@ -407,11 +426,12 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { } } } - return BaseResult.getSuccessMessageEntity("从新推送执行结束",resultEntityArray); + return BaseResult.getSuccessMessageEntity("从新推送执行结束", resultEntityArray); } /** * seeyon流程事件监听前置方法,绑定数据源 + * * @param entity * @return * @throws Exception @@ -426,10 +446,10 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { sysApplicationDatabaseEntity.setAppId(applicationEntity.getId()); sysApplicationDatabaseEntity.setDataSourceCode("master"); List sysDataSourceEntities = sysApplicationDatabaseDao.queryDSBase(sysApplicationDatabaseEntity); - if(sysDataSourceEntities != null && sysDataSourceEntities.size() > 0){ + if (sysDataSourceEntities != null && sysDataSourceEntities.size() > 0) { String parm = entity.getBodys(); JSONObject jsonObject = JSONObject.parseObject(parm); - jsonObject.put("dataSourceCode",sysDataSourceEntities.get(0).getSourceCode()); + jsonObject.put("dataSourceCode", sysDataSourceEntities.get(0).getSourceCode()); entity.setBodys(jsonObject.toJSONString()); } } catch (Exception e) { @@ -448,24 +468,24 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { @Override public JsonResultEntity colEventListener(JSONObject jsonObject) throws Exception { try { - if (null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("jsonStr"))){ + if (null != jsonObject && StrUtil.isNotEmpty(jsonObject.getString("jsonStr"))) { SeeYonInterFaceEntity entity = jsonObject.getJSONObject("jsonStr").toJavaObject(SeeYonInterFaceEntity.class); JSONObject requestData = new JSONObject(); //表单模版ID requestData.put("formAppId", entity.getFormAppId()); //事件事件类型 - requestData.put("eventType",entity.getEventType()); + requestData.put("eventType", entity.getEventType()); //数据源编码 - requestData.put("dataSourceCode",entity.getDataSourceCode()); - requestData.put("formMainIds",entity.getFormMainIds()); - requestData.put("summaryId",entity.getSummaryId()); + requestData.put("dataSourceCode", entity.getDataSourceCode()); + requestData.put("formMainIds", entity.getFormMainIds()); + requestData.put("summaryId", entity.getSummaryId()); JSONObject jsonStr = new JSONObject(); - jsonStr.put("jsonStr",requestData); + jsonStr.put("jsonStr", requestData); thirdInterfaceSeeYonDefinitionRePush(jsonStr); } - }catch (Exception e){ - logger.error("流程事件通知接口出错:{}",e); - return BaseResult.getSuccessMessageEntity("失败",e.getMessage()); + } catch (Exception e) { + logger.error("流程事件通知接口出错:{}", e); + return BaseResult.getSuccessMessageEntity("失败", e.getMessage()); } return BaseResult.getSuccessMessageEntity("成功"); } @@ -480,28 +500,345 @@ public class SeeYonInterFaceImpl implements ISeeYonInterFace { * @throws Exception */ @Override - public String colEventPost(String jsonStr, String formAppId, String eventType) throws Exception { - if (StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType)){ + public JsonResultEntity colEventPost(String jsonStr, String formAppId, String eventType) throws Exception { + if (StrUtil.isNotEmpty(jsonStr) && StrUtil.isNotEmpty(formAppId) && StrUtil.isNotEmpty(eventType)) { SysApplicationApiEntity sysApplicationApiEntity = new SysApplicationApiEntity(); - sysApplicationApiEntity.setHeaderIn(formAppId+"_"+eventType); + sysApplicationApiEntity.setHeaderIn(formAppId + "_" + eventType); List applist = sysApplicationApiService.queryLike(sysApplicationApiEntity); - if (CollectionUtil.isNotEmpty(applist)){ - if (applist.size() > 1){ - throw new BaseSystemException("根据formID:" + formAppId+"查询出多条数据"); + if (CollectionUtil.isNotEmpty(applist)) { + if (applist.size() > 1) { + throw new BaseSystemException("根据formID:" + formAppId + "查询出多条数据"); + } + if (applist.size() == 0 ) { + throw new BaseSystemException("根据formID:" + formAppId + "eventType:"+eventType+"未查询到API配置"); } SysApplicationApiEntity sysApp = applist.get(0); - Map headerMap = MapBuilder.create(true) - .put("apiCode", String.valueOf(sysApp.getApiCode())) - //这里用中台做为发送方 - .put("publicKey","ZJYAWb7lhAUTYqekPkU+uHJv1/ObJxb7dT7sD8HPRDGAgyhCe7eDIk+3zDUT+v578prj") - .put("secretKey","fviZnLBsQUAGF8w8FSOdJi7XlIm/XAZclMxRagDLfTyJFlvnIBF3w66Hrpfzs8cYj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=") - .put("appId",String.valueOf(sysApp.getAppCode())) - .build(); - String body = HttpRequest.post("http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface").addHeaders(headerMap).body(jsonStr).timeout(60000).execute().body(); - logger.info("调用中台返回的参数:{}",body); - return body; + //数据源配置 + SysApplicationDatabaseEntity sysApiDatabase = new SysApplicationDatabaseEntity(); + sysApiDatabase.setAppId(sysApp.getAppId()); + List apiDataBaseList = sysApplicationDatabaseDao.queryDSBase(sysApiDatabase); + if (CollectionUtils.isNotEmpty(apiDataBaseList) && apiDataBaseList.size() == 1){ + sysApiDatabase = apiDataBaseList.get(0); + } + JSONArray headerArray = JSONArray.parseArray(sysApp.getHeaderIn()); + Map headerMap = new HashMap<>(); + if (null != headerArray && headerArray.size() > 0) { + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + String parameterName = querys.getString("parameterName"); + String example = querys.getString("example"); + headerMap.put(parameterName,example); + } + if (headerMap.isEmpty()){ + throw new BaseSystemException("根据formID:" + formAppId + "未获取到head参数"); + } + PluginBaseEntity pluginBaseEntity = PluginUtils.getPluginsById(headerMap.get("plugId")); + if (null == pluginBaseEntity) { + throw new BaseSystemException("根据ID获取插件错误!请传入正确的 pluginId"); + } + //执行业务逻辑代码 + JSONObject reqJson = new JSONObject(); + reqJson.put("jsonStr",jsonStr); + reqJson.put("formAppId",formAppId); + reqJson.put("eventType",eventType); + reqJson.put("headers",JSON.toJSONString(headerMap)); + reqJson.put("apiDataSourceCode",sysApiDatabase.getSourceCode()); + JsonResultEntity result = pluginBaseEntity.executeBusiness(reqJson); + return result; + } else { + throw new BaseSystemException("根据formID:" + formAppId + "未获取到head参数"); + } } } return null; } + @Override + public JsonResultEntity chengeBody(JSONObject object) throws Exception { + JSONObject jsonstr = object.getJSONObject("jsonStr"); + PluginBaseEntity pluginBaseEntity = null; + JsonResultEntity result; + String pluginId = jsonstr.getString("plugId"); + pluginBaseEntity = PluginUtils.getPluginsById(pluginId); + if (null == pluginBaseEntity) { + throw new BaseSystemException("根据ID获取插件错误!请传入正确的 pluginId"); + } else { + //执行业务逻辑代码 + result = pluginBaseEntity.executeBusiness(object); + } + return result; + } + + @Override + public SysExtensionApiEntity chengeBodySetPlug(SysExtensionApiEntity entity) { + Map headers = entity.getHeaders(); + JSONObject jsonObject = JSONObject.parseObject(entity.getBodys()); + jsonObject.put("plugId", headers.get("plugId")); + entity.setBodys(jsonObject.toJSONString()); + return entity; + } + + + @Override + public SysExtensionApiEntity getToken(SysExtensionApiEntity entity) { + Map headers = entity.getHeaders(); + SysApplicationApiEntity sysApplicationEntity = entity.getReceiveApi(); + SysApplicationEntity sendApp = entity.getSendApp(); + SysApplicationEntity receiveApp = entity.getReceiveApp(); + if("1".equals(sysApplicationEntity.getNeedLogin()) && sysApplicationEntity.getAuthenticationPort() != null){ + SysApplicationApiEntity loginApi = getApiByAppIdApiCode(sysApplicationEntity.getAuthenticationPort()); + if (null == loginApi) { + return entity; + } + String rzquerys = getQuery(loginApi,null,null); + Map headersa = new HashMap<>(); + headersa.put("publicKey", sendApp.getPublicKey()); + headersa.put("secretKey", sendApp.getSecretKey()); + headersa.put("appId", receiveApp.getAppId().toString()); + headersa.put("apiCode", loginApi.getApiCode().toString()); + Map rzheaders = getHeaders(loginApi,headersa,null); + String rzbodys = getBodys(loginApi,null,null); + JsonResultEntity rzjsonResultEntity = sendData(loginApi,rzheaders,rzbodys,rzquerys); + if (!rzjsonResultEntity.isFlag()) { + return entity; + } + JSONObject attritube = JSONObject.parseObject(rzjsonResultEntity.getAttribute().toString()); + headers.put("token",attritube.getJSONObject("attribute").getString("id")); + } + entity.setHeaders(headers); + return entity; + } + private SysApplicationApiEntity getApiByAppIdApiCode(String apiId) { + + String str = "apiId" + apiId ; + Object o = applicationCache.get("5", str); + if (o != null) { + return (SysApplicationApiEntity) o; + } + return null; + } + private JsonResultEntity sendData(SysApplicationApiEntity applicationApiEntity, Map headers ,String bodys ,String querys) { + StringBuffer urls = new StringBuffer(url); + if (querys != null) { + urls.append("?"); + urls.append(querys); + } + HttpClientBuilder httpClientBuilder = HttpClientBuilder.create(); + // HttpClient + CloseableHttpClient closeableHttpClient = httpClientBuilder.disableCookieManagement().build(); + HttpPost post = new HttpPost(urls.toString()); + CloseableHttpResponse response = null; + + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(Integer.valueOf(applicationApiEntity.getTimeoutPeriod())).build(); + post.setConfig(requestConfig);//设置请求参数【超时时间】 + + if (headers != null && headers.size() > 0) { + for (String key : headers.keySet()) { + post.setHeader(key, headers.get(key)); + } + } + StringBuilder body = new StringBuilder(); + boolean flag = true; + 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")); + flag = true; + logger.info("返回结果:" + body); + } catch (Exception e) { + logger.error("请求错误:" + e.getMessage()); + body.append(e.getMessage()); + flag = false; + } finally { + try { + // 关闭响应对象 + if (response != null) { + response.close(); + } + // 关闭响应对象 + if (closeableHttpClient != null) { + closeableHttpClient.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + + } + if (flag) { + if (JSONUtil.isTypeJSON(body.toString())) { + JsonResultEntity jsonResultEntity = JSONObject.parseObject(body.toString(),JsonResultEntity.class); + if(jsonResultEntity.isFlag()){ + return BaseResult.getSuccessMessageEntity("转发成功", body); + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + }else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } else { + return BaseResult.getFailureMessageEntity("转发失败", body); + } + } + + private String getBodys(SysApplicationApiEntity loginApi,String sendDatastr, JSONObject loginData) { + JSONObject sendData = new JSONObject(); + if(sendDatastr != null ){ + sendData = JSONObject.parseObject(sendDatastr); + } + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getBodyIn() != null && !"".equals(loginApi.getBodyIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getBodyIn())) { + JSONArray headerbodyArray = JSON.parseArray(loginApi.getBodyIn()); + JSONObject bodyjson = headerbodyArray.getJSONObject(0); + JSONArray headerArray = bodyjson.getJSONArray("children"); + for (int i = 0; i < headerArray.size(); i++) { + //获取到第一个数据 + JSONObject querys = headerArray.getJSONObject(i); + if (SysEnum.FUNDAMENTAL.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + sendData.put(querys.getString(SysEnum.PARAMETERNAME.getValue()),query); + } + } + } + } + } + return sendData.toString(); + } + + private Map getHeaders(SysApplicationApiEntity loginApi,Map map,JSONObject loginData) { + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getHeaderIn() != null && !"".equals(loginApi.getHeaderIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getHeaderIn())) { + JSONArray headerArray = JSON.parseArray(loginApi.getHeaderIn()); + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + JSONArray example = JSONArray.parseArray(query); + String logValue = getObjectValue(loginData, example); + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue); + } + } else { + if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue())); + } + } else {//没有值直接拼接 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), ""); + } + } + } + } + } + } + return map; + + + + + } + + /** + * @param loginData + * @param example + * @return java.lang.String + * @Author lvleigang + * @Description 根据jsonArray 获取jsonobject中的值 + * @Date 11:47 上午 2023/8/31 + **/ + private String getObjectValue(JSONObject loginData, JSONArray example) { + String values = ""; + if (example != null && example.size() > 0) { + for (int i = 0; i < example.size(); i++) { + if (loginData.getString(example.getString(i)) != null && !"".equals(loginData.getString(example.getString(i)))) { + if (i == (example.size() - 1)) { + values = loginData.getString(example.getString(i)); + } else { + loginData = JSONObject.parseObject(loginData.getString(example.getString(i))); + } + } else { + return values; + } + } + } + return values; + } + private String getQuery(SysApplicationApiEntity loginApi,String sendDatastr,JSONObject loginData) { + Map map = new HashMap<>(); + if(sendDatastr != null){ + String[] parts = sendDatastr.split("&"); + if(parts != null && parts.length > 0){ + for (int i = 0; i < parts.length; i++) { + String[] part = parts[i].split("="); + if(part != null && part.length >=2 ){ + for (int a = 0; a < part.length; a++) { + map.put(part[0],part[1]); + } + } + } + } + } + if(loginData == null){ + loginData = new JSONObject(); + } + if (loginApi.getQueryIn() != null && !"".equals(loginApi.getQueryIn())) { + if (JSONUtil.isTypeJSONArray(loginApi.getQueryIn())) { + JSONArray headerArray = JSON.parseArray(loginApi.getQueryIn()); + for (int i = 0; i < headerArray.size(); i++) { + JSONObject querys = headerArray.getJSONObject(i); + //query 只有基本类型,不用循环判断下级 + //判断参数是否有值 + //获取对象下面的层级数据 + if (SysEnum.AUTHPORT.getValue().equals(querys.getString(SysEnum.PARAMETERTYPE.getValue()))) {//认证类型 + String query = querys.getString(SysEnum.EXAMPLE.getValue()); + if (query != null && !"".equals(query)) { + JSONArray example = JSONArray.parseArray(query); + String logValue = getObjectValue(loginData, example); + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), logValue); + } + } else { + //不是认证类型直接取值 + if (querys.getString(SysEnum.EXAMPLE.getValue()) != null && !"".equals(querys.getString(SysEnum.EXAMPLE.getValue()))) {//入参没有值用实例值,如果没有不添加 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), querys.getString(SysEnum.EXAMPLE.getValue())); + } + } else {//没有值直接拼接 + if(map.get(querys.getString(SysEnum.PARAMETERNAME.getValue())) == null){ + map.put(querys.getString(SysEnum.PARAMETERNAME.getValue()), ""); + } + } + } + } + } + } + StringBuffer returnStr = new StringBuffer(); + if(map != null && map.size() > 0){ + for (String key : map.keySet()) { + if("".equals(returnStr)){ + returnStr.append(key).append("=").append(map.get(key)); + }else { + returnStr.append("&").append(key).append("=").append(map.get(key)); + } + } + } + return returnStr.toString(); + } } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OABipUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OABipUtil.java index 53941ca8..9484e2fb 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OABipUtil.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OABipUtil.java @@ -21,15 +21,15 @@ public class OABipUtil { * */ - public static String sendOATOBipEsb(String parm, String apiCode,String token){ - String baseUrl = "http://127.0.0.1:9011/kangarooDataCenterV3/entranceController/externalCallInterface"; + public static String sendU9cTOBipEsb(String parm, String apiCode,String token){ + String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; System.out.println("推送参数"+parm); String result = HttpRequest.post(baseUrl) - .header("appId", "800050")//头信息,多个头信息多次调用此方法即可 + .header("appId", "800023")//头信息,多个头信息多次调用此方法即可 .header("access_token", token)//头信息,多个头信息多次调用此方法即可 .header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可 - .header("publicKey", "ZJYAM2YFEIsIaI1e4wMagkS2Q7SFgGk0RvsPhEES45m/OVFCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 - .header("secretKey", "lR6+uf94mvNMclAB43oIwmhJSMDzQaViTkfXLeNvmGdpLfbFiUvbgbU+p43zO25Zj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 + .header("publicKey", "ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 + .header("secretKey", "7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 .body(parm)//表单内容 .timeout(20000)//超时,毫秒 .execute().body(); @@ -40,13 +40,13 @@ public class OABipUtil { return null; } public static String getBipToken(String userCode, String apiCode){ - String baseUrl = "http://127.0.0.1:9011/kangarooDataCenterV3/entranceController/externalCallInterface"; + String baseUrl = "http://127.0.0.1:9999/kangarooDataCenterV3/entranceController/externalCallInterface"; String result = HttpRequest.post(baseUrl) - .header("appId", "800050")//头信息,多个头信息多次调用此方法即可 + .header("appId", "800023")//头信息,多个头信息多次调用此方法即可 .header("apiCode", apiCode)//头信息,多个头信息多次调用此方法即可 -// .header("usercode", userCode)//头信息,多个头信息多次调用此方法即可 - .header("publicKey", "ZJYAM2YFEIsIaI1e4wMagkS2Q7SFgGk0RvsPhEES45m/OVFCe7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 - .header("secretKey", "lR6+uf94mvNMclAB43oIwmhJSMDzQaViTkfXLeNvmGdpLfbFiUvbgbU+p43zO25Zj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 + .header("usercode", userCode)//头信息,多个头信息多次调用此方法即可 + .header("publicKey", "ZJYA1vBeY1ai53iNmbAEsw6DImjkXGBkdMailxcBdliFC85Ce7eDIk+3zDUT+v578prj")//头信息,多个头信息多次调用此方法即可 + .header("secretKey", "7Gp6OjHrIaQ6R3tXGPrI4morjQyWL+qu4JJschQnkBRtv26VDgGFVYKOy5kMZfd/j3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA=")//头信息,多个头信息多次调用此方法即可 .body("")//表单内容 .timeout(20000)//超时,毫秒 .execute().body(); diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java index 84b42102..73b2d0dc 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/OARestUtil.java @@ -26,9 +26,9 @@ import java.util.List; * @Date 2024/6/17 15:49 **/ @Component -public class OARestUtil { +public class OARestUtil { @Autowired - private ISysApplicationApiService sysApplicationApiService; + private static ISysApplicationApiService sysApplicationApiService; static Logger logger = LoggerFactory.getLogger(OARestUtil.class); private OARestUtil() { @@ -41,14 +41,14 @@ public class OARestUtil { * @param api_code 接口编码 * @return */ - public JSONObject fileUpload(File file,String api_code) { - if (StrUtil.isNotEmpty(api_code)){ + public static JSONObject fileUpload(File file,String api_code_upload,String api_code_token) { + if (StrUtil.isNotEmpty(api_code_upload)){ //1、查询附件上传api接口信息 - SysApplicationApiEntity sysApp = getByCode(api_code); + SysApplicationApiEntity sysApp = getByCode(api_code_upload); if (null != sysApp){ String app_url = sysApp.getAppUrl(); String url = app_url+"/seeyon/rest/attachment?token=@token@"; - String token = getToken(null,"8000240000"); + String token = getToken(null,api_code_token); url = url.replaceAll("@token@",token); HashMap paramMap = new HashMap<>(); paramMap.put("file", file); @@ -147,7 +147,7 @@ public class OARestUtil { * @param api_code * @return */ - public String getToken(String login_name,String api_code){ + public static String getToken(String login_name,String api_code){ if (StrUtil.isNotEmpty(api_code)){ SysApplicationApiEntity sysApp = getByCode(api_code); return getToken(login_name,sysApp); @@ -162,7 +162,7 @@ public class OARestUtil { * @param sysApp 应用信息 * @return */ - public String getToken(String login_name,SysApplicationApiEntity sysApp){ + public static String getToken(String login_name,SysApplicationApiEntity sysApp){ if (null != sysApp){ HashMap hashMap = new HashMap<>(); String app_url = StrUtil.removeSuffix(sysApp.getAppUrl(), "/"); @@ -190,7 +190,7 @@ public class OARestUtil { } return null; } - private SysApplicationApiEntity getByCode(String api_code){ + private static SysApplicationApiEntity getByCode(String api_code){ if (StrUtil.isNotEmpty(api_code)){ SysApplicationApiEntity sysApp = new SysApplicationApiEntity(); sysApp.setApiCode(Long.valueOf(api_code)); diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java new file mode 100644 index 00000000..860a45a3 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/SM2Util.java @@ -0,0 +1,353 @@ +package com.hzya.frame.seeyon.util; + +import org.bouncycastle.crypto.CipherParameters; +import org.bouncycastle.crypto.engines.SM2Engine; +import org.bouncycastle.crypto.params.ECPrivateKeyParameters; +import org.bouncycastle.crypto.params.ECPublicKeyParameters; +import org.bouncycastle.crypto.params.ParametersWithRandom; +import org.bouncycastle.jcajce.provider.asymmetric.util.ECUtil; +import org.bouncycastle.jce.provider.BouncyCastleProvider; + +import java.nio.charset.StandardCharsets; +import java.security.*; +import java.security.spec.*; +import java.util.Base64; +import java.util.HashMap; +import java.util.Map; + +public class SM2Util { + + private final static SM2Engine.Mode DIGEST = SM2Engine.Mode.C1C3C2; + + private static final String PRIVATE_KEY = "privateKey"; + + private static final String PUBLIC_KEY = "publicKey"; + + private static final String STD_NAME = "sm2p256v1"; + + private static final String ALGORITHM = "EC"; + + public static final String LF = "\n"; + + public static final String CR = "\r"; + + public static final String SPACE = " "; + + public static final String EMPTY = ""; + + + /** + * 生成密钥 + * + * @return + */ + public Map generate() { + Map keyMap = new HashMap<>(); + try { + ECGenParameterSpec sm2Spec = new ECGenParameterSpec(STD_NAME); + KeyPairGenerator kpg = KeyPairGenerator.getInstance(ALGORITHM, new BouncyCastleProvider()); + kpg.initialize(sm2Spec); + KeyPair keyPair = kpg.generateKeyPair(); + PublicKey publicKey = keyPair.getPublic(); + PrivateKey privateKey = keyPair.getPrivate(); + keyMap.put(PRIVATE_KEY, new String(Base64.getEncoder().encode(privateKey.getEncoded()), StandardCharsets.UTF_8)); + keyMap.put(PUBLIC_KEY, new String(Base64.getEncoder().encode(publicKey.getEncoded()), StandardCharsets.UTF_8)); + } catch (Exception e) { + /*this.log.info("SM2Util生成密钥出现异常", e);*/ + } + return keyMap; + } + + /** + * 加密 + * + * @param data 数据Str + * @param publicKey 公钥Str + * @return 加密之后的数据 + */ + public static String encrypt(String data, String publicKey) { + try { + return new String(Base64.getEncoder().encode(encrypt(data.getBytes(StandardCharsets.UTF_8), Base64.getDecoder().decode(publicKey.getBytes(StandardCharsets.UTF_8))))); + }catch (Exception e){ + e.printStackTrace(); + } + return null; + } + + /** + * 加密 + * + * @param data 数据 + * @param publicKey 公钥 + * @return 加密之后的数据 + */ + public static byte[] encrypt(byte[] data, byte[] publicKey) throws Exception { + CipherParameters pubKeyParameters = new ParametersWithRandom(publicKeyToParams("SM2", publicKey)); + SM2Engine engine = new SM2Engine(DIGEST); + engine.init(true, pubKeyParameters); + return engine.processBlock(data, 0, data.length); + } + + /** + * 解密 + * + * @param data 数据 + * @param privateKey 私钥 + * @return 解密之后的数据 + */ + public static String decrypt(String data, String privateKey) throws Exception { + return new String(decrypt(Base64.getDecoder().decode(data.getBytes(StandardCharsets.UTF_8)), Base64.getDecoder().decode(privateKey.getBytes(StandardCharsets.UTF_8))), StandardCharsets.UTF_8); + } + + /** + * 解密 + * + * @param data 数据 + * @param privateKey 私钥 + * @return 解密之后的数据 + */ + public static byte[] decrypt(byte[] data, byte[] privateKey) throws Exception { + CipherParameters privateKeyParameters = privateKeyToParams("SM2", privateKey); + SM2Engine engine = new SM2Engine(DIGEST); + engine.init(false, privateKeyParameters); + return engine.processBlock(data, 0, data.length); + } + + /** + * SM2密文转换空格等特殊字符 + * + * @param sm2Content + * @return + */ + public static String fixSm2Content(String sm2Content) { + if (sm2Content == null) { + return sm2Content; + } + return sm2Content.replace(LF, EMPTY).replace(CR, EMPTY).replace(SPACE, "+"); + } + + /** + * 私钥转换为 {@link ECPrivateKeyParameters} + * + * @param key key + * @return + * @throws InvalidKeyException + */ + public static ECPrivateKeyParameters privateKeyToParams(String algorithm, byte[] key) throws InvalidKeyException, InvalidKeySpecException, NoSuchAlgorithmException { + if (key == null || key.length == 0) { + throw new NullPointerException("key must be not null !"); + } + PrivateKey privateKey = generatePrivateKey(algorithm, key); + return (ECPrivateKeyParameters) ECUtil.generatePrivateKeyParameter(privateKey); + } + + /** + * 生成私钥 + * + * @param algorithm 算法 + * @param key key + * @return + */ + public static PrivateKey generatePrivateKey(String algorithm, byte[] key) throws NoSuchAlgorithmException, InvalidKeySpecException { + if (isBlank(algorithm)) { + throw new NullPointerException("algorithm must be not null !"); + } + if (key == null || key.length == 0) { + throw new NullPointerException("key must be not null !"); + } + KeySpec keySpec = new PKCS8EncodedKeySpec(key); + algorithm = getAlgorithmAfterWith(algorithm); + return getKeyFactory(algorithm).generatePrivate(keySpec); + } + + /** + * 公钥转换为 {@link ECPublicKeyParameters} + * + * @param key key + * @return + * @throws InvalidKeyException + */ + public static ECPublicKeyParameters publicKeyToParams(String algorithm, byte[] key) throws InvalidKeyException, InvalidKeySpecException, NoSuchAlgorithmException { + if (isBlank(algorithm)) { + throw new NullPointerException("algorithm must be not null !"); + } + if (key == null || key.length == 0) { + throw new NullPointerException("key must be not null !"); + } + PublicKey publicKey = generatePublicKey(algorithm, key); + return (ECPublicKeyParameters) ECUtil.generatePublicKeyParameter(publicKey); + } + + /** + * 生成公钥 + * + * @param algorithm 算法 + * @param key key + * @return + */ + public static PublicKey generatePublicKey(String algorithm, byte[] key) throws NoSuchAlgorithmException, InvalidKeySpecException { + if (isBlank(algorithm)) { + throw new NullPointerException("algorithm must be not null !"); + } + if (key == null || key.length == 0) { + throw new NullPointerException("key must be not null !"); + } + KeySpec keySpec = new X509EncodedKeySpec(key); + algorithm = getAlgorithmAfterWith(algorithm); + return getKeyFactory(algorithm).generatePublic(keySpec); + } + + /** + * 获取用于密钥生成的算法
+ * 获取XXXwithXXX算法的后半部分算法,如果为ECDSA或SM2,返回算法为EC + * + * @param algorithm XXXwithXXX算法 + * @return 算法 + */ + private static String getAlgorithmAfterWith(String algorithm) { + if (isBlank(algorithm)) { + throw new NullPointerException("algorithm must be not null !"); + } + int indexOfWith = lastIndexOfIgnoreCase(algorithm, "with"); + if (indexOfWith > 0) { + algorithm = substring(algorithm, indexOfWith + "with".length()); + } + if ("ECDSA".equalsIgnoreCase(algorithm) || "SM2".equalsIgnoreCase(algorithm)) { + algorithm = ALGORITHM; + } + return algorithm; + } + + /** + * 获取{@link KeyFactory} + * + * @param algorithm 非对称加密算法 + * @return {@link KeyFactory} + */ + private static KeyFactory getKeyFactory(String algorithm) throws NoSuchAlgorithmException { + final Provider provider = new BouncyCastleProvider(); + return KeyFactory.getInstance(algorithm, provider); + } + + public static void main(String[] args) throws Exception { + SM2Util sm2Utils = new SM2Util(); + sm2Utils.testSignByQuickpass(); + } + + private void testSignByQuickpass() throws Exception { + //密钥生成 + String privateKey = "MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgOHOzaKWBWOAbslvtYtS8tcQiJ9W9DT2cGQM3KSgXpfygCgYIKoEcz1UBgi2hRANCAAQNPct0MHOuDrVJBIy0RI7JKx9/PTlFHZlkIJr0EqpC+b/+N+z3JKbCMZ/wcP1V36Q+DlfDJCY9Ai/Uk2PZ9ZaF"; + String publicKey = "MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEDT3LdDBzrg61SQSMtESOySsffz05RR2ZZCCa9BKqQvm//jfs9ySmwjGf8HD9Vd+kPg5XwyQmPQIv1JNj2fWWhQ=="; + // 加验签 + //String value = "{\"partner\": \"test\",\"tranTime\": \"20240128003627\",\"seqNo\": \"123456\",\"orderNo\": \"order123456\", \"orderAmt\": \"1500\"}"; + String value="{\"data\":{\"companyCode\":\"CN000001\",\"purpose\":\"加入中国光伏行业协会会员单位,获得行业技术支持,2025年会员单位缴纳标准为1万元/年,汇款时需注明“会费”字样,并在备注中注明汇款单位;缴纳会费后,需有付款凭证,将付款凭证发送至协会邮箱,并填写开票信息等内容\",\"recAccountNum\":\"8110701012801540483\",\"recAccountName\":\"\",\"payAccountNum\":\"8110701012601540892\",\"fundType\":\"0001\",\"transAmount\":\"9.90\",\"documentNo\":\"DG202503240321\",\"recBankCode\":\"\",\"settleAccountType\":\"CASH_TRANSFER\",\"sourceFlowNumber\":\"-3854827654841675885_1539\",\"submitUser\":\"user1\",\"digest\":\"加入中国光伏行业协会会员单位,获得行业技术支持,2025年会\",\"payChannel\":\"DIRECT\",\"currency\":\"CNY\",\"toPublic\":true,\"payAccountName\":\"\",\"payDate\":\"2025-03-26\"}}"; + System.out.println("明文:" + value); + //加密 + //String encryptStr = encrypt(value, publicKey); + String encryptStr="BLTRQV8d8D1ILWs21weVXVubIB1Ppx3Oy3rWqdocyrAXm5WBNhSz6YemoVVPTTtdycJ3mcFF1YuRKhuHsMhU/VkzssS3i7W8FPwWHNyyorhd3LrP0HMx+j3MN/s7kGs9PGRem/X4U+tQsJxoQSi8CkmwCcF42aN78LkQ5292cDQ6/AcobhKYNHBqCeX9+gUhue76pWFM12k9rXQYvCnIqdf+vB5ot+UXuk3eXwnlmVdP+f5kSSKxyWRIC8GjLwHRWChkuk6IkjIhVlSMJfVt1fOseBYq5VW32XkHQFbSZW3JvYUhHpimibw7SP6SK60TT8lfJzsABJ5euADCFlhVwfUZZXZLdSV4YFSB/IQ6vVkHorQmD5RdGxktgu3MbErdEPhiGl7/tLj6gKi2ecRobGkQwu1peKcKB08WgnWFX/6Wbs0dxfavAAc1W3mXta0zx/+q2jiIydCsySUT2xCRDVBlGHPIlN8RDucQ4mOE5gBlr9vvMxnKOG2kdWzTVoj+aibqKh5ljwGbIUetbE3XtwNlO7deupvTaUN565P1M8cuK7zQjLeoUD2gqLMZOzz5fgkrPTzd7jUyf3QatDOGEFxrF1u03BMJVNAssxj7pdq2aSBTrHKwafoplUpWEAogeiUh2xYlVSEu2BUinHoMxqGU57UM/ZU1IRFgVKTdHV/R/4hLOpu55Mq7C5cOTVwVFasnIdbkJvabNX/vN0js9Bx/2QJx5SN2wqCV5R4yrXTH4dUGVTQFNLuiZSX8TML463FCIrtiofHZ/jvp3hEbyYTchkMuPEvH3MBZAt6ZXmwInYEktymF2nvBD7Pw22xQaE1Sqfjig5m4gQHB1mRV/RKCaNv7CuXsef29ldU5mQnER0U="; + System.out.println("加密结果:" + encryptStr); + + //解密 + String decryptStr = decrypt(encryptStr, privateKey); + System.out.println("解密结果:" + decryptStr); + } + + /** + * 判断字符串是否为空 + * + * @param str 字符串 + * @return true/false + */ + public static boolean isBlank(String str) { + int strLen; + if (str != null && (strLen = str.length()) != 0) { + for (int i = 0; i < strLen; ++i) { + if (!Character.isWhitespace(str.charAt(i))) { + return false; + } + } + } + return true; + } + + + public static String substring(final String str, int start) { + if (str == null) { + return null; + } + // handle negatives, which means last n characters + if (start < 0) { + start = str.length() + start; // remember start is negative + } + if (start < 0) { + start = 0; + } + if (start > str.length()) { + return ""; + } + return str.substring(start); + } + + public static int lastIndexOfIgnoreCase(final CharSequence str, final CharSequence searchStr) { + if (str == null || searchStr == null) { + return -1; + } + return lastIndexOfIgnoreCase(str, searchStr, str.length()); + } + + public static int lastIndexOfIgnoreCase(final CharSequence str, final CharSequence searchStr, int startPos) { + if (str == null || searchStr == null) { + return -1; + } + if (startPos > str.length() - searchStr.length()) { + startPos = str.length() - searchStr.length(); + } + if (startPos < 0) { + return -1; + } + if (searchStr.length() == 0) { + return startPos; + } + for (int i = startPos; i >= 0; i--) { + if (regionMatches(str, i, searchStr, searchStr.length())) { + return i; + } + } + return -1; + } + + static boolean regionMatches(final CharSequence cs, final int thisStart, + final CharSequence substring, final int length) { + if (cs instanceof String && substring instanceof String) { + return ((String) cs).regionMatches(true, thisStart, (String) substring, 0, length); + } + int index1 = thisStart; + int index2 = 0; + int tmpLen = length; + // Extract these first so we detect NPEs the same as the java.lang.String version + final int srcLen = cs.length() - thisStart; + final int otherLen = substring.length(); + // Check for invalid parameters + if (thisStart < 0 || length < 0) { + return false; + } + // Check that the regions are long enough + if (srcLen < length || otherLen < length) { + return false; + } + while (tmpLen-- > 0) { + final char c1 = cs.charAt(index1++); + final char c2 = substring.charAt(index2++); + + if (c1 == c2) { + continue; + } + // The same check as in String.regionMatches(): + if (Character.toUpperCase(c1) != Character.toUpperCase(c2) + && Character.toLowerCase(c1) != Character.toLowerCase(c2)) { + return false; + } + } + return true; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfObjectUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfObjectUtil.java new file mode 100644 index 00000000..85e29f99 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfObjectUtil.java @@ -0,0 +1,81 @@ +package com.hzya.frame.seeyon.util; + +import java.util.Date; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * @ClassName YzfObjectUtil + * @Description + * @Author llg + * Date 2025/4/2 2:12 下午 + */ +public class YzfObjectUtil { + /** + * 是否为包装类型 + * + * @param clazz 类 + * @return 是否为包装类型 + */ + public static boolean isPrimitiveWrapper(Class clazz) { + if (null == clazz) { + return false; + } + return BasicType.wrapperPrimitiveMap.containsKey(clazz); + } + + /** + * 是否为基本类型(包括包装类和原始类) + * + * @param clazz 类 + * @return 是否为基本类型 + */ + public static boolean isBasicType(Class clazz) { + if (null == clazz) { + return false; + } + return (clazz.isPrimitive() || isPrimitiveWrapper(clazz)); + } + + + /** + * @param clazz 类 + * @return 是否为简单值类型 + * 判断是否是基本数据类型、String类型、other CharSequence、Number、Date + */ + public static boolean isSimpleTypeOrString(Class clazz) { + if(clazz == null) { + return false; + } + return isBasicType(clazz) || clazz.isEnum() || CharSequence.class.isAssignableFrom(clazz) + || Number.class.isAssignableFrom(clazz) || Date.class.isAssignableFrom(clazz); + } + + enum BasicType { + BYTE, SHORT, INT, INTEGER, LONG, DOUBLE, FLOAT, BOOLEAN, CHAR, CHARACTER, STRING; + + /** + * 包装类型为Key,原始类型为Value,例如: Integer.class =》 int.class. + */ + public static final Map, Class> wrapperPrimitiveMap = new ConcurrentHashMap<>(8); + /** + * 原始类型为Key,包装类型为Value,例如: int.class =》 Integer.class. + */ + public static final Map, Class> primitiveWrapperMap = new ConcurrentHashMap<>(8); + + static { + wrapperPrimitiveMap.put(Boolean.class, boolean.class); + wrapperPrimitiveMap.put(Byte.class, byte.class); + wrapperPrimitiveMap.put(Character.class, char.class); + wrapperPrimitiveMap.put(Double.class, double.class); + wrapperPrimitiveMap.put(Float.class, float.class); + wrapperPrimitiveMap.put(Integer.class, int.class); + wrapperPrimitiveMap.put(Long.class, long.class); + wrapperPrimitiveMap.put(Short.class, short.class); + + for (Map.Entry, Class> entry : wrapperPrimitiveMap.entrySet()) { + primitiveWrapperMap.put(entry.getValue(), entry.getKey()); + } + } + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSHA256Util.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSHA256Util.java new file mode 100644 index 00000000..cd65e231 --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSHA256Util.java @@ -0,0 +1,50 @@ +package com.hzya.frame.seeyon.util; +import java.security.MessageDigest; + +/** + * @ClassName YzfSHA256Util + * @Description + * @Author llg + * Date 2025/4/2 2:11 下午 + */ +public class YzfSHA256Util { + + /** +   * 利用java原生的摘要实现SHA256加密 +   * @param str 加密后的报文 +   * @return + */ + public static String getSHA256StrJava(String str, String charsetName) { + MessageDigest messageDigest; + String encodeStr = ""; + + try { + messageDigest = MessageDigest.getInstance("SHA-256"); + messageDigest.update(str.getBytes(charsetName)); + encodeStr = byte2Hex(messageDigest.digest()); + } catch (Exception e) { + e.printStackTrace(); + } + + return encodeStr; + } + + /** +   * 将byte转为16进制 +   * @param bytes +   * @return + */ + private static String byte2Hex(byte[] bytes) { + StringBuffer stringBuffer = new StringBuffer(); + String temp = null; + for (int i = 0; i < bytes.length; i++) { + temp = Integer.toHexString(bytes[i] & 0xFF); + if (temp.length() == 1) { + //1得到一位的进行补0操作 + stringBuffer.append("0"); + } + stringBuffer.append(temp); + } + return stringBuffer.toString(); + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSignUtil.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSignUtil.java new file mode 100644 index 00000000..1a37738b --- /dev/null +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/util/YzfSignUtil.java @@ -0,0 +1,45 @@ +package com.hzya.frame.seeyon.util; + +import org.apache.commons.lang.StringUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Map; + +/** + * @ClassName YzfSignUtil + * @Description + * @Author llg + * Date 2025/4/2 2:14 下午 + */ +public class YzfSignUtil { + private static final String CHARSET = "utf-8"; + + public static String signRequest(Map parametersMap, String secretkey) { + ArrayList list = new ArrayList<>(); + for (Map.Entry entry : parametersMap.entrySet()) { + String key = entry.getKey(); + Object val = entry.getValue(); + if (StringUtils.isBlank(key) || val == null) { + continue; + } + + if (YzfObjectUtil.isSimpleTypeOrString(val.getClass())) { + if (null != val && !"".equals(val)) { + list.add(key + "=" + val + "&"); + } + } + } + int size = list.size(); + String[] arrayToSort = list.toArray(new String[size]); + Arrays.sort(arrayToSort, String.CASE_INSENSITIVE_ORDER); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < size; i++) { + sb.append(arrayToSort[i]); + } + String result = sb.toString(); + result += secretkey; + result = YzfSHA256Util.getSHA256StrJava(result, CHARSET); + return result; + } +} diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/IZxBankDao.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/IZxBankDao.java index ed0e0cec..ceb11fe5 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/IZxBankDao.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/IZxBankDao.java @@ -28,7 +28,7 @@ public interface IZxBankDao extends IBaseDao { * @Author hecan * @Date 2024-12-05 17:58 * **/ - Integer updatePushStatus(ZxBankEntity entity); + Integer updatePushStatusZX(ZxBankEntity entity); /** * @@ -38,7 +38,7 @@ public interface IZxBankDao extends IBaseDao { * @Author hecan * @Date 2025-03-18 17:44 * **/ - List queryResultIsNull(ZxBankEntity zxBankEntity); + List queryResultIsNullZX(ZxBankEntity zxBankEntity); /** * @@ -58,5 +58,15 @@ public interface IZxBankDao extends IBaseDao { * @Author hecan * @Date 2025-03-19 14:15 * **/ - List queryElecIsNull(ZxBankEntity entity); + List queryElecIsNullZX(ZxBankEntity entity); + + /** + * + * @content 更新电子回单 + * @Param + * @Return + * @Author hecan + * @Date 2025-04-07 17:06 + * **/ + Integer updateElecStatusZX(ZxBankEntity entity); } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/impl/ZxBankDaoImpl.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/impl/ZxBankDaoImpl.java index 192305c1..bb092c8c 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/impl/ZxBankDaoImpl.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/dao/impl/ZxBankDaoImpl.java @@ -36,14 +36,14 @@ public class ZxBankDaoImpl extends MybatisGenericDao implem @DS("#entity.dataSourceCode") @Override - public Integer updatePushStatus(ZxBankEntity entity) { - return super.update("updatePushStatus",entity); + public Integer updatePushStatusZX(ZxBankEntity entity) { + return super.update("updatePushStatusZX",entity); } @DS("#entity.dataSourceCode") @Override - public List queryResultIsNull(ZxBankEntity entity) { - return super.queryList(entity,"queryResultIsNull"); + public List queryResultIsNullZX(ZxBankEntity entity) { + return super.queryList(entity,"queryResultIsNullZX"); } @DS("#entity.dataSourceCode") @@ -54,7 +54,13 @@ public class ZxBankDaoImpl extends MybatisGenericDao implem @DS("#entity.dataSourceCode") @Override - public List queryElecIsNull(ZxBankEntity entity) { - return super.queryList(entity,"queryElecIsNull"); + public List queryElecIsNullZX(ZxBankEntity entity) { + return super.queryList(entity,"queryElecIsNullZX"); + } + + @DS("#entity.dataSourceCode") + @Override + public Integer updateElecStatusZX(ZxBankEntity entity) { + return super.update("updateElecStatusZX",entity); } } diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.java b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.java index 160af0b7..e648cac2 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.java +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.java @@ -30,7 +30,15 @@ public class ZxBankEntity extends BaseEntity { private String payResult;//支付结果 private String receipt;//电子回单 private String pushStatus;//推送标识 + private String summaryId;// + public String getSummaryId() { + return summaryId; + } + + public void setSummaryId(String summaryId) { + this.summaryId = summaryId; + } public String getTabName() { return tabName; diff --git a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml index 0f53c4e9..74f290c8 100644 --- a/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml +++ b/fw-oa/src/main/java/com/hzya/frame/seeyon/zxbank/entity/ZxBankEntity.xml @@ -29,6 +29,7 @@ + @@ -60,6 +61,7 @@ ,pay_result as payResult ,receipt as receipt ,push_status as pushStatus + ,summary_id as summaryId @@ -71,26 +73,31 @@ from v_hzya_pay where push_status is null - select - from v_hzya_pay where push_status is not null and pay_result is null + from v_hzya_pay where push_status is not null and (pay_result is null or pay_result='支付中') - select from v_hzya_pay where pay_result='已支付' and receipt is null - - update ${tabName} set ${pushStatusField} =#{pushStatus} where id=#{dataId} + + update ${tabName} set ${pushStatusField} =#{pushStatus} where id=#{id} - update ${tabName} set ${payResultField} =#{payResult} where id=#{dataId} + update ${tabName} set ${payResultField} =#{payResult} where id=#{id} + + + + + update ${tabName} set ${receiptFiled} =#{receipt} where id=#{id} 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 4057b6ef..20d0b981 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 @@ -2,31 +2,49 @@ package com.hzya.frame.seeyon.zxbank.service.impl; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpUtil; +import cn.hutool.log.Log; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hzya.frame.basedao.service.impl.BaseService; import com.hzya.frame.mdm.mdmModuleSource.dao.impl.MdmModuleSourceDaoImpl; import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity; +import com.hzya.frame.seeyon.dao.ICtpAttachmentDao; +import com.hzya.frame.seeyon.entity.CtpAttachmentEntity; +import com.hzya.frame.seeyon.util.OARestUtil; +import com.hzya.frame.seeyon.util.SM2Util; import com.hzya.frame.seeyon.zxbank.dao.IZxBankDao; import com.hzya.frame.seeyon.zxbank.entity.PayState; import com.hzya.frame.seeyon.zxbank.entity.ZxBankEntity; import com.hzya.frame.seeyon.zxbank.service.IZxBankService; +import com.hzya.frame.sysnew.application.database.dao.ISysApplicationDatabaseDao; +import com.hzya.frame.sysnew.application.database.entity.SysApplicationDatabaseEntity; +import com.hzya.frame.sysnew.application.entity.SysApplicationEntity; +import com.hzya.frame.sysnew.application.entity.SysExtensionApiEntity; import com.hzya.frame.sysnew.comparison.service.impl.ComparisonServiceImpl; import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; import com.hzya.frame.sysnew.integtationTaskLivingDetails.service.IIntegrationTaskLivingDetailsService; +import com.hzya.frame.uuid.UUIDLong; import com.hzya.frame.uuid.UUIDUtils; import com.hzya.frame.web.entity.BaseResult; import com.hzya.frame.web.entity.JsonResultEntity; +import 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.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; @Service("ZxBankServiceImpl") public class ZxBankServiceImpl extends BaseService implements IZxBankService { @@ -34,15 +52,26 @@ public class ZxBankServiceImpl extends BaseService impleme @Autowired private MdmModuleSourceDaoImpl mdmModuleSourceDaoImpl; - @Autowired - private IZxBankDao zxBankDao; + @Autowired + private IZxBankDao zxBankDao; @Autowired private IIntegrationTaskLivingDetailsService taskLivingDetailsService; @Autowired private ComparisonServiceImpl comparisonServiceimpl; + @Autowired + private ICtpAttachmentDao ctpAttachmentDao; + + @Autowired + private ISysApplicationDatabaseDao sysApplicationDatabaseDao; @Value("${zt.url}") private String url; + + @Value("${zx.privateKey:}") + private String privateKey; + + @Value("${zx.publicKey:}") + private String publicKey; @Override public JsonResultEntity queryArchives(JSONObject json) { JSONObject jsonObject = json.getJSONObject("jsonStr"); @@ -63,7 +92,7 @@ public class ZxBankServiceImpl extends BaseService impleme switch (appTyp){ case "1": switch (mdmCode){ - case ""://杭泰付款单 + case "10048"://杭泰付款单 tableName = "mdm_zxbank"; listAll = bindingZxBank(jsonObject, mdmModuleSourceEntity, dbCode); break; @@ -83,7 +112,7 @@ public class ZxBankServiceImpl extends BaseService impleme JSONObject attributeResult = (JSONObject) JSON.toJSON(obj); if (attributeResult.getString("status").equals("200")) { String resultString = attributeResult.getString("list"); - if ("".equals(mdmCode)) { + if ("10048".equals(mdmCode)) { JSONArray jsonArray = JSONArray.parseArray(resultString); if (CollectionUtils.isNotEmpty(jsonArray)) { for (Object o : jsonArray) { @@ -100,7 +129,7 @@ public class ZxBankServiceImpl extends BaseService impleme zxBankEntity.setPushStatus("1"); zxBankEntity.setId(dataId); zxBankEntity.setDataSourceCode(mdmModuleSourceEntity.getDataSourceCode()); - zxBankDao.updatePushStatus(zxBankEntity); + zxBankDao.updatePushStatusZX(zxBankEntity); //保存业务数据日志 saveTaskLivingDetails(dataId, jsonObjectCmpApply.getString("document_no"), listAll.get(0).toString(), object.toString(), true,"ZxBankPluginInitializer"); } @@ -112,7 +141,7 @@ public class ZxBankServiceImpl extends BaseService impleme } } } else { - logger.info("三维单据视图数据没有需要同步中台的数据"); + logger.info("杭泰付款单没有需要同步中信的数据"); } }catch (Exception e){ logger.info("杭泰付款单同步失败:{}",e.getMessage()); @@ -126,11 +155,10 @@ public class ZxBankServiceImpl extends BaseService impleme @Override public JsonResultEntity queryArchivesResult(JSONObject json) { try { - JSONObject jsonObject = json.getJSONObject("jsonStr"); - ZxBankEntity zxBankEntity = jsonObject.toJavaObject(ZxBankEntity.class); - zxBankEntity.setDataSourceCode(""); + ZxBankEntity zxBankEntity = json.toJavaObject(ZxBankEntity.class); + zxBankEntity.setDataSourceCode("HT-OA"); logger.info("======开始查询中信返回的支付结果====="); - List zxBankEntities = zxBankDao.queryResultIsNull(zxBankEntity); + List zxBankEntities = zxBankDao.queryResultIsNullZX(zxBankEntity); if(CollectionUtils.isEmpty(zxBankEntities)){ logger.info("=====杭泰付款单中没有已推送并且支付结果为空的数据========"); return BaseResult.getSuccessMessageEntity("查询成功"); @@ -138,25 +166,36 @@ public class ZxBankServiceImpl extends BaseService impleme for (ZxBankEntity bankEntity : zxBankEntities) { List list = new ArrayList<>(); list.add(bankEntity.getDocumentNo()); - String params = String.join(", ", list); - logger.info("=======杭泰付款单调用中信支付结果查询请求参数为:{}", params); + JSONObject jsonObject=new JSONObject(); + jsonObject.put("documentNoList",list); + 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); + logger.info("=======杭泰付款单调用中信支付结果查询请求参数密文为:{}", jsonData.toJSONString()); //发送数据 String result = HttpRequest.post(url). - header("appId", ""). - header("apiCode", ""). + header("appId", "800058"). + header("apiCode", "8000580001"). //header("access_token", tokenBody). - header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj"). - header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). - body(params). + header("publicKey", "ZJYALA1PchEI1s2D5vaapO9RZ6CiDFv/pJAV88lRYg0oBwBCe7eDIk+3zDUT+v578prj"). + header("secretKey", "jcoATYyty05KgDwL4O0xD+Ulq5ExYWkGvZGf2bhKrMaCehb3NIm5DUnJSK/r2SUaj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(jsonData.toJSONString()). execute(). body(); logger.info("========杭泰付款单调用中信支付结果查询返回参数为:{}==========", result); JSONObject resultJson = JSONObject.parseObject(result); if (!resultJson.getBoolean("flag")) { - saveTaskLivingDetails(bankEntity.getDataId(), bankEntity.getDocumentNo(), params, resultJson.toJSONString(), false,"ZxBankResultPluginInitializer"); + saveTaskLivingDetails(bankEntity.getDataId(), bankEntity.getDocumentNo(), jsonData.toJSONString(), resultJson.toJSONString(), false,"ZxBankResultPluginInitializer"); } else { - String data = resultJson.getString("data"); - JSONObject jsonObjectData = JSONObject.parseObject(data); + JSONObject attribute = resultJson.getJSONObject("attribute"); + String data = attribute.getString("data"); + logger.info("=======杭泰付款单调用中信支付结果查询返回参数密文为:{}", data); + String decrypt = SM2Util.decrypt(data, privateKey); + logger.info("=======杭泰付款单调用中信支付结果查询返回参数明文为:{}", decrypt); + JSONObject jsonObjectData = JSONObject.parseObject(decrypt); JSONArray jsonArray = jsonObjectData.getJSONArray("list"); if(CollectionUtils.isNotEmpty(jsonArray)){ for (Object o : jsonArray) { @@ -168,8 +207,10 @@ public class ZxBankServiceImpl extends BaseService impleme if(documentNo.equals(bankEntity.getDocumentNo())){ //修改支付状态 bankEntity.setPayResult(PayState.payStateGetValue(payStatus)); + bankEntity.setDataSourceCode("HT-OA"); + bankEntity.setId(bankEntity.getDataId()); zxBankDao.updateResultStatus(bankEntity); - saveTaskLivingDetails(bankEntity.getDataId(), bankEntity.getDocumentNo(), params, resultJson.toJSONString(), true,"ZxBankResultPluginInitializer"); + saveTaskLivingDetails(bankEntity.getDataId(), bankEntity.getDocumentNo(), jsonData.toJSONString(), resultJson.toJSONString(), true,"ZxBankResultPluginInitializer"); } } }else{ @@ -180,20 +221,21 @@ public class ZxBankServiceImpl extends BaseService impleme logger.info("========杭泰付款单查询支付结果执行成功========"); return BaseResult.getSuccessMessageEntity("支付结果查询成功"); }catch (Exception e){ - logger.info("=========查询中信返回的支付结果失败=======",e.getMessage()); + logger.info("=========查询中信返回的支付结果失败:{}=======",e.getMessage()); e.printStackTrace(); } return BaseResult.getFailureMessageEntity("支付结果查询失败"); } + + @Override public JsonResultEntity queryArchivesElec(JSONObject json) { try { - JSONObject jsonObject = json.getJSONObject("jsonStr"); - ZxBankEntity zxBankEntity = jsonObject.toJavaObject(ZxBankEntity.class); - zxBankEntity.setDataSourceCode(""); + ZxBankEntity zxBankEntity = json.toJavaObject(ZxBankEntity.class); + zxBankEntity.setDataSourceCode("HT-OA"); logger.info("======开始查询中信电子回单====="); - List zxBankEntities = zxBankDao.queryElecIsNull(zxBankEntity); + List zxBankEntities = zxBankDao.queryElecIsNullZX(zxBankEntity); if(CollectionUtils.isEmpty(zxBankEntities)){ logger.info("=====杭泰付款单中没有已支付并且电子回单为空的数据========"); return BaseResult.getSuccessMessageEntity("查询成功"); @@ -202,16 +244,22 @@ public class ZxBankServiceImpl extends BaseService impleme JSONObject jsonParam=new JSONObject(); jsonParam.put("companyCode",bankEntity.getCompanyCode());//公司编码 jsonParam.put("documentNo",bankEntity.getDocumentNo());//单据号 - String params = jsonParam.toJSONString(); - logger.info("======杭泰付款单调用中信电子回单查询请求参数为:{}========",params); + JSONObject jsonData=new JSONObject(); + jsonData.put("data",jsonParam); + String params = jsonData.toJSONString(); + logger.info("======杭泰付款单调用中信电子回单查询请求参数明文为:{}========",params); + String encrypt = SM2Util.encrypt(params, publicKey); + JSONObject objectData=new JSONObject(); + objectData.put("data",encrypt); + logger.info("======杭泰付款单调用中信电子回单查询请求参数密文为:{}========",objectData.toJSONString()); //发送数据 String result = HttpRequest.post(url). - header("appId", ""). - header("apiCode", ""). + header("appId", "800058"). + header("apiCode", "8000580002"). //header("access_token", tokenBody). - header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj"). - header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). - body(params). + header("publicKey", "ZJYALA1PchEI1s2D5vaapO9RZ6CiDFv/pJAV88lRYg0oBwBCe7eDIk+3zDUT+v578prj"). + header("secretKey", "jcoATYyty05KgDwL4O0xD+Ulq5ExYWkGvZGf2bhKrMaCehb3NIm5DUnJSK/r2SUaj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). + body(objectData.toJSONString()). execute(). body(); logger.info("======杭泰付款单调用中信电子回单查询返回参数为:{}========",result); @@ -219,16 +267,22 @@ public class ZxBankServiceImpl extends BaseService impleme if (!resultJson.getBoolean("flag")) { saveTaskLivingDetails(bankEntity.getDataId(), bankEntity.getDocumentNo(), params, resultJson.toJSONString(), false,"ZxBankElecPluginInitializer"); } else { - String data = resultJson.getString("data"); - JSONObject jsonObjectData = JSONObject.parseObject(data); + JSONObject attribute = resultJson.getJSONObject("attribute"); + String data = attribute.getString("data"); + logger.info("=======杭泰付款单调用中信支付结果查询返回参数密文为:{}", data); + String decrypt = SM2Util.decrypt(data, privateKey); + JSONObject jsonObjectData = JSONObject.parseObject(decrypt); String billId = jsonObjectData.getString("billId"); //电子回单id 电子回单下载需要 logger.info("======中信电子回单返回的电子回单id为:{}====",billId); if(StrUtil.isNotEmpty(billId)){ List list=new ArrayList<>(); list.add(billId); - String paramList = String.join(", ", list); - logger.info("====调用中信电子回单下载得请求参数为:{}=======",paramList); - elecDownlod(paramList); + JSONObject billIds=new JSONObject(); + billIds.put("billIds",list); + JSONObject elecdata=new JSONObject(); + elecdata.put("data",billIds); + logger.info("====调用中信电子回单下载得请求参数明文为:{}=======",elecdata.toJSONString()); + elecDownlod(elecdata.toJSONString(),bankEntity); } } } @@ -239,19 +293,122 @@ public class ZxBankServiceImpl extends BaseService impleme return null; } - private JsonResultEntity elecDownlod(String params){ + private JsonResultEntity elecDownlod(String params,ZxBankEntity zxBankEntity){ try { - //发送数据 - String result = HttpRequest.post(url). - header("appId", ""). - header("apiCode", ""). - //header("access_token", tokenBody). - header("publicKey", "ZJYAQ/VtQ66PqKXlV0EowrrlKkhBHYgS/Zk39Q5ezIQne51Ce7eDIk+3zDUT+v578prj"). - header("secretKey", "iLLk424Bmzknbu+ROeJoiVDMYY5EFXtbZY/aU13HmVYIiQrIw9c0Ag4ipxbfpUqqj3JzOP8MtA1LSGvL+2BWG8c/o7DKi92S4mr3zcGearA="). - body(params). - execute(). - body(); - logger.info("======杭泰付款单调用中信电子回单下载返回参数为:{}========",result); + String encrypt = SM2Util.encrypt(params, publicKey); + JSONObject objectData=new JSONObject(); + objectData.put("data",encrypt); + logger.info("====调用中信电子回单下载得请求参数密文为:{}=======",objectData.toJSONString()); + //因为电子回单下载返回的只有文件流,所以无法在中台上注册接口,只能代码中调用第三方接口 + //将文件流的zip下载到文件夹中,之后解压该文件夹,得到pdf文件,上传OA + String downloadFolder ="D:\\yongansystem\\zxbank\\pdf\\"; + String destinationFolder ="D:\\yongansystem\\zxbank\\pdf\\"; + + URL url = new URL("http://202.108.57.65:11370/access/treasury/hangtai/bill/down"); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("POST"); + connection.setRequestProperty("Content-Type", "application/json"); + connection.setDoOutput(true); + + // 写入 JSON 请求体 + try (OutputStream os = connection.getOutputStream(); + OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8")) { + osw.write(objectData.toJSONString()); + osw.flush(); + } + + // 获取响应状态码 + int responseCode = connection.getResponseCode(); + if (responseCode == HttpURLConnection.HTTP_OK) { + // 获取响应头中的 Content-Disposition + String contentDisposition = connection.getHeaderField("Content-Disposition"); + String fileName = parseFileName(contentDisposition); + // 拼接指定文件夹和文件名 + File outputFile = new File(downloadFolder, fileName); + // 确保文件夹存在 + File parentDir = outputFile.getParentFile(); + if (!parentDir.exists()) { + if (!parentDir.mkdirs()) { + logger.info("无法创建目录: {}" , parentDir); + return null; + } + } + + // 获取响应的输入流 + try (InputStream inputStream = connection.getInputStream(); + FileOutputStream outputStream = new FileOutputStream(outputFile)) { + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + logger.info("文件下载成功,保存路径: {}" ,outputFile.getAbsolutePath()); + //开始解压得到的zip文件 + File sourceFolder = new File(outputFile.getAbsolutePath()); + if (!sourceFolder.exists()) { + logger.info("源文件夹不存在或不是一个有效的文件夹"); + return null; + } + + if (sourceFolder.isFile() && sourceFolder.getName().endsWith(".zip")) { + List files = unzipFile(sourceFolder.getAbsolutePath(), destinationFolder); + // 上传 PDF 文件 + for (File pdfFile : files) { + logger.info("pdf文件名称为:{}",pdfFile.getName()); + if (pdfFile.exists()) { + logger.info("=====开始上传中信司库回单到杭泰OA======"); + JSONObject jsonObject = fileUpload(pdfFile); + if (jsonObject.getString("fileUrl") != null) { + //表单的附件字段=ctpAttachment的Sub_reference,表单的Summary_id=ctpAttachment的att_reference + String sub_reference = String.valueOf(UUIDLong.longUUID()); + zxBankEntity.setReceipt(sub_reference); + zxBankEntity.setDataSourceCode("HT-OA"); + zxBankDao.updateElecStatusZX(zxBankEntity); + //根据附件id查询附件业务数据 + String file_url = jsonObject.getString("fileUrl"); + CtpAttachmentEntity ctpAttachmentEntity = new CtpAttachmentEntity(); + ctpAttachmentEntity.setFile_url(file_url); + String att_reference = zxBankEntity.getSummaryId();//Summary_id + ctpAttachmentEntity.setSub_reference(sub_reference); + ctpAttachmentEntity.setAtt_reference(att_reference); + ctpAttachmentEntity.setDataSourceCode("HT-OA"); + List ctpAttachmentEntities = ctpAttachmentDao.queryCtpAttachment(ctpAttachmentEntity); + //如果没有查询到数据,就新增附件业务,否则更新 + if (ctpAttachmentEntities.size() == 0) { + String category = jsonObject.getString("category"); + String type = jsonObject.getString("type"); + String filename = jsonObject.getString("filename"); + String mime_type = jsonObject.getString("mimeType"); + String attachment_size = jsonObject.getString("size"); + String id = String.valueOf(UUIDLong.longUUID()); + ctpAttachmentEntity.setCategory(category); + ctpAttachmentEntity.setFilename(filename); + ctpAttachmentEntity.setType(type); + ctpAttachmentEntity.setMime_type(mime_type); + ctpAttachmentEntity.setAttachment_size(attachment_size); + ctpAttachmentEntity.setId(id); + ctpAttachmentEntity.setCategory("66"); + ctpAttachmentEntity.setCreatedate(new Date()); + ctpAttachmentEntity.setDataSourceCode("HT-OA"); + ctpAttachmentDao.saveCtpAttachment(ctpAttachmentEntity); + } else { + if (ctpAttachmentEntities.size() > 1) { + throw new BaseSystemException("OA附件业务表中查到多条记录"); + } + //更新数据到OA附件业务表中 + ctpAttachmentDao.updateCtpAttachment(ctpAttachmentEntity); + } + logger.info("=====电子回单执行完毕======="); + } + pdfFile.delete(); + } + } + } + } + } else { + logger.info("请求失败,响应状态码:{} " , responseCode); + } + connection.disconnect(); }catch (Exception e){ logger.info("=======中信电子回单下载失败:{}======",e.getMessage()); e.printStackTrace(); @@ -259,26 +416,112 @@ public class ZxBankServiceImpl extends BaseService impleme return null; } + public JSONObject fileUpload(File file) { + if (null != file) { + try { + HashMap paramMap = new HashMap<>(); + paramMap.put("file", file); + String url = "/seeyon/rest/attachment?token=@token@";//如果后面加上applicationCategory=1&extensions=&firstSave=true,附件业务自动生成一条记录 + url = url.replaceAll("@token@", getToken()); + String result = HttpUtil.post("http://60.204.152.210" + url, paramMap); + if (StrUtil.isNotBlank(result)) { + logger.info("附件上传结果"+result); + JSONObject jsonObject = JSONObject.parseObject(result); + String atts = jsonObject.get("atts").toString(); + if (StrUtil.isNotEmpty(atts)) { + JSONArray jsonArray = JSONArray.parseArray(atts); + JSONObject res = (JSONObject) jsonArray.get(0); + String fileUrl = res.getString("fileUrl"); + logger.info("附件id:" + fileUrl); + return res; + } + } + }catch (Exception e){ + logger.error("附件上传失败"+e.getMessage()); + } + } + return null; + } + + private String getToken() { + //获取oatoken + HashMap hashMap = new HashMap<>(); + hashMap.put("userName", "hzyaRest"); + hashMap.put("password", "a5ce21b8-91db-4cec-b3e3-3e44719655fd"); + hashMap.put("loginName","bdmanager"); + String result = HttpUtil.post("http://60.204.152.210" + "/seeyon/rest/token", JSON.toJSONString(hashMap)); + JSONObject jsonObject = JSONObject.parseObject(result); + if (null != jsonObject) { + logger.info(result); + logger.info("======token:{}======" + jsonObject.getString("id")); + return jsonObject.getString("id"); + } + return null; + } + + private static String parseFileName(String contentDisposition) { + if (contentDisposition == null) { + return "unknown.zip"; + } + // 匹配 filename*=utf-8'' 后面的文件名 + Pattern pattern = Pattern.compile("filename\\*=utf-8''([^;]+)"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + return matcher.group(1); + } + return "unknown.zip"; + } + + private List unzipFile(String zipFilePath, String destinationFolderPath) { + List pdfFiles = new ArrayList<>(); + try (ZipFile zipFile = new ZipFile(zipFilePath)) { + Enumeration entries = zipFile.entries(); + while (entries.hasMoreElements()) { + ZipEntry entry = entries.nextElement(); + File outputFile = new File(destinationFolderPath, entry.getName()); + if (entry.isDirectory()) { + outputFile.mkdirs(); + } else { + try (InputStream inputStream = zipFile.getInputStream(entry); + OutputStream outputStream = new FileOutputStream(outputFile)) { + byte[] buffer = new byte[4096]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) != -1) { + outputStream.write(buffer, 0, bytesRead); + } + } + if (outputFile.getName().endsWith(".pdf")) { + pdfFiles.add(outputFile); + } + } + } + } catch (IOException e) { + e.printStackTrace(); + } + return pdfFiles; + } + + private List bindingZxBank(JSONObject jsonObject, MdmModuleSourceEntity mdmModuleSourceEntity, String dbCode) { List list = new ArrayList<>(); - StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("select * from v_hzya_pay where 1=1 and pushStatus is null "); - mdmModuleSourceEntity.setDataSourceCode(dbCode); - List> hashMaps = zxBankDao.queryListByBank(stringBuffer.toString(), mdmModuleSourceEntity); - int i = 0; - if (CollectionUtils.isNotEmpty(hashMaps)) { - for (HashMap hashMap : hashMaps) { - JSONObject main = new JSONObject(); - JSONObject bank = new JSONObject(); - for (String key : hashMap.keySet()) { - bank.put(key.toLowerCase(), hashMap.get(key)); - } - main.put("mdm_zxbank", bank); - list.add(main); + StringBuffer stringBuffer = new StringBuffer(); + stringBuffer.append("select * from v_hzya_pay where 1=1 and push_status is null "); + mdmModuleSourceEntity.setDataSourceCode(dbCode); + List> hashMaps = zxBankDao.queryListByBank(stringBuffer.toString(), mdmModuleSourceEntity); + int i = 0; + if (CollectionUtils.isNotEmpty(hashMaps)) { + for (HashMap hashMap : hashMaps) { + JSONObject main = new JSONObject(); + JSONObject bank = new JSONObject(); + for (String key : hashMap.keySet()) { + bank.put(key.toLowerCase(), hashMap.get(key)); } + main.put("mdm_zxbank", bank); + list.add(main); } - return list; + } + return list; } diff --git a/pom.xml b/pom.xml index 349fd315..2d3edc15 100644 --- a/pom.xml +++ b/pom.xml @@ -471,33 +471,33 @@ maven-war-plugin - - ${basedir}/../base-service/src/main/webapp/WEB-INF/lib - WEB-INF/lib/ - false - - - **/*.jar - - - - ${basedir}/../fw-bip/src/main/webapp/WEB-INF/lib - WEB-INF/lib/ - false - - - **/*.jar - - - - ${basedir}/../fw-ningbobank/src/main/webapp/WEB-INF/lib - WEB-INF/lib/ - false - - - **/*.jar - - + + + + + + + + + + + + + + + + + + + + + + + + + + +