LAPTOP-FO2T5SIU\35838 пре 7 месеци
родитељ
комит
97e8e947d2
1 измењених фајлова са 306 додато и 100 уклоњено
  1. 306 100
      pro-base/src/main/java/com/idea/invoice/util/InvoiceUtil.java

+ 306 - 100
pro-base/src/main/java/com/idea/invoice/util/InvoiceUtil.java

@@ -7,6 +7,8 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.idea.invoice.model.InvoiceManage;
 import com.idea.util.DateUtils;
+import com.rockstar.util.SnowflakeIdWorker;
+import com.rockstar.util.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 import nccloud.open.api.auto.token.cur.utils.APICurUtils;
 
@@ -43,26 +45,46 @@ public class InvoiceUtil {
      */
     public static final String pk_defdoclist = "CJ21";
 
-    public static void main(String[] args) throws Exception {
+    public static final String bank_number = "2019219219212323";
 
-        InvoiceUtil.paybillAdd();
+    public static void main(String[] args) throws Exception {
 
+        String nature = "F2-Cxx-08";
+        String pk_informer = "1001I91000000003V3RZ";
+        String roomNumber = "";
+        String name = "";
+        String def13 = "222";
+//        InvoiceUtil.informerQuery();
+        // 收款单接口-新增提交
+//        InvoiceUtil.gatheringbillAdd("F2-Cxx-06","1001I91000000003V3S0");
+        // 收款单接口-转账单
+//        InvoiceUtil.gatheringbillTurn(nature,roomNumber);
+        // 收款单接口-换票
+//        InvoiceUtil.gatheringbillInvoice(nature,name,def13);
+        // 付款单接口_退款单
+//        InvoiceUtil.paybillAdd();
+        // 收款单接口 删除
+//        InvoiceUtil.gatheringbillDelete();
+        // 应收接口-收入结转单 新增
+//        InvoiceUtil.recbillAdd();
     }
 
     /**
      * 获取token
+     *
      * @return
      * @throws Exception
      */
     public static String getToken(APICurUtils util) throws Exception {
         util.init(ip, port, biz_center, client_id, client_secret, pubKey, username, password);
         String token = util.getToken();
-        
+
         return token;
     }
 
     /**
      * 房间新增
+     *
      * @throws Exception
      */
     public static void defdocAdd() throws Exception {
@@ -71,17 +93,18 @@ public class InvoiceUtil {
         util.setApiUrl("nccloud/api/wxyy/uapbd/defdoc/add");
         JSONObject json = new JSONObject();
         json.put("srcsystemid", "1300419721555869696");
-        json.put("code","1300419721555869696");
-        json.put("name","天鹅湖花园-一期-41-101");
-        json.put("pk_org",pk_org);
-        json.put("pk_defdoclist",pk_defdoclist);
+        json.put("code", "1300419721555869696");
+        json.put("name", "天鹅湖花园-一期-41-101");
+        json.put("pk_org", pk_org);
+        json.put("pk_defdoclist", pk_defdoclist);
         String result = util.getAPIRetrun(token, json.toJSONString());
-        
-        log.info("房间新增:{}",result);
+
+        log.info("房间新增:{}", result);
     }
 
     /**
      * 客户新增
+     *
      * @throws Exception
      */
     public static void customerAdd() throws Exception {
@@ -90,17 +113,18 @@ public class InvoiceUtil {
         util.setApiUrl("nccloud/api/wxyy/uapbd/customer/add");
         JSONObject json = new JSONObject();
         json.put("srcsystemid", "a9eb2c6f3e1f4b36a93f06fdba1a7177");
-        json.put("name","客户测试");
-        json.put("pk_custclass","02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
-        json.put("custprop","0");//财务组织客户类型,必选,默认0
-        json.put("taxpayerid","tyxydm00002"); //统一社会信用代码,必选
+        json.put("name", "客户测试");
+        json.put("pk_custclass", "02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
+        json.put("custprop", "0");//财务组织客户类型,必选,默认0
+        json.put("taxpayerid", "tyxydm00002"); //统一社会信用代码,必选
         String result = util.getAPIRetrun(token, json.toJSONString());
-        
-        log.info("客户新增:{}",result);
+
+        log.info("客户新增:{}", result);
     }
 
     /**
      * 客户分配
+     *
      * @throws Exception
      */
     public static void customerAssign() throws Exception {
@@ -109,14 +133,15 @@ public class InvoiceUtil {
         util.setApiUrl("nccloud/api/wxyy/uapbd/customer/assign");
         JSONObject json = new JSONObject();
         json.put("pk_org", pk_org);
-        json.put("ncid","tyxydm00002");
+        json.put("ncid", "tyxydm00002");
         String result = util.getAPIRetrun(token, json.toJSONString());
-        
-        log.info("客户分配:{}",result);
+
+        log.info("客户分配:{}", result);
     }
 
     /**
      * 付款单接口_退款单
+     *
      * @throws Exception
      */
     public static void paybillAdd() throws Exception {
@@ -124,46 +149,47 @@ public class InvoiceUtil {
         String token = InvoiceUtil.getToken(util);
         util.setApiUrl("nccloud/api/wxyy/arap/paybill/saveandcommit");
         String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+        String number = SnowflakeIdWorker.getUUID();
+
         JSONObject json = new JSONObject();
-        
         JSONObject ap_paybill = new JSONObject();
         String srcsystemid = IdUtil.simpleUUID();
         ap_paybill.put("srcsystemid", srcsystemid); //外系统标识,必选
-        ap_paybill.put("pk_tradetype","F3-Cxx-06"); //交易类型,必选
-        ap_paybill.put("pk_org",pk_org); //组织编码,必选
-        ap_paybill.put("billdate",billdate); //单据日期
-        ap_paybill.put("def2",srcsystemid); //外系统单据号,必填,
-        json.put("ap_paybill",ap_paybill);
+        ap_paybill.put("pk_tradetype", "F3-Cxx-06"); //交易类型,必选
+        ap_paybill.put("pk_org", pk_org); //组织编码,必选
+        ap_paybill.put("billdate", billdate); //单据日期
+        ap_paybill.put("def2", srcsystemid); //外系统单据号,必填,
+        json.put("ap_paybill", ap_paybill);
 
         JSONArray ap_payitem = new JSONArray();
         JSONObject ap_payitemJson = new JSONObject();
-        ap_payitemJson.put("srcsystemid",srcsystemid); //外系统子表标识
-        ap_payitemJson.put("scomment","小二"); //客户名称,必选
-        ap_payitemJson.put("pk_subjcode","MY001"); //收支项目编码,必选
-        ap_payitemJson.put("objtype","0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-        ap_payitemJson.put("customer","tyxydm00002"); //客商的纳税人识别号
-        ap_payitemJson.put("money_de","200"); //金额,必选
-        ap_payitemJson.put("taxrate","10"); //税率,必选,无税传0
-        ap_payitemJson.put("pk_balatype","3"); //结算方式,必选,使用默认账号付款则结算方式为银企直联
-        ap_payitemJson.put("pk_recpaytype","001"); //付款业务类型传默认值“001”
-        ap_payitemJson.put("prepay","0"); //默认值0
-        ap_payitemJson.put("payaccount","2019219219212323"); //付款银行账号,必选
-        ap_payitemJson.put("checktype","1"); //票据类型,必选,看云文档票据类型
-        ap_payitemJson.put("checkno","111"); //票据号,必选
-        // TODO: 2024/10/28 可能是新增房间返回的数据
-        ap_payitemJson.put("def11","1001211000000003UGY0"); //转出前房号编码,必选
-        ap_payitemJson.put("def9","001"); //业态,必选,看云文档业态
-        ap_payitemJson.put("def10","mwjyAdk"); //项目档案编码,看云文档项目档案对照
+        ap_payitemJson.put("srcsystemid", srcsystemid); //外系统子表标识
+        ap_payitemJson.put("scomment", "小二"); //客户名称,必选
+        ap_payitemJson.put("pk_subjcode", "AJ001"); //收支项目编码,必选
+        ap_payitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
+        ap_payitemJson.put("customer", "tyxydm00002"); //客商的纳税人识别号
+        ap_payitemJson.put("money_de", "200"); //金额,必选
+        ap_payitemJson.put("taxrate", "10"); //税率,必选,无税传0
+        ap_payitemJson.put("pk_balatype", "0"); //结算方式,必选,使用默认账号付款则结算方式为银企直联
+        ap_payitemJson.put("pk_recpaytype", "004"); //付款业务类型传默认值“001”
+        ap_payitemJson.put("prepay", "0"); //默认值0
+        ap_payitemJson.put("payaccount", "2019219219212323"); //付款银行账号,必选
+        ap_payitemJson.put("checktype", "5"); //票据类型,必选,看云文档票据类型
+        ap_payitemJson.put("checkno", number); //票据号,必选
+        ap_payitemJson.put("def11", "1300419721555869696"); //转出前房号编码,必选
+        ap_payitemJson.put("def9", "001"); //业态,必选,看云文档业态
+        ap_payitemJson.put("def10", "mwjyAdk"); //项目档案编码,看云文档项目档案对照
         ap_payitem.add(ap_payitemJson);
-        json.put("ap_payitem",ap_payitem);
+        json.put("ap_payitem", ap_payitem);
 
-        log.info("付款单接口_退款单传参:{}",json.toJSONString());
+        log.info("付款单接口_退款单传参:{}", json.toJSONString());
         String result = util.getAPIRetrun(token, json.toJSONString());
-        log.info("付款单接口_退款单:{}",result);
+        log.info("付款单接口_退款单:{}", result);
     }
 
     /**
      * 应收接口-收入结转单
+     *
      * @throws Exception
      */
     public static void recbillAdd() throws Exception {
@@ -176,99 +202,279 @@ public class InvoiceUtil {
         String srcsystemid = IdUtil.simpleUUID();
         String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
         ar_recbill.put("srcsystemid", srcsystemid); //外系统标识,必选
-        ar_recbill.put("pk_tradetype","F3-Cxx-05"); //交易类型,必选
-        ar_recbill.put("pk_org",pk_org); //组织编码,必选
-        ar_recbill.put("billdate",billdate); //单据日期
-        ar_recbill.put("def2",srcsystemid); //外系统单据号,必填,
-        ar_recbill.put("def19","E05"); //特殊票种标识,默认是E05
-        ar_recbill.put("def20","0"); //征税方式
-        ar_recbill.put("def21","不动产地址"); //不动产地址,必填,字符串
-        ar_recbill.put("def22","N"); //不动产地址,必填,字符串
-        json.put("ar_recbill",ar_recbill);
+        ar_recbill.put("pk_tradetype", "F3-Cxx-05"); //交易类型,必选
+        ar_recbill.put("pk_org", pk_org); //组织编码,必选
+        ar_recbill.put("billdate", billdate); //单据日期
+        ar_recbill.put("def2", srcsystemid); //外系统单据号,必填,
+        ar_recbill.put("def19", "E05"); //特殊票种标识,默认是E05
+        ar_recbill.put("def20", "0"); //征税方式
+        ar_recbill.put("def21", "不动产地址"); //不动产地址,必填,字符串
+        ar_recbill.put("def22", "N"); //是否跨地址标志,必填,Y-是,N-否
+        json.put("ar_recbill", ar_recbill);
 
         JSONArray ar_recitem = new JSONArray();
         JSONObject ar_recitemJson = new JSONObject();
-        ar_recitemJson.put("srcsystemid",srcsystemid); //外系统子表标识
-        ar_recitemJson.put("scomment",""); //摘要,非必选
-        ar_recitemJson.put("objtype","0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-        ar_recitemJson.put("customer","tyxydm00002"); //客商的纳税人识别号
-        ar_recitemJson.put("money_de","100"); //金额,必选
-        ar_recitemJson.put("taxrate","16"); //税率,必选,无税传0
-        ar_recitemJson.put("pk_subjcode","MY003"); //收支项目编码,非必选
-
-        // TODO: 2024/10/28 可能是新增房间返回的数据
-        ar_recitemJson.put("def11","1001211000000003UGY0"); //转出前房号编码,收除了诚意金之外的首期等需要选
-        ar_recitemJson.put("def9","001"); //业态,必选,看云文档业态
-        // TODO: 2024/10/28 没有
-        ar_recitemJson.put("def7",""); //房产工程项目,必选,看云文档
-        // TODO: 2024/10/28 没有
-        ar_recitemJson.put("def8",""); //楼栋,必选,看云文档
-        ar_recitemJson.put("material","XXX"); //物料
+        ar_recitemJson.put("srcsystemid", srcsystemid); //外系统子表标识
+        ar_recitemJson.put("scomment", ""); //摘要,非必选
+        ar_recitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
+        ar_recitemJson.put("customer", "tyxydm00002"); //客商的纳税人识别号
+        ar_recitemJson.put("money_de", "100"); //金额,必选
+        ar_recitemJson.put("taxrate", "16"); //税率,必选,无税传0
+        ar_recitemJson.put("pk_subjcode", "AJ003"); //收支项目编码,非必选
+        ar_recitemJson.put("def11", "1300419721555869696"); //转出前房号编码,收除了诚意金之外的首期等需要选
+        ar_recitemJson.put("def9", "001"); //业态,必选,看云文档业态
+        ar_recitemJson.put("def7", "AJ001"); //房产工程项目,必选,看云文档
+        ar_recitemJson.put("def8", "CJ19"); //楼栋,必选,看云文档
+        ar_recitemJson.put("material", "XXX"); //物料
         ar_recitem.add(ar_recitemJson);
-        json.put("ar_recitem",ar_recitem);
+        json.put("ar_recitem", ar_recitem);
 
+        log.info("应收接口-收入结转单传参:{}", json.toJSONString());
         String result = util.getAPIRetrun(token, json.toJSONString());
-        
-        log.info("应收接口-收入结转单:{}",result);
+        log.info("应收接口-收入结转单:{}", result);
     }
 
     /**
      * 收款单接口-新增提交
+     *
      * @throws Exception
      */
-    public static void gatheringbillAdd() throws Exception {
+    public static void gatheringbillAdd(String nature,String pk_informer) throws Exception {
+
         APICurUtils util = new APICurUtils();
         String token = InvoiceUtil.getToken(util);
-        util.setApiUrl("nccloud/api/wxyy/arap/recbill/saveandcommit");
+        util.setApiUrl("nccloud/api/wxyy/arap/gatheringbill/saveandcommit");
         JSONObject json = new JSONObject();
 
         JSONObject ar_gatherbill = new JSONObject();
         String srcsystemid = IdUtil.simpleUUID();
         String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+        String number = SnowflakeIdWorker.getUUID();
         ar_gatherbill.put("srcsystemid", srcsystemid); //外系统标识,必选
-        ar_gatherbill.put("pk_tradetype","F3-Cxx-06"); //交易类型,必选
-        ar_gatherbill.put("pk_org",pk_org); //组织编码,必选
-        ar_gatherbill.put("billdate",billdate); //单据日期
-        ar_gatherbill.put("def2",srcsystemid); //外系统单据号,必填,
-        json.put("ar_gatherbill",ar_gatherbill);
+        ar_gatherbill.put("pk_tradetype", nature); //交易类型,必选
+        ar_gatherbill.put("pk_org", pk_org); //组织编码,必选
+        ar_gatherbill.put("billdate", billdate); //单据日期
+        ar_gatherbill.put("def2", srcsystemid); //外系统单据号,必填,
+        json.put("ar_gatherbill", ar_gatherbill);
 
         JSONArray ar_gatheritem = new JSONArray();
         JSONObject ar_gatheritemJson = new JSONObject();
-        ar_gatheritemJson.put("srcsystemid",srcsystemid); //外系统子表标识
-        ar_gatheritemJson.put("objtype","0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-        ar_gatheritemJson.put("customer","tyxydm00002"); //客商的纳税人识别号
-        ar_gatheritemJson.put("money_cr","200"); //金额,必选
-        ar_gatheritemJson.put("taxrate","10"); //税率,必选,数字——3/10/6````
-        ar_gatheritemJson.put("pk_balatype","3"); //结算方式,必选,看云文档收款类型
-        ar_gatheritemJson.put("pk_recpaytype","001"); //付款业务类型传默认值“001”
-        ar_gatheritemJson.put("prepay","0"); //收款性质应收款时传"0",收款性质预收款时传"1"
-        ar_gatheritemJson.put("recaccount","0407200000001648"); //收款银行账号,必填
-        ar_gatheritemJson.put("scomment","小二"); //客户名称,必选
-        ar_gatheritemJson.put("pk_subjcode","AJ001"); //收支项目编码,必选,看云文档收支项目对照
-        ar_gatheritemJson.put("checktype","1"); //票据类型,必选,看云文档票据类型
-        ar_gatheritemJson.put("checkno","111"); //票据号,必选
-        ar_gatheritemJson.put("def9","001"); //业态,必选,看云文档业态
-        // TODO: 2024/10/28 可能是新增房间返回的数据
-        ar_gatheritemJson.put("def11",""); //转出前房号编码,收除了诚意金之外的首期等需要选
-        // TODO: 2024/10/28 没有
-        ar_gatheritemJson.put("def10",""); //项目档案编码,看云文档项目档案对照
+        ar_gatheritemJson.put("srcsystemid", srcsystemid); //外系统子表标识
+        ar_gatheritemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
+        ar_gatheritemJson.put("customer", "tyxydm00002"); //客商的纳税人识别号
+        ar_gatheritemJson.put("money_cr", "200"); //金额,必选
+        ar_gatheritemJson.put("taxrate", "10"); //税率,必选,数字——3/10/6````
+        ar_gatheritemJson.put("pk_balatype", "0"); //结算方式,必选,看云文档结算方式
+        ar_gatheritemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
+        ar_gatheritemJson.put("prepay", "0"); //收款性质应收款时传"0",收款性质预收款时传"1"
+        ar_gatheritemJson.put("recaccount", bank_number); //收款银行账号,必填
+//        ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
+        ar_gatheritemJson.put("scomment", "小二"); //客户名称,必选
+        ar_gatheritemJson.put("pk_subjcode", "AJ022"); //收款类型
+        ar_gatheritemJson.put("checktype", "5"); //票据类型,必选,看云文档票据类型
+        ar_gatheritemJson.put("checkno", number); //票据号,必选
+        ar_gatheritemJson.put("def9", "001"); //业态,必选,看云文档业态
+        ar_gatheritemJson.put("def11", "1300419721555869696"); //转出前房号编码,收除了诚意金之外的首期等需要选
+        ar_gatheritemJson.put("def10", "mwjyAdk"); //项目档案编码,看云文档项目档案对照
+        ar_gatheritemJson.put("top_billid", pk_informer); //到账通知生单时,(银行流水中返回的id,见5.2.10到账通知认领查询pk_informer字段)
         ar_gatheritem.add(ar_gatheritemJson);
-        json.put("ar_gatheritem",ar_gatheritem);
+        json.put("ar_gatheritem", ar_gatheritem);
 
+        log.info("收款单接口-新增提交:{}", json.toJSONString());
         String result = util.getAPIRetrun(token, json.toJSONString());
-        
-        log.info("应收接口-收入结转单:{}",result);
+        log.info("收款单接口-新增提交:{}", result);
     }
 
+    public static void informerQuery() throws Exception {
+        APICurUtils util = new APICurUtils();
+        String token = InvoiceUtil.getToken(util);
+        util.setApiUrl("nccloud/api/wxyy/cmp/informer/query");
+        JSONObject json = new JSONObject();
+        json.put("pk_org", pk_org);
+        json.put("infodate", "2024-10-31");
+        log.info("到账通知认领查询传参:{}", json.toJSONString());
+        String result = util.getAPIRetrun(token, json.toJSONString());
+        log.info("到账通知认领查询:{}", result);
+    }
 
+    /**
+     * 收款单接口 删除
+     * @throws Exception
+     */
+    public static void gatheringbillDelete() throws Exception {
+        APICurUtils util = new APICurUtils();
+        String token = InvoiceUtil.getToken(util);
+        util.setApiUrl("nccloud/api/wxyy/arap/gatheringbill/uncommitanddelete");
+        JSONObject json = new JSONObject();
+        json.put("ncid", "1001211000000003UWH1");
+        log.info("收款单接口 删除传参:{}", json.toJSONString());
+        String result = util.getAPIRetrun(token, json.toJSONString());
+        log.info("收款单接口 删除:{}", result);
+    }
 
+    /**
+     * 转账单
+     * @param nature
+     * @param roomNumber
+     * @throws Exception
+     */
+    public static void gatheringbillTurn(String nature,String roomNumber) throws Exception {
 
+        APICurUtils util = new APICurUtils();
+        String token = InvoiceUtil.getToken(util);
+        util.setApiUrl("nccloud/api/wxyy/arap/gatheringbill/saveandcommit");
+        JSONObject json = new JSONObject();
 
+        JSONObject ar_gatherbill = new JSONObject();
+        String srcsystemid = IdUtil.simpleUUID();
+        String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+        String number = SnowflakeIdWorker.getUUID();
+        ar_gatherbill.put("srcsystemid", srcsystemid); //外系统标识,必选
+        ar_gatherbill.put("pk_tradetype", nature); //交易类型,必选
+        ar_gatherbill.put("pk_org", pk_org); //组织编码,必选
+        ar_gatherbill.put("billdate", billdate); //单据日期
+        ar_gatherbill.put("def2", srcsystemid); //外系统单据号,必填,
+        json.put("ar_gatherbill", ar_gatherbill);
 
+        JSONArray ar_gatheritem = new JSONArray();
+        JSONObject ar_gatheritemJson = new JSONObject();
+        ar_gatheritemJson.put("srcsystemid", srcsystemid); //外系统子表标识
+        ar_gatheritemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
+        ar_gatheritemJson.put("customer", "tyxydm00002"); //客商的纳税人识别号
+        ar_gatheritemJson.put("money_cr", "200"); //金额,必选
+        ar_gatheritemJson.put("taxrate", "10"); //税率,必选,数字——3/10/6````
+        ar_gatheritemJson.put("pk_balatype", "0"); //结算方式,必选,看云文档结算方式
+        ar_gatheritemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
+        ar_gatheritemJson.put("prepay", "0"); //收款性质应收款时传"0",收款性质预收款时传"1"
+        ar_gatheritemJson.put("recaccount", bank_number); //收款银行账号,必填
+//        ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
+        ar_gatheritemJson.put("scomment", "小二"); //客户名称,必选
+        ar_gatheritemJson.put("pk_subjcode", "AJ003"); //收支项目编码,必选,看云文档收支项目对照
+        ar_gatheritemJson.put("def11", "1300419721555869696"); //转出前房号编码,必选
+        ar_gatheritemJson.put("def9", "001"); //业态,必选,看云文档业态
+        ar_gatheritemJson.put("def12", roomNumber); //转出后房号编码,换房业务时要选
+        ar_gatheritemJson.put("def14", ""); //原收支项目编码,定金转违约金项目时 必选
+        ar_gatheritemJson.put("def13", ""); //换票后票据号,换房业务必选
+        ar_gatheritemJson.put("checktype", "5"); //票据类型,必选,看云文档票据类型
+        ar_gatheritemJson.put("checkno", number); //票据号,必选
+        ar_gatheritemJson.put("def10", "mwjyAdk"); //项目档案编码,看云文档项目档案对照
 
 
+        ar_gatheritem.add(ar_gatheritemJson);
+        json.put("ar_gatheritem", ar_gatheritem);
 
+        log.info("单据提交——转账单传参:{}", json.toJSONString());
+        String result = util.getAPIRetrun(token, json.toJSONString());
+        log.info("单据提交——转账单:{}", result);
+    }
 
+    /**
+     * 换票
+     * @param nature
+     * @param name
+     * @throws Exception
+     */
+    public static void gatheringbillInvoice(String nature,String name,String def13) throws Exception {
+
+        APICurUtils util = new APICurUtils();
+        String token = InvoiceUtil.getToken(util);
+        util.setApiUrl("nccloud/api/wxyy/arap/gatheringbill/saveandcommit");
+        JSONObject json = new JSONObject();
+
+        JSONObject ar_gatherbill = new JSONObject();
+        String srcsystemid = IdUtil.simpleUUID();
+        String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+        String number = SnowflakeIdWorker.getUUID();
+        ar_gatherbill.put("srcsystemid", srcsystemid); //外系统标识,必选
+        ar_gatherbill.put("pk_tradetype", nature); //交易类型,必选
+        ar_gatherbill.put("pk_org", pk_org); //组织编码,必选
+        ar_gatherbill.put("billdate", billdate); //单据日期
+        ar_gatherbill.put("def2", srcsystemid); //外系统单据号,必填,
+        if(StringUtils.isNotEmpty(name)){
+            ar_gatherbill.put("def17", name); //更换成的客户名称,更名业务时必选
+        }
+        json.put("ar_gatherbill", ar_gatherbill);
+
+        JSONArray ar_gatheritem = new JSONArray();
+        JSONObject ar_gatheritemJson = new JSONObject();
+        ar_gatheritemJson.put("srcsystemid", srcsystemid); //外系统子表标识
+        ar_gatheritemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
+        ar_gatheritemJson.put("customer", "tyxydm00002"); //客商的纳税人识别号
+        ar_gatheritemJson.put("money_cr", "200"); //金额,必选
+        ar_gatheritemJson.put("taxrate", "10"); //税率,必选,数字——3/10/6````
+        ar_gatheritemJson.put("pk_balatype", "0"); //结算方式,必选,看云文档结算方式
+        ar_gatheritemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
+        ar_gatheritemJson.put("prepay", "0"); //收款性质应收款时传"0",收款性质预收款时传"1"
+        ar_gatheritemJson.put("recaccount", bank_number); //收款银行账号,必填
+//        ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
+        ar_gatheritemJson.put("scomment", "小二"); //客户名称,必选
+        ar_gatheritemJson.put("pk_subjcode", "AJ003"); //收支项目编码,必选,看云文档收支项目对照
+        ar_gatheritemJson.put("def11", "1300419721555869696"); //转出前房号编码,必选
+        ar_gatheritemJson.put("def9", "001"); //业态,必选,看云文档业态
+        ar_gatheritemJson.put("def12", ""); //转出后房号编码,换房业务时要选
+        ar_gatheritemJson.put("def14", ""); //原收支项目编码,定金转违约金项目时 必选
+        if(StringUtils.isNotEmpty(def13)){
+            ar_gatheritemJson.put("def13", def13); //换票后票据号,必选
+        }
+        ar_gatheritemJson.put("checktype", "5"); //票据类型,必选,看云文档票据类型
+        ar_gatheritemJson.put("checkno", number); //票据号,必选
+        ar_gatheritemJson.put("def10", "mwjyAdk"); //项目档案编码,看云文档项目档案对照
+
+
+        ar_gatheritem.add(ar_gatheritemJson);
+        json.put("ar_gatheritem", ar_gatheritem);
+
+        log.info("单据提交——换票单传参:{}", json.toJSONString());
+        String result = util.getAPIRetrun(token, json.toJSONString());
+        log.info("单据提交——换票单:{}", result);
+    }
+
+
+    public static void gatheringbillTransfer(String nature,String pk_informer) throws Exception {
+
+        APICurUtils util = new APICurUtils();
+        String token = InvoiceUtil.getToken(util);
+        util.setApiUrl("nccloud/api/wxyy/arap/gatheringbill/saveandcommit");
+        JSONObject json = new JSONObject();
 
+        JSONObject ar_gatherbill = new JSONObject();
+        String srcsystemid = IdUtil.simpleUUID();
+        String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+        String number = SnowflakeIdWorker.getUUID();
+        ar_gatherbill.put("srcsystemid", srcsystemid); //外系统标识,必选
+        ar_gatherbill.put("pk_tradetype", nature); //交易类型,必选
+        ar_gatherbill.put("pk_org", pk_org); //组织编码,必选
+        ar_gatherbill.put("billdate", billdate); //单据日期
+        ar_gatherbill.put("def2", srcsystemid); //外系统单据号,必填,
+        json.put("ar_gatherbill", ar_gatherbill);
+
+        JSONArray ar_gatheritem = new JSONArray();
+        JSONObject ar_gatheritemJson = new JSONObject();
+        ar_gatheritemJson.put("srcsystemid", srcsystemid); //外系统子表标识
+        ar_gatheritemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
+        ar_gatheritemJson.put("customer", "tyxydm00002"); //客商的纳税人识别号
+        ar_gatheritemJson.put("money_cr", "200"); //金额,必选
+        ar_gatheritemJson.put("taxrate", "10"); //税率,必选,数字——3/10/6````
+        ar_gatheritemJson.put("pk_balatype", "0"); //结算方式,必选,看云文档结算方式
+        ar_gatheritemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
+        ar_gatheritemJson.put("prepay", "0"); //收款性质应收款时传"0",收款性质预收款时传"1"
+        ar_gatheritemJson.put("recaccount", bank_number); //收款银行账号,必填
+//        ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
+        ar_gatheritemJson.put("scomment", "小二"); //客户名称,必选
+        ar_gatheritemJson.put("pk_subjcode", "AJ015"); //收款类型
+        // TODO: 2024/10/30 没有 
+        ar_gatheritemJson.put("def3", ""); //产品类型,必选
+        ar_gatheritemJson.put("checktype", "5"); //票据类型,必选,看云文档票据类型
+        ar_gatheritemJson.put("checkno", number); //票据号,必选
+        ar_gatheritemJson.put("def9", "001"); //业态,必选,看云文档业态
+        ar_gatheritemJson.put("def11", "1300419721555869696"); //转出前房号编码,收除了诚意金之外的首期等需要选
+        ar_gatheritemJson.put("def10", "mwjyAdk"); //项目档案编码,看云文档项目档案对照
+        ar_gatheritem.add(ar_gatheritemJson);
+        json.put("ar_gatheritem", ar_gatheritem);
+
+        log.info("单据提交-划拨单:{}", json.toJSONString());
+        String result = util.getAPIRetrun(token, json.toJSONString());
+        log.info("单据提交-划拨单:{}", result);
+    }
 
 }