LAPTOP-FO2T5SIU\35838 8 months ago
parent
commit
3ef52b8771

+ 8 - 0
pro-base/src/main/java/com/idea/customerManagement/dto/IntentionalDepositDto.java

@@ -16,6 +16,14 @@ public class IntentionalDepositDto extends IntentionalDeposit {
 
     private String handleName;
 
+    private String startDate;
+
+    private String endDate;
+
+    /**
+     * nc 银行流水id
+     */
+    private String pkInformerId;
 
 
 }

+ 2 - 0
pro-base/src/main/java/com/idea/customerManagement/dto/RoomSelectionInfoDto.java

@@ -42,4 +42,6 @@ public class RoomSelectionInfoDto extends RoomSelectionInfo {
 
     private String groupDiscName;
 
+    private String pkInformerId;
+
 }

+ 4 - 215
pro-base/src/main/java/com/idea/customerManagement/model/IntentionalDeposit.java

@@ -1,12 +1,14 @@
 package com.idea.customerManagement.model;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
 
+@Data
 public class IntentionalDeposit implements Serializable {
     private String id;
 
@@ -72,221 +74,8 @@ public class IntentionalDeposit implements Serializable {
 
     private String houseName;
 
-    private static final long serialVersionUID = 1L;
+    private String ncJson;
 
-    public String getHouseName() {
-        return houseName;
-    }
+    private String turnNcJson;
 
-    public void setHouseName(String houseName) {
-        this.houseName = houseName;
-    }
-
-    public BigDecimal getRefundMoney() {
-        return refundMoney;
-    }
-
-    public void setRefundMoney(BigDecimal refundMoney) {
-        this.refundMoney = refundMoney;
-    }
-
-    public Integer getStatus() {
-        return status;
-    }
-
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id == null ? null : id.trim();
-    }
-
-    public String getGroupId() {
-        return groupId;
-    }
-
-    public void setGroupId(String groupId) {
-        this.groupId = groupId == null ? null : groupId.trim();
-    }
-
-    public String getDiscId() {
-        return discId;
-    }
-
-    public void setDiscId(String discId) {
-        this.discId = discId == null ? null : discId.trim();
-    }
-
-    public String getHouseId() {
-        return houseId;
-    }
-
-    public void setHouseId(String houseId) {
-        this.houseId = houseId == null ? null : houseId.trim();
-    }
-
-    public String getCustomerManagementId() {
-        return customerManagementId;
-    }
-
-    public void setCustomerManagementId(String customerManagementId) {
-        this.customerManagementId = customerManagementId == null ? null : customerManagementId.trim();
-    }
-
-    public BigDecimal getReceivableMoney() {
-        return receivableMoney;
-    }
-
-    public void setReceivableMoney(BigDecimal receivableMoney) {
-        this.receivableMoney = receivableMoney;
-    }
-
-    public BigDecimal getReceivedAmount() {
-        return receivedAmount;
-    }
-
-    public void setReceivedAmount(BigDecimal receivedAmount) {
-        this.receivedAmount = receivedAmount;
-    }
-
-    public Integer getPaymentMethod() {
-        return paymentMethod;
-    }
-
-    public void setPaymentMethod(Integer paymentMethod) {
-        this.paymentMethod = paymentMethod;
-    }
-
-    public String getSerialNumber() {
-        return serialNumber;
-    }
-
-    public void setSerialNumber(String serialNumber) {
-        this.serialNumber = serialNumber == null ? null : serialNumber.trim();
-    }
-
-    public String getDepositSerialNumber() {
-        return depositSerialNumber;
-    }
-
-    public void setDepositSerialNumber(String depositSerialNumber) {
-        this.depositSerialNumber = depositSerialNumber == null ? null : depositSerialNumber.trim();
-    }
-
-    public Date getCollectionTime() {
-        return collectionTime;
-    }
-
-    public void setCollectionTime(Date collectionTime) {
-        this.collectionTime = collectionTime;
-    }
-
-    public String getCreatedId() {
-        return createdId;
-    }
-
-    public void setCreatedId(String createdId) {
-        this.createdId = createdId == null ? null : createdId.trim();
-    }
-
-    public Date getCreatedAt() {
-        return createdAt;
-    }
-
-    public void setCreatedAt(Date createdAt) {
-        this.createdAt = createdAt;
-    }
-
-    public Date getUpdatedAt() {
-        return updatedAt;
-    }
-
-    public void setUpdatedAt(Date updatedAt) {
-        this.updatedAt = updatedAt;
-    }
-
-    public String getUpdatedId() {
-        return updatedId;
-    }
-
-    public void setUpdatedId(String updatedId) {
-        this.updatedId = updatedId == null ? null : updatedId.trim();
-    }
-
-    public String getHandleId() {
-        return handleId;
-    }
-
-    public void setHandleId(String handleId) {
-        this.handleId = handleId == null ? null : handleId.trim();
-    }
-
-    public Date getHandleDate() {
-        return handleDate;
-    }
-
-    public void setHandleDate(Date handleDate) {
-        this.handleDate = handleDate;
-    }
-
-    public String getRefundHandleId() {
-        return refundHandleId;
-    }
-
-    public void setRefundHandleId(String refundHandleId) {
-        this.refundHandleId = refundHandleId == null ? null : refundHandleId.trim();
-    }
-
-    public Date getRefundHandleDate() {
-        return refundHandleDate;
-    }
-
-    public void setRefundHandleDate(Date refundHandleDate) {
-        this.refundHandleDate = refundHandleDate;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark == null ? null : remark.trim();
-    }
-
-    public String getDepositRemark() {
-        return depositRemark;
-    }
-
-    public void setDepositRemark(String depositRemark) {
-        this.depositRemark = depositRemark == null ? null : depositRemark.trim();
-    }
-
-    public String getRefundRemark() {
-        return refundRemark;
-    }
-
-    public void setRefundRemark(String refundRemark) {
-        this.refundRemark = refundRemark == null ? null : refundRemark.trim();
-    }
-
-    public String getFileList() {
-        return fileList;
-    }
-
-    public void setFileList(String fileList) {
-        this.fileList = fileList == null ? null : fileList.trim();
-    }
-
-    public String getPaperReceipts() {
-        return paperReceipts;
-    }
-
-    public void setPaperReceipts(String paperReceipts) {
-        this.paperReceipts = paperReceipts == null ? null : paperReceipts.trim();
-    }
 }

+ 4 - 0
pro-base/src/main/java/com/idea/customerManagement/model/RoomSelectionInfo.java

@@ -54,6 +54,10 @@ public class RoomSelectionInfo implements Serializable {
 
     private String fileList;
 
+    private String ncCode;
+
+    private String ncJson;
+
     private static final long serialVersionUID = 1L;
 
 }

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

@@ -1225,6 +1225,76 @@ public class RoomSelectionInfoExample {
             addCriterion("updated_id not between", value1, value2, "updatedId");
             return (Criteria) this;
         }
+
+        public Criteria andNcCodeIsNull() {
+            addCriterion("nc_code is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeIsNotNull() {
+            addCriterion("nc_code is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeEqualTo(String value) {
+            addCriterion("nc_code =", value, "ncCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeNotEqualTo(String value) {
+            addCriterion("nc_code <>", value, "ncCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeGreaterThan(String value) {
+            addCriterion("nc_code >", value, "ncCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeGreaterThanOrEqualTo(String value) {
+            addCriterion("nc_code >=", value, "ncCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeLessThan(String value) {
+            addCriterion("nc_code <", value, "ncCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeLessThanOrEqualTo(String value) {
+            addCriterion("nc_code <=", value, "ncCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeLike(String value) {
+            addCriterion("nc_code like", value, "ncCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeNotLike(String value) {
+            addCriterion("nc_code not like", value, "ncCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeIn(List<String> values) {
+            addCriterion("nc_code in", values, "ncCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeNotIn(List<String> values) {
+            addCriterion("nc_code not in", values, "ncCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeBetween(String value1, String value2) {
+            addCriterion("nc_code between", value1, value2, "ncCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andNcCodeNotBetween(String value1, String value2) {
+            addCriterion("nc_code not between", value1, value2, "ncCode");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 181 - 29
pro-base/src/main/java/com/idea/customerManagement/service/IntentionalDepositService.java

@@ -3,6 +3,8 @@ package com.idea.customerManagement.service;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.idea.buildManage.mapper.ParkFloorDiscMapper;
@@ -24,19 +26,25 @@ import com.idea.customerManagement.model.*;
 import com.idea.invoice.model.ReceiptManage;
 import com.idea.invoice.model.ReceiptManageExample;
 import com.idea.invoice.service.ReceiptManageService;
+import com.idea.invoice.util.InvoiceConstant;
+import com.idea.invoice.util.InvoiceUtil;
 import com.idea.paymentManagement.mapper.PayLogMapper;
 import com.idea.paymentManagement.model.PayLog;
 import com.idea.util.DateUtils;
 import com.idea.util.MoneyUtils;
 import com.idea.util.ReplaceWord;
 import com.rockstar.common.base.BaseService;
+import com.rockstar.common.domain.AjaxResult;
 import com.rockstar.frame.model.FrameUser;
 import com.rockstar.frame.model.extend.DateTrans;
 import com.rockstar.frame.model.extend.Tablepar;
 import com.rockstar.frame.service.FrameUserService;
 import com.rockstar.shiro.util.ShiroUtils;
 import com.rockstar.system.service.SysDictService;
+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;
@@ -45,6 +53,7 @@ import org.springframework.transaction.annotation.Transactional;
 import javax.servlet.http.HttpServletResponse;
 import java.util.*;
 
+@Slf4j
 @Service
 public class IntentionalDepositService implements BaseService<IntentionalDeposit, IntentionalDepositExample> {
 
@@ -105,12 +114,12 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
 
     @Override
     public int updateByExampleSelective(IntentionalDeposit intentionalDeposit, IntentionalDepositExample intentionalDepositExample) {
-        return modelMapper.updateByExampleSelective(intentionalDeposit,intentionalDepositExample);
+        return modelMapper.updateByExampleSelective(intentionalDeposit, intentionalDepositExample);
     }
 
     @Override
     public int updateByExample(IntentionalDeposit intentionalDeposit, IntentionalDepositExample intentionalDepositExample) {
-        return modelMapper.updateByExample(intentionalDeposit,intentionalDepositExample);
+        return modelMapper.updateByExample(intentionalDeposit, intentionalDepositExample);
     }
 
     @Override
@@ -130,10 +139,11 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
 
     /**
      * 获取收据流水号(意向金编号)
+     *
      * @param customerManagementId
      * @return
      */
-    public String getSerialNumber(String customerManagementId){
+    public String getSerialNumber(String customerManagementId) {
         CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(customerManagementId);
         String groupId = customerManagement.getGroupId();
         String discId = customerManagement.getDiscId();
@@ -142,24 +152,25 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         example.createCriteria().andGroupIdEqualTo(groupId);
         Long count = countByExample(example);
         String number = "";
-        if(count.doubleValue() == 0){
+        if (count.doubleValue() == 0) {
             number = "00001";
-        }else {
-            count ++;
+        } else {
+            count++;
             number = String.format("%05d", count);
         }
         ParkInfo parkInfo = parkInfoMapper.selectByPrimaryKey(groupId);
         ParkFloorDisc parkFloorDisc = parkFloorDiscMapper.selectByPrimaryKey(discId);
-        String serialNumber = parkInfo.getGroupName()+ parkFloorDisc.getName() + "-YXJ" + number;
+        String serialNumber = parkInfo.getGroupName() + parkFloorDisc.getName() + "-YXJ" + number;
         return serialNumber;
     }
 
     /**
      * 获取收据流水号(定金编号)
+     *
      * @param id
      * @return
      */
-    public String getDepositSerialNumber(String id){
+    public String getDepositSerialNumber(String id) {
 
         IntentionalDeposit deposit = selectByPrimaryKey(id);
         String groupId = deposit.getGroupId();
@@ -171,23 +182,24 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         example.createCriteria().andGroupIdEqualTo(groupId).andStatusEqualTo(2);
         Long count = roomSelectionInfoMapper.countByExample(example);
         String number = "";
-        if(count.doubleValue() == 0){
+        if (count.doubleValue() == 0) {
             number = "00001";
-        }else {
-            count ++;
+        } else {
+            count++;
             number = String.format("%05d", count);
         }
-        String serialNumber = parkInfo.getGroupName()+ parkFloorDisc.getName() + "-DJ" + number;
+        String serialNumber = parkInfo.getGroupName() + parkFloorDisc.getName() + "-DJ" + number;
         return serialNumber;
     }
 
 
     /**
      * 意向金登记
+     *
      * @param model
      * @return
      */
-    public int add(IntentionalDeposit model){
+    public int add(IntentionalDeposit model) {
 
         CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(model.getCustomerManagementId());
         String id = IdUtil.simpleUUID();
@@ -216,10 +228,11 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
 
     /**
      * 意向金修改
+     *
      * @param model
      * @return
      */
-    public int edit(IntentionalDeposit model){
+    public int edit(IntentionalDeposit model) {
 
         CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(model.getCustomerManagementId());
         model.setGroupId(customerManagement.getGroupId());
@@ -231,20 +244,21 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
 
     /**
      * 根据客户id查找意向金
+     *
      * @param customerManagementId
      * @return
      */
-    public IntentionalDepositDto getByCustomerManagementId(String customerManagementId){
+    public IntentionalDepositDto getByCustomerManagementId(String customerManagementId) {
 
         IntentionalDepositExample example = new IntentionalDepositExample();
         example.createCriteria().andCustomerManagementIdEqualTo(customerManagementId);
         List<IntentionalDeposit> intentionalDeposits = modelMapper.selectByExampleWithBLOBs(example);
-        if(CollectionUtils.isNotEmpty(intentionalDeposits)){
+        if (CollectionUtils.isNotEmpty(intentionalDeposits)) {
             IntentionalDepositDto result = new IntentionalDepositDto();
             IntentionalDeposit intentionalDeposit = intentionalDeposits.get(0);
-            BeanUtil.copyProperties(intentionalDeposit,result);
+            BeanUtil.copyProperties(intentionalDeposit, result);
             FrameUser frameUser = frameUserService.selectByPrimaryKey(intentionalDeposit.getCreatedId());
-            if(ObjectUtil.isNotNull(frameUser)){
+            if (ObjectUtil.isNotNull(frameUser)) {
                 result.setCreatedName(frameUser.getTruename());
             }
             return result;
@@ -255,6 +269,7 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
 
     /**
      * 分页
+     *
      * @param tablepar
      * @param model
      * @param dt
@@ -269,6 +284,7 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
 
     /**
      * 意向金转定金
+     *
      * @param model
      * @return
      */
@@ -322,7 +338,7 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
 
         // 转定金后生产合同
         String contractId = IdUtil.simpleUUID();
-        contractManageService.addContract(roomSelectionInfo,contractId);
+        contractManageService.addContract(roomSelectionInfo, contractId);
 
         // 新增一条定金收款记录
         PayLog payLog = new PayLog();
@@ -369,7 +385,7 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         ReceiptManageExample receiptManageExample = new ReceiptManageExample();
         receiptManageExample.createCriteria().andBusinessIdEqualTo(model.getId());
         List<ReceiptManage> receiptManages = receiptManageService.selectByExample(receiptManageExample);
-        if(CollectionUtils.isNotEmpty(receiptManages)){
+        if (CollectionUtils.isNotEmpty(receiptManages)) {
             ReceiptManage manage = receiptManages.get(0);
             manage.setAssociationNumber(model.getDepositSerialNumber());
             // 已换票
@@ -378,17 +394,17 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         }
 
 
-
         return result;
 
     }
 
     /**
      * 退意向金
+     *
      * @param model
      * @return
      */
-    public int refund(IntentionalDeposit model){
+    public int refund(IntentionalDeposit model) {
 
         // 退意向金
         model.setStatus(3);
@@ -402,17 +418,18 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         IntentionalDeposit intentionalDeposit = modelMapper.selectByPrimaryKey(id);
         IntentionalDepositDto intentionalDepositDto = new IntentionalDepositDto();
         String handleName = "";
-        if(StringUtils.isNotEmpty(intentionalDeposit.getHandleId())){
+        if (StringUtils.isNotEmpty(intentionalDeposit.getHandleId())) {
             FrameUser frameUser = frameUserService.selectByPrimaryKey(intentionalDeposit.getHandleId());
             handleName = frameUser == null ? "" : frameUser.getTruename();
         }
-        BeanUtil.copyProperties(intentionalDeposit,intentionalDepositDto);
+        BeanUtil.copyProperties(intentionalDeposit, intentionalDepositDto);
         intentionalDepositDto.setHandleName(handleName);
         return intentionalDepositDto;
     }
 
     /**
      * 意向金收据
+     *
      * @param model
      * @param response
      */
@@ -429,16 +446,16 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         List<Buyer> buyers = buyerService.selectByExample(buyerExample);
         StringBuilder builder = new StringBuilder();
         if (CollectionUtils.isNotEmpty(buyers)) {
-            for(Buyer buyer: buyers){
+            for (Buyer buyer : buyers) {
                 builder.append(buyer.getName()).append(",");
             }
-            if(builder.length() > 0){
-                builder.deleteCharAt(builder.length()-1);
+            if (builder.length() > 0) {
+                builder.deleteCharAt(builder.length() - 1);
             }
         }
         String fullName = "(未选房)";
         // 意向金只有选房后 才有houseId
-        if(StringUtils.isNotEmpty(newRecord.getHouseId())){
+        if (StringUtils.isNotEmpty(newRecord.getHouseId())) {
             ParkRoomResponse roomResponse = roomExtendMapper.getFullName(newRecord.getHouseId());
             fullName = roomResponse.getGroupName() + "-"
                     + roomResponse.getDiscName() + "-"
@@ -474,13 +491,148 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
         settingInfoData = new HashMap<>();
         settingInfoData.put("leftOffset", "50");
         settingInfoData.put("topOffset", "0");
-        settingData.put("${seal}",settingInfoData);
+        settingData.put("${seal}", settingInfoData);
 
         ReplaceWord.operateWord(response, filePath, fileName, data, picData, sealData, settingData);
 
 
     }
 
+    /**
+     * 收诚意金 凭证推送
+     *
+     * @param model
+     * @return
+     */
+    public AjaxResult sendVoucher(IntentionalDepositDto model) {
+
+        // 银行流水id
+        String pkInformerId = model.getPkInformerId();
+        IntentionalDeposit intentionalDeposit = selectByPrimaryKey(model.getId());
+        CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(intentionalDeposit.getCustomerManagementId());
+        BuyerExample buyerExample = new BuyerExample();
+        buyerExample.setOrderByClause("order_num");
+        buyerExample.createCriteria().andCustomerManagementIdEqualTo(customerManagement.getId());
+        List<Buyer> buyers = buyerService.selectByExample(buyerExample);
+        Buyer buyer = buyers.get(0);
+
+        JSONObject json = new JSONObject();
+        JSONObject ar_gatherbill = new JSONObject();
+        String srcsystemid = model.getId();
+        String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+        ar_gatherbill.put("srcsystemid", srcsystemid); //外系统标识,必选
+        ar_gatherbill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F2_Cxx_06); //交易类型,必选
+        ar_gatherbill.put("pk_org", InvoiceUtil.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", buyer.getIdentityCard()); //客商的纳税人识别号
+        ar_gatheritemJson.put("money_cr", intentionalDeposit.getReceivedAmount()); //金额,必选
+        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", InvoiceUtil.bank_number); //收款银行账号,必填
+//        ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
+        ar_gatheritemJson.put("scomment", buyer.getName()); //客户名称,必选
+        ar_gatheritemJson.put("pk_subjcode", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026); //收款类型
+        ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
+        ar_gatheritemJson.put("checkno", intentionalDeposit.getSerialNumber()); //票据号,必选
+        ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
+//        ar_gatheritemJson.put("def11", ""); //转出前房号编码,收除了诚意金之外的首期等需要选
+        // TODO: 2024/11/14 具体编码应该是根据小区来的
+        ar_gatheritemJson.put("def10", InvoiceConstant.INVOICE_MATERIAL_djjy); //项目档案编码,看云文档项目档案对照
+        ar_gatheritemJson.put("top_billid", pkInformerId); //到账通知生单时,(银行流水中返回的id,见5.2.10到账通知认领查询pk_informer字段)
+        ar_gatheritem.add(ar_gatheritemJson);
+        json.put("ar_gatheritem", ar_gatheritem);
+
+        try {
+            String result = InvoiceUtil.gatheringbillAdd(json);
+            JSONObject jsonObject = JSONObject.parseObject(result);
+            if(jsonObject.getString("success").equals("true")){
+                intentionalDeposit.setNcJson(result);
+                updateByPrimaryKeySelective(intentionalDeposit);
+            }
+
+        } catch (Exception e) {
+            log.error("收诚意金凭证推送报错",e);
+            return AjaxResult.error(e.getMessage());
+        }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 诚意金转定金 凭证推送
+     * @param model
+     * @return
+     */
+    public AjaxResult sendToDepositVoucher(IntentionalDepositDto model){
+
+        IntentionalDeposit intentionalDeposit = selectByPrimaryKey(model.getId());
+        CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(intentionalDeposit.getCustomerManagementId());
+        BuyerExample buyerExample = new BuyerExample();
+        buyerExample.setOrderByClause("order_num");
+        buyerExample.createCriteria().andCustomerManagementIdEqualTo(customerManagement.getId());
+        List<Buyer> buyers = buyerService.selectByExample(buyerExample);
+        Buyer buyer = buyers.get(0);
+
+        JSONObject json = new JSONObject();
+        JSONObject ar_gatherbill = new JSONObject();
+        String srcsystemid = MD5Util.encode(model.getId());
+        String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+        ar_gatherbill.put("srcsystemid", srcsystemid); //外系统标识,必选
+        ar_gatherbill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F2_Cxx_07); //交易类型,必选
+        ar_gatherbill.put("pk_org", InvoiceUtil.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", buyer.getIdentityCard()); //客商的纳税人识别号
+        ar_gatheritemJson.put("money_cr", intentionalDeposit.getReceivedAmount()); //金额,必选
+        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", InvoiceUtil.bank_number); //收款银行账号,必填
+//        ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
+        ar_gatheritemJson.put("scomment", buyer.getName()); //客户名称,必选
+        ar_gatheritemJson.put("pk_subjcode", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001); //收支项目编码,必选,看云文档收支项目对照
+        ar_gatheritemJson.put("def11", customerManagement.getHouseId()); //转出前房号编码,必选
+        ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
+//        ar_gatheritemJson.put("def12", ""); //转出后房号编码,换房业务时要选
+        ar_gatheritemJson.put("def14", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026); //原收支项目编码,定金转违约金项目时 必选
+//        ar_gatheritemJson.put("def13", ""); //换票后票据号,换房业务必选
+        ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
+        ar_gatheritemJson.put("checkno", intentionalDeposit.getDepositSerialNumber()); //票据号,必选
+        // TODO: 2024/11/14 具体编码 未定
+        ar_gatheritemJson.put("def10", InvoiceConstant.INVOICE_MATERIAL_djjy); //项目档案编码,看云文档项目档案对照
+        ar_gatheritem.add(ar_gatheritemJson);
+        json.put("ar_gatheritem", ar_gatheritem);
+
+        try {
+            String result = InvoiceUtil.gatheringbillTurn(json);
+            JSONObject jsonObject = JSONObject.parseObject(result);
+            if(jsonObject.getString("success").equals("true")){
+                intentionalDeposit.setTurnNcJson(result);
+                updateByPrimaryKeySelective(intentionalDeposit);
+            }
+
+        } catch (Exception e) {
+            log.error("诚意金转定金凭证推送报错",e);
+            return AjaxResult.error(e.getMessage());
+        }
+        return AjaxResult.success();
+
+    }
 
 
 }

+ 80 - 0
pro-base/src/main/java/com/idea/customerManagement/service/RoomSelectionInfoService.java

@@ -2,6 +2,8 @@ package com.idea.customerManagement.service;
 
 import cn.hutool.core.math.Money;
 import cn.hutool.core.util.IdUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.idea.buildManage.mapper.MnpBuildingMapper;
@@ -10,6 +12,7 @@ import com.idea.buildManage.mapper.ParkRoomMapper;
 import com.idea.buildManage.model.ParkRoom;
 import com.idea.buildManage.response.ParkRoomResponse;
 import com.idea.customerManagement.dto.ContractManageDto;
+import com.idea.customerManagement.dto.IntentionalDepositDto;
 import com.idea.customerManagement.dto.RoomSelectionInfoDto;
 import com.idea.customerManagement.mapper.CustomerManagementMapper;
 import com.idea.customerManagement.mapper.RoomSelectionInfoExtendMapper;
@@ -17,17 +20,21 @@ import com.idea.customerManagement.mapper.RoomSelectionInfoMapper;
 import com.idea.customerManagement.model.*;
 import com.idea.invoice.model.ReceiptManage;
 import com.idea.invoice.service.ReceiptManageService;
+import com.idea.invoice.util.InvoiceConstant;
+import com.idea.invoice.util.InvoiceUtil;
 import com.idea.paymentManagement.mapper.PayLogMapper;
 import com.idea.paymentManagement.model.PayLog;
 import com.idea.util.DateUtils;
 import com.idea.util.MoneyUtils;
 import com.idea.util.ReplaceWord;
 import com.rockstar.common.base.BaseService;
+import com.rockstar.common.domain.AjaxResult;
 import com.rockstar.frame.model.extend.DateTrans;
 import com.rockstar.frame.model.extend.Tablepar;
 import com.rockstar.shiro.util.ShiroUtils;
 import com.rockstar.system.service.SysDictService;
 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;
@@ -38,6 +45,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.math.BigDecimal;
 import java.util.*;
 
+@Slf4j
 @Service
 public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo, RoomSelectionInfoExample> {
 
@@ -418,4 +426,76 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
     }
 
 
+    public AjaxResult sendVoucher(RoomSelectionInfoDto model) {
+
+        // 银行流水id
+        String pkInformerId = model.getPkInformerId();
+        RoomSelectionInfo roomSelectionInfo = selectByPrimaryKey(model.getId());
+        CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(roomSelectionInfo.getCustomerManagementId());
+        BuyerExample buyerExample = new BuyerExample();
+        buyerExample.setOrderByClause("order_num");
+        buyerExample.createCriteria().andCustomerManagementIdEqualTo(customerManagement.getId());
+        List<Buyer> buyers = buyerService.selectByExample(buyerExample);
+        Buyer buyer = buyers.get(0);
+
+        JSONObject json = new JSONObject();
+        JSONObject ar_gatherbill = new JSONObject();
+        String srcsystemid = model.getId();
+        String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+        ar_gatherbill.put("srcsystemid", srcsystemid); //外系统标识,必选
+        ar_gatherbill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F2_Cxx_06); //交易类型,必选
+        ar_gatherbill.put("pk_org", InvoiceUtil.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", buyer.getIdentityCard()); //客商的纳税人识别号
+        ar_gatheritemJson.put("money_cr", roomSelectionInfo.getReceivedAmount()); //金额,必选
+        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", InvoiceUtil.bank_number); //收款银行账号,必填
+//        ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
+        ar_gatheritemJson.put("scomment", buyer.getName()); //客户名称,必选
+        ar_gatheritemJson.put("pk_subjcode", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001); //收款类型
+        ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
+        ar_gatheritemJson.put("checkno", roomSelectionInfo.getSerialNumber()); //票据号,必选
+        ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
+//        ar_gatheritemJson.put("def11", ""); //转出前房号编码,收除了诚意金之外的首期等需要选
+        // TODO: 2024/11/14 具体编码应该是根据小区来的
+        ar_gatheritemJson.put("def10", InvoiceConstant.INVOICE_MATERIAL_djjy); //项目档案编码,看云文档项目档案对照
+        ar_gatheritemJson.put("top_billid", pkInformerId); //到账通知生单时,(银行流水中返回的id,见5.2.10到账通知认领查询pk_informer字段)
+        ar_gatheritem.add(ar_gatheritemJson);
+        json.put("ar_gatheritem", ar_gatheritem);
+
+        try {
+            String result = InvoiceUtil.gatheringbillAdd(json);
+            JSONObject jsonObject = JSONObject.parseObject(result);
+            if(jsonObject.getString("success").equals("true")){
+                roomSelectionInfo.setNcJson(result);
+                updateByPrimaryKeySelective(roomSelectionInfo);
+            }
+
+        } catch (Exception e) {
+            log.error("收定金凭证推送报错",e);
+            return AjaxResult.error(e.getMessage());
+        }
+        return AjaxResult.success();
+    }
+
+
+
+
+
+
+
+
+
+
+
 }

+ 24 - 4
pro-base/src/main/java/com/idea/invoice/service/InvoiceBankService.java

@@ -15,6 +15,8 @@ import com.idea.buildManage.service.ParkInfoService;
 import com.idea.invoice.mapper.InvoiceBankMapper;
 import com.idea.invoice.model.InvoiceBank;
 import com.idea.invoice.model.InvoiceBankExample;
+import com.idea.invoice.util.InvoiceUtil;
+import com.idea.invoice.util.NccBankBean;
 import com.rockstar.common.base.BaseService;
 import com.rockstar.common.support.Convert;
 import com.rockstar.frame.model.extend.DateTrans;
@@ -26,10 +28,7 @@ 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;
 
 @Service
@@ -302,4 +301,25 @@ public class InvoiceBankService implements BaseService<InvoiceBank, InvoiceBankE
         return result;
     }
 
+    /**
+     * 获取银行流水
+     * @param startDate
+     * @param endDate
+     * @return
+     * @throws Exception
+     */
+    public List<NccBankBean> getNccBankList(String startDate, String endDate) throws Exception {
+
+        JSONObject json = new JSONObject();
+        json.put("infodate", startDate + "," + endDate);
+        String result = InvoiceUtil.informerQuery(json);
+        JSONObject jsonObject = JSONObject.parseObject(result);
+        if(jsonObject.getString("success").equals("true")){
+            JSONArray jsonArray = jsonObject.getJSONArray("data");
+            List<NccBankBean> list = JSONObject.parseArray(jsonArray.toJSONString(),NccBankBean.class);
+            return list;
+        }
+        return new ArrayList<NccBankBean>();
+    }
+
 }

+ 192 - 192
pro-base/src/main/java/com/idea/invoice/task/InvoiceTask.java

@@ -1,192 +1,192 @@
-package com.idea.invoice.task;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.idea.buildManage.model.MnpBuilding;
-import com.idea.buildManage.model.ParkFloorDisc;
-import com.idea.buildManage.model.ParkInfo;
-import com.idea.buildManage.model.ParkRoom;
-import com.idea.buildManage.service.MnpBuildingService;
-import com.idea.buildManage.service.ParkFloorDiscService;
-import com.idea.buildManage.service.ParkInfoService;
-import com.idea.buildManage.service.ParkRoomService;
-import com.idea.customerManagement.dto.CustomerManagementDto;
-import com.idea.customerManagement.model.Buyer;
-import com.idea.customerManagement.service.CustomerManagementService;
-import com.idea.invoice.model.InvoiceManage;
-import com.idea.invoice.service.InvoiceManageService;
-import com.idea.invoice.util.InvoiceConstant;
-import com.idea.invoice.util.InvoiceUtil;
-import com.idea.util.DateUtils;
-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.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.util.Date;
-import java.util.List;
-import java.util.stream.Collectors;
-
-@Slf4j
-@Component
-public class InvoiceTask {
-
-    @Autowired
-    private InvoiceManageService invoiceManageService;
-    @Autowired
-    private ParkInfoService parkInfoService;
-    @Autowired
-    private ParkFloorDiscService floorDiscService;
-    @Autowired
-    private MnpBuildingService buildingService;
-    @Autowired
-    private ParkRoomService roomService;
-    @Autowired
-    private CustomerManagementService customerManagementService;
-
-
-
-    /**
-     * 每十分钟刷新一次发票状态
-     */
-    @Scheduled(cron = "0 0/10 * * * ?")
-    public void refreshStatus() {
-
-        List<InvoiceManage> invoiceManages = invoiceManageService.selectNeedRefreshStatusList();
-        String ncCodes = invoiceManages.stream().map(InvoiceManage::getNcCode).collect(Collectors.joining());
-        JSONObject json = new JSONObject();
-        json.put("billno",ncCodes);
-        json.put("pk_org", InvoiceUtil.pk_org);
-        try {
-            String result = InvoiceUtil.invoiceQuery(json);
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            if(jsonObject.getString("success").equals("true")){
-                JSONArray data = jsonObject.getJSONArray("data");
-                for (int i = 0; i < data.size(); i++) {
-                    JSONObject object = data.getJSONObject(i);
-                    String srcsystemid = object.getString("srcsystemid");
-                    String invoiceno = object.getString("invoiceno");
-                    String settledate = object.getString("settledate");
-                    if(StringUtils.isNotEmpty(invoiceno)){
-
-                        Date date = DateUtils.parseDate(settledate, DateUtils.YYYY_MM_DD_HH_MM_SS);
-                        InvoiceManage invoiceManage = invoiceManageService.selectByPrimaryKey(srcsystemid);
-                        invoiceManage.setInvoiceNo(invoiceno);
-                        invoiceManage.setInvoiceStatus("1");
-                        invoiceManage.setInvoiceDate(date);
-                        invoiceManageService.updateByPrimaryKeySelective(invoiceManage);
-                    }
-                }
-            }
-        }catch (Exception e){
-            log.error("查询发票状态异常",e);
-        }
-
-    }
-
-    /**
-     * 每天凌晨执行 推送载体数据
-     */
-//    @Scheduled(cron = "0 0 0 1/1 * ?")
-    public void sendBuild() {
-        List<MnpBuilding> mnpBuildings = buildingService.selectNeedSendList();
-        for(MnpBuilding building: mnpBuildings){
-            try {
-                JSONObject json = new JSONObject();
-                json.put("srcsystemid", building.getId());
-                json.put("code", building.getId());
-                json.put("name", building.getBuildNum());
-                json.put("pk_org", InvoiceUtil.pk_org);
-                json.put("pk_defdoclist", InvoiceUtil.pk_defdoclist_build);
-                // 给nc推送载体数据
-                String resultJson = InvoiceUtil.defdocAdd(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");
-                    building.setNcid(ncid);
-                    building.setNcCode(code);
-                    buildingService.updateByPrimaryKeySelective(building);
-                }
-            } catch (Exception e) {
-                log.error("推送载体失败", e);
-            }
-        }
-    }
-
-    /**
-     * 每天凌晨执行 推送房间数据
-     */
-//    @Scheduled(cron = "0 0 0 1/1 * ?")
-    public void sendHouse(){
-        List<ParkRoom> parkRooms = roomService.selectNeedSendList();
-        for(ParkRoom record: parkRooms){
-            try {
-                ParkInfo parkInfo = parkInfoService.selectByPrimaryKey(record.getGroupId());
-                ParkFloorDisc parkFloorDisc = floorDiscService.selectByPrimaryKey(record.getDiscId());
-                MnpBuilding mnpBuilding = buildingService.selectByPrimaryKey(record.getBuildId());
-                String name = parkInfo.getGroupName() + "-" + parkFloorDisc.getName() + "-" + mnpBuilding.getBuildNum()
-                        + "-" + record.getRoomNo();
-                JSONObject json = new JSONObject();
-                json.put("srcsystemid", record.getId());
-                json.put("code", record.getId());
-                json.put("name", name);
-                json.put("pk_org", InvoiceUtil.pk_org);
-                json.put("pk_defdoclist", InvoiceUtil.pk_defdoclist_room);
-                // 给nc推送房间数据
-                String resultJson = InvoiceUtil.defdocAdd(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");
-                    record.setNcid(ncid);
-                    record.setNcCode(code);
-                    roomService.updateByPrimaryKeySelective(record);
-                }
-            } catch (Exception e) {
-                log.error("推送房间失败", e);
-            }
-        }
-    }
-
-    /**
-     * 每天凌晨执行 推送客户数据
-     */
-//    @Scheduled(cron = "0 0 0 1/1 * ?")
-    public void sendCustomer(){
-
-        List<CustomerManagementDto> customerManagementDtos = customerManagementService.selectNeedSendList();
-        for(CustomerManagementDto record: customerManagementDtos){
-            try {
-                // 给nc推送客户数据
-                JSONObject json = new JSONObject();
-                json.put("srcsystemid", record.getId());
-                json.put("name", record.getBuyerName());
-                json.put("pk_custclass", "02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
-                json.put("custprop", "0");//财务组织客户类型,必选,默认0
-                json.put("taxpayerid", record.getIdentityCard()); //统一社会信用代码,必选
-                String result = InvoiceUtil.customerAdd(json);
-                JSONObject jsonObject = JSONObject.parseObject(result);
-                String success = jsonObject.getString("success");
-                if (success.equals("true")) {
-                    JSONObject data = jsonObject.getJSONObject("data");
-                    String code = data.getString("code");
-                    String ncid = data.getString("ncid");
-                    record.setNcid(ncid);
-                    record.setNcCode(code);
-                    customerManagementService.updateByPrimaryKeySelective(record);
-                }
-            }catch (Exception e){
-                log.error("推送客户失败",e);
-            }
-        }
-    }
-
-
-}
+//package com.idea.invoice.task;
+//
+//import com.alibaba.fastjson.JSONArray;
+//import com.alibaba.fastjson.JSONObject;
+//import com.idea.buildManage.model.MnpBuilding;
+//import com.idea.buildManage.model.ParkFloorDisc;
+//import com.idea.buildManage.model.ParkInfo;
+//import com.idea.buildManage.model.ParkRoom;
+//import com.idea.buildManage.service.MnpBuildingService;
+//import com.idea.buildManage.service.ParkFloorDiscService;
+//import com.idea.buildManage.service.ParkInfoService;
+//import com.idea.buildManage.service.ParkRoomService;
+//import com.idea.customerManagement.dto.CustomerManagementDto;
+//import com.idea.customerManagement.model.Buyer;
+//import com.idea.customerManagement.service.CustomerManagementService;
+//import com.idea.invoice.model.InvoiceManage;
+//import com.idea.invoice.service.InvoiceManageService;
+//import com.idea.invoice.util.InvoiceConstant;
+//import com.idea.invoice.util.InvoiceUtil;
+//import com.idea.util.DateUtils;
+//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.scheduling.annotation.Scheduled;
+//import org.springframework.stereotype.Component;
+//
+//import java.util.Date;
+//import java.util.List;
+//import java.util.stream.Collectors;
+//
+//@Slf4j
+//@Component
+//public class InvoiceTask {
+//
+//    @Autowired
+//    private InvoiceManageService invoiceManageService;
+//    @Autowired
+//    private ParkInfoService parkInfoService;
+//    @Autowired
+//    private ParkFloorDiscService floorDiscService;
+//    @Autowired
+//    private MnpBuildingService buildingService;
+//    @Autowired
+//    private ParkRoomService roomService;
+//    @Autowired
+//    private CustomerManagementService customerManagementService;
+//
+//
+//
+//    /**
+//     * 每十分钟刷新一次发票状态
+//     */
+//    @Scheduled(cron = "0 0/10 * * * ?")
+//    public void refreshStatus() {
+//
+//        List<InvoiceManage> invoiceManages = invoiceManageService.selectNeedRefreshStatusList();
+//        String ncCodes = invoiceManages.stream().map(InvoiceManage::getNcCode).collect(Collectors.joining());
+//        JSONObject json = new JSONObject();
+//        json.put("billno",ncCodes);
+//        json.put("pk_org", InvoiceUtil.pk_org);
+//        try {
+//            String result = InvoiceUtil.invoiceQuery(json);
+//            JSONObject jsonObject = JSONObject.parseObject(result);
+//            if(jsonObject.getString("success").equals("true")){
+//                JSONArray data = jsonObject.getJSONArray("data");
+//                for (int i = 0; i < data.size(); i++) {
+//                    JSONObject object = data.getJSONObject(i);
+//                    String srcsystemid = object.getString("srcsystemid");
+//                    String invoiceno = object.getString("invoiceno");
+//                    String settledate = object.getString("settledate");
+//                    if(StringUtils.isNotEmpty(invoiceno)){
+//
+//                        Date date = DateUtils.parseDate(settledate, DateUtils.YYYY_MM_DD_HH_MM_SS);
+//                        InvoiceManage invoiceManage = invoiceManageService.selectByPrimaryKey(srcsystemid);
+//                        invoiceManage.setInvoiceNo(invoiceno);
+//                        invoiceManage.setInvoiceStatus("1");
+//                        invoiceManage.setInvoiceDate(date);
+//                        invoiceManageService.updateByPrimaryKeySelective(invoiceManage);
+//                    }
+//                }
+//            }
+//        }catch (Exception e){
+//            log.error("查询发票状态异常",e);
+//        }
+//
+//    }
+//
+//    /**
+//     * 每天凌晨执行 推送载体数据
+//     */
+////    @Scheduled(cron = "0 0 0 1/1 * ?")
+//    public void sendBuild() {
+//        List<MnpBuilding> mnpBuildings = buildingService.selectNeedSendList();
+//        for(MnpBuilding building: mnpBuildings){
+//            try {
+//                JSONObject json = new JSONObject();
+//                json.put("srcsystemid", building.getId());
+//                json.put("code", building.getId());
+//                json.put("name", building.getBuildNum());
+//                json.put("pk_org", InvoiceUtil.pk_org);
+//                json.put("pk_defdoclist", InvoiceUtil.pk_defdoclist_build);
+//                // 给nc推送载体数据
+//                String resultJson = InvoiceUtil.defdocAdd(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");
+//                    building.setNcid(ncid);
+//                    building.setNcCode(code);
+//                    buildingService.updateByPrimaryKeySelective(building);
+//                }
+//            } catch (Exception e) {
+//                log.error("推送载体失败", e);
+//            }
+//        }
+//    }
+//
+//    /**
+//     * 每天凌晨执行 推送房间数据
+//     */
+////    @Scheduled(cron = "0 0 0 1/1 * ?")
+//    public void sendHouse(){
+//        List<ParkRoom> parkRooms = roomService.selectNeedSendList();
+//        for(ParkRoom record: parkRooms){
+//            try {
+//                ParkInfo parkInfo = parkInfoService.selectByPrimaryKey(record.getGroupId());
+//                ParkFloorDisc parkFloorDisc = floorDiscService.selectByPrimaryKey(record.getDiscId());
+//                MnpBuilding mnpBuilding = buildingService.selectByPrimaryKey(record.getBuildId());
+//                String name = parkInfo.getGroupName() + "-" + parkFloorDisc.getName() + "-" + mnpBuilding.getBuildNum()
+//                        + "-" + record.getRoomNo();
+//                JSONObject json = new JSONObject();
+//                json.put("srcsystemid", record.getId());
+//                json.put("code", record.getId());
+//                json.put("name", name);
+//                json.put("pk_org", InvoiceUtil.pk_org);
+//                json.put("pk_defdoclist", InvoiceUtil.pk_defdoclist_room);
+//                // 给nc推送房间数据
+//                String resultJson = InvoiceUtil.defdocAdd(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");
+//                    record.setNcid(ncid);
+//                    record.setNcCode(code);
+//                    roomService.updateByPrimaryKeySelective(record);
+//                }
+//            } catch (Exception e) {
+//                log.error("推送房间失败", e);
+//            }
+//        }
+//    }
+//
+//    /**
+//     * 每天凌晨执行 推送客户数据
+//     */
+////    @Scheduled(cron = "0 0 0 1/1 * ?")
+//    public void sendCustomer(){
+//
+//        List<CustomerManagementDto> customerManagementDtos = customerManagementService.selectNeedSendList();
+//        for(CustomerManagementDto record: customerManagementDtos){
+//            try {
+//                // 给nc推送客户数据
+//                JSONObject json = new JSONObject();
+//                json.put("srcsystemid", record.getId());
+//                json.put("name", record.getBuyerName());
+//                json.put("pk_custclass", "02"); //客户基本分类 ,,(默认是02),必选,01内部客户,02外部客户
+//                json.put("custprop", "0");//财务组织客户类型,必选,默认0
+//                json.put("taxpayerid", record.getIdentityCard()); //统一社会信用代码,必选
+//                String result = InvoiceUtil.customerAdd(json);
+//                JSONObject jsonObject = JSONObject.parseObject(result);
+//                String success = jsonObject.getString("success");
+//                if (success.equals("true")) {
+//                    JSONObject data = jsonObject.getJSONObject("data");
+//                    String code = data.getString("code");
+//                    String ncid = data.getString("ncid");
+//                    record.setNcid(ncid);
+//                    record.setNcCode(code);
+//                    customerManagementService.updateByPrimaryKeySelective(record);
+//                }
+//            }catch (Exception e){
+//                log.error("推送客户失败",e);
+//            }
+//        }
+//    }
+//
+//
+//}

+ 58 - 1
pro-base/src/main/java/com/idea/invoice/util/InvoiceConstant.java

@@ -38,7 +38,9 @@ public class InvoiceConstant {
     // 电话
     public static final String INVOICE_SELLER_PHONE = "";
 
-
+    /**
+     * NC 单据编码
+     */
     // 收款单
     public static final String INVOICE_BUSINESS_F2_Cxx_06 = "F2-Cxx-06";
 
@@ -90,4 +92,59 @@ public class InvoiceConstant {
     // 瑞扬家园
     public static final String INVOICE_MATERIAL_ryjy = "ryjy";
 
+    /**
+     * 收款类型
+     */
+    // 定金
+    public static final String INVOICE_PAYMENT_TYPE_AJ001 = "AJ001";
+
+    // 首期
+    public static final String INVOICE_PAYMENT_TYPE_AJ002 = "AJ002";
+
+    // 楼款
+    public static final String INVOICE_PAYMENT_TYPE_AJ003 = "AJ003";
+
+    // 补差款
+    public static final String INVOICE_PAYMENT_TYPE_AJ004 = "AJ004";
+
+    // 银行按揭
+    public static final String INVOICE_PAYMENT_TYPE_AJ006 = "AJ006";
+
+    // 公积金
+    public static final String INVOICE_PAYMENT_TYPE_AJ007 = "AJ007";
+
+    // 维修基金
+    public static final String INVOICE_PAYMENT_TYPE_AJ015 = "AJ015";
+
+    // 滞纳金
+    public static final String INVOICE_PAYMENT_TYPE_AJ022 = "AJ022";
+
+    // 挞定款
+    public static final String INVOICE_PAYMENT_TYPE_AJ024 = "AJ024";
+
+    // 住宅诚意金
+    public static final String INVOICE_PAYMENT_TYPE_AJ026 = "AJ026";
+
+    // 车位诚意金
+    public static final String INVOICE_PAYMENT_TYPE_AJ027 = "AJ027";
+
+    /**
+     * 票据类型
+     */
+    // 无票据
+    public static final String INVOICE_RECEIPT_TYPE_1 = "1";
+
+    // 发票
+    public static final String INVOICE_RECEIPT_TYPE_2 = "2";
+
+    // 收据
+    public static final String INVOICE_RECEIPT_TYPE_3 = "3";
+
+    // 增值税(专)
+    public static final String INVOICE_RECEIPT_TYPE_4 = "4";
+
+    // 增值税(普)
+    public static final String INVOICE_RECEIPT_TYPE_5 = "5";
+
+
 }

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

@@ -84,7 +84,7 @@ public class InvoiceUtil {
         // 应收接口-收入结转单 新增
 //        InvoiceUtil.recbillAdd();
         // 楼栋或房间查询
-        InvoiceUtil.defdocView("CJ19");
+//        InvoiceUtil.defdocView("CJ19");
         // 楼栋或房间新增
 //        InvoiceUtil.defdocAdd("41号楼",pk_defdoclist_build);
         // 到账通知认领查询
@@ -253,62 +253,26 @@ public class InvoiceUtil {
      *
      * @throws Exception
      */
-    public static void gatheringbillAdd(String nature,String pk_informer) throws Exception {
+    public static String gatheringbillAdd(JSONObject json) 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"); //收款类型
-        ar_gatheritemJson.put("checktype", "5"); //票据类型,必选,看云文档票据类型
-        ar_gatheritemJson.put("checkno", number); //票据号,必选
-        ar_gatheritemJson.put("def9", "001"); //业态,必选,看云文档业态
-        ar_gatheritemJson.put("def11", "100"); //转出前房号编码,收除了诚意金之外的首期等需要选
-        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);
-
         log.info("收款单接口-新增提交:{}", json.toJSONString());
         String result = util.getAPIRetrun(token, json.toJSONString());
         log.info("收款单接口-新增提交:{}", result);
+        return result;
     }
 
-    public static void informerQuery() throws Exception {
+    public static String informerQuery(JSONObject json) 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);
+        return result;
     }
 
     /**
@@ -328,58 +292,18 @@ public class InvoiceUtil {
 
     /**
      * 转账单
-     * @param nature
-     * @param roomNumber
+     * @param json
      * @throws Exception
      */
-    public static void gatheringbillTurn(String nature,String roomNumber) throws Exception {
+    public static String gatheringbillTurn(JSONObject json) 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);
+        return result;
     }
 
     /**

+ 70 - 0
pro-base/src/main/java/com/idea/invoice/util/NccBankBean.java

@@ -0,0 +1,70 @@
+/**
+  * Copyright 2024 json.cn 
+  */
+package com.idea.invoice.util;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * Auto-generated: 2024-11-14 14:25:17
+ *
+ * @author json.cn (i@json.cn)
+ * @website http://www.json.cn/
+ */
+@Data
+public class NccBankBean {
+
+    private Information pk_group;
+    private Date doperatetime;
+    private String modifier;
+    private String memo;
+    private String bankrelated_code;
+    private String oppbankaccount;
+    private int dr;
+    private Information pk_org;
+    private String pk_src;
+    private String generateflag;
+    private Information pk_acc_sub;
+    private String vbillno;
+    private Date doperatedate;
+    private String pk_oppbank;
+    private Information billmaker;
+    private String oppunittype;
+    private Information pk_bankacc;
+    private Information pk_bank;
+    private Date creationtime;
+    private Information pk_org_v;
+    private String pk_oppacc_sub;
+    private String styleflag;
+    private String pk_billtypecode;
+    private String oper_flag;
+    private String note_no;
+    private String bankaccount;
+    private Information pk_currtype;
+    private String oppinout;
+    private String syscode;
+    private String infodatetime;
+    private Date modifiedtime;
+    private Information pk_oppbanktype;
+    private String pk_informer;
+    private String transerial;
+    private Information pk_banktype;
+    private String direction;
+    private String oppunitname;
+    private String pk_billtypeid;
+    private String pk_oppacc;
+    private String pk_oppunit;
+    private String moneyy;
+    private String usemoney;
+    private String bankname;
+    private Date infodate;
+    private Date ts;
+
+    class Information {
+        private String code;
+        private String name;
+        private String pk;
+    }
+
+}

+ 37 - 5
pro-base/src/main/resources/mybatis/customerManagement/IntentionalDepositMapper.xml

@@ -31,6 +31,8 @@
     <result column="refund_remark" jdbcType="LONGVARCHAR" property="refundRemark" />
     <result column="file_list" jdbcType="LONGVARCHAR" property="fileList" />
     <result column="paper_receipts" jdbcType="LONGVARCHAR" property="paperReceipts" />
+    <result column="nc_json" jdbcType="LONGVARCHAR" property="ncJson" />
+    <result column="turn_nc_json" jdbcType="LONGVARCHAR" property="turnNcJson" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -97,7 +99,7 @@
     status, refund_money, house_name
   </sql>
   <sql id="Blob_Column_List">
-    remark, deposit_remark, refund_remark, file_list, paper_receipts
+    remark, deposit_remark, refund_remark, file_list, paper_receipts, nc_json, turn_nc_json
   </sql>
   <select id="selectByExampleWithBLOBs" parameterType="com.idea.customerManagement.model.IntentionalDepositExample" resultMap="ResultMapWithBLOBs">
     select
@@ -157,7 +159,8 @@
                                      refund_handle_id, refund_handle_date, status,
                                      refund_money, house_name, remark,
                                      deposit_remark, refund_remark, file_list,
-                                     paper_receipts)
+                                     paper_receipts, nc_json, turn_nc_json
+    )
     values (#{id,jdbcType=VARCHAR}, #{groupId,jdbcType=VARCHAR}, #{discId,jdbcType=VARCHAR},
             #{houseId,jdbcType=VARCHAR}, #{customerManagementId,jdbcType=VARCHAR}, #{receivableMoney,jdbcType=DECIMAL},
             #{receivedAmount,jdbcType=DECIMAL}, #{paymentMethod,jdbcType=INTEGER}, #{serialNumber,jdbcType=VARCHAR},
@@ -167,7 +170,8 @@
             #{refundHandleId,jdbcType=VARCHAR}, #{refundHandleDate,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER},
             #{refundMoney,jdbcType=DECIMAL}, #{houseName,jdbcType=VARCHAR}, #{remark,jdbcType=LONGVARCHAR},
             #{depositRemark,jdbcType=LONGVARCHAR}, #{refundRemark,jdbcType=LONGVARCHAR}, #{fileList,jdbcType=LONGVARCHAR},
-            #{paperReceipts,jdbcType=LONGVARCHAR})
+            #{paperReceipts,jdbcType=LONGVARCHAR}, #{ncJson,jdbcType=LONGVARCHAR}, #{turnNcJson,jdbcType=LONGVARCHAR}
+           )
   </insert>
   <insert id="insertSelective" parameterType="com.idea.customerManagement.model.IntentionalDeposit">
     insert into intentional_deposit
@@ -253,6 +257,12 @@
       <if test="paperReceipts != null">
         paper_receipts,
       </if>
+      <if test="ncJson != null">
+        nc_json,
+      </if>
+      <if test="turnNcJson != null">
+        turn_nc_json,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -336,6 +346,12 @@
       <if test="paperReceipts != null">
         #{paperReceipts,jdbcType=LONGVARCHAR},
       </if>
+      <if test="ncJson != null">
+        #{ncJson,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="turnNcJson != null">
+        #{turnNcJson,jdbcType=LONGVARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.idea.customerManagement.model.IntentionalDepositExample" resultType="java.lang.Long">
@@ -428,6 +444,12 @@
       <if test="record.paperReceipts != null">
         paper_receipts = #{record.paperReceipts,jdbcType=LONGVARCHAR},
       </if>
+      <if test="record.ncJson != null">
+        nc_json = #{record.ncJson,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="record.turnNcJson != null">
+        turn_nc_json = #{record.turnNcJson,jdbcType=LONGVARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -461,7 +483,9 @@
     deposit_remark = #{record.depositRemark,jdbcType=LONGVARCHAR},
     refund_remark = #{record.refundRemark,jdbcType=LONGVARCHAR},
     file_list = #{record.fileList,jdbcType=LONGVARCHAR},
-    paper_receipts = #{record.paperReceipts,jdbcType=LONGVARCHAR}
+    paper_receipts = #{record.paperReceipts,jdbcType=LONGVARCHAR},
+    nc_json = #{record.ncJson,jdbcType=LONGVARCHAR},
+    turn_nc_json = #{record.turnNcJson,jdbcType=LONGVARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -575,6 +599,12 @@
       <if test="paperReceipts != null">
         paper_receipts = #{paperReceipts,jdbcType=LONGVARCHAR},
       </if>
+      <if test="ncJson != null">
+        nc_json = #{ncJson,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="turnNcJson != null">
+        turn_nc_json = #{turnNcJson,jdbcType=LONGVARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -605,7 +635,9 @@
         deposit_remark = #{depositRemark,jdbcType=LONGVARCHAR},
         refund_remark = #{refundRemark,jdbcType=LONGVARCHAR},
         file_list = #{fileList,jdbcType=LONGVARCHAR},
-        paper_receipts = #{paperReceipts,jdbcType=LONGVARCHAR}
+        paper_receipts = #{paperReceipts,jdbcType=LONGVARCHAR},
+        nc_json = #{ncJson,jdbcType=LONGVARCHAR},
+        turn_nc_json = #{turnNcJson,jdbcType=LONGVARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.idea.customerManagement.model.IntentionalDeposit">