LAPTOP-FO2T5SIU\35838 il y a 9 mois
Parent
commit
e9c829c5e0

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

@@ -45,7 +45,7 @@ public class InvoiceUtil {
 
     public static void main(String[] args) throws Exception {
 
-
+        InvoiceUtil.paybillAdd();
 
     }
 
@@ -57,7 +57,7 @@ public class InvoiceUtil {
     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();
-        System.out.println(" 获取token=========" + token);
+        
         return token;
     }
 
@@ -71,12 +71,12 @@ public class InvoiceUtil {
         util.setApiUrl("nccloud/api/wxyy/uapbd/defdoc/add");
         JSONObject json = new JSONObject();
         json.put("srcsystemid", "1300419721555869696");
-        json.put("code","100");
+        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());
-        System.out.println(" 接口结果=========" + result);
+        
         log.info("房间新增:{}",result);
     }
 
@@ -93,9 +93,9 @@ public class InvoiceUtil {
         json.put("name","客户测试");
         json.put("pk_custclass","02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
         json.put("custprop","0");//财务组织客户类型,必选,默认0
-        json.put("taxpayerid","tyxydm00001"); //统一社会信用代码,必选
+        json.put("taxpayerid","tyxydm00002"); //统一社会信用代码,必选
         String result = util.getAPIRetrun(token, json.toJSONString());
-        System.out.println(" 接口结果=========" + result);
+        
         log.info("客户新增:{}",result);
     }
 
@@ -109,9 +109,9 @@ public class InvoiceUtil {
         util.setApiUrl("nccloud/api/wxyy/uapbd/customer/assign");
         JSONObject json = new JSONObject();
         json.put("pk_org", pk_org);
-        json.put("ncid","");
+        json.put("ncid","tyxydm00002");
         String result = util.getAPIRetrun(token, json.toJSONString());
-        System.out.println(" 接口结果=========" + result);
+        
         log.info("客户分配:{}",result);
     }
 
@@ -141,7 +141,7 @@ public class InvoiceUtil {
         ap_payitemJson.put("scomment","小二"); //客户名称,必选
         ap_payitemJson.put("pk_subjcode","MY001"); //收支项目编码,必选
         ap_payitemJson.put("objtype","0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-        ap_payitemJson.put("customer","91734"); //客商的纳税人识别号
+        ap_payitemJson.put("customer","tyxydm00002"); //客商的纳税人识别号
         ap_payitemJson.put("money_de","200"); //金额,必选
         ap_payitemJson.put("taxrate","10"); //税率,必选,无税传0
         ap_payitemJson.put("pk_balatype","3"); //结算方式,必选,使用默认账号付款则结算方式为银企直联
@@ -151,14 +151,14 @@ public class InvoiceUtil {
         ap_payitemJson.put("checktype","1"); //票据类型,必选,看云文档票据类型
         ap_payitemJson.put("checkno","111"); //票据号,必选
         // TODO: 2024/10/28 可能是新增房间返回的数据
-        ap_payitemJson.put("def11",""); //转出前房号编码,必选
+        ap_payitemJson.put("def11","1001211000000003UGY0"); //转出前房号编码,必选
         ap_payitemJson.put("def9","001"); //业态,必选,看云文档业态
         ap_payitemJson.put("def10",""); //项目档案编码,看云文档项目档案对照
         ap_payitem.add(ap_payitemJson);
         json.put("ap_payitem",ap_payitem);
 
+        log.info("付款单接口_退款单传参:{}",json.toJSONString());
         String result = util.getAPIRetrun(token, json.toJSONString());
-        System.out.println(" 接口结果=========" + result);
         log.info("付款单接口_退款单:{}",result);
     }
 
@@ -191,7 +191,7 @@ public class InvoiceUtil {
         ar_recitemJson.put("srcsystemid",srcsystemid); //外系统子表标识
         ar_recitemJson.put("scomment",""); //摘要,非必选
         ar_recitemJson.put("objtype","0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-        ar_recitemJson.put("customer","91734"); //客商的纳税人识别号
+        ar_recitemJson.put("customer","tyxydm00002"); //客商的纳税人识别号
         ar_recitemJson.put("money_de","100"); //金额,必选
         ar_recitemJson.put("taxrate","16"); //税率,必选,无税传0
         ar_recitemJson.put("pk_subjcode","MY003"); //收支项目编码,非必选
@@ -208,7 +208,7 @@ public class InvoiceUtil {
         json.put("ar_recitem",ar_recitem);
 
         String result = util.getAPIRetrun(token, json.toJSONString());
-        System.out.println(" 接口结果=========" + result);
+        
         log.info("应收接口-收入结转单:{}",result);
     }
 
@@ -236,7 +236,7 @@ public class InvoiceUtil {
         JSONObject ar_gatheritemJson = new JSONObject();
         ar_gatheritemJson.put("srcsystemid",srcsystemid); //外系统子表标识
         ar_gatheritemJson.put("objtype","0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-        ar_gatheritemJson.put("customer","91734"); //客商的纳税人识别号
+        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"); //结算方式,必选,看云文档收款类型
@@ -250,13 +250,13 @@ public class InvoiceUtil {
         ar_gatheritemJson.put("def9","001"); //业态,必选,看云文档业态
         // TODO: 2024/10/28 可能是新增房间返回的数据
         ar_gatheritemJson.put("def11",""); //转出前房号编码,收除了诚意金之外的首期等需要选
-        // TODO: 2024/10/28 没有 
+        // TODO: 2024/10/28 没有
         ar_gatheritemJson.put("def10",""); //项目档案编码,看云文档项目档案对照
         ar_gatheritem.add(ar_gatheritemJson);
         json.put("ar_gatheritem",ar_gatheritem);
 
         String result = util.getAPIRetrun(token, json.toJSONString());
-        System.out.println(" 接口结果=========" + result);
+        
         log.info("应收接口-收入结转单:{}",result);
     }
 

+ 3 - 3
pro-base/src/main/java/com/idea/paymentManagement/service/MaintenanceFundsManagementService.java

@@ -142,18 +142,18 @@ public class MaintenanceFundsManagementService implements BaseService<Maintenanc
         payLogMapper.insertSelective(payLog);
 
         // 查询合同的房款收款情况
-        Integer collectionStatus = contractManage.getCollectionStatus();
+        Integer collectionStatus = contractManage.getFundCollectionStatus();
         // 完全收款
         if(collectionStatus == 2){
             // 查询该合同是否已生成 正式发票
             InvoiceManageExample invoiceManageExample = new InvoiceManageExample();
-            invoiceManageExample.createCriteria().andTypeEqualTo("1").andContractIdEqualTo(model.getContractId());
+            invoiceManageExample.createCriteria().andTypeEqualTo("2").andContractIdEqualTo(model.getContractId());
             List<InvoiceManage> invoiceManages = invoiceManageService.selectByExample(invoiceManageExample);
             if(CollectionUtils.isEmpty(invoiceManages)){
                 // 生成一条待推送的开票信息
                 InvoiceManage invoiceManage = invoiceManageService.getInfoByContract(model.getContractId());
                 // 正式发票
-                invoiceManage.setType("1");
+                invoiceManage.setType("2");
                 // 专项维修资金
                 invoiceManage.setPaymentType("2");
                 invoiceManage.setSendStatus("0");

+ 4 - 2
pro-base/src/main/resources/mybatis/invoice/InvoiceManageExtendMapper.xml

@@ -4,8 +4,10 @@
 
 
   <select id="listByModel" resultType="com.idea.invoice.dto.InvoiceManageDto">
-      select i.*,cm.id contractId,cm.contract_number,cm.record_number,cm.buyer_name,cm.house_name,cm.total_price,
-             cm.maintenance_total_price,cm.collection_status,cm.fund_collection_status
+      select i.*,cm.id contractId,cm.contract_number,cm.record_number,cm.buyer_name,cm.house_name,
+             ifnull(cm.total_price,0) total_price,
+             ifnull(cm.maintenance_total_price,0) maintenance_total_price,
+             cm.collection_status,cm.fund_collection_status
       from invoice_manage i
       left join idea_settle_down.contract_manage cm on i.contract_id = cm.id
       <where>