Browse Source

修改客户

Administrator 1 year ago
parent
commit
cfb975f230

+ 52 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/idcard/SysUserIdcard.java

@@ -1,10 +1,14 @@
 package com.ruoyi.system.domain.idcard;
 
+import com.ruoyi.system.domain.enterprise.SysUserEnterprise;
+import com.ruoyi.system.domain.loan.LoanApplication;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
 
+import java.util.List;
+
 /**
  * 用户身份证信息对象 sys_user_idcard
  * 
@@ -44,6 +48,54 @@ public class SysUserIdcard extends BaseEntity
     /** 反面地址 */
     @Excel(name = "反面地址")
     private String back;
+    /**
+     * 企业数量
+     */
+    private Integer sysUserEnterpriseNum;
+    /**
+     * 企业集合
+     */
+    private List<SysUserEnterprise> sysUserEnterpriseList;
+    /**
+     * 贷款申请数量
+     */
+    private Integer loanApplicationNum;
+    /**
+     * 贷款申请集合
+     */
+    private List<LoanApplication> loanApplicationList;
+
+    public Integer getSysUserEnterpriseNum() {
+        return sysUserEnterpriseNum;
+    }
+
+    public void setSysUserEnterpriseNum(Integer sysUserEnterpriseNum) {
+        this.sysUserEnterpriseNum = sysUserEnterpriseNum;
+    }
+
+    public List<SysUserEnterprise> getSysUserEnterpriseList() {
+        return sysUserEnterpriseList;
+    }
+
+    public void setSysUserEnterpriseList(List<SysUserEnterprise> sysUserEnterpriseList) {
+        this.sysUserEnterpriseList = sysUserEnterpriseList;
+    }
+
+    public Integer getLoanApplicationNum() {
+        return loanApplicationNum;
+    }
+
+    public void setLoanApplicationNum(Integer loanApplicationNum) {
+        this.loanApplicationNum = loanApplicationNum;
+    }
+
+    public List<LoanApplication> getLoanApplicationList() {
+        return loanApplicationList;
+    }
+
+    public void setLoanApplicationList(List<LoanApplication> loanApplicationList) {
+        this.loanApplicationList = loanApplicationList;
+    }
 
     /** 删除标志(0代表存在 2代表删除) */
     private String delFlag;

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserEnterpriseMapper.java

@@ -19,7 +19,7 @@ public interface SysUserEnterpriseMapper
      * @param userId 用户企业信息主键
      * @return 用户企业信息
      */
-    public SysUserEnterprise selectSysUserEnterpriseByUserId(Long userId);
+    public List<SysUserEnterprise> selectSysUserEnterpriseByUserId(Long userId);
     public SysUserEnterprise selectSysUserEnterpriseByEnterpriseId(Long enterpriseId);
 
     /**

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/enterprise/ISysUserEnterpriseService.java

@@ -19,7 +19,7 @@ public interface ISysUserEnterpriseService
      * @param userId 用户企业信息主键
      * @return 用户企业信息
      */
-    public SysUserEnterprise selectSysUserEnterpriseByUserId(Long userId);
+    public List<SysUserEnterprise> selectSysUserEnterpriseByUserId(Long userId);
     public SysUserEnterprise selectSysUserEnterpriseByEnterpriseId(Long enterpriseId);
 
     /**

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/enterprise/impl/SysUserEnterpriseServiceImpl.java

@@ -27,7 +27,7 @@ public class SysUserEnterpriseServiceImpl implements ISysUserEnterpriseService
      * @return 用户企业信息
      */
     @Override
-    public SysUserEnterprise selectSysUserEnterpriseByUserId(Long userId)
+    public List<SysUserEnterprise> selectSysUserEnterpriseByUserId(Long userId)
     {
         return sysUserEnterpriseMapper.selectSysUserEnterpriseByUserId(userId);
     }

+ 31 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/idcard/impl/SysUserIdcardServiceImpl.java

@@ -3,10 +3,15 @@ package com.ruoyi.system.service.idcard.impl;
 import java.util.List;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.domain.enterprise.SysUserEnterprise;
 import com.ruoyi.system.domain.idcard.SysUserIdcard;
+import com.ruoyi.system.domain.loan.LoanApplication;
+import com.ruoyi.system.mapper.LoanApplicationMapper;
+import com.ruoyi.system.mapper.SysUserEnterpriseMapper;
 import com.ruoyi.system.mapper.SysUserIdcardMapper;
 import com.ruoyi.system.service.idcard.ISysUserIdcardService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.SystemEnvironmentPropertySource;
 import org.springframework.stereotype.Service;
 
 
@@ -21,6 +26,10 @@ public class SysUserIdcardServiceImpl implements ISysUserIdcardService
 {
     @Autowired
     private SysUserIdcardMapper sysUserIdcardMapper;
+    @Autowired
+    private SysUserEnterpriseMapper sysUserEnterpriseMapper;
+    @Autowired
+    private LoanApplicationMapper loanApplicationMapper;
 
     /**
      * 查询用户身份证信息
@@ -31,7 +40,14 @@ public class SysUserIdcardServiceImpl implements ISysUserIdcardService
     @Override
     public SysUserIdcard selectSysUserIdcardByUserId(Long userId)
     {
-        return sysUserIdcardMapper.selectSysUserIdcardByUserId(userId);
+        SysUserIdcard sysUserIdcard = sysUserIdcardMapper.selectSysUserIdcardByUserId(userId);
+        List<SysUserEnterprise> sysUserEnterpriseList = sysUserEnterpriseMapper.selectSysUserEnterpriseByUserId(userId);
+        sysUserIdcard.setSysUserEnterpriseNum(sysUserEnterpriseList.size());
+        LoanApplication loanApplication =  new LoanApplication();
+        loanApplication.setUserId(userId);
+        List<LoanApplication> loanApplications = loanApplicationMapper.selectLoanApplicationList(loanApplication);
+        sysUserIdcard.setLoanApplicationNum(loanApplications.size());
+        return sysUserIdcard;
     }
 
     /**
@@ -43,7 +59,20 @@ public class SysUserIdcardServiceImpl implements ISysUserIdcardService
     @Override
     public List<SysUserIdcard> selectSysUserIdcardList(SysUserIdcard sysUserIdcard)
     {
-        return sysUserIdcardMapper.selectSysUserIdcardList(sysUserIdcard);
+        List<SysUserIdcard> sysUserIdCards = sysUserIdcardMapper.selectSysUserIdcardList(sysUserIdcard);
+        //查询个人名下企业和申请贷款次数
+        if (sysUserIdCards != null && sysUserIdCards.size() > 0){
+            for (SysUserIdcard userIdCard : sysUserIdCards) {
+                Long userId = userIdCard.getUserId();
+                List<SysUserEnterprise> sysUserEnterpriseList = sysUserEnterpriseMapper.selectSysUserEnterpriseByUserId(userId);
+                userIdCard.setSysUserEnterpriseNum(sysUserEnterpriseList.size());
+                LoanApplication loanApplication =  new LoanApplication();
+                loanApplication.setUserId(userId);
+                List<LoanApplication> loanApplications = loanApplicationMapper.selectLoanApplicationList(loanApplication);
+                userIdCard.setLoanApplicationNum(loanApplications.size());
+            }
+        }
+        return sysUserIdCards;
     }
 
     /**

+ 5 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/loan/impl/LoanScheduleServiceImpl.java

@@ -64,8 +64,11 @@ public class LoanScheduleServiceImpl implements ILoanScheduleService {
             loanScheduleNew.setLoanScheduleName(dictLabel);
             loanScheduleNew.setLoanScheduleTime(null);
             loanScheduleNew.setLoanScheduleScore(dictSort);
-            if (collect != null){
-                loanScheduleNew.setLoanScheduleTime(collect.get(dictValue).get(0).getLoanScheduleTime());
+            if (collect != null && collect.size() > 0){
+                List<LoanSchedule> loanSchedulesNew = collect.get(dictValue);
+                if (loanSchedulesNew != null && loanSchedulesNew.size() > 0){
+                    loanScheduleNew.setLoanScheduleTime(collect.get(dictValue).get(0).getLoanScheduleTime());
+                }
             }
             loanScheduleList.add(loanScheduleNew);
         }

+ 5 - 1
ruoyi-system/src/main/resources/mapper/system/LoanApplicationMapper.xml

@@ -13,6 +13,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="usagePeriod"    column="usage_period"    />
         <result property="purposeFunds"    column="purpose_funds"    />
         <result property="repaymentSource"    column="repayment_source"    />
+        <result property="enterpriseId"    column="enterprise_id"    />
         <result property="enterpriseName"    column="enterprise_name"    />
         <result property="categoryType"    column="category_type"    />
         <result property="isMake"    column="is_make"    />
@@ -72,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLoanApplicationVo">
-        select loan_application_id, loan_application_number, application_type,application_amount, application_bank, usage_period, purpose_funds, repayment_source, enterprise_name, category_type, is_make, is_new, is_small, is_duty, company_introduction, customer_type, corporation_front, corporation_back, corporation_name, corporation_id_card, corporation_phone,corporation_address,corporation_expiration_date, family_population, corporation_job, is_loan, receivable_pay, business_situation, business_efficiency, corporation_marital_status, spouse_front, spouse_back, spouse_name, spouse_id_card, spouse_phone, guarantee_type, guarantee_front, guarantee_back, guarantee_name, guarantee_id_card, guarantee_phone, guarantee_marital_status, guarantee_spouse_front, guarantee_spouse_back, guarantee_spouse_name, guarantee_spouse_id_card, guarantee_spouse_phone, user_id, id_card, application_time, file_time, loan_schedule, audit_schedule, audit_type, loan_application_type, a_user_id, a_user_name, b_user_id, b_user_name, create_by, create_time, update_by, update_time, remark from loan_application
+        select loan_application_id, loan_application_number, application_type,application_amount,enterprise_id, application_bank, usage_period, purpose_funds, repayment_source, enterprise_name, category_type, is_make, is_new, is_small, is_duty, company_introduction, customer_type, corporation_front, corporation_back, corporation_name, corporation_id_card, corporation_phone,corporation_address,corporation_expiration_date, family_population, corporation_job, is_loan, receivable_pay, business_situation, business_efficiency, corporation_marital_status, spouse_front, spouse_back, spouse_name, spouse_id_card, spouse_phone, guarantee_type, guarantee_front, guarantee_back, guarantee_name, guarantee_id_card, guarantee_phone, guarantee_marital_status, guarantee_spouse_front, guarantee_spouse_back, guarantee_spouse_name, guarantee_spouse_id_card, guarantee_spouse_phone, user_id, id_card, application_time, file_time, loan_schedule, audit_schedule, audit_type, loan_application_type, a_user_id, a_user_name, b_user_id, b_user_name, create_by, create_time, update_by, update_time, remark from loan_application
     </sql>
 
     <select id="selectLoanApplicationList" parameterType="LoanApplication" resultMap="LoanApplicationResult">
@@ -152,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="usagePeriod != null and usagePeriod != ''">usage_period,</if>
             <if test="purposeFunds != null and purposeFunds != ''">purpose_funds,</if>
             <if test="repaymentSource != null and repaymentSource != ''">repayment_source,</if>
+            <if test="enterpriseId != null and enterpriseId != ''">enterprise_id,</if>
             <if test="enterpriseName != null and enterpriseName != ''">enterprise_name,</if>
             <if test="categoryType != null and categoryType != ''">category_type,</if>
             <if test="isMake != null">is_make,</if>
@@ -217,6 +219,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="usagePeriod != null and usagePeriod != ''">#{usagePeriod},</if>
             <if test="purposeFunds != null and purposeFunds != ''">#{purposeFunds},</if>
             <if test="repaymentSource != null and repaymentSource != ''">#{repaymentSource},</if>
+            <if test="enterpriseId != null and enterpriseId != ''">#{enterpriseId},</if>
             <if test="enterpriseName != null and enterpriseName != ''">#{enterpriseName},</if>
             <if test="categoryType != null and categoryType != ''">#{categoryType},</if>
             <if test="isMake != null">#{isMake},</if>
@@ -286,6 +289,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="usagePeriod != null and usagePeriod != ''">usage_period = #{usagePeriod},</if>
             <if test="purposeFunds != null and purposeFunds != ''">purpose_funds = #{purposeFunds},</if>
             <if test="repaymentSource != null and repaymentSource != ''">repayment_source = #{repaymentSource},</if>
+            <if test="enterpriseId != null and enterpriseId != ''">enterprise_id = #{enterpriseId},</if>
             <if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
             <if test="categoryType != null and categoryType != ''">category_type = #{categoryType},</if>
             <if test="isMake != null">is_make = #{isMake},</if>