LAPTOP-FO2T5SIU\35838 месяцев назад: 6
Родитель
Сommit
870c56c8f6

+ 2 - 0
pro-base/src/main/java/com/idea/buildManage/model/ParkInfo.java

@@ -60,6 +60,8 @@ public class ParkInfo implements Serializable {
 
     private String orderNum;
 
+    private String archiveCode;
+
     private static final long serialVersionUID = 1L;
 
 

+ 70 - 0
pro-base/src/main/java/com/idea/buildManage/model/ParkInfoExample.java

@@ -1755,6 +1755,76 @@ public class ParkInfoExample {
             addCriterion("order_num not between", value1, value2, "orderNum");
             return (Criteria) this;
         }
+
+        public Criteria andArchiveCodeIsNull() {
+            addCriterion("archive_code is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeIsNotNull() {
+            addCriterion("archive_code is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeEqualTo(String value) {
+            addCriterion("archive_code =", value, "archiveCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeNotEqualTo(String value) {
+            addCriterion("archive_code <>", value, "archiveCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeGreaterThan(String value) {
+            addCriterion("archive_code >", value, "archiveCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeGreaterThanOrEqualTo(String value) {
+            addCriterion("archive_code >=", value, "archiveCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeLessThan(String value) {
+            addCriterion("archive_code <", value, "archiveCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeLessThanOrEqualTo(String value) {
+            addCriterion("archive_code <=", value, "archiveCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeLike(String value) {
+            addCriterion("archive_code like", value, "archiveCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeNotLike(String value) {
+            addCriterion("archive_code not like", value, "archiveCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeIn(List<String> values) {
+            addCriterion("archive_code in", values, "archiveCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeNotIn(List<String> values) {
+            addCriterion("archive_code not in", values, "archiveCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeBetween(String value1, String value2) {
+            addCriterion("archive_code between", value1, value2, "archiveCode");
+            return (Criteria) this;
+        }
+
+        public Criteria andArchiveCodeNotBetween(String value1, String value2) {
+            addCriterion("archive_code not between", value1, value2, "archiveCode");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 320 - 269
pro-base/src/main/java/com/idea/transactionRecordManage/service/TransactionRecordService.java

@@ -5,6 +5,9 @@ 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.ParkInfoMapper;
+import com.idea.buildManage.model.ParkInfo;
+import com.idea.buildManage.model.ParkInfoExample;
 import com.idea.buildManage.response.ParkRoomResponse;
 import com.idea.customerManagement.dto.IntentionalDepositDto;
 import com.idea.customerManagement.mapper.CustomerManagementMapper;
@@ -12,6 +15,7 @@ import com.idea.customerManagement.mapper.IntentionalDepositMapper;
 import com.idea.customerManagement.model.Buyer;
 import com.idea.customerManagement.model.BuyerExample;
 import com.idea.customerManagement.model.CustomerManagement;
+import com.idea.customerManagement.model.CustomerManagementExample;
 import com.idea.customerManagement.service.BuyerService;
 import com.idea.invoice.mapper.InvoiceManageMapper;
 import com.idea.invoice.model.InvoiceManage;
@@ -62,16 +66,19 @@ public class TransactionRecordService {
     private IntentionalDepositMapper intentionalDepositMapper;
     @Autowired
     private InvoiceManageMapper invoiceManageMapper;
+    @Autowired
+    private ParkInfoMapper parkInfoMapper;
 
     /**
      * 收款记录
+     *
      * @param model
      * @return
      */
     public PageInfo<NccRecordVo> collectionRecord(Tablepar tablepar, NccRecordVo model) {
 
         PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
-        if(StringUtils.isNotEmpty(model.getDiscIds())){
+        if (StringUtils.isNotEmpty(model.getDiscIds())) {
             List<String> list = Arrays.asList(model.getDiscIds().split(","));
             model.setDiscIdList(list);
         }
@@ -105,6 +112,7 @@ public class TransactionRecordService {
 
     /**
      * 退款记录
+     *
      * @param tablepar
      * @param model
      * @return
@@ -113,7 +121,7 @@ public class TransactionRecordService {
 
         List<Map<String, String>> contentType = sysDictService.selectDictList("CONTENT_TYPE");
         PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
-        if(StringUtils.isNotEmpty(model.getDiscIds())){
+        if (StringUtils.isNotEmpty(model.getDiscIds())) {
             List<String> list = Arrays.asList(model.getDiscIds().split(","));
             model.setDiscIdList(list);
         }
@@ -133,7 +141,7 @@ public class TransactionRecordService {
     public List<NccRecordVo> refundRecordListAll(Tablepar tablepar, NccRecordVo model) {
 
         List<Map<String, String>> contentType = sysDictService.selectDictList("CONTENT_TYPE");
-        if(StringUtils.isNotEmpty(model.getDiscIds())){
+        if (StringUtils.isNotEmpty(model.getDiscIds())) {
             List<String> list = Arrays.asList(model.getDiscIds().split(","));
             model.setDiscIdList(list);
         }
@@ -151,6 +159,7 @@ public class TransactionRecordService {
 
     /**
      * 转换记录
+     *
      * @param tablepar
      * @param model
      * @return
@@ -158,13 +167,13 @@ public class TransactionRecordService {
     public PageInfo<NccRecordVo> convertRecord(Tablepar tablepar, NccRecordVo model) {
 
         PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
-        if(StringUtils.isNotEmpty(model.getDiscIds())){
+        if (StringUtils.isNotEmpty(model.getDiscIds())) {
             List<String> list = Arrays.asList(model.getDiscIds().split(","));
             model.setDiscIdList(list);
         }
         // 转换记录
         List<NccRecordVo> list = modelMapper.convertRecord(model);
-        for (NccRecordVo recordVo : list){
+        for (NccRecordVo recordVo : list) {
             recordVo.setContentType("7");
         }
         PageInfo<NccRecordVo> pageInfo = new PageInfo<>(list);
@@ -173,7 +182,7 @@ public class TransactionRecordService {
 
     public List<NccRecordVo> convertRecordListAll(NccRecordVo model) {
 
-        if(StringUtils.isNotEmpty(model.getDiscIds())){
+        if (StringUtils.isNotEmpty(model.getDiscIds())) {
             List<String> list = Arrays.asList(model.getDiscIds().split(","));
             model.setDiscIdList(list);
         }
@@ -185,120 +194,130 @@ public class TransactionRecordService {
 
     /**
      * 收款记录 ncc提交
+     *
      * @param collectionDateFrom
      * @param collectionDateTo
      * @return
      */
-    public int collectionRecordSubmit(String collectionDateFrom, String collectionDateTo){
+    public int collectionRecordSubmit(String collectionDateFrom, String collectionDateTo) {
 
         List<PayLog> payLogs = modelMapper.listByDate(collectionDateFrom, collectionDateTo);
-        for(PayLog payLog : payLogs){
-            CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(payLog.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);
-
-            String pk_subjcode = "";
-            // 定金
-            if(payLog.getContentType() == 1){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001;
-            }
-            // 首付
-            if(payLog.getContentType() == 2){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ002;
-            }
-            // 银行按揭
-            if(payLog.getContentType() == 3){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ006;
-            }
-            // 专项维修资金
-            if(payLog.getContentType() == 4){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ015;
-            }
-            // 楼款
-            if(payLog.getContentType() == 5){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ003;
-            }
-            // 补差款
-            if(payLog.getContentType() == 6){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ004;
-            }
-            // 意向金
-            if(payLog.getContentType() == 7){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026;
-            }
+        List<CustomerManagement> customerManagements = customerManagementMapper.selectByExample(new CustomerManagementExample());
+        Map<String, CustomerManagement> customerMap = customerManagements.stream()
+                .collect(Collectors.toMap(CustomerManagement::getId, item -> item));
+        List<ParkInfo> parkInfos = parkInfoMapper.selectByExample(new ParkInfoExample());
+        Map<String, ParkInfo> parkInfoMap = parkInfos.stream().collect(Collectors.toMap(ParkInfo::getId, item -> item));
+        for (PayLog payLog : payLogs) {
+            try {
 
-            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;
-            }
+                if (customerMap.containsKey(payLog.getCustomerManagementId())) {
+                    CustomerManagement customerManagement = customerMap.get(payLog.getCustomerManagementId());
+                    // TODO: 2024/11/27 项目档案编码 项目中暂无次字段
+                    String def10 = "";
+                    if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
+                        def10 = parkInfoMap.get(customerManagement.getGroupId()).getArchiveCode();
+                    }
+                    String pk_subjcode = "";
+                    // 定金
+                    if (payLog.getContentType() == 1) {
+                        pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001;
+                    }
+                    // 首付
+                    if (payLog.getContentType() == 2) {
+                        pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ002;
+                    }
+                    // 银行按揭
+                    if (payLog.getContentType() == 3) {
+                        pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ006;
+                    }
+                    // 专项维修资金
+                    if (payLog.getContentType() == 4) {
+                        pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ015;
+                    }
+                    // 楼款
+                    if (payLog.getContentType() == 5) {
+                        pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ003;
+                    }
+                    // 补差款
+                    if (payLog.getContentType() == 6) {
+                        pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ004;
+                    }
+                    // 意向金
+                    if (payLog.getContentType() == 7) {
+                        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();
+                    String srcsystemid = payLog.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", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
+                    ar_gatheritemJson.put("money_cr", payLog.getPayMoney()); //金额,必选
+                    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("scomment", customerManagement.getBuyerName()); //客户名称,必选
+                    ar_gatheritemJson.put("pk_subjcode", pk_subjcode); //收款类型
+                    ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
+                    ar_gatheritemJson.put("checkno", payLog.getSerialNumber()); //票据号,必选
+                    ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
+                    ar_gatheritemJson.put("def11", payLog.getHouseId()); //转出前房号编码,收除了诚意金之外的首期等需要选
+                    ar_gatheritemJson.put("def10", 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);
 
+                    log.info("收款凭证推送详情:{}", json.toJSONString());
+
+                    String result = InvoiceUtil.gatheringbillAdd(json);
+                    JSONObject jsonObject = JSONObject.parseObject(result);
+                    if (jsonObject.getString("success").equals("true")) {
+                        payLog.setNcJson(result);
+                        payLog.setNcSubmitStatus(1);
+                        payLog.setNcSubmitDate(new Date());
+                        payLog.setNcSubmitName(ShiroUtils.getLoginName());
+                        payLogMapper.updateByPrimaryKeySelective(payLog);
+                    }
 
-            JSONObject json = new JSONObject();
-            JSONObject ar_gatherbill = new JSONObject();
-            String srcsystemid = payLog.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", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
-            ar_gatheritemJson.put("money_cr", payLog.getPayMoney()); //金额,必选
-            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("scomment", buyer.getName()); //客户名称,必选
-            ar_gatheritemJson.put("pk_subjcode", pk_subjcode); //收款类型
-            ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
-            ar_gatheritemJson.put("checkno", payLog.getSerialNumber()); //票据号,必选
-            ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
-            ar_gatheritemJson.put("def11", payLog.getHouseId()); //转出前房号编码,收除了诚意金之外的首期等需要选
-            // TODO: 2024/11/14 项目档案编码 待定
-            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);
 
-            try {
-                String result = InvoiceUtil.gatheringbillAdd(json);
-                JSONObject jsonObject = JSONObject.parseObject(result);
-                if(jsonObject.getString("success").equals("true")){
-                    payLog.setNcJson(result);
-                    payLog.setNcSubmitStatus(1);
-                    payLog.setNcSubmitDate(new Date());
-                    payLog.setNcSubmitName(ShiroUtils.getLoginName());
-                    payLogMapper.updateByPrimaryKeySelective(payLog);
                 }
 
             } catch (Exception e) {
-                log.error("收款凭证推送报错",e);
+                log.error("收款凭证推送报错", e);
             }
-
         }
 
         return 1;
@@ -306,113 +325,134 @@ public class TransactionRecordService {
 
     /**
      * 退款记录推送
+     *
      * @param collectionDateFrom
      * @param collectionDateTo
      * @return
      */
     public int refundRecordSubmit(String collectionDateFrom, String collectionDateTo) {
 
+        // 开票列表
         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)){
+        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 pk_subjcode = "";
-            // 定金
-            if(refundManage.getContentType() == 1){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001;
-            }
-            // 首付
-            if(refundManage.getContentType() == 2){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ002;
-            }
-            // 银行按揭
-            if(refundManage.getContentType() == 3){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ006;
-            }
-            // 专项维修资金
-            if(refundManage.getContentType() == 4){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ015;
-            }
-            // 楼款
-            if(refundManage.getContentType() == 5){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ003;
-            }
-            // 补差款
-            if(refundManage.getContentType() == 6){
-                pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ004;
-            }
-            // 意向金
-            if(refundManage.getContentType() == 7){
-                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;
-            }
+        // 客户列表
+        List<CustomerManagement> customerManagements = customerManagementMapper.selectByExample(new CustomerManagementExample());
+        Map<String, CustomerManagement> customerMap = customerManagements.stream()
+                .collect(Collectors.toMap(CustomerManagement::getId, item -> item));
+        // 园区列表
+        List<ParkInfo> parkInfos = parkInfoMapper.selectByExample(new ParkInfoExample());
+        Map<String, ParkInfo> parkInfoMap = parkInfos.stream().collect(Collectors.toMap(ParkInfo::getId, item -> item));
 
+        // 退款列表
+        List<RefundManageDto> refundManages = modelMapper.refundListByDate(collectionDateFrom, collectionDateTo);
+        for (RefundManageDto refundManage : refundManages) {
+            try {
+                if (customerMap.containsKey(refundManage.getCustomerManagementId())) {
+                    CustomerManagement customerManagement = customerMap.get(refundManage.getCustomerManagementId());
+
+                    String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+
+                    // TODO: 2024/11/27 项目档案编码 项目中暂无次字段
+                    String def10 = "";
+                    if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
+                        def10 = parkInfoMap.get(customerManagement.getGroupId()).getArchiveCode();
+                    }
+                    String pk_subjcode = "";
+                    // 定金
+                    if (refundManage.getContentType() == 1) {
+                        pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ001;
+                    }
+                    // 首付
+                    if (refundManage.getContentType() == 2) {
+                        pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ002;
+                    }
+                    // 银行按揭
+                    if (refundManage.getContentType() == 3) {
+                        pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ006;
+                    }
+                    // 专项维修资金
+                    if (refundManage.getContentType() == 4) {
+                        pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ015;
+                    }
+                    // 楼款
+                    if (refundManage.getContentType() == 5) {
+                        pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ003;
+                    }
+                    // 补差款
+                    if (refundManage.getContentType() == 6) {
+                        pk_subjcode = InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ004;
+                    }
+                    // 意向金
+                    if (refundManage.getContentType() == 7) {
+                        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();
+                    ap_paybill.put("srcsystemid", srcsystemid); //外系统标识,必选
+                    ap_paybill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F3_Cxx_06); //交易类型,必选
+                    ap_paybill.put("pk_org", InvoiceUtil.pk_org); //组织编码,必选
+                    ap_paybill.put("billdate", billdate); //单据日期
+                    ap_paybill.put("def2", srcsystemid); //外系统单据号,必填,
+                    json.put("ap_paybill", ap_paybill);
+
+                    JSONArray ap_payitem = new JSONArray();
+                    JSONObject ap_payitemJson = new JSONObject();
+                    ap_payitemJson.put("srcsystemid", srcsystemid); //外系统子表标识
+                    ap_payitemJson.put("scomment", customerManagement.getBuyerName()); //客户名称,必选
+                    ap_payitemJson.put("pk_subjcode", pk_subjcode); //收支项目编码,必选
+                    ap_payitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
+                    ap_payitemJson.put("customer", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
+                    ap_payitemJson.put("money_de", refundManage.getActualRefundAmount()); //金额,必选
+                    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
+                    // 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"); //业态,必选,看云文档业态
+                    ap_payitemJson.put("def10", def10); //项目档案编码,看云文档项目档案对照
+                    ap_payitem.add(ap_payitemJson);
+                    json.put("ap_payitem", ap_payitem);
+
+                    log.info("退款凭证推送详情:{}", json.toJSONString());
+
+                    String result = InvoiceUtil.paybillAdd(json);
+                    JSONObject jsonObject = JSONObject.parseObject(result);
+                    if (jsonObject.getString("success").equals("true")) {
+
+                        RefundDetail detail = new RefundDetail();
+                        detail.setId(refundManage.getRefundDetailId());
+                        detail.setNcJson(result);
+                        detail.setNcSubmitStatus(1);
+                        detail.setNcSubmitDate(new Date());
+                        detail.setNcSubmitName(ShiroUtils.getLoginName());
+                        refundDetailMapper.updateByPrimaryKeySelective(detail);
+                    }
 
-            JSONObject json = new JSONObject();
-            JSONObject ap_paybill = new JSONObject();
-            String srcsystemid = IdUtil.simpleUUID();
-            ap_paybill.put("srcsystemid", srcsystemid); //外系统标识,必选
-            ap_paybill.put("pk_tradetype", InvoiceConstant.INVOICE_BUSINESS_F3_Cxx_06); //交易类型,必选
-            ap_paybill.put("pk_org", InvoiceUtil.pk_org); //组织编码,必选
-            ap_paybill.put("billdate", billdate); //单据日期
-            ap_paybill.put("def2", srcsystemid); //外系统单据号,必填,
-            json.put("ap_paybill", ap_paybill);
-
-            JSONArray ap_payitem = new JSONArray();
-            JSONObject ap_payitemJson = new JSONObject();
-            ap_payitemJson.put("srcsystemid", srcsystemid); //外系统子表标识
-            ap_payitemJson.put("scomment", customerManagement.getBuyerName()); //客户名称,必选
-            ap_payitemJson.put("pk_subjcode", pk_subjcode); //收支项目编码,必选
-            ap_payitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-            ap_payitemJson.put("customer", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
-            ap_payitemJson.put("money_de", refundManage.getActualRefundAmount()); //金额,必选
-            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
-            // 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", ""); //项目档案编码,看云文档项目档案对照
-            ap_payitem.add(ap_payitemJson);
-            json.put("ap_payitem", ap_payitem);
 
-            try {
-                String result = InvoiceUtil.paybillAdd(json);
-                JSONObject jsonObject = JSONObject.parseObject(result);
-                if(jsonObject.getString("success").equals("true")){
-
-                    RefundDetail detail = new RefundDetail();
-                    detail.setId(refundManage.getRefundDetailId());
-                    detail.setNcJson(result);
-                    detail.setNcSubmitStatus(1);
-                    detail.setNcSubmitDate(new Date());
-                    detail.setNcSubmitName(ShiroUtils.getLoginName());
-                    refundDetailMapper.updateByPrimaryKeySelective(detail);
                 }
 
             } catch (Exception e) {
-                log.error("退款凭证推送报错",e);
+                log.error("退款凭证推送报错", e);
             }
 
         }
@@ -422,97 +462,108 @@ public class TransactionRecordService {
 
     /**
      * 转换记录 ncc提交
+     *
      * @param collectionDateFrom
      * @param collectionDateTo
      * @return
      */
     public int convertRecordSubmit(String collectionDateFrom, String collectionDateTo) {
 
-        Map<String, String> cusIdMap = buyerService.getCusIdMap();
+        // 客户列表
+        List<CustomerManagement> customerManagements = customerManagementMapper.selectByExample(new CustomerManagementExample());
+        Map<String, CustomerManagement> customerMap = customerManagements.stream()
+                .collect(Collectors.toMap(CustomerManagement::getId, item -> item));
+        // 园区列表
+        List<ParkInfo> parkInfos = parkInfoMapper.selectByExample(new ParkInfoExample());
+        Map<String, ParkInfo> parkInfoMap = parkInfos.stream().collect(Collectors.toMap(ParkInfo::getId, item -> item));
 
+        // 意向金列表
         List<IntentionalDepositDto> intentionalDeposits = modelMapper.convertListByDate(collectionDateFrom, collectionDateTo);
-        for (IntentionalDepositDto intentionalDeposit : intentionalDeposits){
-            String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
-            String number = SnowflakeIdWorker.getUUID();
-
-            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;
-            }
-
-
-            JSONObject json = new JSONObject();
-            JSONObject ar_gatherbill = new JSONObject();
-            String srcsystemid = intentionalDeposit.getId();
-            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", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
-            ar_gatheritemJson.put("money_cr", intentionalDeposit.getReceivedAmount()); //金额,必选
-            // TODO: 2024/11/20 税率 待定
-            ar_gatheritemJson.put("taxrate", ""); //税率,必选,数字——3/10/6````
-            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", ""); //收款银行账号,必填
+        for (IntentionalDepositDto intentionalDeposit : intentionalDeposits) {
+            try {
+                String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+                if (customerMap.containsKey(intentionalDeposit.getCustomerManagementId())) {
+                    CustomerManagement customerManagement = customerMap.get(intentionalDeposit.getCustomerManagementId());
+
+                    // TODO: 2024/11/27 项目档案编码 项目中暂无次字段
+                    String def10 = "";
+                    if (parkInfoMap.containsKey(customerManagement.getGroupId())) {
+                        def10 = parkInfoMap.get(customerManagement.getGroupId()).getArchiveCode();
+                    }
+
+                    // 目前只有意向金转定金
+                    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;
+                    }
+
+
+                    JSONObject json = new JSONObject();
+                    JSONObject ar_gatherbill = new JSONObject();
+                    String srcsystemid = intentionalDeposit.getId();
+                    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", customerManagement.getBuyerIdentityCard()); //客商的纳税人识别号
+                    ar_gatheritemJson.put("money_cr", intentionalDeposit.getReceivedAmount()); //金额,必选
+                    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", "0"); //收款性质应收款时传"0",收款性质预收款时传"1"
+                    ar_gatheritemJson.put("recaccount", intentionalDeposit.getBankName()); //收款银行账号,必填
 //        ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
-            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("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); //原收支项目编码,定金转违约金项目时 必选
+                    ar_gatheritemJson.put("def14", InvoiceConstant.INVOICE_PAYMENT_TYPE_AJ026); //原收支项目编码,定金转违约金项目时 必选
 //        ar_gatheritemJson.put("def13", ""); //换票后票据号,换房业务必选
-            // TODO: 2024/11/20 票据类型 待定
-            ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
-            ar_gatheritemJson.put("checkno", intentionalDeposit.getSerialNumber()); //票据号,必选
-            // TODO: 2024/11/14 具体编码 未定
-            ar_gatheritemJson.put("def10", ""); //项目档案编码,看云文档项目档案对照
-            ar_gatheritem.add(ar_gatheritemJson);
-            json.put("ar_gatheritem", ar_gatheritem);
+                    ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
+                    ar_gatheritemJson.put("checkno", intentionalDeposit.getSerialNumber()); //票据号,必选
+                    ar_gatheritemJson.put("def10", def10); //项目档案编码,看云文档项目档案对照
+                    ar_gatheritem.add(ar_gatheritemJson);
+                    json.put("ar_gatheritem", ar_gatheritem);
+
+                    log.info("转换记录推送详情:{}", json.toJSONString());
+                    String result = InvoiceUtil.gatheringbillTurn(json);
+                    JSONObject jsonObject = JSONObject.parseObject(result);
+                    if (jsonObject.getString("success").equals("true")) {
+                        intentionalDeposit.setNcJson(result);
+                        intentionalDeposit.setNcSubmitStatus(1);
+                        intentionalDeposit.setNcSubmitDate(new Date());
+                        intentionalDeposit.setNcSubmitName(ShiroUtils.getLoginName());
+                        intentionalDepositMapper.updateByPrimaryKeySelective(intentionalDeposit);
+                    }
 
-            try {
-                String result = InvoiceUtil.gatheringbillTurn(json);
-                JSONObject jsonObject = JSONObject.parseObject(result);
-                if (jsonObject.getString("success").equals("true")) {
-                    intentionalDeposit.setNcJson(result);
-                    intentionalDeposit.setNcSubmitStatus(1);
-                    intentionalDeposit.setNcSubmitDate(new Date());
-                    intentionalDeposit.setNcSubmitName(ShiroUtils.getLoginName());
-                    intentionalDepositMapper.updateByPrimaryKeySelective(intentionalDeposit);
                 }
 
             } catch (Exception e) {
-                log.error("诚意金转定金凭证推送报错", e);
+                log.error("转换记录凭证推送报错", e);
             }
-
         }
         return 1;
 

+ 22 - 5
pro-base/src/main/resources/mybatis/buildManage/ParkInfoMapper.xml

@@ -27,6 +27,7 @@
     <result column="regionalism_code" jdbcType="VARCHAR" property="regionalismCode" />
     <result column="address" jdbcType="VARCHAR" property="address" />
     <result column="order_num" jdbcType="VARCHAR" property="orderNum" />
+    <result column="archive_code" jdbcType="VARCHAR" property="archiveCode" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.idea.buildManage.model.ParkInfo">
     <result column="introduction" jdbcType="LONGVARCHAR" property="introduction" />
@@ -94,7 +95,7 @@
     company_id, build_area, land_area, project_approval_document, engineering_planning_permit,
     construction_permit, land_certificate_number, land_use_permit_number, volume_ratio,
     green_ratio, price, exceeded_price, area_status, sale_status, regionalism_code, address,
-    order_num
+    order_num, archive_code
   </sql>
   <sql id="Blob_Column_List">
     introduction
@@ -157,7 +158,7 @@
                            volume_ratio, green_ratio, price,
                            exceeded_price, area_status, sale_status,
                            regionalism_code, address, order_num,
-                           introduction)
+                           archive_code, introduction)
     values (#{id,jdbcType=VARCHAR}, #{groupId,jdbcType=VARCHAR}, #{groupName,jdbcType=VARCHAR},
             #{createdId,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
             #{nature,jdbcType=VARCHAR}, #{preSalesLicenseNumber,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR},
@@ -167,7 +168,7 @@
             #{volumeRatio,jdbcType=DOUBLE}, #{greenRatio,jdbcType=DOUBLE}, #{price,jdbcType=DECIMAL},
             #{exceededPrice,jdbcType=DECIMAL}, #{areaStatus,jdbcType=INTEGER}, #{saleStatus,jdbcType=INTEGER},
             #{regionalismCode,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{orderNum,jdbcType=VARCHAR},
-            #{introduction,jdbcType=LONGVARCHAR})
+            #{archiveCode,jdbcType=VARCHAR}, #{introduction,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.idea.buildManage.model.ParkInfo">
     insert into park_info
@@ -247,6 +248,9 @@
       <if test="orderNum != null">
         order_num,
       </if>
+      <if test="archiveCode != null">
+        archive_code,
+      </if>
       <if test="introduction != null">
         introduction,
       </if>
@@ -327,6 +331,9 @@
       <if test="orderNum != null">
         #{orderNum,jdbcType=VARCHAR},
       </if>
+      <if test="archiveCode != null">
+        #{archiveCode,jdbcType=VARCHAR},
+      </if>
       <if test="introduction != null">
         #{introduction,jdbcType=LONGVARCHAR},
       </if>
@@ -416,6 +423,9 @@
       <if test="record.orderNum != null">
         order_num = #{record.orderNum,jdbcType=VARCHAR},
       </if>
+      <if test="record.archiveCode != null">
+        archive_code = #{record.archiveCode,jdbcType=VARCHAR},
+      </if>
       <if test="record.introduction != null">
         introduction = #{record.introduction,jdbcType=LONGVARCHAR},
       </if>
@@ -451,6 +461,7 @@
     regionalism_code = #{record.regionalismCode,jdbcType=VARCHAR},
     address = #{record.address,jdbcType=VARCHAR},
     order_num = #{record.orderNum,jdbcType=VARCHAR},
+    archive_code = #{record.archiveCode,jdbcType=VARCHAR},
     introduction = #{record.introduction,jdbcType=LONGVARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -482,7 +493,8 @@
     sale_status = #{record.saleStatus,jdbcType=INTEGER},
     regionalism_code = #{record.regionalismCode,jdbcType=VARCHAR},
     address = #{record.address,jdbcType=VARCHAR},
-    order_num = #{record.orderNum,jdbcType=VARCHAR}
+    order_num = #{record.orderNum,jdbcType=VARCHAR},
+    archive_code = #{record.archiveCode,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -562,6 +574,9 @@
       <if test="orderNum != null">
         order_num = #{orderNum,jdbcType=VARCHAR},
       </if>
+      <if test="archiveCode != null">
+        archive_code = #{archiveCode,jdbcType=VARCHAR},
+      </if>
       <if test="introduction != null">
         introduction = #{introduction,jdbcType=LONGVARCHAR},
       </if>
@@ -594,6 +609,7 @@
         regionalism_code = #{regionalismCode,jdbcType=VARCHAR},
         address = #{address,jdbcType=VARCHAR},
         order_num = #{orderNum,jdbcType=VARCHAR},
+        archive_code = #{archiveCode,jdbcType=VARCHAR},
         introduction = #{introduction,jdbcType=LONGVARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -622,7 +638,8 @@
         sale_status = #{saleStatus,jdbcType=INTEGER},
         regionalism_code = #{regionalismCode,jdbcType=VARCHAR},
         address = #{address,jdbcType=VARCHAR},
-        order_num = #{orderNum,jdbcType=VARCHAR}
+        order_num = #{orderNum,jdbcType=VARCHAR},
+        archive_code = #{archiveCode,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
 </mapper>

+ 3 - 0
pro-base/src/main/resources/mybatis/transactionRecord/TransactionRecord.xml

@@ -52,6 +52,7 @@
     <select id="listByDate" resultType="com.idea.paymentManagement.model.PayLog">
         select * from pay_log where date_format(pay_time,'%Y-%m-%d') >= #{startDate}
                                 and #{endDate} &lt;= date_format(pay_time,'%Y-%m-%d')
+        and ifnull(nc_submit_status,0) = 0
     </select>
 
     <select id="reFundRecord" resultType="com.idea.transactionRecordManage.vo.NccRecordVo">
@@ -99,6 +100,7 @@
         left join refund_detail d on m.id = d.refund_manage_id
         where date_format(m.created_at,'%Y-%m-%d') >= #{startDate}
         and #{endDate} &lt;= date_format(m.created_at,'%Y-%m-%d')
+        and ifnull(nc_submit_status,0) = 0
     </select>
 
     <select id="convertRecord" resultType="com.idea.transactionRecordManage.vo.NccRecordVo">
@@ -136,6 +138,7 @@
     <select id="convertListByDate" resultType="com.idea.customerManagement.dto.IntentionalDepositDto">
         select * from intentional_deposit where date_format(handle_date,'%Y-%m-%d') >= #{startDate}
                                 and #{endDate} &lt;= date_format(handle_date,'%Y-%m-%d')
+        and ifnull(nc_submit_status,0) = 0
     </select>