Jelajahi Sumber

Merge branch 'master' of http://60.171.161.56:20000/tjf/rongzidanbao

wangmengwei 3 bulan lalu
induk
melakukan
dc4b5db1ff

+ 12 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java

@@ -70,7 +70,7 @@ public class CommonController {
     @PostMapping("/upload")
     public AjaxResult uploadFile(MultipartFile file) throws Exception {
         try {
-            String extension = FileUploadUtils.getExtension(file);
+/*            String extension = FileUploadUtils.getExtension(file);
             if("bmp".equals(extension) || "gif".equals(extension) || "jpg".equals(extension) || "jpeg".equals(extension) || "png".equals(extension)){
                 //压缩图片
                 MultipartFile multipartFileCorrection = ImageSizeUtil.compressImg(file);
@@ -79,7 +79,9 @@ public class CommonController {
                 if (file == null){
                     return AjaxResult.error("图片不合规");
                 }
-            }
+            }*/
+            //压缩图片
+            file = ImageSizeUtil.compressImg(file);
             // 上传文件路径
             String filePath = RuoYiConfig.getUploadPath();
             // 上传并返回新文件名称
@@ -105,7 +107,7 @@ public class CommonController {
     @PostMapping("/uploadNew")
     public AjaxResult uploadNewFile(@RequestParam("file") MultipartFile file, @RequestParam("loanApplicationNumber") String loanApplicationNumber, @RequestParam("fileName") String originalFilename) throws Exception {
         try {
-            String extension = FileUploadUtils.getExtension(file);
+/*            String extension = FileUploadUtils.getExtension(file);
             if("bmp".equals(extension) || "gif".equals(extension) || "jpg".equals(extension) || "jpeg".equals(extension) || "png".equals(extension)){
                 //压缩图片
                 MultipartFile multipartFileCorrection = ImageSizeUtil.compressImg(file);
@@ -114,10 +116,12 @@ public class CommonController {
                 if (file == null){
                     return AjaxResult.error("图片不合规");
                 }
-            }
+            }*/
 
 
             // 上传文件路径
+            //压缩图片
+            file = ImageSizeUtil.compressImg(file);
             String filePath = RuoYiConfig.getUploadPath();
             if ("其他附件".equals(originalFilename)) {
                 originalFilename = file.getOriginalFilename();
@@ -146,7 +150,7 @@ public class CommonController {
     @PreAuthorize("@ss.hasPermi('common:upload:uploadNewOcr')")
     public AjaxResult uploadNewOcrFile(@RequestParam("file") MultipartFile file, @RequestParam("loanApplicationNumber") String loanApplicationNumber, @RequestParam("fileName") String originalFilename) throws Exception {
         try {
-            String extension = FileUploadUtils.getExtension(file);
+/*            String extension = FileUploadUtils.getExtension(file);
             if("bmp".equals(extension) || "gif".equals(extension) || "jpg".equals(extension) || "jpeg".equals(extension) || "png".equals(extension)){
                 //压缩图片
                 MultipartFile multipartFileCorrection = ImageSizeUtil.compressImg(file);
@@ -155,7 +159,9 @@ public class CommonController {
                 if (file == null){
                     return AjaxResult.error("图片不合规");
                 }
-            }
+            }*/
+            //压缩图片
+            file = ImageSizeUtil.compressImg(file);
             // 上传文件路径
             String filePath = RuoYiConfig.getUploadPath();
             // 上传并返回新文件名称

+ 33 - 31
ruoyi-framework/src/main/java/com/ruoyi/framework/manager/factory/AsyncFactory.java

@@ -1,47 +1,44 @@
 package com.ruoyi.framework.manager.factory;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.TimerTask;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
 import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.utils.LogUtils;
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.common.utils.ip.AddressUtils;
+import com.ruoyi.common.utils.ip.IpUtils;
+import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.common.utils.uuid.Seq;
+import com.ruoyi.system.domain.SysLogininfor;
+import com.ruoyi.system.domain.SysOperLog;
 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.ISysLogininforService;
+import com.ruoyi.system.service.ISysOperLogService;
 import com.ruoyi.system.service.guarantee.IGuaranteeInfoFjService;
 import com.ruoyi.system.service.loan.ILoanApplicationFjService;
+import eu.bitwalker.useragentutils.UserAgent;
 import org.apache.commons.io.FilenameUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import com.ruoyi.common.constant.Constants;
-import com.ruoyi.common.utils.LogUtils;
-import com.ruoyi.common.utils.ServletUtils;
-import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.common.utils.ip.AddressUtils;
-import com.ruoyi.common.utils.ip.IpUtils;
-import com.ruoyi.common.utils.spring.SpringUtils;
-import com.ruoyi.system.domain.SysLogininfor;
-import com.ruoyi.system.domain.SysOperLog;
-import com.ruoyi.system.service.ISysLogininforService;
-import com.ruoyi.system.service.ISysOperLogService;
-import eu.bitwalker.useragentutils.UserAgent;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 
-import javax.annotation.Resource;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TimerTask;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
 
 import static com.ruoyi.common.constant.CommonConstants.*;
 
@@ -170,10 +167,15 @@ public class AsyncFactory {
             Map<String, List<LoanApplicationFj>> typeMap = loanApplicationFjListA.stream().collect(Collectors.groupingBy(LoanApplicationFj::getType));
             List<LoanApplicationFj> list = new ArrayList<>();
             for (String type : typeMap.keySet()) {
+                List<String> typeList = new ArrayList<>();
+                String fjName = "";
                 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 (!"gsyyzhz".equals(type)) {
+                    //获取附件名称
+                    fjName = loanApplicationFjListInsert.get(0).getName().split("_")[0];
+                    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) {
                     for (int i = 0; i < typeList.size(); i++) {
                         ///profile/upload/RZDB202405281147018884551/公司章程_20240528114820A002.png 前缀替换
@@ -205,7 +207,7 @@ public class AsyncFactory {
                     createPdfFromImages(list, loanApplicationFjList, typeList, loanApplicationNumber, fjName + "_" + Seq.getId(Seq.uploadSeqType), type, bigType);
                 }
             }
-            if (list.size() > 0){
+            if (list.size() > 0) {
                 // 插入数据
                 SpringUtils.getBean(ILoanApplicationFjService.class).insertLoanApplicationFj(list);
             }
@@ -253,7 +255,7 @@ public class AsyncFactory {
      * @return
      */
 
-    public static TimerTask createPdfFromImagesShareholder(List<ShareholderFj> shareholderFjList, String loanApplicationNumber,Long loanApplicationId) {
+    public static TimerTask createPdfFromImagesShareholder(List<ShareholderFj> shareholderFjList, String loanApplicationNumber, Long loanApplicationId) {
         return new TimerTask() {
             @Override
             public void run() {
@@ -399,7 +401,7 @@ public class AsyncFactory {
                                     }
                                 }
                                 //生成PDF数据库数据
-                                createPdfFromImagesGuaranteeInfoFj(list,guaranteeInfoFjInsert, imagePaths, loanApplicationNumber, fjName + "_" + Seq.getId(Seq.uploadSeqType), type, loanApplicationId, guaranteeInfoId);
+                                createPdfFromImagesGuaranteeInfoFj(list, guaranteeInfoFjInsert, imagePaths, loanApplicationNumber, fjName + "_" + Seq.getId(Seq.uploadSeqType), type, loanApplicationId, guaranteeInfoId);
                             }
                         }
                         //判断是否有反担保GuaranteeInfoFjId
@@ -418,7 +420,7 @@ public class AsyncFactory {
                     }
                 }
                 //插入附件数据库数据生成的pdf
-                if (list.size() > 0){
+                if (list.size() > 0) {
                     SpringUtils.getBean(IGuaranteeInfoFjService.class).batchGuaranteeInfoFj(list);
                 }
                 redisCache.deleteObject(key);
@@ -432,7 +434,7 @@ public class AsyncFactory {
      * @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) {
+    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");

+ 176 - 94
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/LoanApplicationServiceImpl.java

@@ -459,44 +459,47 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             guaranteeInfoFjMapper.deleteGuaranteeInfoFjByGuaranteeInfoIds(guaranteeInfoIdList);
         }
         int rows = loanApplicationMapper.updateLoanApplication(loanApplication);
-        //查询审核管理员用户id
-        List<SysUserRole> sysUserRoles = sysUserRoleMapper.selectRoleListNoDataScope();
-        List<Long> userIdList = new ArrayList<>();
-        //待办信息集合
-        List<WaitRemind> waitRemindList = new ArrayList<>();
-        if (sysUserRoles != null && sysUserRoles.size() > 0) {
-            userIdList = sysUserRoles.stream().map(SysUserRole::getUserId).collect(Collectors.toList());
-            for (SysUserRole sysUserRole : sysUserRoles) {
-                WaitRemind waitRemindManager = new WaitRemind();
-                waitRemindManager.setLoanApplicationId(loanApplication.getLoanApplicationId());
-                waitRemindManager.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
-                waitRemindManager.setRemindTitle("有一条【" + loanApplication.getEnterpriseName() + "】贷款申请需及时处理");
-                waitRemindManager.setRemindTime(DateUtils.getNowDate());
-                waitRemindManager.setRemindType(ONE);
-                waitRemindManager.setRemindContent(loanApplication.getEnterpriseName() + "有一条贷款申请需及时处理");
-                //给管理员发送待办提醒
-                waitRemindManager.setReadUserId(sysUserRole.getUserId().toString());
-                waitRemindList.add(waitRemindManager);
+        //暂时不重新发待办
+        /*if (rows > 0) {
+            //查询审核管理员用户id
+            List<SysUserRole> sysUserRoles = sysUserRoleMapper.selectRoleListNoDataScope();
+            List<Long> userIdList = new ArrayList<>();
+            //待办信息集合
+            List<WaitRemind> waitRemindList = new ArrayList<>();
+            if (sysUserRoles != null && sysUserRoles.size() > 0) {
+                userIdList = sysUserRoles.stream().map(SysUserRole::getUserId).collect(Collectors.toList());
+                for (SysUserRole sysUserRole : sysUserRoles) {
+                    WaitRemind waitRemindManager = new WaitRemind();
+                    waitRemindManager.setLoanApplicationId(loanApplication.getLoanApplicationId());
+                    waitRemindManager.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+                    waitRemindManager.setRemindTitle("有一条【" + loanApplication.getEnterpriseName() + "】贷款申请需及时处理");
+                    waitRemindManager.setRemindTime(DateUtils.getNowDate());
+                    waitRemindManager.setRemindType(ONE);
+                    waitRemindManager.setRemindContent(loanApplication.getEnterpriseName() + "有一条贷款申请需及时处理");
+                    //给管理员发送待办提醒
+                    waitRemindManager.setReadUserId(sysUserRole.getUserId().toString());
+                    waitRemindList.add(waitRemindManager);
+                }
             }
-        }
-        //插入审核通过的待办提醒
-        if (waitRemindList.size() > 0) {
-            waitRemindMapper.batchWaitRemind(waitRemindList);
-            //发极光推送id
-            List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
-            if (sysUsers != null && sysUsers.size() > 0) {
-                String notificationTitle = "消息通知";
-                String msgTitle = "审核信息";
-                String msgContent = loanApplication.getEnterpriseName() + "的审核信息申请通过进入到下一阶段";
-                String jPushVO = "";
-                List<String> listS = sysUsers.stream().map(SysUser::getJgId).collect(Collectors.toList());
-                listS.removeAll(Collections.singleton(null));
-                if (listS != null && listS.size() > 0) {
-                    String[] registrationId = listS.toArray(new String[listS.size()]);
-                    JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, registrationId);
+            //插入审核通过的待办提醒
+            if (waitRemindList.size() > 0) {
+                waitRemindMapper.batchWaitRemind(waitRemindList);
+                //发极光推送id
+                List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
+                if (sysUsers != null && sysUsers.size() > 0) {
+                    String notificationTitle = "消息通知";
+                    String msgTitle = "审核信息";
+                    String msgContent = loanApplication.getEnterpriseName() + "的审核信息申请通过进入到下一阶段";
+                    String jPushVO = "";
+                    List<String> listS = sysUsers.stream().map(SysUser::getJgId).collect(Collectors.toList());
+                    listS.removeAll(Collections.singleton(null));
+                    if (listS != null && listS.size() > 0) {
+                        String[] registrationId = listS.toArray(new String[listS.size()]);
+                        JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, registrationId);
+                    }
                 }
             }
-        }
+        }*/
         return rows > 0 ? AjaxResult.success() : AjaxResult.error();
     }
 
@@ -720,10 +723,10 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         if (Integer.parseInt(auditSchedule) <= Integer.parseInt(auditScheduleOld) && !Objects.equals(auditTypeOld, ONE)) {
             return AjaxResult.error("当前进度已审核,请勿重复审核");
         }
-        //删除所有待办信息
+/*      不删除待办改为设置成已读当作操作记录  //删除所有待办信息
         WaitRemind waitRemindDelete = new WaitRemind();
         waitRemindDelete.setLoanApplicationId(loanApplication.getLoanApplicationId());
-        waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);
+        waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);*/
         List<LoanApplicationFj> fjUrl = reviewComments.getFjUrl();
         if (fjUrl != null && fjUrl.size() > 0) {
             StringBuilder type = new StringBuilder();
@@ -812,8 +815,16 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                     waitRemindList.add(waitRemindManager);
                 }
             }
+            //插入待办
             waitRemindMapper.batchWaitRemind(waitRemindList);
 
+            WaitRemind waitRemindIsRead = new WaitRemind();
+            waitRemindIsRead.setLoanApplicationId(loanApplicationId);
+            waitRemindIsRead.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+            waitRemindIsRead.setRemindType(ONE);
+            //把上一阶段的待办都设置为已读
+            waitRemindMapper.updateWaitRemindIsRead(waitRemindIsRead);
+
             //发极光推送id
             //获取所有的userid
             userIdList.add(loanApplication.getaUserId());
@@ -866,7 +877,12 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 }
             }
             waitRemindMapper.batchWaitRemind(waitRemindList);
-
+            //把上一阶段的待办都设置为已读
+            WaitRemind waitRemindIsRead = new WaitRemind();
+            waitRemindIsRead.setLoanApplicationId(loanApplicationId);
+            waitRemindIsRead.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+            waitRemindIsRead.setRemindType(ONE);
+            waitRemindMapper.updateWaitRemindIsRead(waitRemindIsRead);
             //发极光推送id
             //获取所有的userid
             userIdList.add(loanApplication.getaUserId());
@@ -999,7 +1015,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 loanApplication.setAuditSchedule(String.valueOf(Integer.parseInt(auditSchedule) + 1));
                 loanApplication.setAuditType(ONE);
 
-                if (auditSchedule.equals(FOR)){
+                if (auditSchedule.equals(FOR)) {
                     //给初审风险合规 状态下的风险发送
                     WaitRemind waitRemindf = new WaitRemind();
                     waitRemindf.setLoanApplicationId(loanApplicationId);
@@ -1050,6 +1066,12 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             if (waitRemindList.size() > 0) {
                 waitRemindMapper.batchWaitRemind(waitRemindList);
 
+                //把上一阶段的待办都设置为已读
+                WaitRemind waitRemindIsRead = new WaitRemind();
+                waitRemindIsRead.setLoanApplicationId(loanApplicationId);
+                waitRemindIsRead.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+                waitRemindIsRead.setRemindType(String.valueOf(Integer.parseInt(waitRemindList.get(0).getRemindType()) - 1));
+                waitRemindMapper.updateWaitRemindIsRead(waitRemindIsRead);
                 //发极光推送id
                 List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
                 if (sysUsers != null && sysUsers.size() > 0) {
@@ -1171,37 +1193,47 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             return AjaxResult.error("当前项目状态异常,不允许上会");
         }
         int rows = loanApplicationMapper.updateLoanApplication(loanApplication);
-        //删除所有状态小于的待办事项
+/*        //删除所有状态小于的待办事项
         WaitRemind waitRemindDelete = new WaitRemind();
         waitRemindDelete.setLoanApplicationId(loanApplication.getLoanApplicationId());
         //删除所有待办
-        waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);
+        waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);*/
         //给A角色发送上会审核信息
-        WaitRemind waitRemindManager = new WaitRemind();
-        waitRemindManager.setLoanApplicationId(loanApplication.getLoanApplicationId());
-        waitRemindManager.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
-        waitRemindManager.setRemindTitle("有一条【" + loanApplication.getEnterpriseName() + "】的上会审核信息");
-        waitRemindManager.setRemindTime(DateUtils.getNowDate());
-        waitRemindManager.setRemindType(SEV);
-        waitRemindManager.setReadUserId(loanApplication.getaUserId().toString());
-        String result = "通过";
-        if (TWO.equals(reviewSchedule)) {
-            result = "不通过";
-        }
-        waitRemindManager.setRemindContent(loanApplication.getEnterpriseName() + "的上会审核信息申请" + result);
-        waitRemindManager.setReadUserId(String.valueOf(loanApplication.getaUserId()));
-        waitRemindMapper.insertWaitRemind(waitRemindManager);
-
-        //发极光推送
-        SysUser user = sysUserService.selectUserById(loanApplication.getaUserId());
-        if (StringUtils.isNotEmpty(user.getJgId())) {
-            String notificationTitle = "消息通知";
-            String msgTitle = "上会审核信息";
-            String msgContent = loanApplication.getEnterpriseName() + "的上会审核信息申请" + result;
-            String jPushVO = "";
-            JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, user.getJgId());
+        if (rows > 0) {
+            //把上一阶段的待办都设置为已读
+            WaitRemind waitRemindIsRead = new WaitRemind();
+            waitRemindIsRead.setLoanApplicationId(loanApplication.getLoanApplicationId());
+            waitRemindIsRead.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+            waitRemindIsRead.setRemindType(SEV);
+            waitRemindMapper.updateWaitRemindIsRead(waitRemindIsRead);
+
+            WaitRemind waitRemindManager = new WaitRemind();
+            waitRemindManager.setLoanApplicationId(loanApplication.getLoanApplicationId());
+            waitRemindManager.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+            waitRemindManager.setRemindTitle("有一条【" + loanApplication.getEnterpriseName() + "】的上会审核信息");
+            waitRemindManager.setRemindTime(DateUtils.getNowDate());
+            waitRemindManager.setRemindType(SEV);
+            waitRemindManager.setReadUserId(loanApplication.getaUserId().toString());
+            String result = "通过";
+            if (TWO.equals(reviewSchedule)) {
+                result = "不通过";
+            }
+            waitRemindManager.setRemindContent(loanApplication.getEnterpriseName() + "的上会审核信息申请" + result);
+            waitRemindManager.setReadUserId(String.valueOf(loanApplication.getaUserId()));
+            waitRemindMapper.insertWaitRemind(waitRemindManager);
+            //把上一阶段的待办都设置为已读
+            waitRemindIsRead.setRemindType(SIX);
+            waitRemindMapper.updateWaitRemindIsRead(waitRemindIsRead);
+            //发极光推送
+            SysUser user = sysUserService.selectUserById(loanApplication.getaUserId());
+            if (StringUtils.isNotEmpty(user.getJgId())) {
+                String notificationTitle = "消息通知";
+                String msgTitle = "上会审核信息";
+                String msgContent = loanApplication.getEnterpriseName() + "的上会审核信息申请" + result;
+                String jPushVO = "";
+                JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, user.getJgId());
+            }
         }
-
         return rows > 0 ? AjaxResult.success() : AjaxResult.error();
     }
 
@@ -1246,10 +1278,10 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             application.setAuditSchedule(TEN);
         }
         loanApplicationMapper.updateLoanApplication(application);
-        //删除所有状态小于的待办事项
+/*        //删除所有状态小于的待办事项
         WaitRemind waitRemindDelete = new WaitRemind();
         waitRemindDelete.setLoanApplicationId(loanApplication.getLoanApplicationId());
-        waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);
+        waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);*/
 
         WaitRemind waitRemind = new WaitRemind();
         waitRemind.setLoanApplicationId(loanApplication.getLoanApplicationId());
@@ -1280,7 +1312,12 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             }
         }
         waitRemindMapper.batchWaitRemind(waitRemindList);
-
+        //把上一阶段的待办都设置为已读
+        WaitRemind waitRemindIsRead = new WaitRemind();
+        waitRemindIsRead.setLoanApplicationId(loanApplication.getLoanApplicationId());
+        waitRemindIsRead.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+        waitRemindIsRead.setRemindType(String.valueOf(Integer.parseInt(application.getAuditSchedule()) - 1));
+        waitRemindMapper.updateWaitRemindIsRead(waitRemindIsRead);
         //发极光推送id
         userIdList.add(loanApplication.getaUserId());
         List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
@@ -1336,10 +1373,11 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         if (Integer.parseInt(loanSchedule) < 2 || Integer.parseInt(auditSchedule) < 1 || Integer.parseInt(loanApplicationType) != 2) {
             return AjaxResult.error("当前项目不可撤销");
         }
-        //删除所有待办事项
+        //删除所有当前未操作的待办事项 删除当前remind_type and isRead = N 未操作
         WaitRemind waitRemindDelete = new WaitRemind();
         waitRemindDelete.setLoanApplicationId(loanApplication.getLoanApplicationId());
-        waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);
+        waitRemindDelete.setRemindType(auditSchedule);
+        waitRemindMapper.deleteWaitRemindByLoanApplicationIdAndIsRead(waitRemindDelete);
         if (Integer.parseInt(loanSchedule) > 7) {
             //撤销只返回贷款申请进度到上一步
             loanApplication.setLoanSchedule(String.valueOf(Integer.parseInt(loanSchedule) - 1));
@@ -1423,7 +1461,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             waitRemindList.add(waitRemind);
             userIdList.add(loanApplicationOld.getaUserId());
             //如果退回到初审风险合规  给风险发送待办
-            if (loanApplication.getAuditSchedule().equals(FIV)){
+            if (loanApplication.getAuditSchedule().equals(FIV)) {
                 WaitRemind waitRemindf = new WaitRemind();
                 waitRemindf.setLoanApplicationId(loanApplicationId);
                 waitRemindf.setLoanApplicationNumber(loanApplicationNumber);
@@ -1455,21 +1493,28 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         }
         loanApplicationMapper.updateLoanApplication2(loanApplication);
 
-        //插入待办事项
-        waitRemindMapper.batchWaitRemind(waitRemindList);
-
-        //极光推送
-        List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
-        if (sysUsers != null && sysUsers.size() > 0) {
-            String notificationTitle = "消息通知";
-            String msgTitle = "审核信息";
-            String msgContent = loanApplication.getEnterpriseName() + "的审核信息申请需及时处理";
-            String jPushVO = "";
-            List<String> listS = sysUsers.stream().map(SysUser::getJgId).collect(Collectors.toList());
-            listS.removeAll(Collections.singleton(null));
-            if (listS != null && listS.size() > 0) {
-                String[] registrationId = listS.toArray(new String[listS.size()]);
-                JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, registrationId);
+        if (waitRemindList.size() > 0){
+            //插入待办事项
+            waitRemindMapper.batchWaitRemind(waitRemindList);
+            //把上一阶段的待办都设置为已读
+            WaitRemind waitRemindIsRead = new WaitRemind();
+            waitRemindIsRead.setLoanApplicationId(loanApplication.getLoanApplicationId());
+            waitRemindIsRead.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+            waitRemindIsRead.setRemindType(String.valueOf(Integer.parseInt(waitRemindList.get(0).getRemindType()) - 1));
+            waitRemindMapper.updateWaitRemindIsRead(waitRemindIsRead);
+            //极光推送
+            List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
+            if (sysUsers != null && sysUsers.size() > 0) {
+                String notificationTitle = "消息通知";
+                String msgTitle = "审核信息";
+                String msgContent = loanApplication.getEnterpriseName() + "的审核信息申请需及时处理";
+                String jPushVO = "";
+                List<String> listS = sysUsers.stream().map(SysUser::getJgId).collect(Collectors.toList());
+                listS.removeAll(Collections.singleton(null));
+                if (listS != null && listS.size() > 0) {
+                    String[] registrationId = listS.toArray(new String[listS.size()]);
+                    JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, registrationId);
+                }
             }
         }
 
@@ -1668,10 +1713,10 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         reviewComments.setAuditTime(DateUtils.getNowDate());
         reviewComments.setCreateBy(SecurityUtils.getUsername());
         reviewCommentsMapper.insertReviewComments(reviewComments);
-        //删除所有代办提醒
+/*        //删除所有代办提醒
         WaitRemind waitRemindDelete = new WaitRemind();
         waitRemindDelete.setLoanApplicationId(loanApplication.getLoanApplicationId());
-        waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);
+        waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);*/
         return AjaxResult.success();
     }
 
@@ -1683,10 +1728,10 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
      */
     @Override
     public AjaxResult zanHuan(LoanApplication loanApplication) {
-        //删除所有状态小于的待办事项
+/*        //删除所有状态小于的待办事项
         WaitRemind waitRemindDelete = new WaitRemind();
         waitRemindDelete.setLoanApplicationId(loanApplication.getLoanApplicationId());
-        waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);
+        waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);*/
         WaitRemind waitRemind = new WaitRemind();
         waitRemind.setLoanApplicationId(loanApplication.getLoanApplicationId());
         waitRemind.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
@@ -1715,6 +1760,12 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 waitRemindRole.setRemindContent(loanApplication.getRemark());
                 waitRemindMapper.insertWaitRemind(waitRemindRole);
             }
+            //把上一阶段的待办都设置为已读
+            WaitRemind waitRemindIsRead = new WaitRemind();
+            waitRemindIsRead.setLoanApplicationId(loanApplication.getLoanApplicationId());
+            waitRemindIsRead.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+            waitRemindIsRead.setRemindType(EIG);
+            waitRemindMapper.updateWaitRemindIsRead(waitRemindIsRead);
             //发极光推送id
             //获取所有的userid
             List<Long> userIdList = sysUserRoles.stream().map(SysUserRole::getUserId).collect(Collectors.toList());
@@ -2215,7 +2266,38 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             case "15":
                 //查询评审人员信息
                 //查询所有人员的投票结果
-                SysUserConference sysUserConference = new SysUserConference();
+                //查询所有与当前项目同一时间的项目
+
+                LoanApplication aplication = new LoanApplication();
+                aplication.setReviewTime(loanApplication.getReviewTime());
+                List<LoanApplication> loanApplicationList = loanApplicationMapper.selectLoanApplicationList(aplication);
+                //拼接所有项目名称
+                StringBuilder sbxmname = new StringBuilder();
+                int num = 1;
+                for (LoanApplication application : loanApplicationList) {
+                    if(sbxmname.length()>0){
+                        sbxmname.append("、").append(application.getEnterpriseName());
+                    }else{
+                        sbxmname.append(application.getEnterpriseName());
+                    }
+                    SysUserConference sysUserConference = new SysUserConference();
+                    sysUserConference.setLoanApplicationId(application.getLoanApplicationId());
+                    sysUserConference.setConferenceTime(application.getReviewTime());
+                    List<SysUserConference> sysUserConferences = sysUserConferenceMapper.selectSysUserConferenceList(sysUserConference);
+                    //凭借参会信息
+                    //拼接姓名
+                    StringBuilder sb = new StringBuilder();
+                    sb.append(application.getEnterpriseName()).append("的评委是:");
+                    for (SysUserConference userConference1 : sysUserConferences) {
+                        sb.append(" ").append(userConference1.getRealName());
+                    }
+                    params.put("user"+num, sb.toString());
+                    num++;
+                }
+                //评审会公司
+                params.put("enterpriseName", sbxmname.toString());
+
+                /*SysUserConference sysUserConference = new SysUserConference();
                 sysUserConference.setLoanApplicationId(loanApplication.getLoanApplicationId());
                 sysUserConference.setConferenceTime(loanApplication.getReviewTime());
                 List<SysUserConference> sysUserConferences = sysUserConferenceMapper.selectSysUserConferenceList(sysUserConference);
@@ -2228,13 +2310,13 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                         sb.append(userConference1.getRealName());
                     }
 
-                }
+                }*/
                 //评审会时间
                 params.put("time", loanApplication.getReviewTime());
                 //评审会公司
-                params.put("enterpriseName", loanApplication.getEnterpriseName());
+                //params.put("enterpriseName", loanApplication.getEnterpriseName());
                 //评审会人员
-                params.put("user", sb.toString());
+                //params.put("user", sb.toString());
                 //path = path + "/委托担保申请书.doc";
                 templatePath = templatePath + "/mb/评审会通知.docx";
                 fileDir = fileDir + "/mb/temporarily/" + loanApplicationNumber;

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

@@ -1,6 +1,7 @@
 package com.ruoyi.system.mapper;
 
 import java.util.List;
+import java.util.Set;
 
 import com.ruoyi.system.domain.conference.SysUserConference;
 import org.apache.ibatis.annotations.Param;
@@ -130,7 +131,7 @@ public interface SysUserMapper
 
     public SysUser selectUserByPhonenumber(String userName);
 
-    List<SysUser> selectUserManageList(List<String> strlist);
+    List<SysUser> selectUserManageList(@Param("set") Set<String> strlist);
 
     List<SysUser> selectUserListByIdList(List<Long> userIdList);
 }

+ 4 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/WaitRemindMapper.java

@@ -47,6 +47,7 @@ public interface WaitRemindMapper
      * @return 结果
      */
     public int updateWaitRemind(WaitRemind waitRemind);
+    public int updateWaitRemindIsRead(WaitRemind waitRemind);
 
     /**
      * 删除待办提醒
@@ -61,6 +62,7 @@ public interface WaitRemindMapper
     public int deleteWaitRemindByLoanApplicationIdAndRemindType(WaitRemind waitRemind);
     //删除项目所有待办
     public int deleteWaitRemindByLoanApplicationIdOnly(WaitRemind waitRemind);
+    public int deleteWaitRemindByLoanApplicationIdAndIsRead(WaitRemind waitRemind);
 
     /**
      * 批量删除待办提醒
@@ -69,4 +71,6 @@ public interface WaitRemindMapper
      * @return 结果
      */
     public int deleteWaitRemindByRemindIds(Integer[] remindIds);
+
+    void updateWaitRemindIsReadUserId(WaitRemind waitRemind1);
 }

+ 87 - 22
ruoyi-system/src/main/java/com/ruoyi/system/service/conference/impl/SysUserConferenceServiceImpl.java

@@ -4,6 +4,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -129,39 +130,38 @@ public class SysUserConferenceServiceImpl implements ISysUserConferenceService {
     @Override
     @Transactional
     public AjaxResult randomAdd(SysUserConference sysUserConference) {
-
+        //排序 1:徐春生,2:左秀
+        int px = 3;
         int num = 0;
         //查询贷款信息
         LoanApplication loanApplication = loanApplicationMapper.selectLoanApplicationByLoanApplicationId(sysUserConference.getLoanApplicationId());
         //主表赋值
-        loanApplication.setReviewTime(sysUserConference.getConferenceTime());
-        loanApplication.setReviewSchedule(FOR);
-        loanApplicationMapper.updateLoanApplication(loanApplication);
+        LoanApplication application = new LoanApplication();
+        application.setReviewTime(sysUserConference.getConferenceTime());
+        application.setReviewSchedule(FOR);
+        application.setLoanApplicationId(loanApplication.getLoanApplicationId());
+        loanApplicationMapper.updateLoanApplication(application);
 
         redisCache.setCacheObject(sysUserConference.getLoanApplicationNumber() + "tp", FOR);
-
         //查询参会人员的字典值
         List<SysDictData> data = dictTypeService.selectDictDataByType("conference_role");
-        List<String> strlist = data.stream().map(SysDictData::getDictValue).collect(Collectors.toList());
+        Set<String> strlist = data.stream().map(SysDictData::getDictValue).collect(Collectors.toSet());
         //查询人员
         List<SysUser> userList = userMapper.selectUserManageList(strlist);
-        //生成0-n的随机数
-        List<Integer> intList = new ArrayList<>();
-        Random random = new Random();
-        while (num < 5) {
-            int randomNumber = random.nextInt(userList.size() - 1);
-            if (intList.size() > 0 && intList.contains(randomNumber)) {
-                continue;
-            }
-            SysUser sysUser = userList.get(randomNumber);
+        //去掉项目本身的A,B,风险,董事长徐春生和左秀
+        List<SysUser> userChList = new ArrayList<>();
+        for (SysUser sysUser : userList) {
             //A
             boolean b1 = sysUser.getUserId().equals(loanApplication.getaUserId());
             //B
             boolean b2 = sysUser.getUserId().equals(loanApplication.getbUserId());
             //风险
             boolean b3 = sysUser.getUserId().equals(loanApplication.getfUserId());
-            //只有同时满足随机人员不是这三个时才能加入参会人员
-            if (!b1 && !b2 && !b3) {
+            if (b1 || b2 || b3) {
+                continue;
+            }
+            //固定董事长徐春生和左秀参会
+            if("左秀".equals(sysUser.getNickName()) || "徐春生".equals(sysUser.getNickName())){
                 //将信息存入库
                 SysUserConference userConference = new SysUserConference();
                 userConference.setUserId(sysUser.getUserId());
@@ -170,6 +170,10 @@ public class SysUserConferenceServiceImpl implements ISysUserConferenceService {
                 userConference.setLoanApplicationName(loanApplication.getEnterpriseName());
                 userConference.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
                 userConference.setConferenceTime(sysUserConference.getConferenceTime());
+                userConference.setRemark("1");
+                if("左秀".equals(sysUser.getNickName())){
+                    userConference.setRemark("2");
+                }
                 sysUserConferenceMapper.insertSysUserConference(userConference);
                 //给人员发生代办信息
                 WaitRemind waitRemind = new WaitRemind();
@@ -181,9 +185,6 @@ public class SysUserConferenceServiceImpl implements ISysUserConferenceService {
                 waitRemind.setReadUserId(sysUser.getUserId().toString());
                 waitRemind.setRemindContent("您有一个评审会议需参加,会议时间:" + sysUserConference.getConferenceTime() + ",会议主题:【" + loanApplication.getEnterpriseName() + "】评审会");
                 waitRemindMapper.insertWaitRemind(waitRemind);
-                num++;
-                intList.add(randomNumber);
-
                 //发极光推送
                 SysUser user = sysUserService.selectUserById(sysUser.getUserId());
                 if (StringUtils.isNotEmpty(user.getJgId())) {
@@ -193,6 +194,53 @@ public class SysUserConferenceServiceImpl implements ISysUserConferenceService {
                     String jPushVO = "";
                     JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, user.getJgId());
                 }
+                continue;
+            }
+            userChList.add(sysUser);
+        }
+
+        //生成0-n的随机数
+        List<Integer> intList = new ArrayList<>();
+        Random random = new Random();
+        if (userChList.size() < 3) {
+            throw new ServiceException("符合参会人员数量不足,无法开启会议");
+        }
+        while (num < 3) {
+            int randomNumber = random.nextInt(userChList.size() - 1);
+            SysUser sysUser = userChList.get(randomNumber);
+
+            //将信息存入库
+            SysUserConference userConference = new SysUserConference();
+            userConference.setUserId(sysUser.getUserId());
+            userConference.setRealName(sysUser.getNickName());
+            userConference.setLoanApplicationId(sysUserConference.getLoanApplicationId());
+            userConference.setLoanApplicationName(loanApplication.getEnterpriseName());
+            userConference.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+            userConference.setConferenceTime(sysUserConference.getConferenceTime());
+            userConference.setRemark(String.valueOf(px));
+            sysUserConferenceMapper.insertSysUserConference(userConference);
+            //给人员发生代办信息
+            WaitRemind waitRemind = new WaitRemind();
+            waitRemind.setLoanApplicationId(sysUserConference.getLoanApplicationId());
+            waitRemind.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
+            waitRemind.setRemindTitle("您有一条【" + loanApplication.getEnterpriseName() + "】评审会议");
+            waitRemind.setRemindTime(DateUtils.getNowDate());
+            waitRemind.setRemindType("12");
+            waitRemind.setReadUserId(sysUser.getUserId().toString());
+            waitRemind.setRemindContent("您有一个评审会议需参加,会议时间:" + sysUserConference.getConferenceTime() + ",会议主题:【" + loanApplication.getEnterpriseName() + "】评审会");
+            waitRemindMapper.insertWaitRemind(waitRemind);
+            num++;
+            px++;
+            intList.add(randomNumber);
+            userChList.remove(sysUser);
+            //发极光推送
+            SysUser user = sysUserService.selectUserById(sysUser.getUserId());
+            if (StringUtils.isNotEmpty(user.getJgId())) {
+                String notificationTitle = "消息通知";
+                String msgTitle = "评审会议";
+                String msgContent = "您有一个评审会议需参加,会议时间:" + sysUserConference.getConferenceTime() + ",会议主题:【" + loanApplication.getEnterpriseName() + "】评审会";
+                String jPushVO = "";
+                JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, user.getJgId());
             }
         }
         return AjaxResult.success("成功");
@@ -259,6 +307,15 @@ public class SysUserConferenceServiceImpl implements ISysUserConferenceService {
         sysUserConference.setUserId(user.getUserId());
         sysUserConference.setUpdateTime(DateUtils.getNowDate());
         sysUserConferenceMapper.updateSysUserConferenceByUserId(sysUserConference);
+
+        //把当前阶段本人的待办都设置为已读
+        WaitRemind waitRemind1 = new WaitRemind();
+        waitRemind1.setLoanApplicationId(sysUserConference.getLoanApplicationId());
+        waitRemind1.setLoanApplicationNumber(sysUserConference.getLoanApplicationNumber());
+        waitRemind1.setRemindType(TWE);
+        waitRemind1.setReadUserId(String.valueOf(user.getUserId()));
+        waitRemindMapper.updateWaitRemindIsReadUserId(waitRemind1);
+
         //除了本人外是否全部投票
         //不同意人数
         int bty = 0;
@@ -338,10 +395,10 @@ public class SysUserConferenceServiceImpl implements ISysUserConferenceService {
             List<WaitRemind> waitRemindList = new ArrayList<>();
             LoanApplication loanApplicationOld = loanApplicationMapper.selectLoanApplicationByLoanApplicationId(sysUserConference.getLoanApplicationId());
             //发送待办消息
-            //删除所有待办事项
+/*            //删除所有待办事项
             WaitRemind waitRemindDelete = new WaitRemind();
             waitRemindDelete.setLoanApplicationId(loanApplication.getLoanApplicationId());
-            waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);
+            waitRemindMapper.deleteWaitRemindByLoanApplicationIdOnly(waitRemindDelete);*/
             //给A发送待办消息
             WaitRemind waitRemind = new WaitRemind();
             waitRemind.setLoanApplicationId(loanApplicationOld.getLoanApplicationId());
@@ -359,6 +416,14 @@ public class SysUserConferenceServiceImpl implements ISysUserConferenceService {
 
             //插入待办事项
             waitRemindMapper.batchWaitRemind(waitRemindList);
+
+            //把上一阶段的待办都设置为已读
+            WaitRemind waitRemindIsRead = new WaitRemind();
+            waitRemindIsRead.setLoanApplicationId(loanApplicationOld.getLoanApplicationId());
+            waitRemindIsRead.setLoanApplicationNumber(loanApplicationOld.getLoanApplicationNumber());
+            waitRemindIsRead.setRemindType(String.valueOf(Integer.parseInt(loanApplication.getAuditSchedule()) - 1));
+            waitRemindMapper.updateWaitRemindIsRead(waitRemindIsRead);
+
             //发极光推送id
             List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
             if (sysUsers != null && sysUsers.size() > 0) {

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/webOfficeImpl/MultiPhaseFileStorageServiceImpl.java

@@ -76,8 +76,8 @@ public class MultiPhaseFileStorageServiceImpl implements MultiPhaseFileStorageSe
         // 然后在调用 正真的 upload 方法的时候,需要确认当前的文件后缀
         // ***************************************************************
         // ***************************************************************
-
         // 这里简单的放内存
+        request.setManual(false);
         String suffix = FileUtils.suffix(request.getName());
         redisCache.setCacheObject(request.getFileId(), suffix, 2, TimeUnit.HOURS);
         SysUser user = SecurityUtils.getLoginUser().getUser();

+ 3 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/webOfficeImpl/PreviewServiceImpl.java

@@ -59,7 +59,7 @@ public class PreviewServiceImpl implements PreviewService {
         // 然后这里就会获取最后一个版本的文件并返回
         // 这里为了方便,所以设计成了一张表
         LoanApplicationFj cacheObject = redisCache.getCacheObject(fileId + "info");
-        String url = "https://rzdb.qs163.cn/prod-api/"+cacheObject.getUrl();
+        String url = "https://rzdb.qs163.cn/prod-api"+cacheObject.getUrl();
         DownloadInfo downloadInfo = new DownloadInfo();
         downloadInfo.setUrl(url);
         return downloadInfo;
@@ -79,6 +79,7 @@ public class PreviewServiceImpl implements PreviewService {
         webofficeFjServiceImpl.fetchFile(fileId);
         // 获取user信息,这个方法点进去看看把!!!
         SysUser user = SecurityUtils.getLoginUser().getUser();
+        System.out.println("rrrrrrrrrrrrrr"+user.getUserId());
         // 构建user对应的文件权限
         return UserPermission.builder()
                 .userId(String.valueOf(user.getUserId()))
@@ -87,6 +88,7 @@ public class PreviewServiceImpl implements PreviewService {
                 .rename(true)
                 .download(true)
                 .copy(true)
+                .print(true)
                 .comment(true)
                 .history(true)
                 .build();

+ 7 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/webOfficeImpl/UserServiceImpl.java

@@ -4,6 +4,8 @@ import cn.ljserver.tool.weboffice.v3.model.UserInfo;
 import cn.ljserver.tool.weboffice.v3.service.UserService;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.mapper.SysUserMapper;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -17,6 +19,9 @@ import java.util.List;
 @Service
 public class UserServiceImpl implements UserService {
 
+    @Autowired
+    private SysUserMapper userMapper;
+
     /**
      * 获取用户信息
      *
@@ -33,7 +38,8 @@ public class UserServiceImpl implements UserService {
         }*/
 
         List<UserInfo> userInfoList = new ArrayList<>();
-        SysUser user = SecurityUtils.getLoginUser().getUser();
+        SysUser user = userMapper.selectUserById(Long.valueOf(userIds.get(0)));
+        System.out.println("ttttttttttttttttttttttttttttt"+user.toString());
         UserInfo userInfo = new UserInfo();
         userInfo.setId(String.valueOf(user.getUserId()));
         userInfo.setName(user.getNickName());

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

@@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="reason != null  and reason != ''"> and reason = #{reason}</if>
             <if test="conferenceTime != null  and conferenceTime != ''"> and conference_time = #{conferenceTime}</if>
         </where>
-        order by create_time desc,real_name
+        order by remark
     </select>
     
     <select id="selectSysUserConferenceByConferenceId" parameterType="Long" resultMap="SysUserConferenceResult">

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

@@ -165,8 +165,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		from sys_user u
 				 left join sys_user_role ur on u.user_id = ur.user_id
 				 left join sys_role r on r.role_id = ur.role_id
-		where  u.del_flag = '0' and r.role_key in
-		<foreach collection="list" item="item" open="(" separator="," close=")">
+		where  u.del_flag = '0' and u.status = '0' and r.role_key in
+		<foreach collection="set" item="item" open="(" separator="," close=")">
 			#{item}
 		</foreach>
 

+ 11 - 0
ruoyi-system/src/main/resources/mapper/system/WaitRemindMapper.xml

@@ -115,6 +115,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where remind_id = #{remindId}
     </update>
 
+    <update id="updateWaitRemindIsRead" parameterType="WaitRemind">
+        update wait_remind set is_read = 'Y'
+        where loan_application_id = #{loanApplicationId} and loan_application_number = #{loanApplicationNumber} and remind_type = #{remindType}
+    </update>
+    <update id="updateWaitRemindIsReadUserId" parameterType="WaitRemind">
+        update wait_remind set is_read = 'Y'
+        where loan_application_id = #{loanApplicationId} and loan_application_number = #{loanApplicationNumber} and remind_type = #{remindType} and read_user_id = #{readUserId}
+    </update>
     <delete id="deleteWaitRemindByRemindId" parameterType="Integer">
         delete from wait_remind where remind_id = #{remindId}
     </delete>
@@ -138,4 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <delete id="deleteWaitRemindByLoanApplicationIdOnly" parameterType="WaitRemind">
         delete from wait_remind where loan_application_id = #{loanApplicationId}
     </delete>
+    <delete id="deleteWaitRemindByLoanApplicationIdAndIsRead" parameterType="WaitRemind">
+        delete from wait_remind where loan_application_id = #{loanApplicationId} and remind_type = #{remindType}  and is_read = 'N'
+    </delete>
 </mapper>