Bläddra i källkod

Merge remote-tracking branch 'origin/smb' into smb

liutao 1 månad sedan
förälder
incheckning
e02f599618

+ 5 - 5
src/main/java/com/sunxung/factoring/entity/financing/sop/QuotaDisburseReport.java

@@ -116,7 +116,7 @@ public class QuotaDisburseReport extends BaseEcommerceApiSearch {
     /**
      * 再融资计划
      */
-    private List<PaymentCollectionPlanRefinancingApi> planRefinancingApiList;
+    private List<PaymentCollectionPlanRefinancingApi> planRefinancingList;
 
     public String getBusinessNo() {
         return businessNo;
@@ -270,11 +270,11 @@ public class QuotaDisburseReport extends BaseEcommerceApiSearch {
         this.planFactoringList = planFactoringList;
     }
 
-    public List<PaymentCollectionPlanRefinancingApi> getPlanRefinancingApiList() {
-        return planRefinancingApiList;
+    public List<PaymentCollectionPlanRefinancingApi> getPlanRefinancingList() {
+        return planRefinancingList;
     }
 
-    public void setPlanRefinancingApiList(List<PaymentCollectionPlanRefinancingApi> planRefinancingApiList) {
-        this.planRefinancingApiList = planRefinancingApiList;
+    public void setPlanRefinancingList(List<PaymentCollectionPlanRefinancingApi> planRefinancingList) {
+        this.planRefinancingList = planRefinancingList;
     }
 }

+ 18 - 0
src/main/java/com/sunxung/factoring/entity/smb/FinancingLoanInfo.java

@@ -49,6 +49,12 @@ public class FinancingLoanInfo extends BaseEntity {
     @TableField("c_enterprise_id")
     private Long cEnterpriseId;
 
+    /**
+     * 供应商名称
+     */
+    @TableField(exist = false)
+    private String supplierName;
+
     /**
      * 资方ID
      */
@@ -330,6 +336,18 @@ public class FinancingLoanInfo extends BaseEntity {
         this.repayAcctType = repayAcctType;
     }
 
+    public Integer getCustomerType() {
+        return customerType;
+    }
+
+    public String getSupplierName() {
+        return supplierName;
+    }
+
+    public void setSupplierName(String supplierName) {
+        this.supplierName = supplierName;
+    }
+
     @Override
     public String toString() {
         return "FinancingLoanInfo{" +

+ 61 - 0
src/main/java/com/sunxung/factoring/entity/smb/vo/FinancingLoanInfoSearch.java

@@ -0,0 +1,61 @@
+package com.sunxung.factoring.entity.smb.vo;
+
+import com.sunxung.factoring.entity.BaseSearch;
+
+/**
+ * 资方放款信息查询类
+ */
+public class FinancingLoanInfoSearch extends BaseSearch {
+
+    /**
+     * 申请编号
+     */
+    private String payoutNo;
+
+    /**
+     * 放款日期
+     */
+    private String payoutDate;
+
+    /**
+     * 到期日期
+     */
+    private String maturityDate;
+
+    /**
+     * 放款状态
+     */
+    private String payoutStatus;
+
+    public String getPayoutNo() {
+        return payoutNo;
+    }
+
+    public void setPayoutNo(String payoutNo) {
+        this.payoutNo = payoutNo;
+    }
+
+    public String getPayoutDate() {
+        return payoutDate;
+    }
+
+    public void setPayoutDate(String payoutDate) {
+        this.payoutDate = payoutDate;
+    }
+
+    public String getMaturityDate() {
+        return maturityDate;
+    }
+
+    public void setMaturityDate(String maturityDate) {
+        this.maturityDate = maturityDate;
+    }
+
+    public String getPayoutStatus() {
+        return payoutStatus;
+    }
+
+    public void setPayoutStatus(String payoutStatus) {
+        this.payoutStatus = payoutStatus;
+    }
+}

+ 11 - 0
src/main/java/com/sunxung/factoring/mapper/smb/FinancingLoanInfoMapper.java

@@ -2,8 +2,11 @@ package com.sunxung.factoring.mapper.smb;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sunxung.factoring.entity.smb.FinancingLoanInfo;
+import com.sunxung.factoring.entity.smb.vo.FinancingLoanInfoSearch;
 import org.apache.ibatis.annotations.Mapper;
 
+import java.util.List;
+
 /**
  * <p>
  * 资方放款信息 Mapper 接口
@@ -14,4 +17,12 @@ import org.apache.ibatis.annotations.Mapper;
  */
 @Mapper
 public interface FinancingLoanInfoMapper extends BaseMapper<FinancingLoanInfo> {
+
+    /**
+     * 列表页查询
+     *
+     * @param search
+     * @return
+     */
+    List<FinancingLoanInfo> findBySearch(FinancingLoanInfoSearch search);
 }

+ 1 - 1
src/main/java/com/sunxung/factoring/service/financing/payment/impl/PaymentApplyServiceImpl.java

@@ -727,7 +727,7 @@ public class PaymentApplyServiceImpl extends ServiceImpl<PaymentApplyMapper, Pay
             if (financingLoanInfo != null && financingLoanInfo.getDueBillNo() != null) {
                 //构建再融资计划
                 List<PaymentCollectionPlanRefinancingApi> planRefinancingApiList = createPlanRefinancingApiList(openId, financingLoanInfo);
-                quotaDisburseReport.setPlanRefinancingApiList(planRefinancingApiList);
+                quotaDisburseReport.setPlanRefinancingList(planRefinancingApiList);
 
                 //构建收放款计划
                 List<PaymentCollectionPlanFactoringApi> planFactoringList = createPlanFactoringApiList(payoutDate, reviewFinancingInfo);

+ 17 - 0
src/main/java/com/sunxung/factoring/service/smb/IFinancingLoanInfoService.java

@@ -1,7 +1,9 @@
 package com.sunxung.factoring.service.smb;
 
+import com.sunxung.factoring.entity.GridPage;
 import com.sunxung.factoring.entity.smb.FinancingLoanInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.sunxung.factoring.entity.smb.vo.FinancingLoanInfoSearch;
 
 /**
  * <p>
@@ -13,4 +15,19 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IFinancingLoanInfoService extends IService<FinancingLoanInfo> {
 
+    /**
+     * 列表页查询
+     *
+     * @param search
+     * @return
+     */
+    GridPage<FinancingLoanInfo> findBySearch(FinancingLoanInfoSearch search);
+
+    /**
+     * 详情页查询
+     *
+     * @param id
+     * @return
+     */
+    FinancingLoanInfo getDetail(Long id);
 }

+ 32 - 1
src/main/java/com/sunxung/factoring/service/smb/impl/FinancingLoanInfoServiceImpl.java

@@ -1,11 +1,20 @@
 package com.sunxung.factoring.service.smb.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.sunxung.factoring.entity.GridPage;
+import com.sunxung.factoring.entity.entprise.Enterprise;
 import com.sunxung.factoring.entity.smb.FinancingLoanInfo;
+import com.sunxung.factoring.entity.smb.vo.FinancingLoanInfoSearch;
 import com.sunxung.factoring.mapper.smb.FinancingLoanInfoMapper;
+import com.sunxung.factoring.service.entprise.IEnterpriseService;
 import com.sunxung.factoring.service.smb.IFinancingLoanInfoService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 资方放款信息 服务实现类
@@ -17,4 +26,26 @@ import org.springframework.stereotype.Service;
 @Service
 public class FinancingLoanInfoServiceImpl extends ServiceImpl<FinancingLoanInfoMapper, FinancingLoanInfo> implements IFinancingLoanInfoService {
 
+    @Autowired
+    private IEnterpriseService enterpriseService;
+
+    @Override
+    public GridPage<FinancingLoanInfo> findBySearch(FinancingLoanInfoSearch search) {
+
+        Page<FinancingLoanInfo> page = PageHelper.startPage(search.getPage(), search.getRows());
+        List<FinancingLoanInfo> list = baseMapper.findBySearch(search);
+        return new GridPage<>(search.getRows(), search.getPage(), page.getTotal(), list);
+    }
+
+    @Override
+    public FinancingLoanInfo getDetail(Long id) {
+        FinancingLoanInfo financingLoanInfo = getById(id);
+        if (financingLoanInfo != null && financingLoanInfo.getcEnterpriseId() != null) {
+            Enterprise enterprise = enterpriseService.getById(financingLoanInfo.getcEnterpriseId());
+            if (enterprise != null) {
+                financingLoanInfo.setSupplierName(enterprise.getCorporateName());
+            }
+        }
+        return financingLoanInfo;
+    }
 }

+ 42 - 0
src/main/java/com/sunxung/factoring/web/smb/FinancingLoanInfoController.java

@@ -0,0 +1,42 @@
+package com.sunxung.factoring.web.smb;
+
+import com.sunxung.factoring.entity.GridPage;
+import com.sunxung.factoring.entity.smb.FinancingFromInvestors;
+import com.sunxung.factoring.entity.smb.FinancingLoanInfo;
+import com.sunxung.factoring.entity.smb.vo.FinancingFromInvestorsSearchVo;
+import com.sunxung.factoring.entity.smb.vo.FinancingLoanInfoSearch;
+import com.sunxung.factoring.service.smb.IFinancingLoanInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 资方放款信息
+ */
+
+@RestController
+@RequestMapping("/financing/loanInfo")
+public class FinancingLoanInfoController {
+
+    @Autowired
+    private IFinancingLoanInfoService financingLoanInfoService;
+
+    /**
+     * 列表页查询
+     * @param
+     * @return
+     */
+    @PostMapping("/list")
+    public GridPage<FinancingLoanInfo> findBySearch(@RequestBody FinancingLoanInfoSearch search){
+        return financingLoanInfoService.findBySearch(search);
+    }
+
+    /**
+     * 详情页查询
+     * @param
+     * @return
+     */
+    @GetMapping("/detail")
+    public FinancingLoanInfo getDetail(Long id){
+        return financingLoanInfoService.getDetail(id);
+    }
+}

+ 1 - 1
src/main/resources/application-dev.yml

@@ -21,7 +21,7 @@ spring:
     master:
       continueOnError: true
       type: com.alibaba.druid.pool.DruidDataSource
-      url: jdbc:mysql://192.168.3.5:3306/factoring_trade_v4_08_26?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
+      url: jdbc:mysql://192.168.3.5:3306/factoring_trade_v4_09_06?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
       username: root
       password: root
       driver-class-name: com.mysql.jdbc.Driver

+ 64 - 0
src/main/resources/mapper/smb/FinancingLoanInfoMapper.xml

@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.sunxung.factoring.mapper.smb.FinancingLoanInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.sunxung.factoring.entity.smb.FinancingLoanInfo">
+        <result column="id" property="id" />
+        <result column="user_create" property="userCreate" />
+        <result column="user_modified" property="userModified" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="c_financing_basic_info_id" property="cFinancingBasicInfoId" />
+        <result column="contract_no" property="contractNo" />
+        <result column="quota_disburse_batch" property="quotaDisburseBatch" />
+        <result column="customer_type" property="customerType" />
+        <result column="c_enterprise_id" property="cEnterpriseId" />
+        <result column="corporate_name" property="supplierName" />
+        <result column="financing_management_id" property="financingManagementId" />
+        <result column="financing_institution_name" property="financingInstitutionName" />
+        <result column="loan_amount" property="loanAmount" />
+        <result column="payout_no" property="payoutNo" />
+        <result column="due_bill_no" property="dueBillNo" />
+        <result column="payout_status" property="payoutStatus" />
+        <result column="fail_msg" property="failMsg" />
+        <result column="payout_date" property="payoutDate" />
+        <result column="maturity_date" property="maturityDate" />
+        <result column="loan_apply_date" property="loanApplyDate" />
+        <result column="repay_method" property="repayMethod" />
+        <result column="term" property="term" />
+        <result column="pay_way" property="payWay" />
+        <result column="payee_inner_card_flag" property="payeeInnerCardFlag" />
+        <result column="payee_acct_th_number" property="payeeAcctThNumber" />
+        <result column="payee_acct_th_name" property="payeeAcctThName" />
+        <result column="repay_acct_no" property="repayAcctNo" />
+        <result column="repay_acct_name" property="repayAcctName" />
+        <result column="repay_acct_type" property="repayAcctType" />
+    </resultMap>
+
+    <select id="findBySearch" resultMap="BaseResultMap">
+        SELECT
+            t1.*,
+            t2.corporate_name
+        FROM financing_loan_info t1 LEFT JOIN c_enterprise t2 on t2.id = t1.c_enterprise_id
+        <where>
+            <if test="payoutDate != null and payoutDate != ''">
+                AND t1.payout_date = #{payoutDate}
+            </if>
+            <if test="maturityDate != null and maturityDate != ''">
+                AND t1.maturity_date = #{maturityDate}
+            </if>
+            <if test="payoutStatus != null and payoutStatus != ''">
+                AND t1.payout_status = #{payoutStatus}
+            </if>
+            <if test="payoutNo != null and payoutNo != ''">
+                AND t1.payout_no = #{payoutNo}
+            </if>
+            <if test="fastSearch != null and fastSearch != ''">
+                AND (t1.contract_no LIKE CONCAT('%',#{fastSearch},'%') OR t1.due_bill_no LIKE CONCAT('%',#{fastSearch},'%')
+                OR t2.corporate_name LIKE CONCAT('%',#{fastSearch},'%'))
+            </if>
+        </where>
+    </select>
+
+</mapper>