LAPTOP-FO2T5SIU\35838 il y a 7 mois
Parent
commit
54addb1de8

+ 2 - 0
pro-base/src/main/java/com/idea/paymentManagement/dto/PayLogDto.java

@@ -35,4 +35,6 @@ public class PayLogDto extends PayLog {
 
     private String createdName;
 
+    private String pkInformerId;
+
 }

+ 4 - 166
pro-base/src/main/java/com/idea/paymentManagement/model/PayLog.java

@@ -1,12 +1,14 @@
 package com.idea.paymentManagement.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 PayLog implements Serializable {
     private String id;
 
@@ -54,173 +56,9 @@ public class PayLog implements Serializable {
 
     private String fileList;
 
-    private static final long serialVersionUID = 1L;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id == null ? null : id.trim();
-    }
-
-    public String getHouseId() {
-        return houseId;
-    }
-
-    public void setHouseId(String houseId) {
-        this.houseId = houseId == null ? null : houseId.trim();
-    }
-
-    public String getContractId() {
-        return contractId;
-    }
-
-    public void setContractId(String contractId) {
-        this.contractId = contractId == null ? null : contractId.trim();
-    }
-
-    public String getCustomerManagementId() {
-        return customerManagementId;
-    }
-
-    public void setCustomerManagementId(String customerManagementId) {
-        this.customerManagementId = customerManagementId == null ? null : customerManagementId.trim();
-    }
-
-    public Integer getPayType() {
-        return payType;
-    }
-
-    public void setPayType(Integer payType) {
-        this.payType = payType;
-    }
-
-    public Integer getContentType() {
-        return contentType;
-    }
-
-    public void setContentType(Integer contentType) {
-        this.contentType = contentType;
-    }
-
-    public String getBankName() {
-        return bankName;
-    }
-
-    public void setBankName(String bankName) {
-        this.bankName = bankName == null ? null : bankName.trim();
-    }
-
-    public String getBankBranchName() {
-        return bankBranchName;
-    }
-
-    public void setBankBranchName(String bankBranchName) {
-        this.bankBranchName = bankBranchName == null ? null : bankBranchName.trim();
-    }
-
-    public String getBankNumber() {
-        return bankNumber;
-    }
-
-    public void setBankNumber(String bankNumber) {
-        this.bankNumber = bankNumber == null ? null : bankNumber.trim();
-    }
-
-    public BigDecimal getPayMoney() {
-        return payMoney;
-    }
-
-    public void setPayMoney(BigDecimal payMoney) {
-        this.payMoney = payMoney;
-    }
+    private String ncJson;
 
-    public Date getPayTime() {
-        return payTime;
-    }
-
-    public void setPayTime(Date payTime) {
-        this.payTime = payTime;
-    }
-
-    public Integer getPaymentMethod() {
-        return paymentMethod;
-    }
-
-    public void setPaymentMethod(Integer paymentMethod) {
-        this.paymentMethod = paymentMethod;
-    }
-
-    public Integer getStatus() {
-        return status;
-    }
-
-    public void setStatus(Integer status) {
-        this.status = status;
-    }
-
-    public Integer getPaymentStatus() {
-        return paymentStatus;
-    }
-
-    public void setPaymentStatus(Integer paymentStatus) {
-        this.paymentStatus = paymentStatus;
-    }
-
-    public String getSerialNumber() {
-        return serialNumber;
-    }
-
-    public void setSerialNumber(String serialNumber) {
-        this.serialNumber = serialNumber == null ? null : serialNumber.trim();
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark == null ? null : remark.trim();
-    }
-
-    public String getCreatedBy() {
-        return createdBy;
-    }
-
-    public void setCreatedBy(String createdBy) {
-        this.createdBy = createdBy == null ? null : createdBy.trim();
-    }
-
-    public Date getCreatedAt() {
-        return createdAt;
-    }
-
-    public void setCreatedAt(Date createdAt) {
-        this.createdAt = createdAt;
-    }
-
-    public String getUpdatedBy() {
-        return updatedBy;
-    }
-
-    public void setUpdatedBy(String updatedBy) {
-        this.updatedBy = updatedBy == null ? null : updatedBy.trim();
-    }
-
-    public Date getUpdatedAt() {
-        return updatedAt;
-    }
-
-    public void setUpdatedAt(Date updatedAt) {
-        this.updatedAt = updatedAt;
-    }
+    private static final long serialVersionUID = 1L;
 
-    public String getFileList() {
-        return fileList;
-    }
 
-    public void setFileList(String fileList) {
-        this.fileList = fileList == null ? null : fileList.trim();
-    }
 }

+ 97 - 0
pro-base/src/main/java/com/idea/paymentManagement/service/PayLogService.java

@@ -3,17 +3,21 @@ package com.idea.paymentManagement.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;
 import com.idea.buildManage.mapper.ParkInfoMapper;
 import com.idea.buildManage.mapper.ParkRoomExtendMapper;
+import com.idea.buildManage.mapper.ParkRoomMapper;
 import com.idea.buildManage.model.ParkFloorDisc;
 import com.idea.buildManage.model.ParkInfo;
 import com.idea.buildManage.model.ParkInfoExample;
 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.mapper.ContractManageMapper;
 import com.idea.customerManagement.mapper.CustomerManagementMapper;
 import com.idea.customerManagement.model.*;
@@ -24,6 +28,8 @@ import com.idea.invoice.model.InvoiceManageExample;
 import com.idea.invoice.model.ReceiptManage;
 import com.idea.invoice.service.InvoiceManageService;
 import com.idea.invoice.service.ReceiptManageService;
+import com.idea.invoice.util.InvoiceConstant;
+import com.idea.invoice.util.InvoiceUtil;
 import com.idea.paymentManagement.dto.PayLogDto;
 import com.idea.paymentManagement.mapper.PayLogExtendMapper;
 import com.idea.paymentManagement.mapper.PayLogMapper;
@@ -33,6 +39,7 @@ 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;
@@ -78,6 +85,8 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
     @Autowired
     private ParkRoomExtendMapper roomExtendMapper;
     @Autowired
+    private ParkRoomMapper roomMapper;
+    @Autowired
     private ParkInfoMapper parkInfoMapper;
     @Autowired
     private ParkFloorDiscMapper parkFloorDiscMapper;
@@ -436,5 +445,93 @@ public class PayLogService implements BaseService<PayLog, PayLogExample> {
 
     }
 
+    public AjaxResult sendVoucher(PayLogDto model) {
+
+        // 银行流水id
+        String pkInformerId = model.getPkInformerId();
+        PayLog payLog = selectByPrimaryKey(model.getId());
+        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;
+        }
+
+
+        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", payLog.getPayMoney()); //金额,必选
+        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", 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", 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")){
+                payLog.setNcJson(result);
+                updateByPrimaryKeySelective(payLog);
+            }
+
+        } catch (Exception e) {
+            log.error("收诚意金凭证推送报错",e);
+            return AjaxResult.error(e.getMessage());
+        }
+        return AjaxResult.success();
+    }
+
+
+
+
+
+
+
+
 
 }

+ 22 - 7
pro-base/src/main/resources/mybatis/paymentManagement/PayLogMapper.xml

@@ -25,6 +25,7 @@
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.idea.paymentManagement.model.PayLog">
     <result column="file_list" jdbcType="LONGVARCHAR" property="fileList" />
+    <result column="nc_json" jdbcType="LONGVARCHAR" property="ncJson" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -90,7 +91,7 @@
     serial_number, remark, created_by, created_at, updated_by, updated_at
   </sql>
   <sql id="Blob_Column_List">
-    file_list
+    file_list, nc_json
   </sql>
   <select id="selectByExampleWithBLOBs" parameterType="com.idea.paymentManagement.model.PayLogExample" resultMap="ResultMapWithBLOBs">
     select
@@ -147,16 +148,16 @@
                          pay_money, pay_time, payment_method,
                          status, payment_status, serial_number,
                          remark, created_by, created_at,
-                         updated_by, updated_at, file_list
-    )
+                         updated_by, updated_at, file_list,
+                         nc_json)
     values (#{id,jdbcType=VARCHAR}, #{houseId,jdbcType=VARCHAR}, #{contractId,jdbcType=VARCHAR},
             #{customerManagementId,jdbcType=VARCHAR}, #{payType,jdbcType=INTEGER}, #{contentType,jdbcType=INTEGER},
             #{bankName,jdbcType=VARCHAR}, #{bankBranchName,jdbcType=VARCHAR}, #{bankNumber,jdbcType=CHAR},
             #{payMoney,jdbcType=DECIMAL}, #{payTime,jdbcType=TIMESTAMP}, #{paymentMethod,jdbcType=INTEGER},
             #{status,jdbcType=INTEGER}, #{paymentStatus,jdbcType=INTEGER}, #{serialNumber,jdbcType=VARCHAR},
             #{remark,jdbcType=VARCHAR}, #{createdBy,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
-            #{updatedBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{fileList,jdbcType=LONGVARCHAR}
-           )
+            #{updatedBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{fileList,jdbcType=LONGVARCHAR},
+            #{ncJson,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.idea.paymentManagement.model.PayLog">
     insert into pay_log
@@ -224,6 +225,9 @@
       <if test="fileList != null">
         file_list,
       </if>
+      <if test="ncJson != null">
+        nc_json,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -289,6 +293,9 @@
       <if test="fileList != null">
         #{fileList,jdbcType=LONGVARCHAR},
       </if>
+      <if test="ncJson != null">
+        #{ncJson,jdbcType=LONGVARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.idea.paymentManagement.model.PayLogExample" resultType="java.lang.Long">
@@ -363,6 +370,9 @@
       <if test="record.fileList != null">
         file_list = #{record.fileList,jdbcType=LONGVARCHAR},
       </if>
+      <if test="record.ncJson != null">
+        nc_json = #{record.ncJson,jdbcType=LONGVARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -390,7 +400,8 @@
     created_at = #{record.createdAt,jdbcType=TIMESTAMP},
     updated_by = #{record.updatedBy,jdbcType=VARCHAR},
     updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
-    file_list = #{record.fileList,jdbcType=LONGVARCHAR}
+    file_list = #{record.fileList,jdbcType=LONGVARCHAR},
+    nc_json = #{record.ncJson,jdbcType=LONGVARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -484,6 +495,9 @@
       <if test="fileList != null">
         file_list = #{fileList,jdbcType=LONGVARCHAR},
       </if>
+      <if test="ncJson != null">
+        nc_json = #{ncJson,jdbcType=LONGVARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
@@ -508,7 +522,8 @@
         created_at = #{createdAt,jdbcType=TIMESTAMP},
         updated_by = #{updatedBy,jdbcType=VARCHAR},
         updated_at = #{updatedAt,jdbcType=TIMESTAMP},
-        file_list = #{fileList,jdbcType=LONGVARCHAR}
+        file_list = #{fileList,jdbcType=LONGVARCHAR},
+        nc_json = #{ncJson,jdbcType=LONGVARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.idea.paymentManagement.model.PayLog">