Browse Source

新增 股东征信自动生成pdf

Administrator 11 months ago
parent
commit
37f4b1b3b0

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

@@ -7,6 +7,7 @@ import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SendSmsUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.system.domain.loan.LoanApplication;
+import com.ruoyi.system.domain.remind.WaitRemind;
 import com.ruoyi.system.domain.review.ReviewComments;
 import com.ruoyi.system.service.loan.ILoanApplicationService;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -159,6 +160,24 @@ public class LoanApplicationController extends BaseController {
         return loanApplicationService.gd(loanApplication);
     }
 
+    /**
+     * 暂缓出具放款合规表-风险使用
+     */
+    @PreAuthorize("@ss.hasPermi('system:application:zanHuan')")
+    @PostMapping("/zanHuan")
+    public AjaxResult zanHuan(@RequestBody LoanApplication loanApplication) {
+        return loanApplicationService.zanHuan(loanApplication);
+    }
+
+    /**
+     * 管理员授权A角色开具放款通知书
+     */
+    @PreAuthorize("@ss.hasPermi('system:application:authorize')")
+    @PostMapping("/authorize")
+    public AjaxResult authorize(@RequestBody LoanApplication loanApplication) {
+        return loanApplicationService.authorize(loanApplication);
+    }
+
     /**
      * 导出模板附件
      */

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

@@ -28,6 +28,7 @@ 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 Y = "Y";
 
     //角色权限
     //超级管理员

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

@@ -262,6 +262,10 @@ public class LoanApplication extends BaseEntity
     /** A角色用户名称 */
     @Excel(name = "A角色用户名称")
     private String aUserName;
+    /**
+     * A角色是否被管理员授权 N:未授权 Y:已授权
+     */
+    private String aAuthorize;
 
     /** B角色用户ID */
     @Excel(name = "B角色用户ID")
@@ -305,6 +309,14 @@ public class LoanApplication extends BaseEntity
      */
     private Map<String,List<LoanApplicationFj>> otherFj;
 
+    public String getaAuthorize() {
+        return aAuthorize;
+    }
+
+    public void setaAuthorize(String aAuthorize) {
+        this.aAuthorize = aAuthorize;
+    }
+
     public String getGuaranteeShareholderName() {
         return guaranteeShareholderName;
     }

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

@@ -17,6 +17,7 @@ public interface SysRoleMapper
      * @return 角色数据集合信息
      */
     public List<SysRole> selectRoleList(SysRole role);
+    public List<SysRole> selectRoleListNoDataScope(SysRole role);
 
     /**
      * 根据用户ID查询角色

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

@@ -1,6 +1,8 @@
 package com.ruoyi.system.mapper;
 
 import java.util.List;
+
+import com.ruoyi.common.core.domain.entity.SysRole;
 import org.apache.ibatis.annotations.Param;
 import com.ruoyi.system.domain.SysUserRole;
 
@@ -51,6 +53,12 @@ public interface SysUserRoleMapper
      */
     public int deleteUserRoleInfo(SysUserRole userRole);
 
+    /**
+     * 查询所有中心管理员账号
+     * @return
+     */
+    public List<SysUserRole> selectRoleListNoDataScope();
+
     /**
      * 批量取消授权用户角色
      * 

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

@@ -2,6 +2,7 @@ package com.ruoyi.system.service.loan;
 
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.system.domain.loan.LoanApplication;
+import com.ruoyi.system.domain.remind.WaitRemind;
 import com.ruoyi.system.domain.review.ReviewComments;
 
 import java.util.List;
@@ -99,5 +100,16 @@ public interface ILoanApplicationService
      */
     public AjaxResult gd(LoanApplication loanApplication);
 
+    /**
+     * 暂缓出具放款合规表-风险使用
+     * @param loanApplication
+     * @return
+     */
+    public AjaxResult zanHuan(LoanApplication loanApplication);
+    /**
+     * 管理员授权A角色开具放款通知书
+     */
+    public AjaxResult authorize(LoanApplication loanApplication);
+
     AjaxResult exportMb(LoanApplication loanApplication);
 }

+ 52 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/loan/impl/LoanApplicationServiceImpl.java

@@ -17,6 +17,7 @@ import com.ruoyi.common.utils.poi.WordUtil;
 import com.ruoyi.common.utils.uuid.Seq;
 import com.ruoyi.common.utils.uuid.IdUtils;
 import com.ruoyi.common.utils.uuid.UUID;
+import com.ruoyi.system.domain.SysUserRole;
 import com.ruoyi.system.domain.conference.SysUserConference;
 import com.ruoyi.system.domain.enterprise.SysUserEnterprise;
 import com.ruoyi.system.domain.loan.LoanApplication;
@@ -75,6 +76,8 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
 
     @Autowired
     private RedisCache redisCache;
+    @Resource
+    private SysUserRoleMapper sysUserRoleMapper;
 
 
     /**
@@ -882,6 +885,55 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         return AjaxResult.success();
     }
 
+    /**
+     * 暂缓出具放款合规表-风险使用
+     * @param loanApplication
+     * @return
+     */
+    @Override
+    public AjaxResult zanHuan(LoanApplication loanApplication) {
+        WaitRemind waitRemind = new WaitRemind();
+        waitRemind.setLoanApplicationId(loanApplication.getLoanApplicationId());
+        waitRemind.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+        waitRemind.setRemindTitle("您有一条风险部暂缓出具【" + loanApplication.getEnterpriseName() + "】放款合规表的申请");
+        waitRemind.setRemindTime(DateUtils.getNowDate());
+        waitRemind.setRemindType(SIX);
+        //给A角色发送待办提醒
+        waitRemind.setReadUserId(loanApplication.getaUserId().toString());
+        //getRemark()风险部暂缓出具的原因
+        waitRemind.setRemindContent(loanApplication.getRemark());
+        waitRemindMapper.insertWaitRemind(waitRemind);
+        //给管理员发送 = 查询所有role_key等于manager的账号
+        List<SysUserRole> sysUserRoles = sysUserRoleMapper.selectRoleListNoDataScope();
+        if (sysUserRoles != null && sysUserRoles.size() > 0){
+            for (SysUserRole sysUserRole : sysUserRoles) {
+                WaitRemind waitRemindRole = new WaitRemind();
+                waitRemindRole.setLoanApplicationId(loanApplication.getLoanApplicationId());
+                waitRemindRole.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+                waitRemindRole.setRemindTitle("您有一条风险部暂缓出具【" + loanApplication.getEnterpriseName() + "】放款合规表的申请");
+                waitRemindRole.setRemindTime(DateUtils.getNowDate());
+                waitRemindRole.setRemindType(SIX);
+                //给A角色发送待办提醒
+                waitRemindRole.setReadUserId(sysUserRole.getUserId().toString());
+                //getRemark()风险部暂缓出具的原因
+                waitRemindRole.setRemindContent(loanApplication.getRemark());
+                waitRemindMapper.insertWaitRemind(waitRemindRole);
+            }
+        }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 管理员授权A角色开具放款通知书
+     */
+    @Override
+    public AjaxResult authorize(LoanApplication loanApplication) {
+        loanApplication.setLoanSchedule(NIN);
+        loanApplication.setaAuthorize(Y);
+        loanApplicationMapper.updateLoanApplication(loanApplication);
+        return AjaxResult.success();
+    }
+
     /**
      * 压缩文件,返回地址
      *

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

@@ -65,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="loanApplicationType"    column="loan_application_type"    />
         <result property="aUserId"    column="a_user_id"    />
         <result property="aUserName"    column="a_user_name"    />
+        <result property="aAuthorize"    column="a_authorize"    />
         <result property="bUserId"    column="b_user_id"    />
         <result property="bUserName"    column="b_user_name"    />
         <result property="createBy"    column="create_by"    />
@@ -75,7 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectLoanApplicationVo">
-        select loan_application_id, loan_application_number, application_type,application_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, 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,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, loan_schedule, audit_schedule, audit_type, loan_application_type, a_user_id, a_user_name,a_authorize, 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">
@@ -128,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="applicationTime != null ">AND date_format(application_time,'%Y%m%d') &gt;= date_format(#{applicationTime},'%Y%m%d')</if>
             <if test="fileTime != null "> and file_time = #{fileTime}</if>
             <if test="loanSchedule != null  and loanSchedule != ''"> and loan_schedule = #{loanSchedule}</if>
+            <if test="aAuthorize != null  and aAuthorize != ''"> and a_authorize = #{aAuthorize}</if>
             <if test="auditSchedule != null  and auditSchedule != ''"> and audit_schedule = #{auditSchedule}</if>
             <if test="auditType != null  and auditType != ''"> and audit_type = #{auditType}</if>
             <if test="loanApplicationType != null  and loanApplicationType != ''"> and loan_application_type = #{loanApplicationType}</if>
@@ -218,6 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="loanApplicationType != null and loanApplicationType != ''">loan_application_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>
             <if test="bUserId != null">b_user_id,</if>
             <if test="bUserName != null">b_user_name,</if>
             <if test="createBy != null">create_by,</if>
@@ -286,6 +289,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="loanApplicationType != null and loanApplicationType != ''">#{loanApplicationType},</if>
             <if test="aUserId != null">#{aUserId},</if>
             <if test="aUserName != null">#{aUserName},</if>
+            <if test="aAuthorize != null and aAuthorize != ''">#{aAuthorize},</if>
             <if test="bUserId != null">#{bUserId},</if>
             <if test="bUserName != null">#{bUserName},</if>
             <if test="createBy != null">#{createBy},</if>
@@ -358,6 +362,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="loanApplicationType != null and loanApplicationType != ''">loan_application_type = #{loanApplicationType},</if>
             <if test="aUserId != null">a_user_id = #{aUserId},</if>
             <if test="aUserName != null">a_user_name = #{aUserName},</if>
+            <if test="aAuthorize != null and aAuthorize != ''">a_authorize = #{aAuthorize},</if>
             <if test="bUserId != null">b_user_id = #{bUserId},</if>
             <if test="bUserName != null">b_user_name = #{bUserName},</if>
             <if test="createBy != null">create_by = #{createBy},</if>

+ 2 - 1
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -55,7 +55,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		${params.dataScope}
 		order by r.role_sort
 	</select>
-    
+
+
 	<select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult">
 		<include refid="selectRoleVo"/>
 		WHERE r.del_flag = '0' and ur.user_id = #{userId}

+ 8 - 0
ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml

@@ -9,6 +9,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="roleId"     column="role_id"      />
 	</resultMap>
 
+	<select id="selectRoleListNoDataScope"  resultMap="SysUserRoleResult">
+		select  ur.role_id, ur.user_id
+		from sys_role r
+		left join sys_user_role ur on ur.role_id = r.role_id
+		where r.del_flag = '0'
+			AND r.role_key = 'manager'
+	</select>
+
 	<delete id="deleteUserRoleByUserId" parameterType="Long">
 		delete from sys_user_role where user_id=#{userId}
 	</delete>