Browse Source

更改反担保人逻辑

Administrator 11 tháng trước cách đây
mục cha
commit
d244e7d181
16 tập tin đã thay đổi với 1520 bổ sung119 xóa
  1. 103 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/guarantee/GuaranteeInfoController.java
  2. 103 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/guarantee/GuaranteeInfoFjController.java
  3. 187 66
      ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java
  4. 116 50
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/LoanApplicationServiceImpl.java
  5. 141 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/guarantee/GuaranteeInfo.java
  6. 140 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/guarantee/GuaranteeInfoFj.java
  7. 39 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/loan/LoanApplication.java
  8. 63 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/GuaranteeInfoFjMapper.java
  9. 71 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/GuaranteeInfoMapper.java
  10. 64 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/guarantee/IGuaranteeInfoFjService.java
  11. 63 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/guarantee/IGuaranteeInfoService.java
  12. 104 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/guarantee/impl/GuaranteeInfoFjServiceImpl.java
  13. 96 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/guarantee/impl/GuaranteeInfoServiceImpl.java
  14. 116 0
      ruoyi-system/src/main/resources/mapper/system/GuaranteeInfoFjMapper.xml
  15. 111 0
      ruoyi-system/src/main/resources/mapper/system/GuaranteeInfoMapper.xml
  16. 3 3
      ruoyi-system/src/main/resources/mapper/system/LoanApplicationMapper.xml

+ 103 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/guarantee/GuaranteeInfoController.java

@@ -0,0 +1,103 @@
+package com.ruoyi.web.controller.guarantee;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.guarantee.GuaranteeInfo;
+import com.ruoyi.system.service.guarantee.IGuaranteeInfoService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 反担保基础信息Controller
+ *
+ * @author boman
+ * @date 2024-08-01
+ */
+@RestController
+@RequestMapping("/guarantee/info")
+public class GuaranteeInfoController extends BaseController
+{
+    @Autowired
+    private IGuaranteeInfoService guaranteeInfoService;
+
+/**
+ * 查询反担保基础信息列表
+ */
+@PreAuthorize("@ss.hasPermi('guarantee:info:list')")
+@GetMapping("/list")
+    public TableDataInfo list(GuaranteeInfo guaranteeInfo)
+    {
+        startPage();
+        List<GuaranteeInfo> list = guaranteeInfoService.selectGuaranteeInfoList(guaranteeInfo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出反担保基础信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('guarantee:info:export')")
+    @Log(title = "反担保基础信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, GuaranteeInfo guaranteeInfo)
+    {
+        List<GuaranteeInfo> list = guaranteeInfoService.selectGuaranteeInfoList(guaranteeInfo);
+        ExcelUtil<GuaranteeInfo> util = new ExcelUtil<GuaranteeInfo>(GuaranteeInfo.class);
+        util.exportExcel(response, list, "反担保基础信息数据");
+    }
+
+    /**
+     * 获取反担保基础信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('guarantee:info:query')")
+    @GetMapping(value = "/{guaranteeInfoId}")
+    public AjaxResult getInfo(@PathVariable("guaranteeInfoId") Long guaranteeInfoId)
+    {
+        return success(guaranteeInfoService.selectGuaranteeInfoByGuaranteeInfoId(guaranteeInfoId));
+    }
+
+    /**
+     * 新增反担保基础信息
+     */
+    @PreAuthorize("@ss.hasPermi('guarantee:info:add')")
+    @Log(title = "反担保基础信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody GuaranteeInfo guaranteeInfo)
+    {
+        return toAjax(guaranteeInfoService.insertGuaranteeInfo(guaranteeInfo));
+    }
+
+    /**
+     * 修改反担保基础信息
+     */
+    @PreAuthorize("@ss.hasPermi('guarantee:info:edit')")
+    @Log(title = "反担保基础信息", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody GuaranteeInfo guaranteeInfo)
+    {
+        return toAjax(guaranteeInfoService.updateGuaranteeInfo(guaranteeInfo));
+    }
+
+    /**
+     * 删除反担保基础信息
+     */
+    @PreAuthorize("@ss.hasPermi('guarantee:info:remove')")
+    @Log(title = "反担保基础信息", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{guaranteeInfoIds}")
+    public AjaxResult remove(@PathVariable Long[] guaranteeInfoIds)
+    {
+        return toAjax(guaranteeInfoService.deleteGuaranteeInfoByGuaranteeInfoIds(guaranteeInfoIds));
+    }
+}

+ 103 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/guarantee/GuaranteeInfoFjController.java

@@ -0,0 +1,103 @@
+package com.ruoyi.web.controller.guarantee;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.guarantee.GuaranteeInfoFj;
+import com.ruoyi.system.service.guarantee.IGuaranteeInfoFjService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 反担保基础信息附件Controller
+ *
+ * @author boman
+ * @date 2024-08-01
+ */
+@RestController
+@RequestMapping("/guarantee/fj")
+public class GuaranteeInfoFjController extends BaseController
+{
+    @Autowired
+    private IGuaranteeInfoFjService guaranteeInfoFjService;
+
+/**
+ * 查询反担保基础信息附件列表
+ */
+@PreAuthorize("@ss.hasPermi('guarantee:fj:list')")
+@GetMapping("/list")
+    public TableDataInfo list(GuaranteeInfoFj guaranteeInfoFj)
+    {
+        startPage();
+        List<GuaranteeInfoFj> list = guaranteeInfoFjService.selectGuaranteeInfoFjList(guaranteeInfoFj);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出反担保基础信息附件列表
+     */
+    @PreAuthorize("@ss.hasPermi('guarantee:fj:export')")
+    @Log(title = "反担保基础信息附件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, GuaranteeInfoFj guaranteeInfoFj)
+    {
+        List<GuaranteeInfoFj> list = guaranteeInfoFjService.selectGuaranteeInfoFjList(guaranteeInfoFj);
+        ExcelUtil<GuaranteeInfoFj> util = new ExcelUtil<GuaranteeInfoFj>(GuaranteeInfoFj.class);
+        util.exportExcel(response, list, "反担保基础信息附件数据");
+    }
+
+    /**
+     * 获取反担保基础信息附件详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('guarantee:fj:query')")
+    @GetMapping(value = "/{guaranteeInfoFjId}")
+    public AjaxResult getInfo(@PathVariable("guaranteeInfoFjId") Long guaranteeInfoFjId)
+    {
+        return success(guaranteeInfoFjService.selectGuaranteeInfoFjByGuaranteeInfoFjId(guaranteeInfoFjId));
+    }
+
+    /**
+     * 新增反担保基础信息附件
+     */
+    @PreAuthorize("@ss.hasPermi('guarantee:fj:add')")
+    @Log(title = "反担保基础信息附件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody GuaranteeInfoFj guaranteeInfoFj)
+    {
+        return toAjax(guaranteeInfoFjService.insertGuaranteeInfoFj(guaranteeInfoFj));
+    }
+
+    /**
+     * 修改反担保基础信息附件
+     */
+    @PreAuthorize("@ss.hasPermi('guarantee:fj:edit')")
+    @Log(title = "反担保基础信息附件", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody GuaranteeInfoFj guaranteeInfoFj)
+    {
+        return toAjax(guaranteeInfoFjService.updateGuaranteeInfoFj(guaranteeInfoFj));
+    }
+
+    /**
+     * 删除反担保基础信息附件
+     */
+    @PreAuthorize("@ss.hasPermi('guarantee:fj:remove')")
+    @Log(title = "反担保基础信息附件", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{guaranteeInfoFjIds}")
+    public AjaxResult remove(@PathVariable Long[] guaranteeInfoFjIds)
+    {
+        return toAjax(guaranteeInfoFjService.deleteGuaranteeInfoFjByGuaranteeInfoFjIds(guaranteeInfoFjIds));
+    }
+}

+ 187 - 66
ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java

@@ -13,9 +13,13 @@ import com.ruoyi.common.config.RuoYiConfig;
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.common.utils.uuid.Seq;
+import com.ruoyi.system.domain.guarantee.GuaranteeInfo;
+import com.ruoyi.system.domain.guarantee.GuaranteeInfoFj;
 import com.ruoyi.system.domain.loan.LoanApplicationFj;
 import com.ruoyi.system.domain.loan.ShareholderFj;
+import com.ruoyi.system.mapper.GuaranteeInfoFjMapper;
 import com.ruoyi.system.mapper.ShareholderFjMapper;
+import com.ruoyi.system.service.guarantee.IGuaranteeInfoFjService;
 import com.ruoyi.system.service.loan.ILoanApplicationFjService;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang3.ObjectUtils;
@@ -48,8 +52,7 @@ import static com.ruoyi.common.constant.CommonConstants.*;
  */
 
 @Component
-public class AsyncFactory
-{
+public class AsyncFactory {
     private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user");
 
     @Autowired
@@ -64,21 +67,18 @@ public class AsyncFactory
      * 记录登录信息
      *
      * @param username 用户名
-     * @param status 状态
-     * @param message 消息
-     * @param args 列表
+     * @param status   状态
+     * @param message  消息
+     * @param args     列表
      * @return 任务task
      */
     public static TimerTask recordLogininfor(final String username, final String status, final String message,
-            final Object... args)
-    {
+                                             final Object... args) {
         final UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
         final String ip = IpUtils.getIpAddr();
-        return new TimerTask()
-        {
+        return new TimerTask() {
             @Override
-            public void run()
-            {
+            public void run() {
                 String address = AddressUtils.getRealAddressByIP(ip);
                 StringBuilder s = new StringBuilder();
                 s.append(LogUtils.getBlock(ip));
@@ -101,12 +101,9 @@ public class AsyncFactory
                 logininfor.setOs(os);
                 logininfor.setMsg(message);
                 // 日志状态
-                if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER))
-                {
+                if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER)) {
                     logininfor.setStatus(Constants.SUCCESS);
-                }
-                else if (Constants.LOGIN_FAIL.equals(status))
-                {
+                } else if (Constants.LOGIN_FAIL.equals(status)) {
                     logininfor.setStatus(Constants.FAIL);
                 }
                 // 插入数据
@@ -121,13 +118,10 @@ public class AsyncFactory
      * @param operLog 操作日志信息
      * @return 任务task
      */
-    public static TimerTask recordOper(final SysOperLog operLog)
-    {
-        return new TimerTask()
-        {
+    public static TimerTask recordOper(final SysOperLog operLog) {
+        return new TimerTask() {
             @Override
-            public void run()
-            {
+            public void run() {
                 // 远程查询操作地点
                 operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp()));
                 SpringUtils.getBean(ISysOperLogService.class).insertOperlog(operLog);
@@ -142,23 +136,22 @@ public class AsyncFactory
      * @return
      */
     public static TimerTask createPdfFromImages(List<LoanApplicationFj> loanApplicationFjList, String loanApplicationNumber) {
-        return new TimerTask(){
+        return new TimerTask() {
             @Override
-            public void run()
-            {
-                String key = "lock:A:"+loanApplicationNumber;
-                redisCache.setCacheObject(key,1,5, TimeUnit.MINUTES);
+            public void run() {
+                String key = "lock:A:" + loanApplicationNumber;
+                redisCache.setCacheObject(key, 1, 5, TimeUnit.MINUTES);
                 //自定义锁,必须要所有异步任务都跑完才能再次修改
                 //根据文件类型进行判断是否需要合成pdf
                 Map<String, List<LoanApplicationFj>> bigTypeMap = loanApplicationFjList.stream().collect(Collectors.groupingBy(LoanApplicationFj::getBigType));
-                if (bigTypeMap.size() > 0){
+                if (bigTypeMap.size() > 0) {
                     List<LoanApplicationFj> loanApplicationFjListA = bigTypeMap.get(A);
                     List<LoanApplicationFj> loanApplicationFjListB = bigTypeMap.get(B);
-                    if (loanApplicationFjListA != null && loanApplicationFjListA.size() > 0){
-                        createPdfFromImages(loanApplicationFjList,loanApplicationFjListA,loanApplicationNumber,A);
+                    if (loanApplicationFjListA != null && loanApplicationFjListA.size() > 0) {
+                        createPdfFromImages(loanApplicationFjList, loanApplicationFjListA, loanApplicationNumber, A);
                     }
-                    if (loanApplicationFjListB != null && loanApplicationFjListB.size() > 0){
-                        createPdfFromImages(loanApplicationFjList,loanApplicationFjListB,loanApplicationNumber,B);
+                    if (loanApplicationFjListB != null && loanApplicationFjListB.size() > 0) {
+                        createPdfFromImages(loanApplicationFjList, loanApplicationFjListB, loanApplicationNumber, B);
                     }
                 }
                 //自定义锁,必须要所有异步任务都跑完才能再次修改
@@ -168,20 +161,20 @@ public class AsyncFactory
     }
 
     /**
-     *
-     * @param loanApplicationFjList 全体附件
+     * @param loanApplicationFjList  全体附件
      * @param loanApplicationFjListA 分附件大类集合
      * @return
      */
-    public static void createPdfFromImages(List<LoanApplicationFj> loanApplicationFjList, List<LoanApplicationFj> loanApplicationFjListA,String loanApplicationNumber,String bigType){
-        if (loanApplicationFjListA != null && loanApplicationFjListA.size() > 0){
+    public static void createPdfFromImages(List<LoanApplicationFj> loanApplicationFjList, List<LoanApplicationFj> loanApplicationFjListA, String loanApplicationNumber, String bigType) {
+        if (loanApplicationFjListA != null && loanApplicationFjListA.size() > 0) {
             Map<String, List<LoanApplicationFj>> typeMap = loanApplicationFjListA.stream().collect(Collectors.groupingBy(LoanApplicationFj::getType));
+            List<LoanApplicationFj> list = new ArrayList<>();
             for (String type : typeMap.keySet()) {
                 List<LoanApplicationFj> loanApplicationFjListInsert = typeMap.get(type);
                 //获取附件名称
                 String fjName = loanApplicationFjListInsert.get(0).getName().split("_")[0];
                 List<String> typeList = loanApplicationFjListInsert.stream().filter(e -> type.equals(e.getType()) && ("png".equals(e.getName().split("\\.")[1]) || "jpg".equals(e.getName().split("\\.")[1]) || "jpeg".equals(e.getName().split("\\.")[1]))).map(LoanApplicationFj::getUrl).collect(Collectors.toList());
-                if (typeList.size() > 0){
+                if (typeList.size() > 0) {
                     for (int i = 0; i < typeList.size(); i++) {
                         ///profile/upload/RZDB202405281147018884551/公司章程_20240528114820A002.png 前缀替换
                         String replaced = typeList.get(i).replace("/profile/upload", RuoYiConfig.getUploadPath());
@@ -189,29 +182,33 @@ public class AsyncFactory
                     }
                     //先删除原先的pdf数据库记录
                     List<LoanApplicationFj> pdfOne = loanApplicationFjListInsert.stream().filter(e -> ObjectUtils.isNotEmpty(e.getRemark()) && e.getRemark().equals(ONE) && ("pdf".equals(e.getName().split("\\.")[1]))).collect(Collectors.toList());
-                    if (pdfOne.size() > 0){
+                    if (pdfOne.size() > 0) {
                         for (LoanApplicationFj loanApplicationFj : pdfOne) {
                             //删除数据库数据
                             SpringUtils.getBean(ILoanApplicationFjService.class).deleteLoanApplicationFjByFjId(loanApplicationFj.getFjId());
                             //删除服务器记录
                             String urlPdf = loanApplicationFj.getUrl();
-                            if (StringUtils.isNotBlank(urlPdf)){
+                            if (StringUtils.isNotBlank(urlPdf)) {
                                 String filePath = urlPdf.replace("/profile/upload", RuoYiConfig.getUploadPath());
                                 //删除服务器上对应文件
                                 File file = new File(filePath);
-                                if (file.exists()){
-                                    if (file.delete()){
-                                        System.out.println("删除:"+filePath);
-                                    }else {
-                                        System.out.println("删除:"+filePath+"失败");
+                                if (file.exists()) {
+                                    if (file.delete()) {
+                                        System.out.println("删除:" + filePath);
+                                    } else {
+                                        System.out.println("删除:" + filePath + "失败");
                                     }
                                 }
                             }
                         }
                     }
-                    createPdfFromImages(loanApplicationFjList, typeList, loanApplicationNumber, fjName+"_" + Seq.getId(Seq.uploadSeqType), type,bigType);
+                    createPdfFromImages(list, loanApplicationFjList, typeList, loanApplicationNumber, fjName + "_" + Seq.getId(Seq.uploadSeqType), type, bigType);
                 }
             }
+            if (list.size() > 0){
+                // 插入数据
+                SpringUtils.getBean(ILoanApplicationFjService.class).insertLoanApplicationFj(list);
+            }
         }
     }
 
@@ -221,14 +218,14 @@ public class AsyncFactory
      * @param originalFilename      pdf文件名称
      * @param type                  文件类型
      */
-    public static void createPdfFromImages(List<LoanApplicationFj> loanApplicationFjList, List<String> imagePaths, String loanApplicationNumber, String originalFilename, String type,String bigType) {
+    public static List<LoanApplicationFj> createPdfFromImages(List<LoanApplicationFj> list, List<LoanApplicationFj> loanApplicationFjList, List<String> imagePaths, String loanApplicationNumber, String originalFilename, String type, String bigType) {
         // 上传文件路径 = 根+申请编号
         String filePath = StringUtils.format("{}/{}/{}.{}", RuoYiConfig.getUploadPath(), loanApplicationNumber,
                 FilenameUtils.getBaseName(originalFilename), "pdf");
         //pdf保存位置
         File outPutPdf = new File(filePath);
         try {
-            List list = new ArrayList();
+
             FileUploadUtils.createPdfFromImages(imagePaths, outPutPdf);
             //往附件信息中插入对应PDF数据
             LoanApplicationFj applicationFj = new LoanApplicationFj();
@@ -242,43 +239,40 @@ public class AsyncFactory
             //给前端判断是否是系统生成的pdf
             applicationFj.setRemark(ONE);
             list.add(applicationFj);
-            // 插入数据
-            SpringUtils.getBean(ILoanApplicationFjService.class).insertLoanApplicationFj(list);
         } catch (IOException e) {
             e.printStackTrace();
         }
+        return list;
     }
 
 
-
     /**
-     * 合并图片生成PDF保存为文件
+     * 股东附件合并图片生成PDF保存为文件
      *
      * @param shareholderFjList
      * @return
      */
 
     public static TimerTask createPdfFromImagesShareholder(List<ShareholderFj> shareholderFjList, String loanApplicationNumber) {
-        return new TimerTask(){
+        return new TimerTask() {
             @Override
-            public void run()
-            {
-                String key = "lock:B:"+loanApplicationNumber;
-                redisCache.setCacheObject(key,1,5, TimeUnit.MINUTES);
+            public void run() {
+                String key = "lock:B:" + loanApplicationNumber;
+                redisCache.setCacheObject(key, 1, 5, TimeUnit.MINUTES);
                 List<String> imagePaths = new ArrayList<>();
                 //根据文件类型进行判断是否需要合成pdf
                 for (ShareholderFj shareholderFj : shareholderFjList) {
                     //获取原先的pdf地址,去服务器上删除要替换路径
                     String shareholderZxUrlPdf = shareholderFj.getShareholderZxUrlPdf();
-                    if (StringUtils.isNotBlank(shareholderZxUrlPdf)){
+                    if (StringUtils.isNotBlank(shareholderZxUrlPdf)) {
                         String filePath = shareholderZxUrlPdf.replace("/profile/upload", RuoYiConfig.getUploadPath());
                         //删除服务器上对应文件
                         File file = new File(filePath);
-                        if (file.exists()){
-                            if (file.delete()){
-                                System.out.println("删除:"+filePath);
-                            }else {
-                                System.out.println("删除:"+filePath+"失败");
+                        if (file.exists()) {
+                            if (file.delete()) {
+                                System.out.println("删除:" + filePath);
+                            } else {
+                                System.out.println("删除:" + filePath + "失败");
                             }
                         }
                     }
@@ -286,13 +280,13 @@ public class AsyncFactory
                     if (StringUtils.isNotEmpty(shareholderZxUrl)) {
                         String[] split = shareholderZxUrl.split(",");
                         for (String fileName : split) {
-                            if ("png".equals(fileName.split("\\.")[1]) || "jpg".equals(fileName.split("\\.")[1]) || "jpeg".equals(fileName.split("\\.")[1])){
+                            if ("png".equals(fileName.split("\\.")[1]) || "jpg".equals(fileName.split("\\.")[1]) || "jpeg".equals(fileName.split("\\.")[1])) {
                                 imagePaths.add(fileName);
                             }
                         }
                     }
                     if (imagePaths.size() > 0) {
-                        String substring = imagePaths.get(0).substring(imagePaths.get(0).lastIndexOf("/")+1, imagePaths.get(0).lastIndexOf("_"))+Seq.getId(Seq.uploadSeqType);
+                        String substring = imagePaths.get(0).substring(imagePaths.get(0).lastIndexOf("/") + 1, imagePaths.get(0).lastIndexOf("_")) + Seq.getId(Seq.uploadSeqType);
 
                         for (int i = 0; i < imagePaths.size(); i++) {
                             //前缀替换
@@ -316,12 +310,12 @@ public class AsyncFactory
                 }
                 //判断是否有股东shareholder_fj_id
                 List<ShareholderFj> shareholderFjsInsert = shareholderFjList.stream().filter(e -> ObjectUtils.isEmpty(e.getShareholderFjId())).collect(Collectors.toList());
-                if (shareholderFjsInsert.size() > 0){
+                if (shareholderFjsInsert.size() > 0) {
                     // 新增股东数据
                     SpringUtils.getBean(ShareholderFjMapper.class).batchShareholderFj(shareholderFjsInsert);
                 }
                 List<ShareholderFj> shareholderFjsUpdate = shareholderFjList.stream().filter(e -> ObjectUtils.isNotEmpty(e.getShareholderFjId())).collect(Collectors.toList());
-                if (shareholderFjsUpdate.size() > 0){
+                if (shareholderFjsUpdate.size() > 0) {
                     for (ShareholderFj shareholderFj : shareholderFjsUpdate) {
                         //更新股东信息
                         SpringUtils.getBean(ShareholderFjMapper.class).updateShareholderFj(shareholderFj);
@@ -331,4 +325,131 @@ public class AsyncFactory
             }
         };
     }
+
+
+    /**
+     * 反担保附件合并图片生成PDF保存为文件
+     *
+     * @param guaranteeInfoList 反担保基础信息集合
+     * @return
+     */
+
+    public static TimerTask createPdfFromImagesGuaranteeInfo(List<GuaranteeInfo> guaranteeInfoList, String loanApplicationNumber) {
+        return new TimerTask() {
+            @Override
+            public void run() {
+                String key = "lock:C:" + loanApplicationNumber;
+                redisCache.setCacheObject(key, 1, 5, TimeUnit.MINUTES);
+                List<GuaranteeInfoFj> list = new ArrayList();
+                //根据文件类型进行判断是否需要合成pdf
+                for (GuaranteeInfo guaranteeInfo : guaranteeInfoList) {
+                    Long loanApplicationId = guaranteeInfo.getLoanApplicationId();
+                    Long guaranteeInfoId = guaranteeInfo.getGuaranteeInfoId();
+                    //所有反担保信息的附件
+                    List<GuaranteeInfoFj> guaranteeInfoFjList = guaranteeInfo.getGuaranteeInfoFjList();
+                    if (guaranteeInfoFjList != null && guaranteeInfoFjList.size() > 0) {
+                        for (GuaranteeInfoFj guaranteeInfoFj : guaranteeInfoFjList) {
+                            guaranteeInfoFj.setGuaranteeInfoId(guaranteeInfoId);
+                        }
+                        Map<String, List<GuaranteeInfoFj>> typeMap = guaranteeInfoFjList.stream().collect(Collectors.groupingBy(GuaranteeInfoFj::getType));
+                        for (String type : typeMap.keySet()) {
+                            //每个反担保信息的单个分类的附件集合
+                            List<GuaranteeInfoFj> guaranteeInfoFjInsert = typeMap.get(type);
+                            String fjName = guaranteeInfoFjInsert.get(0).getName().split("_")[0];
+                            List<String> imagePaths = guaranteeInfoFjInsert.stream().filter(e -> type.equals(e.getType()) && ("png".equals(e.getName().split("\\.")[1]) || "jpg".equals(e.getName().split("\\.")[1]) || "jpeg".equals(e.getName().split("\\.")[1]))).map(GuaranteeInfoFj::getUrl).collect(Collectors.toList());
+                            //替换前缀,获取服务器上地址
+                            if (imagePaths.size() > 0) {
+                                for (int i = 0; i < imagePaths.size(); i++) {
+                                    ///profile/upload/RZDB202405281147018884551/公司章程_20240528114820A002.png 前缀替换
+                                    String replaced = imagePaths.get(i).replace("/profile/upload", RuoYiConfig.getUploadPath());
+                                    imagePaths.set(i, replaced);
+                                }
+
+                                //先删除原先的所有pdf数据库记录
+                                GuaranteeInfoFj gInfoFj = new GuaranteeInfoFj();
+                                gInfoFj.setLoanApplicationId(loanApplicationId);
+                                gInfoFj.setLoanApplicationNumber(loanApplicationNumber);
+                                gInfoFj.setGuaranteeInfoId(guaranteeInfoId);
+                                gInfoFj.setRemark("1");
+                                List<GuaranteeInfoFj> pdfOne = SpringUtils.getBean(GuaranteeInfoFjMapper.class).selectGuaranteeInfoFjList(gInfoFj);
+                                if (pdfOne.size() > 0) {
+                                    for (GuaranteeInfoFj guaranteeInfoFj : pdfOne) {
+                                        //删除数据库数据附件记录
+                                        SpringUtils.getBean(IGuaranteeInfoFjService.class).deleteGuaranteeInfoFjByGuaranteeInfoFjId(guaranteeInfoFj.getGuaranteeInfoFjId());
+                                        //删除服务器记录
+                                        String urlPdf = guaranteeInfoFj.getUrl();
+                                        if (StringUtils.isNotBlank(urlPdf)) {
+                                            String filePath = urlPdf.replace("/profile/upload", RuoYiConfig.getUploadPath());
+                                            //删除服务器上对应文件
+                                            File file = new File(filePath);
+                                            if (file.exists()) {
+                                                if (file.delete()) {
+                                                    System.out.println("删除:" + filePath);
+                                                } else {
+                                                    System.out.println("删除:" + filePath + "失败");
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                                //生成PDF数据库数据
+                                createPdfFromImagesGuaranteeInfoFj(list,guaranteeInfoFjInsert, imagePaths, loanApplicationNumber, fjName + "_" + Seq.getId(Seq.uploadSeqType), type, loanApplicationId, guaranteeInfoId);
+                            }
+                        }
+                        //判断是否有股东shareholder_fj_id
+                        List<GuaranteeInfoFj> guaranteeInfoFjListInsert = guaranteeInfoFjList.stream().filter(e -> ObjectUtils.isEmpty(e.getGuaranteeInfoFjId())).collect(Collectors.toList());
+                        if (guaranteeInfoFjListInsert.size() > 0) {
+                            // 新增反担保附件数据
+                            SpringUtils.getBean(GuaranteeInfoFjMapper.class).batchGuaranteeInfoFj(guaranteeInfoFjListInsert);
+                        }
+                        List<GuaranteeInfoFj> guaranteeInfoFjListUpdate = guaranteeInfoFjList.stream().filter(e -> ObjectUtils.isNotEmpty(e.getGuaranteeInfoFjId())).collect(Collectors.toList());
+                        if (guaranteeInfoFjListUpdate.size() > 0) {
+                            for (GuaranteeInfoFj guaranteeInfoFj : guaranteeInfoFjListUpdate) {
+                                //更新反担保附件信息
+                                SpringUtils.getBean(GuaranteeInfoFjMapper.class).updateGuaranteeInfoFj(guaranteeInfoFj);
+                            }
+                        }
+                    }
+                }
+                //插入附件数据库数据生成的pdf
+                if (list.size() > 0){
+                    SpringUtils.getBean(IGuaranteeInfoFjService.class).batchGuaranteeInfoFj(list);
+                }
+                redisCache.deleteObject(key);
+            }
+        };
+    }
+
+    /**
+     * @param imagePaths            图片地址集合
+     * @param loanApplicationNumber 申请编号
+     * @param originalFilename      pdf文件名称
+     * @param type                  文件类型
+     */
+    public static List<GuaranteeInfoFj> createPdfFromImagesGuaranteeInfoFj( List<GuaranteeInfoFj> list ,List<GuaranteeInfoFj> guaranteeInfoFjInsert, List<String> imagePaths, String loanApplicationNumber, String originalFilename, String type, Long loanApplicationId, Long guaranteeInfoId) {
+        // 上传文件路径 = 根+申请编号
+        String filePath = StringUtils.format("{}/{}/{}.{}", RuoYiConfig.getUploadPath(), loanApplicationNumber,
+                FilenameUtils.getBaseName(originalFilename), "pdf");
+        //pdf保存位置
+        File outPutPdf = new File(filePath);
+        try {
+            FileUploadUtils.createPdfFromImages(imagePaths, outPutPdf);
+            //往附件信息中插入对应PDF数据
+            GuaranteeInfoFj guaranteeInfoFj = new GuaranteeInfoFj();
+            guaranteeInfoFj.setLoanApplicationId(loanApplicationId);
+            guaranteeInfoFj.setLoanApplicationNumber(loanApplicationNumber);
+            guaranteeInfoFj.setGuaranteeInfoId(guaranteeInfoId);
+            guaranteeInfoFj.setName(originalFilename + ".pdf");
+            guaranteeInfoFj.setUrl(StringUtils.format("{}/{}/{}.{}", "/profile/upload", loanApplicationNumber,
+                    FilenameUtils.getBaseName(originalFilename), "pdf"));
+            guaranteeInfoFj.setType(type);
+            //给前端判断是否是系统生成的pdf
+            guaranteeInfoFj.setRemark(ONE);
+            list.add(guaranteeInfoFj);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return list;
+    }
 }
+

+ 116 - 50
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/LoanApplicationServiceImpl.java

@@ -19,6 +19,8 @@ import com.ruoyi.framework.manager.factory.AsyncFactory;
 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.guarantee.GuaranteeInfo;
+import com.ruoyi.system.domain.guarantee.GuaranteeInfoFj;
 import com.ruoyi.system.domain.loan.LoanApplication;
 import com.ruoyi.system.domain.loan.LoanApplicationFj;
 import com.ruoyi.system.domain.loan.LoanSchedule;
@@ -69,7 +71,10 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
     private WaitRemindMapper waitRemindMapper;
     @Resource
     private SysDictDataMapper dictDataMapper;
-
+    @Resource
+    private GuaranteeInfoMapper guaranteeInfoMapper;
+    @Resource
+    private GuaranteeInfoFjMapper guaranteeInfoFjMapper;
 
     @Autowired
     private RedisCache redisCache;
@@ -87,14 +92,16 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
     public AjaxResult selectLoanApplicationByLoanApplicationId(Long loanApplicationId) {
 
         LoanApplication loanApplication = loanApplicationMapper.selectLoanApplicationByLoanApplicationId(loanApplicationId);
-        if (loanApplication != null){
+        if (loanApplication != null) {
             String loanApplicationNumber = loanApplication.getLoanApplicationNumber();
             //判断自定义锁,必须全部释放,才能修改
             String keyA = "lock:A:" + loanApplicationNumber;
             String keyB = "lock:B:" + loanApplicationNumber;
+            String keyC = "lock:C:" + loanApplicationNumber;
             Object cacheObjectA = redisCache.getCacheObject(keyA);
             Object cacheObjectB = redisCache.getCacheObject(keyB);
-            if (ObjectUtils.isNotEmpty(cacheObjectA)||ObjectUtils.isNotEmpty(cacheObjectB)) {
+            Object cacheObjectC = redisCache.getCacheObject(keyC);
+            if (ObjectUtils.isNotEmpty(cacheObjectA) || ObjectUtils.isNotEmpty(cacheObjectB) || ObjectUtils.isNotEmpty(cacheObjectC)) {
                 return AjaxResult.error("稍后重试,文件正在生成");
             }
         }
@@ -135,6 +142,19 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         if (redisCache.getCacheObject(loanApplication.getLoanApplicationNumber() + "tp") != null) {
             loanApplication.setVotingResult(redisCache.getCacheObject(loanApplication.getLoanApplicationNumber() + "tp"));
         }
+        //查询反担保人信息
+        List<GuaranteeInfo> guaranteeInfos = guaranteeInfoMapper.selectGuaranteeInfoListByLoanApplicationId(loanApplicationId);
+        //查询对应的附件
+        if (guaranteeInfos != null && guaranteeInfos.size() > 0){
+            for (GuaranteeInfo guaranteeInfo : guaranteeInfos) {
+                GuaranteeInfoFj guaranteeInfoFj = new GuaranteeInfoFj();
+                guaranteeInfoFj.setLoanApplicationId(loanApplicationId);
+                guaranteeInfoFj.setGuaranteeInfoId(guaranteeInfo.getGuaranteeInfoId());
+                List<GuaranteeInfoFj> guaranteeInfoFjs = guaranteeInfoFjMapper.selectGuaranteeInfoFjList(guaranteeInfoFj);
+                guaranteeInfo.setGuaranteeInfoFjList(guaranteeInfoFjs);
+            }
+        }
+        loanApplication.setGuaranteeInfoList(guaranteeInfos);
         return AjaxResult.success(loanApplication);
     }
 
@@ -250,9 +270,19 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 shareholderFj.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
             }
             AsyncManager.me().execute(AsyncFactory.createPdfFromImagesShareholder(shareholderFjList, loanApplication.getLoanApplicationNumber()));
-            //shareholderFjMapper.batchShareholderFj(shareholderFjList);
         }
-
+        //反担保基础信息和附件新增
+        List<GuaranteeInfo> guaranteeInfoList = loanApplication.getGuaranteeInfoList();
+        if (guaranteeInfoList != null && guaranteeInfoList.size() > 0) {
+            for (GuaranteeInfo guaranteeInfo : guaranteeInfoList) {
+                guaranteeInfo.setLoanApplicationId(loanApplication.getLoanApplicationId());
+                guaranteeInfo.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+            }
+            //先新增反担保基础信息,再去异步插入附件
+            guaranteeInfoMapper.batchGuaranteeInfo(guaranteeInfoList);
+            //异步插入附件
+            AsyncManager.me().execute(AsyncFactory.createPdfFromImagesGuaranteeInfo(guaranteeInfoList, loanApplication.getLoanApplicationNumber()));
+        }
         //往业务进度表 loan_schedule 插入数据
         LoanSchedule loanSchedule = new LoanSchedule();
         loanSchedule.setLoanApplicationId(loanApplication.getLoanApplicationId());
@@ -275,27 +305,21 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
     @Override
     public AjaxResult updateLoanApplication(LoanApplication loanApplication) {
 
-        //判断自定义锁,必须全部释放,才能修改
-        String keyA = "lock:A:" + loanApplication.getLoanApplicationNumber();
-        String keyB = "lock:B:" + loanApplication.getLoanApplicationNumber();
-        Object cacheObjectA = redisCache.getCacheObject(keyA);
-        Object cacheObjectB = redisCache.getCacheObject(keyB);
-        if (ObjectUtils.isNotEmpty(cacheObjectA)||ObjectUtils.isNotEmpty(cacheObjectB)) {
-            return AjaxResult.error("稍后重试,文件正在生成");
-        }
         loanApplication.setUpdateTime(DateUtils.getNowDate());
         loanApplication.setLoanApplicationType(TWO);
         loanApplication.setApplicationTime(DateUtils.getNowDate());
         Long loanApplicationId = loanApplication.getLoanApplicationId();
         //判断如果是审核进度 =1 贷款申请进度 =2业务审核/分配 审核状态 = 3(未通过的时候)把审核状态改为1 待审核
-        if (loanApplication.getLoanSchedule().equals(TWO) && loanApplication.getAuditSchedule().equals(ONE) && loanApplication.getAuditType().equals(THR)){
+        if (loanApplication.getLoanSchedule().equals(TWO) && loanApplication.getAuditSchedule().equals(ONE) && loanApplication.getAuditType().equals(THR)) {
             loanApplication.setAuditType(ONE);
         }
 
         //需要删除的id集合
         Long[] loanApplicationFjIdList = loanApplication.getLoanApplicationFjIdList();
         Long[] shareholderFjIdList = loanApplication.getShareholderFjIdList();
-
+        Long[] guaranteeInfoIdList = loanApplication.getGuaranteeInfoIdList();
+        //反担保附件删除id集合
+        Long[] guaranteeInfoFjIdList = loanApplication.getGuaranteeInfoFjIdList();
         List<LoanApplicationFj> loanApplicationFjList = loanApplication.getLoanApplicationFjList();
         if (loanApplicationFjList != null && loanApplicationFjList.size() > 0) {
             //判断有附件id的附件进行修改,没有的进行新增
@@ -327,6 +351,36 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         if (shareholderFjIdList.length > 0) {
             shareholderFjMapper.deleteShareholderFjByShareholderFjIds(shareholderFjIdList);
         }
+
+        //反担保基础信息和附件新增
+        List<GuaranteeInfo> guaranteeInfoList = loanApplication.getGuaranteeInfoList();
+        if (guaranteeInfoList != null && guaranteeInfoList.size() > 0) {
+            for (GuaranteeInfo guaranteeInfo : guaranteeInfoList) {
+                guaranteeInfo.setLoanApplicationId(loanApplication.getLoanApplicationId());
+                guaranteeInfo.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+            }
+            //判断有反担保信息表id的进行修改,没有的进行新增
+            List<GuaranteeInfo> guaranteeInfosInsert = guaranteeInfoList.stream().filter(e -> ObjectUtils.isEmpty(e.getGuaranteeInfoId())).collect(Collectors.toList());
+            List<GuaranteeInfo> guaranteeInfosUpdate = guaranteeInfoList.stream().filter(e -> ObjectUtils.isNotEmpty(e.getGuaranteeInfoId())).collect(Collectors.toList());
+            if (guaranteeInfosInsert.size() > 0){
+                guaranteeInfoMapper.batchGuaranteeInfo(guaranteeInfoList);
+            }
+            if (guaranteeInfosUpdate.size() > 0) {
+                for (GuaranteeInfo guaranteeInfo : guaranteeInfosUpdate) {
+                    guaranteeInfoMapper.updateGuaranteeInfo(guaranteeInfo);
+                }
+            }
+            if (guaranteeInfoFjIdList.length > 0){
+                guaranteeInfoFjMapper.deleteGuaranteeInfoFjByGuaranteeInfoFjIds(guaranteeInfoFjIdList);
+            }
+            if (guaranteeInfoIdList.length > 0){
+                guaranteeInfoMapper.deleteGuaranteeInfoByGuaranteeInfoIds(guaranteeInfoIdList);
+            }
+            //先新增反担保基础信息,再去异步插入附件
+            //异步插入附件
+            AsyncManager.me().execute(AsyncFactory.createPdfFromImagesGuaranteeInfo(guaranteeInfoList, loanApplication.getLoanApplicationNumber()));
+        }
+
         int rows = loanApplicationMapper.updateLoanApplication(loanApplication);
         return rows > 0 ? AjaxResult.success() : AjaxResult.error();
     }
@@ -339,14 +393,6 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
      */
     @Override
     public AjaxResult temporary(LoanApplication loanApplication) {
-        //判断自定义锁,必须全部释放,才能修改
-        String keyA = "lock:A:" + loanApplication.getLoanApplicationNumber();
-        String keyB = "lock:B:" + loanApplication.getLoanApplicationNumber();
-        Object cacheObjectA = redisCache.getCacheObject(keyA);
-        Object cacheObjectB = redisCache.getCacheObject(keyB);
-        if (ObjectUtils.isNotEmpty(cacheObjectA)||ObjectUtils.isNotEmpty(cacheObjectB)) {
-            return AjaxResult.error("稍后重试,文件正在生成");
-        }
         loanApplication.setLoanApplicationType(ONE);
         Long loanApplicationId = loanApplication.getLoanApplicationId();
         //走修改
@@ -354,7 +400,9 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             //需要删除的id集合
             Long[] loanApplicationFjIdList = loanApplication.getLoanApplicationFjIdList();
             Long[] shareholderFjIdList = loanApplication.getShareholderFjIdList();
-
+            Long[] guaranteeInfoIdList = loanApplication.getGuaranteeInfoIdList();
+            //反担保附件删除id集合
+            Long[] guaranteeInfoFjIdList = loanApplication.getGuaranteeInfoFjIdList();
             List<LoanApplicationFj> loanApplicationFjList = loanApplication.getLoanApplicationFjList();
             if (loanApplicationFjList != null && loanApplicationFjList.size() > 0) {
                 //判断有附件id的附件进行修改,没有的进行新增
@@ -388,6 +436,37 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             if (shareholderFjIdList.length > 0) {
                 shareholderFjMapper.deleteShareholderFjByShareholderFjIds(shareholderFjIdList);
             }
+
+            //反担保基础信息和附件新增
+            List<GuaranteeInfo> guaranteeInfoList = loanApplication.getGuaranteeInfoList();
+            if (guaranteeInfoList != null && guaranteeInfoList.size() > 0) {
+                for (GuaranteeInfo guaranteeInfo : guaranteeInfoList) {
+                    guaranteeInfo.setLoanApplicationId(loanApplication.getLoanApplicationId());
+                    guaranteeInfo.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+                }
+                //判断有反担保信息表id的进行修改,没有的进行新增
+                List<GuaranteeInfo> guaranteeInfosInsert = guaranteeInfoList.stream().filter(e -> ObjectUtils.isEmpty(e.getGuaranteeInfoId())).collect(Collectors.toList());
+                List<GuaranteeInfo> guaranteeInfosUpdate = guaranteeInfoList.stream().filter(e -> ObjectUtils.isNotEmpty(e.getGuaranteeInfoId())).collect(Collectors.toList());
+                if (guaranteeInfosInsert.size() > 0){
+                    guaranteeInfoMapper.batchGuaranteeInfo(guaranteeInfoList);
+                }
+                if (guaranteeInfosUpdate.size() > 0) {
+                    for (GuaranteeInfo guaranteeInfo : guaranteeInfosUpdate) {
+                        guaranteeInfoMapper.updateGuaranteeInfo(guaranteeInfo);
+                    }
+                }
+                if (guaranteeInfoFjIdList.length > 0){
+                    guaranteeInfoFjMapper.deleteGuaranteeInfoFjByGuaranteeInfoFjIds(guaranteeInfoFjIdList);
+                }
+                if (guaranteeInfoIdList.length > 0){
+                    guaranteeInfoMapper.deleteGuaranteeInfoByGuaranteeInfoIds(guaranteeInfoIdList);
+                }
+                //先新增反担保基础信息,再去异步插入附件
+                //异步插入附件
+                AsyncManager.me().execute(AsyncFactory.createPdfFromImagesGuaranteeInfo(guaranteeInfoList, loanApplication.getLoanApplicationNumber()));
+            }
+
+
             int rows = loanApplicationMapper.updateLoanApplication(loanApplication);
             return rows > 0 ? AjaxResult.success() : AjaxResult.error();
         }
@@ -459,7 +538,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
     @Override
     public AjaxResult sh(ReviewComments reviewComments) {
         reviewComments.setAuditTime(DateUtils.getNowDate());
-        List<SysUserConference> sysUserConferenceList = reviewComments.getSysUserConferenceList();
+        //List<SysUserConference> sysUserConferenceList = reviewComments.getSysUserConferenceList();
         //审核进度1:业务审核/分配 2:A角色审核 3:B角色审核 4:风险审核 5:初审风险合规 6:尽职调查7:上会评审
         String auditSchedule = reviewComments.getAuditSchedule();
         //审核状态 1:待审核 2:已通过 3:未通过 4:申诉
@@ -678,30 +757,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                     }
                 }
                 //审核流程结束
-            } /*else if (auditSchedule.equals(SEV)) {
-                loanApplication.setLoanSchedule(String.valueOf(Integer.parseInt(loanScheduleOld) + 1));
-                loanApplication.setAuditSchedule(auditSchedule);
-                loanApplication.setAuditType(auditType);
-                //给A角色发送待办提醒
-                waitRemind.setReadUserId(loanApplication.getaUserId().toString());
-                waitRemind.setRemindContent(enterpriseName + "的审核信息申请通过进入到下一阶段");
-                waitRemindList.add(waitRemind);
-                if (sysUserRoles != null && sysUserRoles.size() > 0) {
-                    for (SysUserRole sysUserRole : sysUserRoles) {
-                        WaitRemind waitRemindManager = new WaitRemind();
-                        waitRemindManager.setLoanApplicationId(loanApplicationId);
-                        waitRemindManager.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
-                        waitRemindManager.setRemindTitle("有一条【" + enterpriseName + "】的审核信息进入到下一阶段");
-                        waitRemindManager.setRemindTime(DateUtils.getNowDate());
-                        waitRemindManager.setRemindType(TWO);
-                        waitRemindManager.setReadUserId(loanApplication.getaUserId().toString());
-                        waitRemindManager.setRemindContent(enterpriseName + "的审核信息申请通过进入到下一阶段");
-                        //给管理员发送待办提醒
-                        waitRemindManager.setReadUserId(sysUserRole.getUserId().toString());
-                        waitRemindList.add(waitRemindManager);
-                    }
-                }
-            }*/ else {
+            } else {
                 loanApplication.setLoanSchedule(String.valueOf(Integer.parseInt(loanScheduleOld) + 1));
                 loanApplication.setAuditSchedule(String.valueOf(Integer.parseInt(auditSchedule) + 1));
                 loanApplication.setAuditType(ONE);
@@ -963,7 +1019,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 //等于6:评审会撤销
                 if (SIX.equals(loanSchedule) && !ONE.equals(reviewSchedule)) {
                     loanApplication.setReviewSchedule(ONE);
-                    if (Integer.parseInt(reviewSchedule) >  3) {
+                    if (Integer.parseInt(reviewSchedule) > 3) {
                         //撤销到确认上会
                         loanApplication.setReviewSchedule(THR);
                         loanApplication.setReviewTime("");
@@ -980,10 +1036,20 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                         //删掉参会人员
                         sysUserConferenceMapper.deleteSysUserConferenceByTime(loanApplicationOld.getReviewTime(), loanApplicationOld.getLoanApplicationId());
                     }
+                    if (loanApplication.getLoanSchedule().equals(TWO) && loanApplication.getAuditSchedule().equals(ONE)) {
+                        //撤回到重新分配AB风险,重置主表数据
+                        loanApplication.setaUserId(null);
+                        loanApplication.setaUserName("");
+                        loanApplication.setbUserId(null);
+                        loanApplication.setbUserName("");
+                        loanApplication.setfUserId(null);
+                        loanApplication.setfUserName("");
+                    }
                 }
             } else {
                 //进入待审核
                 loanApplication.setAuditType(ONE);
+
             }
 /*            String type = "-1";
             if (auditSchedule.equals(SIX)) {

+ 141 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/guarantee/GuaranteeInfo.java

@@ -0,0 +1,141 @@
+package com.ruoyi.system.domain.guarantee;
+
+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;
+
+/**
+ * 反担保基础信息对象 guarantee_info
+ * 
+ * @author boman
+ * @date 2024-08-01
+ */
+public class GuaranteeInfo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 反担保基础信息ID */
+    private Long guaranteeInfoId;
+
+    /** 贷款申请id */
+    @Excel(name = "贷款申请id")
+    private Long loanApplicationId;
+
+    /** 贷款申请编号 */
+    @Excel(name = "贷款申请编号")
+    private String loanApplicationNumber;
+
+    /** 反担保人姓名 */
+    @Excel(name = "反担保人姓名")
+    private String guaranteeName;
+
+    /** 反担保人身份证号 */
+    @Excel(name = "反担保人身份证号")
+    private String guaranteeIdCard;
+
+    /** 反担保人手机号 */
+    @Excel(name = "反担保人手机号")
+    private String guaranteePhone;
+
+    /** 1:反担保人 2:反担保企业 */
+    @Excel(name = "1:反担保人 2:反担保企业")
+    private String type;
+
+    /**
+     * 反担保附件列表
+     */
+    private List<GuaranteeInfoFj> guaranteeInfoFjList;
+
+    public List<GuaranteeInfoFj> getGuaranteeInfoFjList() {
+        return guaranteeInfoFjList;
+    }
+
+    public void setGuaranteeInfoFjList(List<GuaranteeInfoFj> guaranteeInfoFjList) {
+        this.guaranteeInfoFjList = guaranteeInfoFjList;
+    }
+
+    public void setGuaranteeInfoId(Long guaranteeInfoId)
+    {
+        this.guaranteeInfoId = guaranteeInfoId;
+    }
+
+    public Long getGuaranteeInfoId() 
+    {
+        return guaranteeInfoId;
+    }
+    public void setLoanApplicationId(Long loanApplicationId) 
+    {
+        this.loanApplicationId = loanApplicationId;
+    }
+
+    public Long getLoanApplicationId() 
+    {
+        return loanApplicationId;
+    }
+    public void setLoanApplicationNumber(String loanApplicationNumber) 
+    {
+        this.loanApplicationNumber = loanApplicationNumber;
+    }
+
+    public String getLoanApplicationNumber() 
+    {
+        return loanApplicationNumber;
+    }
+    public void setGuaranteeName(String guaranteeName) 
+    {
+        this.guaranteeName = guaranteeName;
+    }
+
+    public String getGuaranteeName() 
+    {
+        return guaranteeName;
+    }
+    public void setGuaranteeIdCard(String guaranteeIdCard) 
+    {
+        this.guaranteeIdCard = guaranteeIdCard;
+    }
+
+    public String getGuaranteeIdCard() 
+    {
+        return guaranteeIdCard;
+    }
+    public void setGuaranteePhone(String guaranteePhone) 
+    {
+        this.guaranteePhone = guaranteePhone;
+    }
+
+    public String getGuaranteePhone() 
+    {
+        return guaranteePhone;
+    }
+    public void setType(String type) 
+    {
+        this.type = type;
+    }
+
+    public String getType() 
+    {
+        return type;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("guaranteeInfoId", getGuaranteeInfoId())
+            .append("loanApplicationId", getLoanApplicationId())
+            .append("loanApplicationNumber", getLoanApplicationNumber())
+            .append("guaranteeName", getGuaranteeName())
+            .append("guaranteeIdCard", getGuaranteeIdCard())
+            .append("guaranteePhone", getGuaranteePhone())
+            .append("type", getType())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 140 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/guarantee/GuaranteeInfoFj.java

@@ -0,0 +1,140 @@
+package com.ruoyi.system.domain.guarantee;
+
+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;
+
+/**
+ * 反担保基础信息附件对象 guarantee_info_fj
+ * 
+ * @author boman
+ * @date 2024-08-01
+ */
+public class GuaranteeInfoFj extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 反担保基础信息附件表ID */
+    private Long guaranteeInfoFjId;
+
+    /** 贷款申请id */
+    @Excel(name = "贷款申请id")
+    private Long loanApplicationId;
+
+    /** 贷款申请编号 */
+    @Excel(name = "贷款申请编号")
+    private String loanApplicationNumber;
+
+    /** 反担保基础信息表ID */
+    @Excel(name = "反担保基础信息表ID")
+    private Long guaranteeInfoId;
+
+    /** 原文件名称 */
+    @Excel(name = "原文件名称")
+    private String oldName;
+
+    /** 附件名称 */
+    @Excel(name = "附件名称")
+    private String name;
+
+    /** 附件地址 */
+    @Excel(name = "附件地址")
+    private String url;
+
+    /** 附件类型 1:身份证正面 2:身份证反面 3:个人工作证明 4:个人征信报告 5:身份证复印件 6:企业征信报告 7:企业营业执照 */
+    @Excel(name = "附件类型 1:身份证正面 2:身份证反面 3:个人工作证明 4:个人征信报告 5:身份证复印件 6:企业征信报告 7:企业营业执照")
+    private String type;
+
+    public void setGuaranteeInfoFjId(Long guaranteeInfoFjId) 
+    {
+        this.guaranteeInfoFjId = guaranteeInfoFjId;
+    }
+
+    public Long getGuaranteeInfoFjId() 
+    {
+        return guaranteeInfoFjId;
+    }
+    public void setLoanApplicationId(Long loanApplicationId) 
+    {
+        this.loanApplicationId = loanApplicationId;
+    }
+
+    public Long getLoanApplicationId() 
+    {
+        return loanApplicationId;
+    }
+    public void setLoanApplicationNumber(String loanApplicationNumber) 
+    {
+        this.loanApplicationNumber = loanApplicationNumber;
+    }
+
+    public String getLoanApplicationNumber() 
+    {
+        return loanApplicationNumber;
+    }
+    public void setGuaranteeInfoId(Long guaranteeInfoId) 
+    {
+        this.guaranteeInfoId = guaranteeInfoId;
+    }
+
+    public Long getGuaranteeInfoId() 
+    {
+        return guaranteeInfoId;
+    }
+    public void setOldName(String oldName) 
+    {
+        this.oldName = oldName;
+    }
+
+    public String getOldName() 
+    {
+        return oldName;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setUrl(String url) 
+    {
+        this.url = url;
+    }
+
+    public String getUrl() 
+    {
+        return url;
+    }
+    public void setType(String type) 
+    {
+        this.type = type;
+    }
+
+    public String getType() 
+    {
+        return type;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("guaranteeInfoFjId", getGuaranteeInfoFjId())
+            .append("loanApplicationId", getLoanApplicationId())
+            .append("loanApplicationNumber", getLoanApplicationNumber())
+            .append("guaranteeInfoId", getGuaranteeInfoId())
+            .append("oldName", getOldName())
+            .append("name", getName())
+            .append("url", getUrl())
+            .append("type", getType())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

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

@@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.system.domain.enterprise.SysUserEnterprise;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
+import com.ruoyi.system.domain.guarantee.GuaranteeInfo;
 
 /**
  * 贷款申请主对象 loan_application
@@ -344,6 +345,44 @@ public class LoanApplication extends BaseEntity
      */
     private Long[] shareholderFjIdList;
 
+    /**
+     * 反担保基础信息对象集合
+     */
+    private List<GuaranteeInfo> guaranteeInfoList;
+
+    /**
+     * 反担保基础附件删除id集合
+     */
+    private Long[] guaranteeInfoFjIdList;
+    /**
+     * 反担保基础信息删除id集合
+     */
+    private Long[] guaranteeInfoIdList;
+
+    public Long[] getGuaranteeInfoFjIdList() {
+        return guaranteeInfoFjIdList;
+    }
+
+    public void setGuaranteeInfoFjIdList(Long[] guaranteeInfoFjIdList) {
+        this.guaranteeInfoFjIdList = guaranteeInfoFjIdList;
+    }
+
+    public Long[] getGuaranteeInfoIdList() {
+        return guaranteeInfoIdList;
+    }
+
+    public void setGuaranteeInfoIdList(Long[] guaranteeInfoIdList) {
+        this.guaranteeInfoIdList = guaranteeInfoIdList;
+    }
+
+    public List<GuaranteeInfo> getGuaranteeInfoList() {
+        return guaranteeInfoList;
+    }
+
+    public void setGuaranteeInfoList(List<GuaranteeInfo> guaranteeInfoList) {
+        this.guaranteeInfoList = guaranteeInfoList;
+    }
+
     public String getRejectionReason() {
         return rejectionReason;
     }

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

@@ -0,0 +1,63 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.guarantee.GuaranteeInfoFj;
+import java.util.List;
+
+
+/**
+ * 反担保基础信息附件Mapper接口
+ * 
+ * @author boman
+ * @date 2024-08-01
+ */
+public interface GuaranteeInfoFjMapper 
+{
+    /**
+     * 查询反担保基础信息附件
+     * 
+     * @param guaranteeInfoFjId 反担保基础信息附件主键
+     * @return 反担保基础信息附件
+     */
+    public GuaranteeInfoFj selectGuaranteeInfoFjByGuaranteeInfoFjId(Long guaranteeInfoFjId);
+
+    /**
+     * 查询反担保基础信息附件列表
+     * 
+     * @param guaranteeInfoFj 反担保基础信息附件
+     * @return 反担保基础信息附件集合
+     */
+    public List<GuaranteeInfoFj> selectGuaranteeInfoFjList(GuaranteeInfoFj guaranteeInfoFj);
+
+    /**
+     * 新增反担保基础信息附件
+     * 
+     * @param guaranteeInfoFj 反担保基础信息附件
+     * @return 结果
+     */
+    public int insertGuaranteeInfoFj(GuaranteeInfoFj guaranteeInfoFj);
+    public int batchGuaranteeInfoFj(List<GuaranteeInfoFj> guaranteeInfoFj);
+
+    /**
+     * 修改反担保基础信息附件
+     * 
+     * @param guaranteeInfoFj 反担保基础信息附件
+     * @return 结果
+     */
+    public int updateGuaranteeInfoFj(GuaranteeInfoFj guaranteeInfoFj);
+
+    /**
+     * 删除反担保基础信息附件
+     * 
+     * @param guaranteeInfoFjId 反担保基础信息附件主键
+     * @return 结果
+     */
+    public int deleteGuaranteeInfoFjByGuaranteeInfoFjId(Long guaranteeInfoFjId);
+
+    /**
+     * 批量删除反担保基础信息附件
+     * 
+     * @param guaranteeInfoFjIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteGuaranteeInfoFjByGuaranteeInfoFjIds(Long[] guaranteeInfoFjIds);
+}

+ 71 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/GuaranteeInfoMapper.java

@@ -0,0 +1,71 @@
+package com.ruoyi.system.mapper;
+
+
+import com.ruoyi.system.domain.guarantee.GuaranteeInfo;
+
+import java.util.List;
+
+/**
+ * 反担保基础信息Mapper接口
+ * 
+ * @author boman
+ * @date 2024-08-01
+ */
+public interface GuaranteeInfoMapper 
+{
+    /**
+     * 查询反担保基础信息
+     * 
+     * @param guaranteeInfoId 反担保基础信息主键
+     * @return 反担保基础信息
+     */
+    public GuaranteeInfo selectGuaranteeInfoByGuaranteeInfoId(Long guaranteeInfoId);
+
+    /**
+     * 查询反担保基础信息列表
+     * 
+     * @param guaranteeInfo 反担保基础信息
+     * @return 反担保基础信息集合
+     */
+    public List<GuaranteeInfo> selectGuaranteeInfoList(GuaranteeInfo guaranteeInfo);
+    public List<GuaranteeInfo> selectGuaranteeInfoListByLoanApplicationId(Long loanApplicationId);
+
+    /**
+     * 新增反担保基础信息
+     * 
+     * @param guaranteeInfo 反担保基础信息
+     * @return 结果
+     */
+    public int insertGuaranteeInfo(GuaranteeInfo guaranteeInfo);
+
+    /**
+     * 批量插入
+     * @param guaranteeInfo
+     * @return
+     */
+    public int batchGuaranteeInfo(List<GuaranteeInfo> guaranteeInfo);
+
+    /**
+     * 修改反担保基础信息
+     * 
+     * @param guaranteeInfo 反担保基础信息
+     * @return 结果
+     */
+    public int updateGuaranteeInfo(GuaranteeInfo guaranteeInfo);
+
+    /**
+     * 删除反担保基础信息
+     * 
+     * @param guaranteeInfoId 反担保基础信息主键
+     * @return 结果
+     */
+    public int deleteGuaranteeInfoByGuaranteeInfoId(Long guaranteeInfoId);
+
+    /**
+     * 批量删除反担保基础信息
+     * 
+     * @param guaranteeInfoIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteGuaranteeInfoByGuaranteeInfoIds(Long[] guaranteeInfoIds);
+}

+ 64 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/guarantee/IGuaranteeInfoFjService.java

@@ -0,0 +1,64 @@
+package com.ruoyi.system.service.guarantee;
+
+
+import com.ruoyi.system.domain.guarantee.GuaranteeInfoFj;
+
+import java.util.List;
+
+/**
+ * 反担保基础信息附件Service接口
+ * 
+ * @author boman
+ * @date 2024-08-01
+ */
+public interface IGuaranteeInfoFjService 
+{
+    /**
+     * 查询反担保基础信息附件
+     * 
+     * @param guaranteeInfoFjId 反担保基础信息附件主键
+     * @return 反担保基础信息附件
+     */
+    public GuaranteeInfoFj selectGuaranteeInfoFjByGuaranteeInfoFjId(Long guaranteeInfoFjId);
+
+    /**
+     * 查询反担保基础信息附件列表
+     * 
+     * @param guaranteeInfoFj 反担保基础信息附件
+     * @return 反担保基础信息附件集合
+     */
+    public List<GuaranteeInfoFj> selectGuaranteeInfoFjList(GuaranteeInfoFj guaranteeInfoFj);
+
+    /**
+     * 新增反担保基础信息附件
+     * 
+     * @param guaranteeInfoFj 反担保基础信息附件
+     * @return 结果
+     */
+    public int insertGuaranteeInfoFj(GuaranteeInfoFj guaranteeInfoFj);
+    public int batchGuaranteeInfoFj(List<GuaranteeInfoFj> guaranteeInfoFj);
+
+    /**
+     * 修改反担保基础信息附件
+     * 
+     * @param guaranteeInfoFj 反担保基础信息附件
+     * @return 结果
+     */
+    public int updateGuaranteeInfoFj(GuaranteeInfoFj guaranteeInfoFj);
+
+    /**
+     * 批量删除反担保基础信息附件
+     * 
+     * @param guaranteeInfoFjIds 需要删除的反担保基础信息附件主键集合
+     * @return 结果
+     */
+    public int deleteGuaranteeInfoFjByGuaranteeInfoFjIds(Long[] guaranteeInfoFjIds);
+
+    /**
+     * 删除反担保基础信息附件信息
+     * 
+     * @param guaranteeInfoFjId 反担保基础信息附件主键
+     * @return 结果
+     */
+    public int deleteGuaranteeInfoFjByGuaranteeInfoFjId(Long guaranteeInfoFjId);
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/guarantee/IGuaranteeInfoService.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.service.guarantee;
+
+
+import com.ruoyi.system.domain.guarantee.GuaranteeInfo;
+
+import java.util.List;
+
+/**
+ * 反担保基础信息Service接口
+ * 
+ * @author boman
+ * @date 2024-08-01
+ */
+public interface IGuaranteeInfoService 
+{
+    /**
+     * 查询反担保基础信息
+     * 
+     * @param guaranteeInfoId 反担保基础信息主键
+     * @return 反担保基础信息
+     */
+    public GuaranteeInfo selectGuaranteeInfoByGuaranteeInfoId(Long guaranteeInfoId);
+
+    /**
+     * 查询反担保基础信息列表
+     * 
+     * @param guaranteeInfo 反担保基础信息
+     * @return 反担保基础信息集合
+     */
+    public List<GuaranteeInfo> selectGuaranteeInfoList(GuaranteeInfo guaranteeInfo);
+
+    /**
+     * 新增反担保基础信息
+     * 
+     * @param guaranteeInfo 反担保基础信息
+     * @return 结果
+     */
+    public int insertGuaranteeInfo(GuaranteeInfo guaranteeInfo);
+
+    /**
+     * 修改反担保基础信息
+     * 
+     * @param guaranteeInfo 反担保基础信息
+     * @return 结果
+     */
+    public int updateGuaranteeInfo(GuaranteeInfo guaranteeInfo);
+
+    /**
+     * 批量删除反担保基础信息
+     * 
+     * @param guaranteeInfoIds 需要删除的反担保基础信息主键集合
+     * @return 结果
+     */
+    public int deleteGuaranteeInfoByGuaranteeInfoIds(Long[] guaranteeInfoIds);
+
+    /**
+     * 删除反担保基础信息信息
+     * 
+     * @param guaranteeInfoId 反担保基础信息主键
+     * @return 结果
+     */
+    public int deleteGuaranteeInfoByGuaranteeInfoId(Long guaranteeInfoId);
+}

+ 104 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/guarantee/impl/GuaranteeInfoFjServiceImpl.java

@@ -0,0 +1,104 @@
+package com.ruoyi.system.service.guarantee.impl;
+
+
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.guarantee.GuaranteeInfoFj;
+import com.ruoyi.system.service.guarantee.IGuaranteeInfoFjService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.GuaranteeInfoFjMapper;
+
+import java.util.List;
+
+
+/**
+ * 反担保基础信息附件Service业务层处理
+ * 
+ * @author boman
+ * @date 2024-08-01
+ */
+@Service
+public class GuaranteeInfoFjServiceImpl implements IGuaranteeInfoFjService
+{
+    @Autowired
+    private GuaranteeInfoFjMapper guaranteeInfoFjMapper;
+
+    /**
+     * 查询反担保基础信息附件
+     * 
+     * @param guaranteeInfoFjId 反担保基础信息附件主键
+     * @return 反担保基础信息附件
+     */
+    @Override
+    public GuaranteeInfoFj selectGuaranteeInfoFjByGuaranteeInfoFjId(Long guaranteeInfoFjId)
+    {
+        return guaranteeInfoFjMapper.selectGuaranteeInfoFjByGuaranteeInfoFjId(guaranteeInfoFjId);
+    }
+
+    /**
+     * 查询反担保基础信息附件列表
+     * 
+     * @param guaranteeInfoFj 反担保基础信息附件
+     * @return 反担保基础信息附件
+     */
+    @Override
+    public List<GuaranteeInfoFj> selectGuaranteeInfoFjList(GuaranteeInfoFj guaranteeInfoFj)
+    {
+        return guaranteeInfoFjMapper.selectGuaranteeInfoFjList(guaranteeInfoFj);
+    }
+
+    /**
+     * 新增反担保基础信息附件
+     * 
+     * @param guaranteeInfoFj 反担保基础信息附件
+     * @return 结果
+     */
+    @Override
+    public int insertGuaranteeInfoFj(GuaranteeInfoFj guaranteeInfoFj)
+    {
+        guaranteeInfoFj.setCreateTime(DateUtils.getNowDate());
+        return guaranteeInfoFjMapper.insertGuaranteeInfoFj(guaranteeInfoFj);
+    }
+
+    @Override
+    public int batchGuaranteeInfoFj(List<GuaranteeInfoFj> guaranteeInfoFj) {
+        return guaranteeInfoFjMapper.batchGuaranteeInfoFj(guaranteeInfoFj);
+    }
+
+    /**
+     * 修改反担保基础信息附件
+     * 
+     * @param guaranteeInfoFj 反担保基础信息附件
+     * @return 结果
+     */
+    @Override
+    public int updateGuaranteeInfoFj(GuaranteeInfoFj guaranteeInfoFj)
+    {
+        guaranteeInfoFj.setUpdateTime(DateUtils.getNowDate());
+        return guaranteeInfoFjMapper.updateGuaranteeInfoFj(guaranteeInfoFj);
+    }
+
+    /**
+     * 批量删除反担保基础信息附件
+     * 
+     * @param guaranteeInfoFjIds 需要删除的反担保基础信息附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteGuaranteeInfoFjByGuaranteeInfoFjIds(Long[] guaranteeInfoFjIds)
+    {
+        return guaranteeInfoFjMapper.deleteGuaranteeInfoFjByGuaranteeInfoFjIds(guaranteeInfoFjIds);
+    }
+
+    /**
+     * 删除反担保基础信息附件信息
+     * 
+     * @param guaranteeInfoFjId 反担保基础信息附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteGuaranteeInfoFjByGuaranteeInfoFjId(Long guaranteeInfoFjId)
+    {
+        return guaranteeInfoFjMapper.deleteGuaranteeInfoFjByGuaranteeInfoFjId(guaranteeInfoFjId);
+    }
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/guarantee/impl/GuaranteeInfoServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.system.service.guarantee.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.domain.guarantee.GuaranteeInfo;
+import com.ruoyi.system.service.guarantee.IGuaranteeInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.system.mapper.GuaranteeInfoMapper;
+
+/**
+ * 反担保基础信息Service业务层处理
+ * 
+ * @author boman
+ * @date 2024-08-01
+ */
+@Service
+public class GuaranteeInfoServiceImpl implements IGuaranteeInfoService
+{
+    @Autowired
+    private GuaranteeInfoMapper guaranteeInfoMapper;
+
+    /**
+     * 查询反担保基础信息
+     * 
+     * @param guaranteeInfoId 反担保基础信息主键
+     * @return 反担保基础信息
+     */
+    @Override
+    public GuaranteeInfo selectGuaranteeInfoByGuaranteeInfoId(Long guaranteeInfoId)
+    {
+        return guaranteeInfoMapper.selectGuaranteeInfoByGuaranteeInfoId(guaranteeInfoId);
+    }
+
+    /**
+     * 查询反担保基础信息列表
+     * 
+     * @param guaranteeInfo 反担保基础信息
+     * @return 反担保基础信息
+     */
+    @Override
+    public List<GuaranteeInfo> selectGuaranteeInfoList(GuaranteeInfo guaranteeInfo)
+    {
+        return guaranteeInfoMapper.selectGuaranteeInfoList(guaranteeInfo);
+    }
+
+    /**
+     * 新增反担保基础信息
+     * 
+     * @param guaranteeInfo 反担保基础信息
+     * @return 结果
+     */
+    @Override
+    public int insertGuaranteeInfo(GuaranteeInfo guaranteeInfo)
+    {
+        guaranteeInfo.setCreateTime(DateUtils.getNowDate());
+        return guaranteeInfoMapper.insertGuaranteeInfo(guaranteeInfo);
+    }
+
+    /**
+     * 修改反担保基础信息
+     * 
+     * @param guaranteeInfo 反担保基础信息
+     * @return 结果
+     */
+    @Override
+    public int updateGuaranteeInfo(GuaranteeInfo guaranteeInfo)
+    {
+        guaranteeInfo.setUpdateTime(DateUtils.getNowDate());
+        return guaranteeInfoMapper.updateGuaranteeInfo(guaranteeInfo);
+    }
+
+    /**
+     * 批量删除反担保基础信息
+     * 
+     * @param guaranteeInfoIds 需要删除的反担保基础信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteGuaranteeInfoByGuaranteeInfoIds(Long[] guaranteeInfoIds)
+    {
+        return guaranteeInfoMapper.deleteGuaranteeInfoByGuaranteeInfoIds(guaranteeInfoIds);
+    }
+
+    /**
+     * 删除反担保基础信息信息
+     * 
+     * @param guaranteeInfoId 反担保基础信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteGuaranteeInfoByGuaranteeInfoId(Long guaranteeInfoId)
+    {
+        return guaranteeInfoMapper.deleteGuaranteeInfoByGuaranteeInfoId(guaranteeInfoId);
+    }
+}

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

@@ -0,0 +1,116 @@
+<?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.ruoyi.system.mapper.GuaranteeInfoFjMapper">
+    
+    <resultMap type="GuaranteeInfoFj" id="GuaranteeInfoFjResult">
+        <result property="guaranteeInfoFjId"    column="guarantee_info_fj_id"    />
+        <result property="loanApplicationId"    column="loan_application_id"    />
+        <result property="loanApplicationNumber"    column="loan_application_number"    />
+        <result property="guaranteeInfoId"    column="guarantee_info_id"    />
+        <result property="oldName"    column="old_name"    />
+        <result property="name"    column="name"    />
+        <result property="url"    column="url"    />
+        <result property="type"    column="type"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectGuaranteeInfoFjVo">
+        select guarantee_info_fj_id, loan_application_id, loan_application_number, guarantee_info_id, old_name, name, url, type, create_by, create_time, update_by, update_time, remark from guarantee_info_fj
+    </sql>
+
+    <select id="selectGuaranteeInfoFjList" parameterType="GuaranteeInfoFj" resultMap="GuaranteeInfoFjResult">
+        <include refid="selectGuaranteeInfoFjVo"/>
+        <where>  
+            <if test="loanApplicationId != null "> and loan_application_id = #{loanApplicationId}</if>
+            <if test="loanApplicationNumber != null  and loanApplicationNumber != ''"> and loan_application_number = #{loanApplicationNumber}</if>
+            <if test="guaranteeInfoId != null "> and guarantee_info_id = #{guaranteeInfoId}</if>
+            <if test="oldName != null  and oldName != ''"> and old_name like concat('%', #{oldName}, '%')</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="url != null  and url != ''"> and url = #{url}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="remark != null  and remark != ''"> and remark = #{remark}</if>
+        </where>
+        order by create_time
+    </select>
+    
+    <select id="selectGuaranteeInfoFjByGuaranteeInfoFjId" parameterType="Long" resultMap="GuaranteeInfoFjResult">
+        <include refid="selectGuaranteeInfoFjVo"/>
+        where guarantee_info_fj_id = #{guaranteeInfoFjId}
+    </select>
+        
+    <insert id="insertGuaranteeInfoFj" parameterType="GuaranteeInfoFj" useGeneratedKeys="true" keyProperty="guaranteeInfoFjId">
+        insert into guarantee_info_fj
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="loanApplicationId != null">loan_application_id,</if>
+            <if test="loanApplicationNumber != null">loan_application_number,</if>
+            <if test="guaranteeInfoId != null">guarantee_info_id,</if>
+            <if test="oldName != null">old_name,</if>
+            <if test="name != null and name != ''">name,</if>
+            <if test="url != null">url,</if>
+            <if test="type != null">type,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="loanApplicationId != null">#{loanApplicationId},</if>
+            <if test="loanApplicationNumber != null">#{loanApplicationNumber},</if>
+            <if test="guaranteeInfoId != null">#{guaranteeInfoId},</if>
+            <if test="oldName != null">#{oldName},</if>
+            <if test="name != null and name != ''">#{name},</if>
+            <if test="url != null">#{url},</if>
+            <if test="type != null">#{type},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <insert id="batchGuaranteeInfoFj">
+        insert into guarantee_info_fj(loan_application_id, loan_application_number, guarantee_info_id,old_name, name, url,
+        type, create_time,  remark) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            (#{item.loanApplicationId},#{item.loanApplicationNumber},#{item.guaranteeInfoId},#{item.oldName},#{item.name},#{item.url},
+             #{item.type},sysdate(),#{item.remark})
+        </foreach>
+    </insert>
+    <update id="updateGuaranteeInfoFj" parameterType="GuaranteeInfoFj">
+        update guarantee_info_fj
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="loanApplicationId != null">loan_application_id = #{loanApplicationId},</if>
+            <if test="loanApplicationNumber != null">loan_application_number = #{loanApplicationNumber},</if>
+            <if test="guaranteeInfoId != null">guarantee_info_id = #{guaranteeInfoId},</if>
+            <if test="oldName != null">old_name = #{oldName},</if>
+            <if test="name != null and name != ''">name = #{name},</if>
+            <if test="url != null">url = #{url},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where guarantee_info_fj_id = #{guaranteeInfoFjId}
+    </update>
+
+    <delete id="deleteGuaranteeInfoFjByGuaranteeInfoFjId" parameterType="Long">
+        delete from guarantee_info_fj where guarantee_info_fj_id = #{guaranteeInfoFjId}
+    </delete>
+
+    <delete id="deleteGuaranteeInfoFjByGuaranteeInfoFjIds" parameterType="String">
+        delete from guarantee_info_fj where guarantee_info_fj_id in 
+        <foreach item="guaranteeInfoFjId" collection="array" open="(" separator="," close=")">
+            #{guaranteeInfoFjId}
+        </foreach>
+    </delete>
+</mapper>

+ 111 - 0
ruoyi-system/src/main/resources/mapper/system/GuaranteeInfoMapper.xml

@@ -0,0 +1,111 @@
+<?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.ruoyi.system.mapper.GuaranteeInfoMapper">
+    
+    <resultMap type="GuaranteeInfo" id="GuaranteeInfoResult">
+        <result property="guaranteeInfoId"    column="guarantee_info_id"    />
+        <result property="loanApplicationId"    column="loan_application_id"    />
+        <result property="loanApplicationNumber"    column="loan_application_number"    />
+        <result property="guaranteeName"    column="guarantee_name"    />
+        <result property="guaranteeIdCard"    column="guarantee_id_card"    />
+        <result property="guaranteePhone"    column="guarantee_phone"    />
+        <result property="type"    column="type"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectGuaranteeInfoVo">
+        select guarantee_info_id, loan_application_id, loan_application_number, guarantee_name, guarantee_id_card, guarantee_phone, type, create_by, create_time, update_by, update_time, remark from guarantee_info
+    </sql>
+
+    <select id="selectGuaranteeInfoList" parameterType="GuaranteeInfo" resultMap="GuaranteeInfoResult">
+        <include refid="selectGuaranteeInfoVo"/>
+        <where>  
+            <if test="loanApplicationId != null "> and loan_application_id = #{loanApplicationId}</if>
+            <if test="loanApplicationNumber != null  and loanApplicationNumber != ''"> and loan_application_number = #{loanApplicationNumber}</if>
+            <if test="guaranteeName != null  and guaranteeName != ''"> and guarantee_name like concat('%', #{guaranteeName}, '%')</if>
+            <if test="guaranteeIdCard != null  and guaranteeIdCard != ''"> and guarantee_id_card = #{guaranteeIdCard}</if>
+            <if test="guaranteePhone != null  and guaranteePhone != ''"> and guarantee_phone = #{guaranteePhone}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+        </where>
+        order by create_time
+    </select>
+    
+    <select id="selectGuaranteeInfoByGuaranteeInfoId" parameterType="Long" resultMap="GuaranteeInfoResult">
+        <include refid="selectGuaranteeInfoVo"/>
+        where guarantee_info_id = #{guaranteeInfoId}
+    </select>
+    <select id="selectGuaranteeInfoListByLoanApplicationId" parameterType="Long" resultMap="GuaranteeInfoResult">
+        <include refid="selectGuaranteeInfoVo"/>
+        where loan_application_id = #{loanApplicationId}
+    </select>
+
+    <insert id="insertGuaranteeInfo" parameterType="GuaranteeInfo" useGeneratedKeys="true" keyProperty="guaranteeInfoId">
+        insert into guarantee_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="loanApplicationId != null">loan_application_id,</if>
+            <if test="loanApplicationNumber != null">loan_application_number,</if>
+            <if test="guaranteeName != null">guarantee_name,</if>
+            <if test="guaranteeIdCard != null">guarantee_id_card,</if>
+            <if test="guaranteePhone != null">guarantee_phone,</if>
+            <if test="type != null">type,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="loanApplicationId != null">#{loanApplicationId},</if>
+            <if test="loanApplicationNumber != null">#{loanApplicationNumber},</if>
+            <if test="guaranteeName != null">#{guaranteeName},</if>
+            <if test="guaranteeIdCard != null">#{guaranteeIdCard},</if>
+            <if test="guaranteePhone != null">#{guaranteePhone},</if>
+            <if test="type != null">#{type},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+    <insert id="batchGuaranteeInfo" useGeneratedKeys="true" keyProperty="guaranteeInfoId">
+        insert into guarantee_info(loan_application_id, loan_application_number, guarantee_name, guarantee_id_card,guarantee_phone, type,create_time,  remark) values
+        <foreach item="item" index="index" collection="list" separator=",">
+            (#{item.loanApplicationId},#{item.loanApplicationNumber},#{item.guaranteeName},#{item.guaranteeIdCard},#{item.guaranteePhone},#{item.type},sysdate(),#{item.remark})
+        </foreach>
+    </insert>
+    <update id="updateGuaranteeInfo" parameterType="GuaranteeInfo">
+        update guarantee_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="loanApplicationId != null">loan_application_id = #{loanApplicationId},</if>
+            <if test="loanApplicationNumber != null">loan_application_number = #{loanApplicationNumber},</if>
+            <if test="guaranteeName != null">guarantee_name = #{guaranteeName},</if>
+            <if test="guaranteeIdCard != null">guarantee_id_card = #{guaranteeIdCard},</if>
+            <if test="guaranteePhone != null">guarantee_phone = #{guaranteePhone},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where guarantee_info_id = #{guaranteeInfoId}
+    </update>
+
+    <delete id="deleteGuaranteeInfoByGuaranteeInfoId" parameterType="Long">
+        delete from guarantee_info where guarantee_info_id = #{guaranteeInfoId}
+    </delete>
+
+    <delete id="deleteGuaranteeInfoByGuaranteeInfoIds" parameterType="String">
+        delete from guarantee_info where guarantee_info_id in 
+        <foreach item="guaranteeInfoId" collection="array" open="(" separator="," close=")">
+            #{guaranteeInfoId}
+        </foreach>
+    </delete>
+</mapper>

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

@@ -489,12 +489,12 @@ 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="aUserId != null">a_user_id = #{aUserId},</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>
-            <if test="bUserId != null">b_user_id = #{bUserId},</if>
+            <if test="bUserId != -1">b_user_id = #{bUserId},</if>
             <if test="bUserName != null">b_user_name = #{bUserName},</if>
-            <if test="fUserId != null">f_user_id = #{fUserId},</if>
+            <if test="fUserId != -1">f_user_id = #{fUserId},</if>
             <if test="fUserName != null">f_user_name = #{fUserName},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>