LAPTOP-FO2T5SIU\35838 1 년 전
부모
커밋
a353aff715
21개의 변경된 파일544개의 추가작업 그리고 87개의 파일을 삭제
  1. 1 1
      pro-base/src/main/java/com/idea/customerManagement/controller/RoomSelectionInfoController.java
  2. 2 0
      pro-base/src/main/java/com/idea/customerManagement/dto/CustomerManagementDto.java
  3. 1 0
      pro-base/src/main/java/com/idea/customerManagement/mapper/BuyerExtendMapper.java
  4. 15 2
      pro-base/src/main/java/com/idea/customerManagement/service/BuyerService.java
  5. 5 14
      pro-base/src/main/java/com/idea/customerManagement/service/RoomSelectionInfoService.java
  6. 2 34
      pro-base/src/main/java/com/idea/invoice/util/InvoiceUtil.java
  7. 1 4
      pro-base/src/main/java/com/idea/paymentManagement/controller/RefundDetailController.java
  8. 15 0
      pro-base/src/main/java/com/idea/paymentManagement/dto/RefundDetailDto.java
  9. 4 0
      pro-base/src/main/java/com/idea/paymentManagement/dto/RefundManageDto.java
  10. 2 0
      pro-base/src/main/java/com/idea/paymentManagement/model/RefundDetail.java
  11. 0 14
      pro-base/src/main/java/com/idea/paymentManagement/model/RefundDetailDto.java
  12. 60 0
      pro-base/src/main/java/com/idea/paymentManagement/model/RefundDetailExample.java
  13. 1 1
      pro-base/src/main/java/com/idea/paymentManagement/service/RefundDetailService.java
  14. 43 0
      pro-base/src/main/java/com/idea/transactionRecordManage/controller/TransactionRecordController.java
  15. 12 0
      pro-base/src/main/java/com/idea/transactionRecordManage/mapper/TransactionRecordMapper.java
  16. 294 0
      pro-base/src/main/java/com/idea/transactionRecordManage/service/TransactionRecordService.java
  17. 9 0
      pro-base/src/main/resources/mybatis/customerManagement/BuyerExtendMapper.xml
  18. 3 1
      pro-base/src/main/resources/mybatis/customerManagement/CustomerManagementExtendMapper.xml
  19. 30 13
      pro-base/src/main/resources/mybatis/paymentManagement/RefundDetailMapper.xml
  20. 42 1
      pro-base/src/main/resources/mybatis/transactionRecord/TransactionRecord.xml
  21. 2 2
      pro-wx/src/main/java/com/idea/pro/wx/controller/customerManagement/WxRoomSelectionInfoController.java

+ 1 - 1
pro-base/src/main/java/com/idea/customerManagement/controller/RoomSelectionInfoController.java

@@ -47,7 +47,7 @@ public class RoomSelectionInfoController extends BaseController {
     @PostMapping(value = "submit",produces = {"application/json;charset=UTF-8"})
     @ResponseBody
     public AjaxResult submit(String houseIds, String customerManagementId){
-        int result = modelService.submit(houseIds,customerManagementId);
+        int result = modelService.submit(houseIds,customerManagementId,null);
         return result(result);
     }
 

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

@@ -29,4 +29,6 @@ public class CustomerManagementDto extends CustomerManagement {
 
     private String statusStr;
 
+    private String intentionalDepositStatus;
+
 }

+ 1 - 0
pro-base/src/main/java/com/idea/customerManagement/mapper/BuyerExtendMapper.java

@@ -10,5 +10,6 @@ public interface BuyerExtendMapper {
 
     List<String> idNumberList();
 
+    List<Buyer> getCusIdMap();
 
 }

+ 15 - 2
pro-base/src/main/java/com/idea/customerManagement/service/BuyerService.java

@@ -8,10 +8,13 @@ import com.idea.customerManagement.model.BuyerExample;
 import com.rockstar.common.base.BaseService;
 import com.rockstar.frame.model.extend.DateTrans;
 import com.rockstar.util.StringUtils;
+import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 @Service
@@ -94,8 +97,18 @@ public class BuyerService implements BaseService<Buyer, BuyerExample> {
         return numberList;
     }
 
-
-
+    /**
+     * 获取客户id和客户名称
+     * @return
+     */
+    public Map<String,String> getCusIdMap(){
+        Map<String, String> map = new HashMap<>();
+        List<Buyer> buyers = extendMapper.getCusIdMap();
+        if(CollectionUtils.isNotEmpty(buyers)){
+            map = buyers.stream().collect(Collectors.toMap(Buyer::getCustomerManagementId,Buyer::getName));
+        }
+        return map;
+    }
 
 
 

+ 5 - 14
pro-base/src/main/java/com/idea/customerManagement/service/RoomSelectionInfoService.java

@@ -139,7 +139,7 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
      * @param customerManagementId
      * @return
      */
-    public int submit(String houseIds, String customerManagementId) {
+    public int submit(String houseIds, String customerManagementId, String userId) {
 
         CustomerManagement customerManagement = customerManagementMapper.selectByPrimaryKey(customerManagementId);
         customerManagement.setStatus(2);
@@ -173,7 +173,7 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
             roomSelectionInfo.setDiscId(response.getDiscId());
             roomSelectionInfo.setGroupId(response.getGroupId());
             roomSelectionInfo.setCreatedAt(new Date());
-            roomSelectionInfo.setCreatedId(ShiroUtils.getUserId());
+            roomSelectionInfo.setCreatedId(userId == null ? ShiroUtils.getUserId() : userId);
             roomSelectionInfo.setReceivableMoney(response.getSubscriptionFunds());
             roomSelectionInfo.setStatus(1);
             insertSelective(roomSelectionInfo);
@@ -418,7 +418,7 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
         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);
 
@@ -476,26 +476,17 @@ public class RoomSelectionInfoService implements BaseService<RoomSelectionInfo,
         try {
             String result = InvoiceUtil.gatheringbillAdd(json);
             JSONObject jsonObject = JSONObject.parseObject(result);
-            if(jsonObject.getString("success").equals("true")){
+            if (jsonObject.getString("success").equals("true")) {
                 roomSelectionInfo.setNcJson(result);
                 updateByPrimaryKeySelective(roomSelectionInfo);
             }
 
         } catch (Exception e) {
-            log.error("收定金凭证推送报错",e);
+            log.error("收定金凭证推送报错", e);
             return AjaxResult.error(e.getMessage());
         }
         return AjaxResult.success();
     }
 
 
-
-
-
-
-
-
-
-
-
 }

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

@@ -190,47 +190,15 @@ public class InvoiceUtil {
      *
      * @throws Exception
      */
-    public static void paybillAdd() throws Exception {
+    public static String paybillAdd(JSONObject json) throws Exception {
         APICurUtils util = new APICurUtils();
         String token = InvoiceUtil.getToken(util);
         util.setApiUrl("nccloud/api/wxyy/arap/paybill/saveandcommit");
-        String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
-        String number = SnowflakeIdWorker.getUUID();
-
-        JSONObject json = new JSONObject();
-        JSONObject ap_paybill = new JSONObject();
-        String srcsystemid = IdUtil.simpleUUID();
-        ap_paybill.put("srcsystemid", srcsystemid); //外系统标识,必选
-        ap_paybill.put("pk_tradetype", "F3-Cxx-06"); //交易类型,必选
-        ap_paybill.put("pk_org", pk_org); //组织编码,必选
-        ap_paybill.put("billdate", billdate); //单据日期
-        ap_paybill.put("def2", srcsystemid); //外系统单据号,必填,
-        json.put("ap_paybill", ap_paybill);
-
-        JSONArray ap_payitem = new JSONArray();
-        JSONObject ap_payitemJson = new JSONObject();
-        ap_payitemJson.put("srcsystemid", srcsystemid); //外系统子表标识
-        ap_payitemJson.put("scomment", "小二"); //客户名称,必选
-        ap_payitemJson.put("pk_subjcode", "AJ001"); //收支项目编码,必选
-        ap_payitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
-        ap_payitemJson.put("customer", "tyxydm00002"); //客商的纳税人识别号
-        ap_payitemJson.put("money_de", "200"); //金额,必选
-        ap_payitemJson.put("taxrate", "10"); //税率,必选,无税传0
-        ap_payitemJson.put("pk_balatype", "0"); //结算方式,必选,使用默认账号付款则结算方式为银企直联
-        ap_payitemJson.put("pk_recpaytype", "004"); //付款业务类型传默认值“001”
-        ap_payitemJson.put("prepay", "0"); //默认值0
-        ap_payitemJson.put("payaccount", "2019219219212323"); //付款银行账号,必选
-        ap_payitemJson.put("checktype", "5"); //票据类型,必选,看云文档票据类型
-        ap_payitemJson.put("checkno", number); //票据号,必选
-        ap_payitemJson.put("def11", "1300419721555869696"); //转出前房号编码,必选
-        ap_payitemJson.put("def9", "001"); //业态,必选,看云文档业态
-        ap_payitemJson.put("def10", "mwjyAdk"); //项目档案编码,看云文档项目档案对照
-        ap_payitem.add(ap_payitemJson);
-        json.put("ap_payitem", ap_payitem);
 
         log.info("付款单接口_退款单传参:{}", json.toJSONString());
         String result = util.getAPIRetrun(token, json.toJSONString());
         log.info("付款单接口_退款单:{}", result);
+        return result;
     }
 
     /**

+ 1 - 4
pro-base/src/main/java/com/idea/paymentManagement/controller/RefundDetailController.java

@@ -1,14 +1,11 @@
 package com.idea.paymentManagement.controller;
 
-import com.idea.buildManage.model.ParkRoom;
-import com.idea.buildManage.response.ParkRoomResponse;
 import com.idea.paymentManagement.model.RefundDetail;
-import com.idea.paymentManagement.model.RefundDetailDto;
+import com.idea.paymentManagement.dto.RefundDetailDto;
 import com.idea.paymentManagement.service.RefundDetailService;
 import com.rockstar.common.base.BaseController;
 import com.rockstar.frame.model.extend.DateTrans;
 import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.PostMapping;

+ 15 - 0
pro-base/src/main/java/com/idea/paymentManagement/dto/RefundDetailDto.java

@@ -0,0 +1,15 @@
+package com.idea.paymentManagement.dto;
+
+import com.idea.paymentManagement.model.RefundDetail;
+import lombok.Data;
+
+@Data
+public class RefundDetailDto extends RefundDetail {
+
+    private String uuid;
+
+
+
+
+
+}

+ 4 - 0
pro-base/src/main/java/com/idea/paymentManagement/dto/RefundManageDto.java

@@ -18,4 +18,8 @@ public class RefundManageDto extends RefundManage {
 
     private String createdName;
 
+    private String refundDetailId;
+
+    private Integer contentType;
+
 }

+ 2 - 0
pro-base/src/main/java/com/idea/paymentManagement/model/RefundDetail.java

@@ -14,6 +14,8 @@ public class RefundDetail implements Serializable {
 
     private String type;
 
+    private Integer contentType;
+
     private BigDecimal receivedAmount;
 
     private BigDecimal deductible;

+ 0 - 14
pro-base/src/main/java/com/idea/paymentManagement/model/RefundDetailDto.java

@@ -1,14 +0,0 @@
-package com.idea.paymentManagement.model;
-
-import lombok.Data;
-
-@Data
-public class RefundDetailDto extends RefundDetail{
-
-    private String uuid;
-
-
-
-
-
-}

+ 60 - 0
pro-base/src/main/java/com/idea/paymentManagement/model/RefundDetailExample.java

@@ -316,6 +316,66 @@ public class RefundDetailExample {
             return (Criteria) this;
         }
 
+        public Criteria andContentTypeIsNull() {
+            addCriterion("content_type is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentTypeIsNotNull() {
+            addCriterion("content_type is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentTypeEqualTo(Integer value) {
+            addCriterion("content_type =", value, "contentType");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentTypeNotEqualTo(Integer value) {
+            addCriterion("content_type <>", value, "contentType");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentTypeGreaterThan(Integer value) {
+            addCriterion("content_type >", value, "contentType");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("content_type >=", value, "contentType");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentTypeLessThan(Integer value) {
+            addCriterion("content_type <", value, "contentType");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("content_type <=", value, "contentType");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentTypeIn(List<Integer> values) {
+            addCriterion("content_type in", values, "contentType");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentTypeNotIn(List<Integer> values) {
+            addCriterion("content_type not in", values, "contentType");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentTypeBetween(Integer value1, Integer value2) {
+            addCriterion("content_type between", value1, value2, "contentType");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("content_type not between", value1, value2, "contentType");
+            return (Criteria) this;
+        }
+
         public Criteria andReceivedAmountIsNull() {
             addCriterion("received_amount is null");
             return (Criteria) this;

+ 1 - 1
pro-base/src/main/java/com/idea/paymentManagement/service/RefundDetailService.java

@@ -4,7 +4,7 @@ import cn.hutool.core.util.IdUtil;
 import com.idea.customerManagement.mapper.ContractManageMapper;
 import com.idea.customerManagement.model.ContractManage;
 import com.idea.customerManagement.model.ContractManageExample;
-import com.idea.customerManagement.model.CustomerManagementExample;
+import com.idea.paymentManagement.dto.RefundDetailDto;
 import com.idea.paymentManagement.mapper.PayLogExtendMapper;
 import com.idea.paymentManagement.mapper.PayLogMapper;
 import com.idea.paymentManagement.mapper.RefundDetailMapper;

+ 43 - 0
pro-base/src/main/java/com/idea/transactionRecordManage/controller/TransactionRecordController.java

@@ -6,6 +6,7 @@ import com.idea.buildManage.response.ParkRoomResponse;
 import com.idea.transactionRecordManage.service.TransactionRecordService;
 import com.idea.transactionRecordManage.vo.NccRecordVo;
 import com.rockstar.common.base.BaseController;
+import com.rockstar.common.domain.AjaxResult;
 import com.rockstar.frame.model.extend.DateTrans;
 import com.rockstar.frame.model.extend.TableSplitResult;
 import com.rockstar.frame.model.extend.Tablepar;
@@ -47,10 +48,52 @@ public class TransactionRecordController extends BaseController  {
     }
 
 
+    /**
+     * 退款记录
+     * @param model
+     * @return
+     */
+    @PostMapping(value = "refundRecord", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public Object refundRecord(Tablepar tablepar, NccRecordVo model) {
+        PageInfo<NccRecordVo> page = modelService.refundRecord(tablepar, model);
+        TableSplitResult<NccRecordVo> result = new TableSplitResult<NccRecordVo>(page.getPageNum(), page.getTotal(), page.getList());
+        return result;
+    }
 
+    @PostMapping(value = "refundRecordListAll", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public Object refundRecordListAll(NccRecordVo model) {
+        List<NccRecordVo> list = modelService.collectionRecordListAll(model);
+        return list;
+    }
 
+    /**
+     * 收款记录 ncc提交
+     * @param collectionDateFrom
+     * @param collectionDateTo
+     * @return
+     */
+    @PostMapping(value = "collectionRecordSubmit", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public AjaxResult collectionRecordSubmit(String collectionDateFrom, String collectionDateTo) {
+        modelService.collectionRecordSubmit(collectionDateFrom, collectionDateTo);
+        return AjaxResult.success();
+    }
 
 
+    /**
+     * 退款记录 ncc提交
+     * @param collectionDateFrom
+     * @param collectionDateTo
+     * @return
+     */
+    @PostMapping(value = "refundRecordSubmit", produces = {"application/json;charset=UTF-8"})
+    @ResponseBody
+    public AjaxResult refundRecordSubmit(String collectionDateFrom, String collectionDateTo) {
+        modelService.refundRecordSubmit(collectionDateFrom, collectionDateTo);
+        return AjaxResult.success();
+    }
 
 
 }

+ 12 - 0
pro-base/src/main/java/com/idea/transactionRecordManage/mapper/TransactionRecordMapper.java

@@ -1,6 +1,9 @@
 package com.idea.transactionRecordManage.mapper;
 
+import com.idea.paymentManagement.dto.RefundManageDto;
+import com.idea.paymentManagement.model.PayLog;
 import com.idea.transactionRecordManage.vo.NccRecordVo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -8,5 +11,14 @@ public interface TransactionRecordMapper {
 
     List<NccRecordVo> collectionRecord(NccRecordVo model);
 
+    List<PayLog> listByDate(@Param("startDate") String startDate,
+                            @Param("endDate") String endDate);
+
+
+    List<NccRecordVo> reFundRecord(NccRecordVo model);
+
+
+    List<RefundManageDto> refundListByDate(@Param("startDate") String startDate,
+                                     @Param("endDate") String endDate);
 
 }

+ 294 - 0
pro-base/src/main/java/com/idea/transactionRecordManage/service/TransactionRecordService.java

@@ -1,20 +1,43 @@
 package com.idea.transactionRecordManage.service;
 
+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.response.ParkRoomResponse;
+import com.idea.customerManagement.mapper.CustomerManagementMapper;
+import com.idea.customerManagement.model.Buyer;
+import com.idea.customerManagement.model.BuyerExample;
+import com.idea.customerManagement.model.CustomerManagement;
+import com.idea.customerManagement.service.BuyerService;
+import com.idea.invoice.util.InvoiceConstant;
+import com.idea.invoice.util.InvoiceUtil;
+import com.idea.paymentManagement.dto.RefundManageDto;
+import com.idea.paymentManagement.mapper.PayLogMapper;
+import com.idea.paymentManagement.mapper.RefundDetailMapper;
+import com.idea.paymentManagement.model.PayLog;
+import com.idea.paymentManagement.model.RefundDetail;
+import com.idea.paymentManagement.service.PayLogService;
 import com.idea.transactionRecordManage.mapper.TransactionRecordMapper;
 import com.idea.transactionRecordManage.vo.NccRecordVo;
+import com.idea.util.DateUtils;
+import com.rockstar.common.domain.AjaxResult;
 import com.rockstar.frame.model.extend.Tablepar;
+import com.rockstar.shiro.util.ShiroUtils;
 import com.rockstar.system.service.SysDictService;
+import com.rockstar.util.SnowflakeIdWorker;
 import com.rockstar.util.StringUtils;
+import lombok.extern.slf4j.Slf4j;
 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;
 
+@Slf4j
 @Service
 public class TransactionRecordService {
 
@@ -22,6 +45,14 @@ public class TransactionRecordService {
     private TransactionRecordMapper modelMapper;
     @Autowired
     private SysDictService sysDictService;
+    @Autowired
+    private CustomerManagementMapper customerManagementMapper;
+    @Autowired
+    private BuyerService buyerService;
+    @Autowired
+    private PayLogMapper payLogMapper;
+    @Autowired
+    private RefundDetailMapper refundDetailMapper;
 
     /**
      * 收款记录
@@ -64,4 +95,267 @@ public class TransactionRecordService {
         return list;
     }
 
+    /**
+     * 退款记录
+     * @param tablepar
+     * @param model
+     * @return
+     */
+    public PageInfo<NccRecordVo> refundRecord(Tablepar tablepar, NccRecordVo model) {
+
+        List<Map<String, String>> contentType = sysDictService.selectDictList("CONTENT_TYPE");
+        PageHelper.startPage(tablepar.getPageNum(), tablepar.getPageSize());
+        if(StringUtils.isNotEmpty(model.getDiscIds())){
+            List<String> list = Arrays.asList(model.getDiscIds().split(","));
+            model.setDiscIdList(list);
+        }
+        // 收款记录
+        List<NccRecordVo> list = modelMapper.reFundRecord(model);
+        for (NccRecordVo recordVo : list) {
+            for(Map<String, String> map : contentType){
+                if(recordVo.getContentType().equals(map.get("value"))){
+                    recordVo.setContentType(map.get("label"));
+                }
+            }
+        }
+        PageInfo<NccRecordVo> pageInfo = new PageInfo<>(list);
+        return pageInfo;
+    }
+
+    public List<NccRecordVo> refundRecordListAll(Tablepar tablepar, NccRecordVo model) {
+
+        List<Map<String, String>> contentType = sysDictService.selectDictList("CONTENT_TYPE");
+        if(StringUtils.isNotEmpty(model.getDiscIds())){
+            List<String> list = Arrays.asList(model.getDiscIds().split(","));
+            model.setDiscIdList(list);
+        }
+        // 收款记录
+        List<NccRecordVo> list = modelMapper.reFundRecord(model);
+        for (NccRecordVo recordVo : list) {
+            for(Map<String, String> map : contentType){
+                if(recordVo.getContentType().equals(map.get("value"))){
+                    recordVo.setContentType(map.get("label"));
+                }
+            }
+        }
+        return list;
+    }
+
+
+    /**
+     * 收款记录 ncc提交
+     * @param collectionDateFrom
+     * @param collectionDateTo
+     * @return
+     */
+    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;
+            }
+
+
+            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是否必填,必选
+            // TODO: 2024/11/19 客商的纳税人识别号 待定 
+            ar_gatheritemJson.put("customer", ""); //客商的纳税人识别号
+            ar_gatheritemJson.put("money_cr", payLog.getPayMoney()); //金额,必选
+            // TODO: 2024/11/19 税率待定
+            ar_gatheritemJson.put("taxrate", ""); //税率,必选,数字——3/10/6````
+            // TODO: 2024/11/19 结算方式 待定
+            ar_gatheritemJson.put("pk_balatype", ""); //结算方式,必选,看云文档结算方式
+            ar_gatheritemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
+            ar_gatheritemJson.put("prepay", "1"); //收款性质应收款时传"0",收款性质预收款时传"1"
+            ar_gatheritemJson.put("recaccount", payLog.getBankNumber()); //收款银行账号,必填
+//        ar_gatheritemJson.put("invoiceno","fphm"); //发票号码,非必选
+            ar_gatheritemJson.put("scomment", buyer.getName()); //客户名称,必选
+            ar_gatheritemJson.put("pk_subjcode", pk_subjcode); //收款类型
+            // TODO: 2024/11/19 票据类型 待定 
+            ar_gatheritemJson.put("checktype", InvoiceConstant.INVOICE_RECEIPT_TYPE_3); //票据类型,必选,看云文档票据类型
+            ar_gatheritemJson.put("checkno", payLog.getSerialNumber()); //票据号,必选
+            ar_gatheritemJson.put("def9", InvoiceConstant.INVOICE_BUSINESS_FORMAT_001); //业态,必选,看云文档业态
+            // TODO: 2024/11/19 房间户编号? 待定
+            ar_gatheritemJson.put("def11", ""); //转出前房号编码,收除了诚意金之外的首期等需要选
+            // TODO: 2024/11/14 项目档案编码 待定
+            ar_gatheritemJson.put("def10", InvoiceConstant.INVOICE_PROJECT_CODE_mwjyAdk); //项目档案编码,看云文档项目档案对照
+//        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);
+            }
+
+        }
+
+        return 1;
+    }
+
+    /**
+     * 退款记录推送
+     * @param collectionDateFrom
+     * @param collectionDateTo
+     * @return
+     */
+    public int refundRecordSubmit(String collectionDateFrom, String collectionDateTo) {
+
+        Map<String, String> cusIdMap = buyerService.getCusIdMap();
+
+        List<RefundManageDto> refundManages = modelMapper.refundListByDate(collectionDateFrom, collectionDateTo);
+        for (RefundManageDto refundManage : refundManages){
+            String billdate = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, new Date());
+            String number = SnowflakeIdWorker.getUUID();
+            String scomment = "";
+            if (cusIdMap.containsKey(refundManage.getCustomerManagementId())){
+                scomment = cusIdMap.get(refundManage.getCustomerManagementId());
+            }
+
+            String pk_subjcode = "";
+            // 定金
+            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;
+            }
+
+            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", scomment); //客户名称,必选
+            ap_payitemJson.put("pk_subjcode", pk_subjcode); //收支项目编码,必选
+            ap_payitemJson.put("objtype", "0"); //0=客户,1=供应商--判断customer和supplier是否必填,必选
+            // TODO: 2024/11/19 纳税人识别号 待定
+            ap_payitemJson.put("customer", ""); //客商的纳税人识别号
+            ap_payitemJson.put("money_de", refundManage.getActualRefundAmount()); //金额,必选
+            // TODO: 2024/11/19 税率待定
+            ap_payitemJson.put("taxrate", ""); //税率,必选,无税传0
+            ap_payitemJson.put("pk_balatype", "4"); //结算方式,必选,默认是4
+            ap_payitemJson.put("pk_recpaytype", "001"); //付款业务类型传默认值“001”
+            ap_payitemJson.put("prepay", "0"); //默认值0
+            ap_payitemJson.put("payaccount", refundManage.getBankNumber()); //付款银行账号,必选
+            // TODO: 2024/11/19 票据类型 待定 
+            ap_payitemJson.put("checktype", ""); //票据类型,必选,看云文档票据类型
+            ap_payitemJson.put("checkno", number); //票据号,必选
+            // TODO: 2024/11/19 房间户编号? 待定
+            ap_payitemJson.put("def11", ""); //转出前房号编码,必选
+            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);
+            }
+
+        }
+        return 1;
+
+    }
+
 }

+ 9 - 0
pro-base/src/main/resources/mybatis/customerManagement/BuyerExtendMapper.xml

@@ -5,4 +5,13 @@
   <select id="idNumberList" resultType="java.lang.String">
     select distinct(identity_card)  from buyer
   </select>
+
+    <select id="getCusIdMap" resultType="com.idea.customerManagement.model.Buyer">
+      SELECT
+        *
+      FROM
+          ( SELECT * FROM buyer ORDER BY order_num ASC ) t
+      GROUP BY
+        t.customer_management_id
+    </select>
 </mapper>

+ 3 - 1
pro-base/src/main/resources/mybatis/customerManagement/CustomerManagementExtendMapper.xml

@@ -5,8 +5,10 @@
 
   <select id="listByModel" resultType="com.idea.customerManagement.dto.CustomerManagementDto">
     select customer_management.*,
-           concat(park_info.group_name,park_floor_disc.name) groupDiscName
+           concat(park_info.group_name,park_floor_disc.name) groupDiscName,
+           intentional_deposit.status intentional_deposit_status
     from customer_management
+    left join intentional_deposit on intentional_deposit.customer_management_id = customer_management.id
     left join park_info on park_info.id = customer_management.group_id
     left join park_floor_disc on park_floor_disc.id = customer_management.disc_id
     <where>

+ 30 - 13
pro-base/src/main/resources/mybatis/paymentManagement/RefundDetailMapper.xml

@@ -5,6 +5,7 @@
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="refund_manage_id" jdbcType="VARCHAR" property="refundManageId" />
     <result column="type" jdbcType="VARCHAR" property="type" />
+    <result column="content_type" jdbcType="INTEGER" property="contentType" />
     <result column="received_amount" jdbcType="DECIMAL" property="receivedAmount" />
     <result column="deductible" jdbcType="DECIMAL" property="deductible" />
     <result column="actual_refund_amount" jdbcType="DECIMAL" property="actualRefundAmount" />
@@ -79,9 +80,9 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, refund_manage_id, type, received_amount, deductible, actual_refund_amount, created_id,
-    created_at, updated_at, updated_id, nc_submit_status, nc_submit_date, nc_submit_name,
-    is_hide
+    id, refund_manage_id, type, content_type, received_amount, deductible, actual_refund_amount,
+    created_id, created_at, updated_at, updated_id, nc_submit_status, nc_submit_date,
+    nc_submit_name, is_hide
   </sql>
   <sql id="Blob_Column_List">
     nc_json
@@ -136,17 +137,17 @@
   </delete>
   <insert id="insert" parameterType="com.idea.paymentManagement.model.RefundDetail">
     insert into refund_detail (id, refund_manage_id, type,
-                               received_amount, deductible, actual_refund_amount,
-                               created_id, created_at, updated_at,
-                               updated_id, nc_submit_status, nc_submit_date,
-                               nc_submit_name, is_hide, nc_json
-    )
+                               content_type, received_amount, deductible,
+                               actual_refund_amount, created_id, created_at,
+                               updated_at, updated_id, nc_submit_status,
+                               nc_submit_date, nc_submit_name, is_hide,
+                               nc_json)
     values (#{id,jdbcType=VARCHAR}, #{refundManageId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
-            #{receivedAmount,jdbcType=DECIMAL}, #{deductible,jdbcType=DECIMAL}, #{actualRefundAmount,jdbcType=DECIMAL},
-            #{createdId,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
-            #{updatedId,jdbcType=VARCHAR}, #{ncSubmitStatus,jdbcType=INTEGER}, #{ncSubmitDate,jdbcType=TIMESTAMP},
-            #{ncSubmitName,jdbcType=VARCHAR}, #{isHide,jdbcType=INTEGER}, #{ncJson,jdbcType=LONGVARCHAR}
-           )
+            #{contentType,jdbcType=INTEGER}, #{receivedAmount,jdbcType=DECIMAL}, #{deductible,jdbcType=DECIMAL},
+            #{actualRefundAmount,jdbcType=DECIMAL}, #{createdId,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
+            #{updatedAt,jdbcType=TIMESTAMP}, #{updatedId,jdbcType=VARCHAR}, #{ncSubmitStatus,jdbcType=INTEGER},
+            #{ncSubmitDate,jdbcType=TIMESTAMP}, #{ncSubmitName,jdbcType=VARCHAR}, #{isHide,jdbcType=INTEGER},
+            #{ncJson,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.idea.paymentManagement.model.RefundDetail">
     insert into refund_detail
@@ -160,6 +161,9 @@
       <if test="type != null">
         type,
       </if>
+      <if test="contentType != null">
+        content_type,
+      </if>
       <if test="receivedAmount != null">
         received_amount,
       </if>
@@ -207,6 +211,9 @@
       <if test="type != null">
         #{type,jdbcType=VARCHAR},
       </if>
+      <if test="contentType != null">
+        #{contentType,jdbcType=INTEGER},
+      </if>
       <if test="receivedAmount != null">
         #{receivedAmount,jdbcType=DECIMAL},
       </if>
@@ -263,6 +270,9 @@
       <if test="record.type != null">
         type = #{record.type,jdbcType=VARCHAR},
       </if>
+      <if test="record.contentType != null">
+        content_type = #{record.contentType,jdbcType=INTEGER},
+      </if>
       <if test="record.receivedAmount != null">
         received_amount = #{record.receivedAmount,jdbcType=DECIMAL},
       </if>
@@ -309,6 +319,7 @@
     set id = #{record.id,jdbcType=VARCHAR},
     refund_manage_id = #{record.refundManageId,jdbcType=VARCHAR},
     type = #{record.type,jdbcType=VARCHAR},
+    content_type = #{record.contentType,jdbcType=INTEGER},
     received_amount = #{record.receivedAmount,jdbcType=DECIMAL},
     deductible = #{record.deductible,jdbcType=DECIMAL},
     actual_refund_amount = #{record.actualRefundAmount,jdbcType=DECIMAL},
@@ -330,6 +341,7 @@
     set id = #{record.id,jdbcType=VARCHAR},
     refund_manage_id = #{record.refundManageId,jdbcType=VARCHAR},
     type = #{record.type,jdbcType=VARCHAR},
+    content_type = #{record.contentType,jdbcType=INTEGER},
     received_amount = #{record.receivedAmount,jdbcType=DECIMAL},
     deductible = #{record.deductible,jdbcType=DECIMAL},
     actual_refund_amount = #{record.actualRefundAmount,jdbcType=DECIMAL},
@@ -354,6 +366,9 @@
       <if test="type != null">
         type = #{type,jdbcType=VARCHAR},
       </if>
+      <if test="contentType != null">
+        content_type = #{contentType,jdbcType=INTEGER},
+      </if>
       <if test="receivedAmount != null">
         received_amount = #{receivedAmount,jdbcType=DECIMAL},
       </if>
@@ -397,6 +412,7 @@
     update refund_detail
     set refund_manage_id = #{refundManageId,jdbcType=VARCHAR},
         type = #{type,jdbcType=VARCHAR},
+        content_type = #{contentType,jdbcType=INTEGER},
         received_amount = #{receivedAmount,jdbcType=DECIMAL},
         deductible = #{deductible,jdbcType=DECIMAL},
         actual_refund_amount = #{actualRefundAmount,jdbcType=DECIMAL},
@@ -415,6 +431,7 @@
     update refund_detail
     set refund_manage_id = #{refundManageId,jdbcType=VARCHAR},
         type = #{type,jdbcType=VARCHAR},
+        content_type = #{contentType,jdbcType=INTEGER},
         received_amount = #{receivedAmount,jdbcType=DECIMAL},
         deductible = #{deductible,jdbcType=DECIMAL},
         actual_refund_amount = #{actualRefundAmount,jdbcType=DECIMAL},

+ 42 - 1
pro-base/src/main/resources/mybatis/transactionRecord/TransactionRecord.xml

@@ -35,7 +35,7 @@
                 AND p.pay_time &lt;= #{collectionDateTo}
             </if>
             <if test="buyerName != null and buyerName != ''">
-                AND cm.buyer_name = #{buyerName}
+                AND cm.buyer_name like concat('%',#{buyerName},'%')
             </if>
             <if test="contentType != null and contentType != ''">
                 AND p.content_type = #{contentType}
@@ -46,7 +46,48 @@
         </where>
     </select>
 
+    <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')
+    </select>
+
+    <select id="reFundRecord" resultType="com.idea.transactionRecordManage.vo.NccRecordVo">
+        SELECT
+            d.*,
+            r.customer_management_id,
+            r.house_id,
+            r.buyer_name,
+            r.bank_number
+        FROM
+            refund_detail d
+        LEFT JOIN refund_manage r ON d.refund_manage_id = r.id
+        LEFT JOIN frame_user u on u.id = d.created_id
+        LEFT JOIN park_room pr on pr.id = r.house_id
+        <where>
+            <if test="discIdList != null">
+                AND pr.disc_id in
+                <foreach collection="discIdList" open="(" close=")" separator="," item="item">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="collectionDateFrom != null and collectionDateFrom != ''">
+                AND d.created_at >= #{collectionDateFrom}
+            </if>
+            <if test="collectionDateTo != null and collectionDateTo != ''">
+                AND d.created_at &lt;= #{collectionDateTo}
+            </if>
+            <if test="buyerName != null and buyerName != ''">
+                AND r.buyer_name like concat('%',#{buyerName},'%')
+            </if>
+            <if test="contentType != null and contentType != ''">
+                AND d.content_type = #{contentType}
+            </if>
+        </where>
+    </select>
 
+    <select id="refundListByDate" resultType="com.idea.paymentManagement.dto.RefundManageDto">
+
+    </select>
 
 
 </mapper>

+ 2 - 2
pro-wx/src/main/java/com/idea/pro/wx/controller/customerManagement/WxRoomSelectionInfoController.java

@@ -48,8 +48,8 @@ public class WxRoomSelectionInfoController extends BaseController {
      */
     @PostMapping(value = "submit",produces = {"application/json;charset=UTF-8"})
     @ResponseBody
-    public AjaxResult submit(String houseIds, String customerManagementId){
-        int result = modelService.submit(houseIds,customerManagementId);
+    public AjaxResult submit(String houseIds, String customerManagementId, String userId){
+        int result = modelService.submit(houseIds,customerManagementId,userId);
         return result(result);
     }