Procházet zdrojové kódy

凭证推送调整

LAPTOP-FO2T5SIU\35838 před 6 měsíci
rodič
revize
0e58ca1b2c

+ 2 - 0
pro-base/src/main/java/com/idea/customerManagement/model/CustomerManagement.java

@@ -53,6 +53,8 @@ public class CustomerManagement implements Serializable {
 
     private String buyerName;
 
+    private String buyerIdentityCard;
+
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
     private Date abandonmentAt;

+ 70 - 0
pro-base/src/main/java/com/idea/customerManagement/model/CustomerManagementExample.java

@@ -785,6 +785,76 @@ public class CustomerManagementExample {
             return (Criteria) this;
         }
 
+        public Criteria andBuyerIdentityCardIsNull() {
+            addCriterion("buyer_identity_card is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardIsNotNull() {
+            addCriterion("buyer_identity_card is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardEqualTo(String value) {
+            addCriterion("buyer_identity_card =", value, "buyerIdentityCard");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardNotEqualTo(String value) {
+            addCriterion("buyer_identity_card <>", value, "buyerIdentityCard");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardGreaterThan(String value) {
+            addCriterion("buyer_identity_card >", value, "buyerIdentityCard");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardGreaterThanOrEqualTo(String value) {
+            addCriterion("buyer_identity_card >=", value, "buyerIdentityCard");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardLessThan(String value) {
+            addCriterion("buyer_identity_card <", value, "buyerIdentityCard");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardLessThanOrEqualTo(String value) {
+            addCriterion("buyer_identity_card <=", value, "buyerIdentityCard");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardLike(String value) {
+            addCriterion("buyer_identity_card like", value, "buyerIdentityCard");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardNotLike(String value) {
+            addCriterion("buyer_identity_card not like", value, "buyerIdentityCard");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardIn(List<String> values) {
+            addCriterion("buyer_identity_card in", values, "buyerIdentityCard");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardNotIn(List<String> values) {
+            addCriterion("buyer_identity_card not in", values, "buyerIdentityCard");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardBetween(String value1, String value2) {
+            addCriterion("buyer_identity_card between", value1, value2, "buyerIdentityCard");
+            return (Criteria) this;
+        }
+
+        public Criteria andBuyerIdentityCardNotBetween(String value1, String value2) {
+            addCriterion("buyer_identity_card not between", value1, value2, "buyerIdentityCard");
+            return (Criteria) this;
+        }
+
         public Criteria andCreatedIdIsNull() {
             addCriterion("created_id is null");
             return (Criteria) this;

+ 69 - 64
pro-base/src/main/java/com/idea/customerManagement/service/CustomerManagementService.java

@@ -180,6 +180,7 @@ public class CustomerManagementService implements BaseService<CustomerManagement
         List<Buyer> buyers = JSONObject.parseArray(buyerJson, Buyer.class);
         int i = 1;
         StringBuilder builder = new StringBuilder();
+        StringBuilder identityCardBuilder = new StringBuilder();
         for(Buyer buyer : buyers){
             buyer.setOrderNum(i);
             i++;
@@ -197,11 +198,16 @@ public class CustomerManagementService implements BaseService<CustomerManagement
                         .append(")")
                         .append(",");
             }
+            identityCardBuilder.append(buyer.getIdentityCard()).append(",");
         }
         if(builder.length() > 0){
             builder.deleteCharAt(builder.length()-1);
         }
+        if (identityCardBuilder.length()>0){
+            identityCardBuilder.deleteCharAt(identityCardBuilder.length()-1);
+        }
         model.setBuyerName(builder.toString());
+        model.setBuyerIdentityCard(identityCardBuilder.toString());
         model.setId(id);
         // 待选房
         model.setStatus(1);
@@ -209,42 +215,40 @@ public class CustomerManagementService implements BaseService<CustomerManagement
         model.setCreatedId(userId);
         int result = insertWithOutId(model);
 
-//        try {
-//            Buyer buyer = buyers.get(0);
-//            // 给nc推送客户数据
-//            JSONObject json = new JSONObject();
-//            json.put("srcsystemid", id);
-//            json.put("name", buyer.getName());
-//            json.put("pk_custclass", "02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
-//            json.put("custprop", "0");//财务组织客户类型,必选,默认0
-//            json.put("taxpayerid", buyer.getIdentityCard()); //统一社会信用代码,必选
-//            String resultJson = InvoiceUtil.customerAdd(json);
-//            JSONObject jsonObject = JSONObject.parseObject(resultJson);
-//            String success = jsonObject.getString("success");
-//            if (success.equals("true")) {
-//                JSONObject data = jsonObject.getJSONObject("data");
-//                String code = data.getString("code");
-//                String ncid = data.getString("ncid");
-//                CustomerManagement record = new CustomerManagement();
-//                record.setId(id);
-//                record.setNcid(ncid);
-//                record.setNcCode(code);
-//                updateByPrimaryKeySelective(record);
-//            }
-//        }catch (Exception e){
-//            log.error("推送客户失败",e);
-//        }
-//
-//        try {
-//            Buyer buyer = buyers.get(0);
-//            // 客户分配
-//            JSONObject json = new JSONObject();
-//            json.put("pk_org", InvoiceUtil.pk_org);
-//            json.put("ncid", buyer.getIdentityCard());
-//            InvoiceUtil.customerAssign(json);
-//        }catch (Exception e){
-//            log.error("客户分配失败",e);
-//        }
+        try {
+            // 给nc推送客户数据
+            JSONObject json = new JSONObject();
+            json.put("srcsystemid", id);
+            json.put("name", builder.toString());
+            json.put("pk_custclass", "02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
+            json.put("custprop", "0");//财务组织客户类型,必选,默认0
+            json.put("taxpayerid",identityCardBuilder.toString() ); //统一社会信用代码,必选
+            String resultJson = InvoiceUtil.customerAdd(json);
+            JSONObject jsonObject = JSONObject.parseObject(resultJson);
+            String success = jsonObject.getString("success");
+            if (success.equals("true")) {
+                JSONObject data = jsonObject.getJSONObject("data");
+                String code = data.getString("code");
+                String ncid = data.getString("ncid");
+                CustomerManagement record = new CustomerManagement();
+                record.setId(id);
+                record.setNcid(ncid);
+                record.setNcCode(code);
+                updateByPrimaryKeySelective(record);
+            }
+        }catch (Exception e){
+            log.error("推送客户失败",e);
+        }
+
+        try {
+            // 客户分配
+            JSONObject json = new JSONObject();
+            json.put("pk_org", InvoiceUtil.pk_org);
+            json.put("ncid", identityCardBuilder.toString());
+            InvoiceUtil.customerAssign(json);
+        }catch (Exception e){
+            log.error("客户分配失败",e);
+        }
 
         return result;
 
@@ -263,6 +267,8 @@ public class CustomerManagementService implements BaseService<CustomerManagement
         String userId = ShiroUtils.getUserId();
         Date date = new Date();
 
+        CustomerManagement oldCustomer = selectByPrimaryKey(id);
+
         // 先删除
         BuyerExample buyerExample = new BuyerExample();
         buyerExample.setOrderByClause("order_num asc");
@@ -275,6 +281,7 @@ public class CustomerManagementService implements BaseService<CustomerManagement
         List<Buyer> buyers = JSONObject.parseArray(buyerJson, Buyer.class);
         int i = 1;
         StringBuilder builder = new StringBuilder();
+        StringBuilder identityCardBuilder = new StringBuilder();
         for(Buyer buyer : buyers){
             buyer.setOrderNum(i);
             i++;
@@ -292,42 +299,40 @@ public class CustomerManagementService implements BaseService<CustomerManagement
                         .append(")")
                         .append(",");
             }
+            identityCardBuilder.append(buyer.getIdentityCard()).append(",");
         }
         if(builder.length() > 0){
             builder.deleteCharAt(builder.length()-1);
         }
+        if (identityCardBuilder.length()>0){
+            identityCardBuilder.deleteCharAt(identityCardBuilder.length()-1);
+        }
         model.setBuyerName(builder.toString());
+        model.setBuyerIdentityCard(identityCardBuilder.toString());
         model.setUpdatedAt(date);
         model.setUpdatedId(userId);
 
-//        try {
-//            Buyer oldBuyer = oldBuyers.get(0);
-//            Buyer newBuyer = buyers.get(0);
-//            // 修改客户数据
-//            JSONObject json = new JSONObject();
-//            json.put("ncid", oldBuyer.getIdentityCard());// 客户统一信用代码,必选
-//            json.put("name", newBuyer.getName());
-//            json.put("pk_custclass", "02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
-//            json.put("custprop", "0");//财务组织客户类型,必选,默认0
-//            json.put("taxpayerid", newBuyer.getIdentityCard()); //统一社会信用代码,必选
-//            String resultJson = InvoiceUtil.customerUpdate(json);
-//            JSONObject jsonObject = JSONObject.parseObject(resultJson);
-//            String success = jsonObject.getString("success");
-//            if (success.equals("true")) {
-//                JSONObject data = jsonObject.getJSONObject("data");
-//                String code = data.getString("code");
-//                String ncid = data.getString("ncid");
-//                CustomerManagement record = new CustomerManagement();
-//                record.setId(id);
-//                record.setNcid(ncid);
-//                record.setNcCode(code);
-//                updateByPrimaryKeySelective(record);
-//            }
-//        }catch (Exception e){
-//            log.error("修改客户失败",e);
-//        }
-
-        return updateByPrimaryKeySelective(model);
+        int result = updateByPrimaryKeySelective(model);
+
+        try {
+
+            // 修改客户数据
+            JSONObject json = new JSONObject();
+            json.put("ncid", oldCustomer.getBuyerIdentityCard());// 客户统一信用代码,必选
+            json.put("name", builder.toString());
+            json.put("pk_custclass", "02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
+            json.put("custprop", "0");//财务组织客户类型,必选,默认0
+            json.put("taxpayerid", identityCardBuilder.toString()); //统一社会信用代码,必选
+            String resultJson = InvoiceUtil.customerUpdate(json);
+            JSONObject jsonObject = JSONObject.parseObject(resultJson);
+            String success = jsonObject.getString("success");
+            if (success.equals("true")) {
+            }
+        }catch (Exception e){
+            log.error("修改客户失败",e);
+        }
+
+        return result;
 
     }
 

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

@@ -9,35 +9,6 @@ public class InvoiceConstant {
     public static final String INVOICE_STATUS_WAIT_BAD_DEBT = "3";
     public static final String INVOICE_STATUS_BAD_DEBT = "4";
 
-    // 026 增值税电子发票, 007 增值税普通发票, 028 增值税电子专用发票, 004 增值税专用发票
-    public static final String INVOICE_TYPE_ELE_NORMAL = "026";
-    public static final String INVOICE_TYPE_NORMAL = "007";
-    public static final String INVOICE_TYPE_ELE_SPECIAL = "028";
-    public static final String INVOICE_TYPE_SPECIAL = "004";
-
-
-
-    // 税收商品编码
-    // 房地产预收款
-    public static final String INVOICE_GOODS_CODE_ADVANCE_PAYMENT = "";
-    public static final String INVOICE_GOODS_NAME_ADVANCE_PAYMENT = "房地产预收款";
-
-    // 不动产
-    public static final String INVOICE_GOODS_CODE_REAL_ESTATE = "";
-    public static final String INVOICE_GOODS_NAME_REAL_ESTATE = "不动产";
-
-
-    // 开票销方信息
-    // 企业名称
-    public static final String INVOICE_SELLER_NAME = "无锡安恒置业有限公司";
-    // 税号
-    public static final String INVOICE_SELLER_NUMBER = "91320213MA27N437X0";
-    public static final String INVOICE_SELLER_NUMBER_TEST = "";
-    // 地址
-    public static final String INVOICE_SELLER_ADDRESS = "";
-    // 电话
-    public static final String INVOICE_SELLER_PHONE = "";
-
     /**
      * NC 单据编码
      */
@@ -151,5 +122,21 @@ public class InvoiceConstant {
      */
     public static final String INVOICE_PROJECT_CODE_mwjyAdk = "mwjyAdk";
 
+    /**
+     * 结算方式
+     */
+    // pos机
+    public static final String INVOICE_PAYMENT_METHOD_11 = "11";
+
+    // 电汇
+    public static final String INVOICE_PAYMENT_METHOD_4 = "4";
+
+    // 现金
+    public static final String INVOICE_PAYMENT_METHOD_0 = "0";
+
+    // 工抵房
+    public static final String INVOICE_PAYMENT_METHOD_12 = "12";
+
+
 
 }

+ 85 - 46
pro-base/src/main/java/com/idea/transactionRecordManage/service/TransactionRecordService.java

@@ -13,6 +13,9 @@ import com.idea.customerManagement.model.Buyer;
 import com.idea.customerManagement.model.BuyerExample;
 import com.idea.customerManagement.model.CustomerManagement;
 import com.idea.customerManagement.service.BuyerService;
+import com.idea.invoice.mapper.InvoiceManageMapper;
+import com.idea.invoice.model.InvoiceManage;
+import com.idea.invoice.model.InvoiceManageExample;
 import com.idea.invoice.util.InvoiceConstant;
 import com.idea.invoice.util.InvoiceUtil;
 import com.idea.paymentManagement.dto.RefundManageDto;
@@ -32,13 +35,12 @@ import com.rockstar.util.MD5Util;
 import com.rockstar.util.SnowflakeIdWorker;
 import com.rockstar.util.StringUtils;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @Slf4j
 @Service
@@ -58,6 +60,8 @@ public class TransactionRecordService {
     private RefundDetailMapper refundDetailMapper;
     @Autowired
     private IntentionalDepositMapper intentionalDepositMapper;
+    @Autowired
+    private InvoiceManageMapper invoiceManageMapper;
 
     /**
      * 收款记录
@@ -224,6 +228,24 @@ public class TransactionRecordService {
                 pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026;
             }
 
+            String pk_balatype = "";
+            // 现金
+            if(payLog.getPaymentMethod() == 1){
+                pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_0;
+            }
+            // 支付宝
+            if(payLog.getPaymentMethod() == 2){
+                pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
+            }
+            // 微信
+            if(payLog.getPaymentMethod() == 3){
+                pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
+            }
+            // 银行卡
+            if(payLog.getPaymentMethod() == 3){
+                pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
+            }
+
 
             JSONObject json = new JSONObject();
             JSONObject ar_gatherbill = new JSONObject();
@@ -240,27 +262,22 @@ public class TransactionRecordService {
             JSONObject ar_gatheritemJson = new JSONObject();
             ar_gatheritemJson.put("srcsystemid", srcsystemid); //外系统子表标识
             ar_gatheritemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-            // TODO: 2024/11/19 客商的纳税人识别号 待定 
-            ar_gatheritemJson.put("customer", ""); //客商的纳税人识别号
+            ar_gatheritemJson.put("customer", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
             ar_gatheritemJson.put("money_cr", payLog.getPayMoney()); //金额,必选
-            // TODO: 2024/11/19 税率待定
-            ar_gatheritemJson.put("taxrate", ""); //税率,必选,数字——3/10/6````
-            // TODO: 2024/11/19 结算方式 待定
-            ar_gatheritemJson.put("pk_balatype", ""); //结算方式,必选,看云文档结算方式
+            ar_gatheritemJson.put("taxrate", "0"); //税率,必选,数字——3/10/6````
+            ar_gatheritemJson.put("pk_balatype", pk_balatype); //结算方式,必选,看云文档结算方式
             ar_gatheritemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
             ar_gatheritemJson.put("prepay", "1"); //收款性质应收款时传"0",收款性质预收款时传"1"
             ar_gatheritemJson.put("recaccount", payLog.getBankNumber()); //收款银行账号,必填
-//        ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
             ar_gatheritemJson.put("scomment", buyer.getName()); //客户名称,必选
             ar_gatheritemJson.put("pk_subjcode", pk_subjcode); //收款类型
-            // TODO: 2024/11/19 票据类型 待定 
             ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
             ar_gatheritemJson.put("checkno", payLog.getSerialNumber()); //票据号,必选
             ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
-            // TODO: 2024/11/19 房间户编号? 待定
-            ar_gatheritemJson.put("def11", ""); //转出前房号编码,收除了诚意金之外的首期等需要选
+            ar_gatheritemJson.put("def11", payLog.getHouseId()); //转出前房号编码,收除了诚意金之外的首期等需要选
             // TODO: 2024/11/14 项目档案编码 待定
-            ar_gatheritemJson.put("def10", InvoiceConstant.INVOICE_PROJECT_CODE_mwjyAdk); //项目档案编码,看云文档项目档案对照
+            ar_gatheritemJson.put("def10", ""); //项目档案编码,看云文档项目档案对照
+            // TODO: 2024/11/22 银行流水号 待定
 //        ar_gatheritemJson.put("top_billid", pkInformerId); //到账通知生单时,(银行流水中返回的id,见5.2.10到账通知认领查询pk_informer字段)
             ar_gatheritem.add(ar_gatheritemJson);
             json.put("ar_gatheritem", ar_gatheritem);
@@ -293,16 +310,19 @@ public class TransactionRecordService {
      */
     public int refundRecordSubmit(String collectionDateFrom, String collectionDateTo) {
 
-        Map<String, String> cusIdMap = buyerService.getCusIdMap();
+        Map<String, String> map = new HashMap<>();
+        InvoiceManageExample invoiceManageExample = new InvoiceManageExample();
+        invoiceManageExample.createCriteria().andTypeEqualTo("1").andInvoiceStatusEqualTo("2");
+        List<InvoiceManage> invoiceManages = invoiceManageMapper.selectByExample(invoiceManageExample);
+        if(CollectionUtils.isNotEmpty(invoiceManages)){
+            map = invoiceManages.stream().collect(Collectors.toMap(InvoiceManage::getCustomerManagementId, InvoiceManage::getId));
+        }
 
         List<RefundManageDto> refundManages = modelMapper.refundListByDate(collectionDateFrom, collectionDateTo);
         for (RefundManageDto refundManage : refundManages){
+
+            CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(refundManage.getCustomerManagementId());
             String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
-            String number = SnowflakeIdWorker.getUUID();
-            String scomment = "";
-            if (cusIdMap.containsKey(refundManage.getCustomerManagementId())){
-                scomment = cusIdMap.get(refundManage.getCustomerManagementId());
-            }
 
             String pk_subjcode = "";
             // 定金
@@ -334,6 +354,13 @@ public class TransactionRecordService {
                 pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026;
             }
 
+            String checktype = InvoiceConstant.INVOICE_RECEIPT_TYPE_3;
+            // 如对应项目的客户,未开预收款发票的退款,则为收据;开了预收款发票则为发票
+            if(map.containsKey(refundManage.getCustomerManagementId())){
+                checktype = InvoiceConstant.INVOICE_RECEIPT_TYPE_2;
+            }
+
+
             JSONObject json = new JSONObject();
             JSONObject ap_paybill = new JSONObject();
             String srcsystemid = IdUtil.simpleUUID();
@@ -347,23 +374,21 @@ public class TransactionRecordService {
             JSONArray ap_payitem = new JSONArray();
             JSONObject ap_payitemJson = new JSONObject();
             ap_payitemJson.put("srcsystemid", srcsystemid); //外系统子表标识
-            ap_payitemJson.put("scomment", scomment); //客户名称,必选
+            ap_payitemJson.put("scomment", customerManagement.getBuyerName()); //客户名称,必选
             ap_payitemJson.put("pk_subjcode", pk_subjcode); //收支项目编码,必选
             ap_payitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-            // TODO: 2024/11/19 纳税人识别号 待定
-            ap_payitemJson.put("customer", ""); //客商的纳税人识别号
+            ap_payitemJson.put("customer", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
             ap_payitemJson.put("money_de", refundManage.getActualRefundAmount()); //金额,必选
-            // TODO: 2024/11/19 税率待定
-            ap_payitemJson.put("taxrate", ""); //税率,必选,无税传0
+            ap_payitemJson.put("taxrate", "0"); //税率,必选,无税传0
             ap_payitemJson.put("pk_balatype", "4"); //结算方式,必选,默认是4
             ap_payitemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
             ap_payitemJson.put("prepay", "0"); //默认值0
-            ap_payitemJson.put("payaccount", refundManage.getBankNumber()); //付款银行账号,必选
-            // TODO: 2024/11/19 票据类型 待定 
-            ap_payitemJson.put("checktype", ""); //票据类型,必选,看云文档票据类型
-            ap_payitemJson.put("checkno", number); //票据号,必选
-            // TODO: 2024/11/19 房间户编号? 待定
-            ap_payitemJson.put("def11", ""); //转出前房号编码,必选
+            // TODO: 2024/11/22 安居的退款账号 待定
+            ap_payitemJson.put("payaccount", ""); //付款银行账号,必选
+            ap_payitemJson.put("checktype", checktype); //票据类型,必选,看云文档票据类型
+            // TODO: 2024/11/22 退款的记录 是汇合的多笔的 票据号待定
+            ap_payitemJson.put("checkno", IdUtil.simpleUUID()); //票据号,必选
+            ap_payitemJson.put("def11", refundManage.getHouseId()); //转出前房号编码,必选
             ap_payitemJson.put("def9", "001"); //业态,必选,看云文档业态
             // TODO: 2024/11/19 项目档案 待定
             ap_payitemJson.put("def10", ""); //项目档案编码,看云文档项目档案对照
@@ -407,13 +432,30 @@ public class TransactionRecordService {
         for (IntentionalDepositDto intentionalDeposit : intentionalDeposits){
             String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
             String number = SnowflakeIdWorker.getUUID();
-            String scomment = "";
-            if (cusIdMap.containsKey(intentionalDeposit.getCustomerManagementId())){
-                scomment = cusIdMap.get(intentionalDeposit.getCustomerManagementId());
+
+            CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(intentionalDeposit.getCustomerManagementId());
+
+            // 目前只有意向金转定金
+            String pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001;
+
+            String pk_balatype = "";
+            // 现金
+            if(intentionalDeposit.getPaymentMethod() == 1){
+                pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_0;
+            }
+            // 支付宝
+            if(intentionalDeposit.getPaymentMethod() == 2){
+                pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
+            }
+            // 微信
+            if(intentionalDeposit.getPaymentMethod() == 3){
+                pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
+            }
+            // 银行卡
+            if(intentionalDeposit.getPaymentMethod() == 3){
+                pk_balatype = InvoiceConstant.INVOICE_PAYMENT_METHOD_4;
             }
 
-            // 目前只有意向金
-            String pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026;
 
             JSONObject json = new JSONObject();
             JSONObject ar_gatherbill = new JSONObject();
@@ -429,22 +471,19 @@ public class TransactionRecordService {
             JSONObject ar_gatheritemJson = new JSONObject();
             ar_gatheritemJson.put("srcsystemid", srcsystemid); //外系统子表标识
             ar_gatheritemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-            // TODO: 2024/11/20 客商纳税人识别号 待定
-            ar_gatheritemJson.put("customer", ""); //客商的纳税人识别号
+            ar_gatheritemJson.put("customer", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
             ar_gatheritemJson.put("money_cr", intentionalDeposit.getReceivedAmount()); //金额,必选
             // TODO: 2024/11/20 税率 待定
             ar_gatheritemJson.put("taxrate", ""); //税率,必选,数字——3/10/6````
-            // TODO: 2024/11/20 结算方式 待定
-            ar_gatheritemJson.put("pk_balatype", "0"); //结算方式,必选,看云文档结算方式
+            ar_gatheritemJson.put("pk_balatype", pk_balatype); //结算方式,必选,看云文档结算方式
             ar_gatheritemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
             ar_gatheritemJson.put("prepay", "0"); //收款性质应收款时传"0",收款性质预收款时传"1"
             // TODO: 2024/11/20 意向金暂无收款账号 待定
             ar_gatheritemJson.put("recaccount", ""); //收款银行账号,必填
 //        ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
-            ar_gatheritemJson.put("scomment", scomment); //客户名称,必选
-            ar_gatheritemJson.put("pk_subjcode", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001); //收支项目编码,必选,看云文档收支项目对照
-            // TODO: 2024/11/20 房间户编号待定 
-            ar_gatheritemJson.put("def11", ""); //转出前房号编码,必选
+            ar_gatheritemJson.put("scomment", customerManagement.getBuyerName()); //客户名称,必选
+            ar_gatheritemJson.put("pk_subjcode", pk_subjcode); //收支项目编码,必选,看云文档收支项目对照
+            ar_gatheritemJson.put("def11", intentionalDeposit.getHouseId()); //转出前房号编码,必选
             ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
 //        ar_gatheritemJson.put("def12", ""); //转出后房号编码,换房业务时要选
             ar_gatheritemJson.put("def14", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026); //原收支项目编码,定金转违约金项目时 必选
@@ -453,7 +492,7 @@ public class TransactionRecordService {
             ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
             ar_gatheritemJson.put("checkno", intentionalDeposit.getSerialNumber()); //票据号,必选
             // TODO: 2024/11/14 具体编码 未定
-            ar_gatheritemJson.put("def10", InvoiceConstant.INVOICE_MATERIAL_djjy); //项目档案编码,看云文档项目档案对照
+            ar_gatheritemJson.put("def10", ""); //项目档案编码,看云文档项目档案对照
             ar_gatheritem.add(ar_gatheritemJson);
             json.put("ar_gatheritem", ar_gatheritem);
 

+ 3 - 3
pro-base/src/main/java/com/idea/util/OAUtil.java

@@ -8,7 +8,7 @@ import java.util.Map;
 
 public class OAUtil {
 
-    public static final String prefix = "";
+    public static final String prefix = "http://112.25.69.137:8088/";
 
     public static final Map<String, String> headers = new HashMap<String, String>() {{
         put("accept","*/*");
@@ -18,8 +18,8 @@ public class OAUtil {
 
     public static String receiveRequestInfoByJson(Map<String, Object> map) {
 
-        String url = prefix + "/rest/ofs/ReceiveRequestInfoByJson";
-        String result= HttpUtil.createGet(url).addHeaders(headers).form(map).execute().body();
+        String url = prefix + "rest/ofs/ReceiveRequestInfoByJson";
+        String result= HttpUtil.createPost(url).addHeaders(headers).form(map).execute().body();
         return result;
     }
 

+ 29 - 12
pro-base/src/main/resources/mybatis/customerManagement/CustomerManagementMapper.xml

@@ -12,6 +12,7 @@
     <result column="house_id" jdbcType="VARCHAR" property="houseId" />
     <result column="house_name" jdbcType="VARCHAR" property="houseName" />
     <result column="buyer_name" jdbcType="VARCHAR" property="buyerName" />
+    <result column="buyer_identity_card" jdbcType="VARCHAR" property="buyerIdentityCard" />
     <result column="created_id" jdbcType="VARCHAR" property="createdId" />
     <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
     <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
@@ -86,8 +87,8 @@
   </sql>
   <sql id="Base_Column_List">
     id, group_id, disc_id, batch_number, room_selection_number, room_selection_date,
-    status, house_id, house_name, buyer_name, created_id, created_at, updated_at, updated_id,
-    abandonment_date, abandonment_at, abandonment_id, ncid, nc_code
+    status, house_id, house_name, buyer_name, buyer_identity_card, created_id, created_at,
+    updated_at, updated_id, abandonment_date, abandonment_at, abandonment_id, ncid, nc_code
   </sql>
   <sql id="Blob_Column_List">
     abandonment_remark, abandonment_file_list
@@ -144,19 +145,19 @@
     insert into customer_management (id, group_id, disc_id,
                                      batch_number, room_selection_number, room_selection_date,
                                      status, house_id, house_name,
-                                     buyer_name, created_id, created_at,
-                                     updated_at, updated_id, abandonment_date,
-                                     abandonment_at, abandonment_id, ncid,
-                                     nc_code, abandonment_remark, abandonment_file_list
-    )
+                                     buyer_name, buyer_identity_card, created_id,
+                                     created_at, updated_at, updated_id,
+                                     abandonment_date, abandonment_at, abandonment_id,
+                                     ncid, nc_code, abandonment_remark,
+                                     abandonment_file_list)
     values (#{id,jdbcType=VARCHAR}, #{groupId,jdbcType=VARCHAR}, #{discId,jdbcType=VARCHAR},
             #{batchNumber,jdbcType=VARCHAR}, #{roomSelectionNumber,jdbcType=VARCHAR}, #{roomSelectionDate,jdbcType=TIMESTAMP},
             #{status,jdbcType=INTEGER}, #{houseId,jdbcType=VARCHAR}, #{houseName,jdbcType=VARCHAR},
-            #{buyerName,jdbcType=VARCHAR}, #{createdId,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
-            #{updatedAt,jdbcType=TIMESTAMP}, #{updatedId,jdbcType=VARCHAR}, #{abandonmentDate,jdbcType=TIMESTAMP},
-            #{abandonmentAt,jdbcType=TIMESTAMP}, #{abandonmentId,jdbcType=VARCHAR}, #{ncid,jdbcType=VARCHAR},
-            #{ncCode,jdbcType=VARCHAR}, #{abandonmentRemark,jdbcType=LONGVARCHAR}, #{abandonmentFileList,jdbcType=LONGVARCHAR}
-           )
+            #{buyerName,jdbcType=VARCHAR}, #{buyerIdentityCard,jdbcType=VARCHAR}, #{createdId,jdbcType=VARCHAR},
+            #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedId,jdbcType=VARCHAR},
+            #{abandonmentDate,jdbcType=TIMESTAMP}, #{abandonmentAt,jdbcType=TIMESTAMP}, #{abandonmentId,jdbcType=VARCHAR},
+            #{ncid,jdbcType=VARCHAR}, #{ncCode,jdbcType=VARCHAR}, #{abandonmentRemark,jdbcType=LONGVARCHAR},
+            #{abandonmentFileList,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.idea.customerManagement.model.CustomerManagement">
     insert into customer_management
@@ -191,6 +192,9 @@
       <if test="buyerName != null">
         buyer_name,
       </if>
+      <if test="buyerIdentityCard != null">
+        buyer_identity_card,
+      </if>
       <if test="createdId != null">
         created_id,
       </if>
@@ -256,6 +260,9 @@
       <if test="buyerName != null">
         #{buyerName,jdbcType=VARCHAR},
       </if>
+      <if test="buyerIdentityCard != null">
+        #{buyerIdentityCard,jdbcType=VARCHAR},
+      </if>
       <if test="createdId != null">
         #{createdId,jdbcType=VARCHAR},
       </if>
@@ -330,6 +337,9 @@
       <if test="record.buyerName != null">
         buyer_name = #{record.buyerName,jdbcType=VARCHAR},
       </if>
+      <if test="record.buyerIdentityCard != null">
+        buyer_identity_card = #{record.buyerIdentityCard,jdbcType=VARCHAR},
+      </if>
       <if test="record.createdId != null">
         created_id = #{record.createdId,jdbcType=VARCHAR},
       </if>
@@ -380,6 +390,7 @@
     house_id = #{record.houseId,jdbcType=VARCHAR},
     house_name = #{record.houseName,jdbcType=VARCHAR},
     buyer_name = #{record.buyerName,jdbcType=VARCHAR},
+    buyer_identity_card = #{record.buyerIdentityCard,jdbcType=VARCHAR},
     created_id = #{record.createdId,jdbcType=VARCHAR},
     created_at = #{record.createdAt,jdbcType=TIMESTAMP},
     updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
@@ -407,6 +418,7 @@
     house_id = #{record.houseId,jdbcType=VARCHAR},
     house_name = #{record.houseName,jdbcType=VARCHAR},
     buyer_name = #{record.buyerName,jdbcType=VARCHAR},
+    buyer_identity_card = #{record.buyerIdentityCard,jdbcType=VARCHAR},
     created_id = #{record.createdId,jdbcType=VARCHAR},
     created_at = #{record.createdAt,jdbcType=TIMESTAMP},
     updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
@@ -450,6 +462,9 @@
       <if test="buyerName != null">
         buyer_name = #{buyerName,jdbcType=VARCHAR},
       </if>
+      <if test="buyerIdentityCard != null">
+        buyer_identity_card = #{buyerIdentityCard,jdbcType=VARCHAR},
+      </if>
       <if test="createdId != null">
         created_id = #{createdId,jdbcType=VARCHAR},
       </if>
@@ -497,6 +512,7 @@
         house_id = #{houseId,jdbcType=VARCHAR},
         house_name = #{houseName,jdbcType=VARCHAR},
         buyer_name = #{buyerName,jdbcType=VARCHAR},
+        buyer_identity_card = #{buyerIdentityCard,jdbcType=VARCHAR},
         created_id = #{createdId,jdbcType=VARCHAR},
         created_at = #{createdAt,jdbcType=TIMESTAMP},
         updated_at = #{updatedAt,jdbcType=TIMESTAMP},
@@ -521,6 +537,7 @@
         house_id = #{houseId,jdbcType=VARCHAR},
         house_name = #{houseName,jdbcType=VARCHAR},
         buyer_name = #{buyerName,jdbcType=VARCHAR},
+        buyer_identity_card = #{buyerIdentityCard,jdbcType=VARCHAR},
         created_id = #{createdId,jdbcType=VARCHAR},
         created_at = #{createdAt,jdbcType=TIMESTAMP},
         updated_at = #{updatedAt,jdbcType=TIMESTAMP},