Эх сурвалжийг харах

新增保后列表,图片识别文字未完成

Administrator 10 сар өмнө
parent
commit
3f92801a6b

+ 43 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java

@@ -7,16 +7,21 @@ import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.common.utils.IdCardUtil;
 import com.ruoyi.common.utils.ThumbnailUtil;
 import com.ruoyi.system.domain.vo.UploadVo;
 import net.lingala.zip4j.ZipFile;
 import net.lingala.zip4j.exception.ZipException;
 import net.lingala.zip4j.model.ZipParameters;
 import net.lingala.zip4j.model.enums.EncryptionMethod;
+import net.sourceforge.tess4j.ITesseract;
+import net.sourceforge.tess4j.Tesseract;
+import net.sourceforge.tess4j.TesseractException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import com.ruoyi.common.config.RuoYiConfig;
@@ -118,6 +123,44 @@ public class CommonController {
         }
     }
 
+    /**
+     * 按照项目编号创建文件夹通用上传请求(单个)带识别图片转文字
+     */
+    @PostMapping("/uploadNewOcr")
+    @PreAuthorize("@ss.hasPermi('common:upload:uploadNewOcr')")
+    public AjaxResult uploadNewOcrFile(@RequestParam("file") MultipartFile file, @RequestParam("loanApplicationNumber") String loanApplicationNumber, @RequestParam("fileName") String originalFilename) throws Exception {
+        try {
+            // 上传文件路径
+            String filePath = RuoYiConfig.getUploadPath();
+            // 上传并返回新文件名称
+            String fileName = FileUploadUtils.uploadLoanApplicationNumber(filePath, file, loanApplicationNumber, originalFilename);
+            String url = serverConfig.getUrl() + fileName;
+            AjaxResult ajax = AjaxResult.success();
+            //服务器路径
+            String urlOnline = filePath + fileName.replace("/profile/upload", "");
+            //百度图片识别
+            String result = IdCardUtil.accurateBasic(urlOnline);
+            System.out.println(result);
+/*            //获取本地图片
+            File fileOcr = new File(urlOnline);
+            // 使用 Tesseract 识别文本
+            ITesseract tesseract = new Tesseract();
+            // 设置训练数据文件夹路径
+            tesseract.setDatapath("ruoyi-admin/src/main/resources/traineddata");
+            // 设置为中文简体
+            tesseract.setLanguage("chi_sim");
+            String result = tesseract.doOCR(fileOcr);*/
+            ajax.put("url", url);
+            ajax.put("urlOnline", urlOnline);
+            ajax.put("fileName", fileName);
+            ajax.put("newFileName", FileUtils.getName(fileName));
+            ajax.put("originalFilename", file.getOriginalFilename());
+            ajax.put("OCR", result);
+            return ajax;
+        } catch (Exception e) {
+            return AjaxResult.error(e.getMessage());
+        }
+    }
     /**
      * 通用上传请求(多个)
      */

+ 4 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/OcrController.java

@@ -7,11 +7,15 @@ import com.ruoyi.common.core.domain.IdCardVo;
 import com.ruoyi.common.core.domain.SysUserIdcardVo;
 import com.ruoyi.common.utils.IdCardUtil;
 import com.ruoyi.system.domain.idcard.SysUserIdcard;
+import net.sourceforge.tess4j.ITesseract;
+import net.sourceforge.tess4j.Tesseract;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.io.File;
+
 /**
  * @Author: tjf
  * @Date: 2024/4/22 14:24

+ 15 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/loan/LoanApplicationController.java

@@ -51,6 +51,21 @@ public class LoanApplicationController extends BaseController {
         return getDataTable(list);
     }
 
+
+    /**
+     * 查询需要保后的数据
+     *
+     * @param loanApplication
+     * @return
+     */
+    @PreAuthorize("@ss.hasPermi('system:application:loanAfterList')")
+    @GetMapping("/loanAfterList")
+    public TableDataInfo loanAfterList(LoanApplication loanApplication) {
+        startPage();
+        List<LoanApplication> list = loanApplicationService.selectLoanAfterList(loanApplication);
+        return getDataTable(list);
+    }
+
     /**
      * 参会人员查看列表
      */

BIN
ruoyi-admin/src/main/resources/traineddata/chi_sim.traineddata


+ 6 - 0
ruoyi-common/pom.xml

@@ -17,6 +17,12 @@
 
 
     <dependencies>
+        <!--图片识别文字-->
+        <dependency>
+            <groupId>net.sourceforge.tess4j</groupId>
+            <artifactId>tess4j</artifactId>
+            <version>5.3.0</version>
+        </dependency>
         <!--imageio-jpeg CMYK模式读取支持-->
         <dependency>
             <groupId>com.twelvemonkeys.imageio</groupId>

+ 2 - 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/CommonConstants.java

@@ -28,6 +28,8 @@ public class CommonConstants {
     public static final String B = "b";
     public static final String C = "c";
     public static final String D = "d";
+    public static final String E = "e";
+    public static final String F = "f";
     public static final String Y = "Y";
 
     //角色权限

+ 77 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/HttpUtil.java

@@ -0,0 +1,77 @@
+package com.ruoyi.common.utils;
+
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * http 工具类
+ */
+public class HttpUtil {
+
+    public static String post(String requestUrl, String accessToken, String params)
+            throws Exception {
+        String contentType = "application/x-www-form-urlencoded";
+        return HttpUtil.post(requestUrl, accessToken, contentType, params);
+    }
+
+    public static String post(String requestUrl, String accessToken, String contentType, String params)
+            throws Exception {
+        String encoding = "UTF-8";
+        if (requestUrl.contains("nlp")) {
+            encoding = "GBK";
+        }
+        return HttpUtil.post(requestUrl, accessToken, contentType, params, encoding);
+    }
+
+    public static String post(String requestUrl, String accessToken, String contentType, String params, String encoding)
+            throws Exception {
+        String url = requestUrl + "?access_token=" + accessToken;
+        return HttpUtil.postGeneralUrl(url, contentType, params, encoding);
+    }
+
+    public static String postGeneralUrl(String generalUrl, String contentType, String params, String encoding)
+            throws Exception {
+        URL url = new URL(generalUrl);
+        // 打开和URL之间的连接
+        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+        connection.setRequestMethod("POST");
+        // 设置通用的请求属性
+        connection.setRequestProperty("Content-Type", contentType);
+        connection.setRequestProperty("Connection", "Keep-Alive");
+        connection.setUseCaches(false);
+        connection.setDoOutput(true);
+        connection.setDoInput(true);
+
+        // 得到请求的输出流对象
+        DataOutputStream out = new DataOutputStream(connection.getOutputStream());
+        out.write(params.getBytes(encoding));
+        out.flush();
+        out.close();
+
+        // 建立实际的连接
+        connection.connect();
+        // 获取所有响应头字段
+        Map<String, List<String>> headers = connection.getHeaderFields();
+        // 遍历所有的响应头字段
+        for (String key : headers.keySet()) {
+            System.err.println(key + "--->" + headers.get(key));
+        }
+        // 定义 BufferedReader输入流来读取URL的响应
+        BufferedReader in = null;
+        in = new BufferedReader(
+                new InputStreamReader(connection.getInputStream(), encoding));
+        String result = "";
+        String getLine;
+        while ((getLine = in.readLine()) != null) {
+            result += getLine;
+        }
+        in.close();
+        System.err.println("result:" + result);
+        return result;
+    }
+}

+ 27 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/IdCardUtil.java

@@ -786,4 +786,31 @@ public class IdCardUtil {
 
         return client.initFaceVerifyWithOptions(request, runtime);
     }
+
+
+    /**
+     * 图片文字识别
+     * @param filePath     本地文件路径
+     * @return
+     */
+    public static String accurateBasic(String filePath) {
+        // 请求url
+        String url = "https://aip.baidubce.com/rest/2.0/ocr/v1/accurate_basic";
+        try {
+            byte[] imgData = FileUtil.readFileByBytes(filePath);
+            String imgStr = Base64Util.encodeBase64(imgData);
+            String imgParam = URLEncoder.encode(imgStr, "UTF-8");
+
+            String param = "image=" + imgParam;
+
+            // 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
+            String accessToken = getAccessToken("TvvuZOOh7MgnlDFnw11ln67n", "CY47OI0eKAzYBD2LO55SM3OITzsyq6DK");
+            String result =  com.ruoyi.common.utils.HttpUtil.post(url, accessToken, param);
+            System.out.println(result);
+            return result;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
 }

+ 44 - 12
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/LoanApplicationServiceImpl.java

@@ -108,7 +108,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         }
 
         //查询企业信息
-        if(ObjectUtils.isNotEmpty(loanApplication.getEnterpriseId())){
+        if (ObjectUtils.isNotEmpty(loanApplication.getEnterpriseId())) {
             SysUserEnterprise sysUserEnterprise = sysUserEnterpriseMapper.selectSysUserEnterpriseByEnterpriseId(loanApplication.getEnterpriseId());
             loanApplication.setSysUserEnterprise(sysUserEnterprise);
         }
@@ -136,6 +136,10 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             if (loanApplicationFjsD != null && loanApplicationFjsD.size() > 0) {
                 loanApplication.setOtherFj(loanApplicationFjsD.stream().collect(Collectors.groupingBy(LoanApplicationFj::getType)));
             }
+            List<LoanApplicationFj> loanApplicationFjsF = bigTypeFj.get(F);
+            if (loanApplicationFjsF != null && loanApplicationFjsF.size() > 0) {
+                loanApplication.setBackFj(loanApplicationFjsF.stream().collect(Collectors.groupingBy(LoanApplicationFj::getType)));
+            }
         }
         List<ShareholderFj> shareholderFjs = shareholderFjMapper.selectShareholderFjLoanApplicationId(loanApplicationId);
         if (shareholderFjs != null && shareholderFjs.size() > 0) {
@@ -185,6 +189,19 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         return loanApplications;
     }
 
+    /**
+     * 查询需要保后的数据
+     *
+     * @param loanApplication
+     * @return
+     */
+    @Override
+    public List<LoanApplication> selectLoanAfterList(LoanApplication loanApplication) {
+        loanApplication.setActuallyTime(DateUtils.getNowDate());
+        List<LoanApplication> loanApplications = loanApplicationMapper.selectLoanAfterList(loanApplication);
+        return loanApplications;
+    }
+
     @Override
     public List<LoanApplication> conferenceList(LoanApplication loanApplication) {
         //查询人员id
@@ -1218,6 +1235,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         }
         loanApplication.setLoanSchedule(TEN);
         loanApplication.setLoanApplicationType(FOR);
+        loanApplication.setAuditSchedule(ELE);
         loanApplication.setFileTime(DateUtils.getNowDate());
 
         //插入流程记录表
@@ -1231,11 +1249,16 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         // 上传文件路径
         String filePath = RuoYiConfig.getUploadPath() + "/";
         Long loanApplicationId = loanApplication.getLoanApplicationId();
+        //附件
         List<LoanApplicationFj> loanApplicationFjList = loanApplicationFjMapper.selectLoanApplicationFjByLoanApplicationId(loanApplicationId);
         //基础附件
         LoanApplication loanApplicationOld = loanApplicationMapper.selectLoanApplicationByLoanApplicationId(loanApplicationId);
         //股东附件
         List<ShareholderFj> shareholderFjs = shareholderFjMapper.selectShareholderFjLoanApplicationId(loanApplicationId);
+
+        //反担保人附件
+        List<GuaranteeInfoFj> guaranteeInfoFjs = guaranteeInfoFjMapper.selectGuaranteeInfoFjByLoanApplicationId(loanApplicationId);
+
         List<File> fileList = new ArrayList<>();
         if (loanApplicationFjList != null && loanApplicationFjList.size() > 0) {
             for (LoanApplicationFj loanApplicationFj : loanApplicationFjList) {
@@ -1246,8 +1269,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         String corporationBack = loanApplicationOld.getCorporationBack();
         String spouseFront = loanApplicationOld.getSpouseFront();
         String spouseBack = loanApplicationOld.getSpouseBack();
-        String guaranteeFront = loanApplicationOld.getGuaranteeFront();
-        String guaranteeBack = loanApplicationOld.getGuaranteeBack();
+
         if (StringUtils.isNotEmpty(corporationFront)) {
             fileList.add(new File(corporationFront.replace("/profile/upload/", filePath)));
         }
@@ -1260,20 +1282,30 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         if (StringUtils.isNotEmpty(spouseBack)) {
             fileList.add(new File(spouseBack.replace("/profile/upload/", filePath)));
         }
-        if (StringUtils.isNotEmpty(guaranteeFront)) {
-            fileList.add(new File(guaranteeFront.replace("/profile/upload/", filePath)));
-        }
-        if (StringUtils.isNotEmpty(guaranteeBack)) {
-            fileList.add(new File(guaranteeBack.replace("/profile/upload/", filePath)));
-        }
+
         if (shareholderFjs != null && shareholderFjs.size() > 0) {
             for (ShareholderFj shareholderFj : shareholderFjs) {
                 fileList.add(new File(shareholderFj.getShareholderZxUrl().replace("/profile/upload/", filePath)));
-                fileList.add(new File(shareholderFj.getShareholderFrontUrl().replace("/profile/upload/", filePath)));
-                fileList.add(new File(shareholderFj.getShareholderBackUrl().replace("/profile/upload/", filePath)));
+                String shareholderFrontUrl = shareholderFj.getShareholderFrontUrl();
+                String shareholderBackUrl = shareholderFj.getShareholderBackUrl();
+                String shareholderBusinessUrl = shareholderFj.getShareholderBusinessUrl();
+                if (StringUtils.isNotBlank(shareholderFrontUrl)) {
+                    fileList.add(new File(shareholderFj.getShareholderFrontUrl().replace("/profile/upload/", filePath)));
+                }
+                if (StringUtils.isNotBlank(shareholderBackUrl)) {
+                    fileList.add(new File(shareholderFj.getShareholderBackUrl().replace("/profile/upload/", filePath)));
+                }
+                if (StringUtils.isNotBlank(shareholderBusinessUrl)) {
+                    fileList.add(new File(shareholderFj.getShareholderBusinessUrl().replace("/profile/upload/", filePath)));
+                }
             }
         }
 
+        if (guaranteeInfoFjs != null && guaranteeInfoFjs.size() > 0) {
+            for (GuaranteeInfoFj guaranteeInfoFj : guaranteeInfoFjs) {
+                fileList.add(new File(guaranteeInfoFj.getUrl().replace("/profile/upload/", filePath)));
+            }
+        }
 
         //16位序列号
         String id = Seq.getId(Seq.uploadSeqType);
@@ -1331,7 +1363,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         reviewComments.setLoanApplicationId(loanApplication.getLoanApplicationId());
         reviewComments.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
         //归档
-        reviewComments.setAuditSchedule("11");
+        reviewComments.setAuditSchedule(ELE);
         reviewComments.setAuditType(TWO);
         reviewComments.setAuditTime(DateUtils.getNowDate());
         reviewComments.setCreateBy(SecurityUtils.getUsername());

+ 37 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/loan/LoanApplication.java

@@ -35,6 +35,10 @@ public class LoanApplication extends BaseEntity
     /** 实际放款金额(万元) */
     @Excel(name = "实际放款金额(万元)")
     private Double actuallyAmount;
+    /**
+     * 实际放款时间
+     */
+    private Date actuallyTime;
 
     /** 申请银行 */
     @Excel(name = "申请银行")
@@ -265,6 +269,10 @@ public class LoanApplication extends BaseEntity
      * 业务审核/分配驳回原因,给贷款客户使用,只展示最新的原因
      */
     private String rejectionReason;
+    /**
+     * 保后状态:1:未首保 2:已首保  3:已N次保
+     */
+    private String loanAfterType;
 
     /** A角色用户ID */
     @Excel(name = "A角色用户ID")
@@ -336,6 +344,11 @@ public class LoanApplication extends BaseEntity
      * 其他附件
      */
     private Map<String,List<LoanApplicationFj>> otherFj;
+
+    /**
+     * 保后附件
+     */
+    private Map<String,List<LoanApplicationFj>> backFj;
     /**
      * fj删除id集合
      */
@@ -359,6 +372,30 @@ public class LoanApplication extends BaseEntity
      */
     private Long[] guaranteeInfoIdList;
 
+    public Date getActuallyTime() {
+        return actuallyTime;
+    }
+
+    public void setActuallyTime(Date actuallyTime) {
+        this.actuallyTime = actuallyTime;
+    }
+
+    public String getLoanAfterType() {
+        return loanAfterType;
+    }
+
+    public void setLoanAfterType(String loanAfterType) {
+        this.loanAfterType = loanAfterType;
+    }
+
+    public Map<String, List<LoanApplicationFj>> getBackFj() {
+        return backFj;
+    }
+
+    public void setBackFj(Map<String, List<LoanApplicationFj>> backFj) {
+        this.backFj = backFj;
+    }
+
     public Long[] getGuaranteeInfoFjIdList() {
         return guaranteeInfoFjIdList;
     }

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

@@ -27,6 +27,7 @@ public interface GuaranteeInfoFjMapper
      * @return 反担保基础信息附件集合
      */
     public List<GuaranteeInfoFj> selectGuaranteeInfoFjList(GuaranteeInfoFj guaranteeInfoFj);
+    public List<GuaranteeInfoFj> selectGuaranteeInfoFjByLoanApplicationId(Long loanApplicationId);
 
     /**
      * 新增反担保基础信息附件

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/LoanApplicationMapper.java

@@ -29,6 +29,14 @@ public interface LoanApplicationMapper
      */
     public List<LoanApplication> selectLoanApplicationList(LoanApplication loanApplication);
 
+    /**
+     * 查询需要保后的数据
+     *
+     * @param loanApplication
+     * @return
+     */
+    public List<LoanApplication> selectLoanAfterList(LoanApplication loanApplication);
+
     /**
      * 统计使用查询列表
      * @param loanApplication

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/loan/ILoanApplicationService.java

@@ -30,6 +30,13 @@ public interface ILoanApplicationService
      * @return 贷款申请主集合
      */
     public List<LoanApplication> selectLoanApplicationList(LoanApplication loanApplication);
+    /**
+     * 查询需要保后的数据
+     *
+     * @param loanApplication
+     * @return
+     */
+    public List<LoanApplication> selectLoanAfterList(LoanApplication loanApplication);
     public List<LoanApplication> listOss(LoanApplication loanApplication);
 
     /**

+ 9 - 0
ruoyi-system/src/main/resources/mapper/system/GuaranteeInfoFjMapper.xml

@@ -38,6 +38,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         order by create_time
     </select>
+
+
+    <select id="selectGuaranteeInfoFjByLoanApplicationId" parameterType="Long" resultMap="GuaranteeInfoFjResult">
+        <include refid="selectGuaranteeInfoFjVo"/>
+
+          where loan_application_id = #{loanApplicationId}
+
+        order by create_time
+    </select>
     
     <select id="selectGuaranteeInfoFjByGuaranteeInfoFjId" parameterType="Long" resultMap="GuaranteeInfoFjResult">
         <include refid="selectGuaranteeInfoFjVo"/>

+ 2 - 4
ruoyi-system/src/main/resources/mapper/system/LoanApplicationFjMapper.xml

@@ -57,12 +57,10 @@
         <include refid="selectLoanApplicationFjVo"/>
         where fj_id = #{fjId}
     </select>
-    <select id="selectLoanApplicationFjByLoanApplicationId" parameterType="LoanApplicationFj"
+    <select id="selectLoanApplicationFjByLoanApplicationId" parameterType="Long"
             resultMap="LoanApplicationFjResult">
         <include refid="selectLoanApplicationFjVo"/>
-        <where>
-            <if test="loanApplicationId != null ">and loan_application_id = #{loanApplicationId}</if>
-        </where>
+          where  loan_application_id = #{loanApplicationId}
         order by create_time
     </select>
     <select id="selectLoanApplicationFjByLoanApplicationIdAndType" parameterType="LoanApplicationFj" resultMap="LoanApplicationFjResult">

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

@@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="applicationType"    column="application_type"    />
         <result property="applicationAmount"    column="application_amount"    />
         <result property="actuallyAmount"    column="actually_amount"    />
+        <result property="actuallyTime"    column="actually_time"    />
         <result property="applicationBank"    column="application_bank"    />
         <result property="usagePeriod"    column="usage_period"    />
         <result property="purposeFunds"    column="purpose_funds"    />
@@ -67,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="loanApplicationType"    column="loan_application_type"    />
         <result property="reviewSchedule"    column="review_schedule"    />
         <result property="rejectionReason"    column="rejection_reason"    />
+        <result property="loanAfterType"    column="loan_after_type"    />
         <result property="aUserId"    column="a_user_id"    />
         <result property="aUserName"    column="a_user_name"    />
         <result property="aAuthorize"    column="a_authorize"    />
@@ -82,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLoanApplicationVo">
-        select loan_application_id, loan_application_number, application_type,application_amount,actually_amount,enterprise_id,guarantee_shareholder_name,guarantee_shareholder_id_card, 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,review_time, loan_schedule, audit_schedule, audit_type, loan_application_type,review_schedule,rejection_reason, a_user_id, a_user_name,a_authorize, b_user_id, b_user_name,f_user_id, f_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,actually_amount,actually_time,enterprise_id,guarantee_shareholder_name,guarantee_shareholder_id_card, 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,review_time, loan_schedule, audit_schedule, audit_type, loan_application_type,review_schedule,rejection_reason,loan_after_type, a_user_id, a_user_name,a_authorize, b_user_id, b_user_name,f_user_id, f_user_name, create_by, create_time, update_by, update_time, remark from loan_application
     </sql>
 
     <select id="selectLoanApplicationList" parameterType="LoanApplication" resultMap="LoanApplicationResult">
@@ -91,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="loanApplicationNumber != null and loanApplicationNumber != ''"> and loan_application_number = #{loanApplicationNumber}</if>
             <if test="applicationAmount != null "> and application_amount = #{applicationAmount}</if>
             <if test="actuallyAmount != null "> and actually_amount = #{actuallyAmount}</if>
+            <if test="actuallyTime != null "> and actually_time = #{actuallyTime}</if>
             <if test="applicationType != null and applicationType != ''"> and application_type = #{applicationType}</if>
             <if test="applicationBank != null  and applicationBank != ''"> and application_bank = #{applicationBank}</if>
             <if test="usagePeriod != null  and usagePeriod != ''"> and usage_period = #{usagePeriod}</if>
@@ -143,6 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="auditType != null  and auditType != ''"> and audit_type = #{auditType}</if>
             <if test="loanApplicationType != null  and loanApplicationType != ''"> and loan_application_type = #{loanApplicationType}</if>
             <if test="reviewSchedule != null  and reviewSchedule != ''"> and review_schedule = #{reviewSchedule}</if>
+            <if test="loanAfterType != null  and loanAfterType != ''"> and loan_after_type = #{loanAfterType}</if>
             <if test="userId != null "> and (a_user_id = #{userId} or (b_user_id = #{userId} and audit_schedule = '3') or  user_id = #{userId} or f_user_id = #{userId})</if>
             <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
                 AND date_format(create_time,'%Y') = #{params.beginTime}
@@ -151,6 +155,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by create_time DESC
     </select>
 
+    <select id="selectLoanAfterList" parameterType="LoanApplication" resultMap="LoanApplicationResult">
+        <include refid="selectLoanApplicationVo"/>
+     <where>   (#{actuallyTime}&gt;DATE_ADD(actually_time,INTERVAL 30 DAY)
+            or #{actuallyTime}&gt;DATE_ADD(actually_time,INTERVAL 180 DAY))
+        <if test="enterpriseName != null  and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
+         <if test="loanAfterType != null  and loanAfterType != ''"> and loan_after_type = #{loanAfterType}</if>
+     </where>
+        order by create_time DESC
+    </select>
     <select id="selectLoanApplicationListStatistics" parameterType="LoanApplication" resultMap="LoanApplicationResult">
         <include refid="selectLoanApplicationVo"/>
         <where>
@@ -278,6 +291,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="applicationType  != null and applicationType != ''">application_type,</if>
             <if test="applicationAmount != null">application_amount,</if>
             <if test="actuallyAmount != null">actually_amount,</if>
+            <if test="actuallyTime != null">actually_time,</if>
             <if test="applicationBank != null and applicationBank != ''">application_bank,</if>
             <if test="usagePeriod != null and usagePeriod != ''">usage_period,</if>
             <if test="purposeFunds != null and purposeFunds != ''">purpose_funds,</if>
@@ -335,6 +349,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="loanApplicationType != null and loanApplicationType != ''">loan_application_type,</if>
             <if test="reviewSchedule != null and reviewSchedule != ''">review_schedule,</if>
             <if test="rejectionReason != null and rejectionReason != ''">rejection_reason,</if>
+            <if test="loanAfterType != null and loanAfterType != ''">loan_after_type,</if>
             <if test="aUserId != null">a_user_id,</if>
             <if test="aUserName != null">a_user_name,</if>
             <if test="aAuthorize != null and aAuthorize != ''">a_authorize,</if>
@@ -353,6 +368,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="applicationType != null and applicationType != ''">#{applicationType},</if>
             <if test="applicationAmount != null">#{applicationAmount},</if>
             <if test="actuallyAmount != null">#{actuallyAmount},</if>
+            <if test="actuallyTime != null">#{actuallyTime},</if>
             <if test="applicationBank != null and applicationBank != ''">#{applicationBank},</if>
             <if test="usagePeriod != null and usagePeriod != ''">#{usagePeriod},</if>
             <if test="purposeFunds != null and purposeFunds != ''">#{purposeFunds},</if>
@@ -410,6 +426,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="loanApplicationType != null and loanApplicationType != ''">#{loanApplicationType},</if>
             <if test="reviewSchedule != null and reviewSchedule != ''">#{reviewSchedule},</if>
             <if test="rejectionReason != null and rejectionReason != ''">#{rejectionReason},</if>
+            <if test="loanAfterType != null and loanAfterType != ''">#{loanAfterType},</if>
             <if test="aUserId != null">#{aUserId},</if>
             <if test="aUserName != null">#{aUserName},</if>
             <if test="aAuthorize != null and aAuthorize != ''">#{aAuthorize},</if>
@@ -432,6 +449,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="applicationType != null and applicationType != ''">application_type = #{applicationType},</if>
             <if test="applicationAmount != null">application_amount = #{applicationAmount},</if>
             <if test="actuallyAmount != null">actually_amount = #{actuallyAmount},</if>
+            <if test="actuallyTime != null">actually_time = #{actuallyTime},</if>
             <if test="applicationBank != null and applicationBank != ''">application_bank = #{applicationBank},</if>
             <if test="usagePeriod != null and usagePeriod != ''">usage_period = #{usagePeriod},</if>
             <if test="purposeFunds != null and purposeFunds != ''">purpose_funds = #{purposeFunds},</if>
@@ -489,6 +507,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="loanApplicationType != null and loanApplicationType != ''">loan_application_type = #{loanApplicationType},</if>
             <if test="reviewSchedule != null and reviewSchedule != ''">review_schedule = #{reviewSchedule},</if>
             <if test="rejectionReason != null and rejectionReason != ''">rejection_reason = #{rejectionReason},</if>
+            <if test="loanAfterType != null and loanAfterType != ''">loan_after_type = #{loanAfterType},</if>
             <if test="aUserId != -1">a_user_id = #{aUserId},</if>
             <if test="aUserName != null">a_user_name = #{aUserName},</if>
             <if test="aAuthorize != null and aAuthorize != ''">a_authorize = #{aAuthorize},</if>