Quellcode durchsuchen

股东会决议在线编辑

LIVE_YE vor 8 Monaten
Ursprung
Commit
bfa792bf35

+ 56 - 47
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/LoanApplicationServiceImpl.java

@@ -6,6 +6,7 @@ import com.deepoove.poi.data.PictureRenderData;
 import com.deepoove.poi.data.Pictures;
 import com.itextpdf.text.DocumentException;
 import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysRole;
 import com.ruoyi.common.core.domain.entity.SysUser;
@@ -52,6 +53,7 @@ import java.util.zip.ZipOutputStream;
 
 import java.io.FileInputStream;
 import java.io.IOException;
+
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
 import org.apache.poi.xwpf.usermodel.XWPFParagraph;
 
@@ -63,7 +65,6 @@ import java.nio.file.Files;
 import java.nio.file.Paths;
 
 
-
 import static com.ruoyi.common.constant.CommonConstants.*;
 
 import javax.annotation.Resource;
@@ -764,16 +765,16 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             //获取所有的userid
             userIdList.add(loanApplication.getaUserId());
             List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
-            if(sysUsers!=null && sysUsers.size()>0){
+            if (sysUsers != null && sysUsers.size() > 0) {
                 String notificationTitle = "消息通知";
                 String msgTitle = "审核信息";
                 String msgContent = enterpriseName + "有一条贷款申请进入未通过需及时处理";
                 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 (listS != null && listS.size() > 0) {
+                    String[] registrationId = listS.toArray(new String[listS.size()]);
+                    JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, registrationId);
                 }
             }
 
@@ -828,16 +829,16 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             //获取所有的userid
             userIdList.add(loanApplication.getaUserId());
             List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
-            if(sysUsers!=null && sysUsers.size()>0){
+            if (sysUsers != null && sysUsers.size() > 0) {
                 String notificationTitle = "消息通知";
                 String msgTitle = "审核信息";
                 String msgContent = enterpriseName + "有一条贷款申请进入申诉状态需及时处理";
                 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 (listS != null && listS.size() > 0) {
+                    String[] registrationId = listS.toArray(new String[listS.size()]);
+                    JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, registrationId);
                 }
             }
             return AjaxResult.success();
@@ -904,7 +905,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 sysUserConferenceMapper.batchSysUserConference(sysUserConferenceList);
             }*/
             //audit_schedule = 2,3的时候贷款申请进度处于担保初审状态
-         else    if (auditSchedule.equals(TWO) || auditSchedule.equals(THR)) {
+            else if (auditSchedule.equals(TWO) || auditSchedule.equals(THR)) {
                 loanApplication.setLoanSchedule(THR);
                 loanApplication.setAuditSchedule(String.valueOf(Integer.parseInt(auditSchedule) + 1));
                 loanApplication.setAuditType(ONE);
@@ -1038,16 +1039,16 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
 
                 //发极光推送id
                 List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
-                if(sysUsers!=null && sysUsers.size()>0){
+                if (sysUsers != null && sysUsers.size() > 0) {
                     String notificationTitle = "消息通知";
                     String msgTitle = "审核信息";
                     String msgContent = enterpriseName + "的审核信息申请通过进入到下一阶段";
                     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 (listS != null && listS.size() > 0) {
+                        String[] registrationId = listS.toArray(new String[listS.size()]);
+                        JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, registrationId);
                     }
                 }
             }
@@ -1182,12 +1183,12 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
 
         //发极光推送
         SysUser user = sysUserService.selectUserById(loanApplication.getaUserId());
-        if(StringUtils.isNotEmpty(user.getJgId())){
+        if (StringUtils.isNotEmpty(user.getJgId())) {
             String notificationTitle = "消息通知";
             String msgTitle = "上会审核信息";
             String msgContent = loanApplication.getEnterpriseName() + "的上会审核信息申请" + result;
             String jPushVO = "";
-            JPushToolUtil.sendToRegistrationId(notificationTitle,msgTitle,msgContent,jPushVO,user.getJgId());
+            JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, user.getJgId());
         }
 
         return rows > 0 ? AjaxResult.success() : AjaxResult.error();
@@ -1269,16 +1270,16 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         //发极光推送id
         userIdList.add(loanApplication.getaUserId());
         List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
-        if(sysUsers!=null && sysUsers.size()>0){
+        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 (listS != null && listS.size() > 0) {
+                String[] registrationId = listS.toArray(new String[listS.size()]);
+                JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, registrationId);
             }
         }
 
@@ -1470,16 +1471,16 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
 
             //发极光推送id
             List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
-            if(sysUsers!=null && sysUsers.size()>0){
+            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 (listS != null && listS.size() > 0) {
+                    String[] registrationId = listS.toArray(new String[listS.size()]);
+                    JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, registrationId);
                 }
             }
         }
@@ -1733,16 +1734,16 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
             List<Long> userIdList = sysUserRoles.stream().map(SysUserRole::getUserId).collect(Collectors.toList());
             userIdList.add(loanApplication.getaUserId());
             List<SysUser> sysUsers = sysUserService.selectUserListByIdList(userIdList);
-            if(sysUsers!=null && sysUsers.size()>0){
+            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 (listS != null && listS.size() > 0) {
+                    String[] registrationId = listS.toArray(new String[listS.size()]);
+                    JPushToolUtil.sendToRegistrationId(notificationTitle, msgTitle, msgContent, jPushVO, registrationId);
                 }
             }
 
@@ -2058,21 +2059,25 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 if (shareholderFjs != null && shareholderFjs.size() > 0) {
                     for (ShareholderFj fj : shareholderFjs) {
                         if (StringUtils.isNotEmpty(fj.getShareholderBusinessUrl())) {
-                            params.put("gsName", fj.getShareholderName());
+                            String shareholderName = "";
+                            if(StringUtils.isNotEmpty(fj.getShareholderName())){
+                                shareholderName = fj.getShareholderName();
+                            }
+                            params.put("gsName", shareholderName);
                             params.put("bgs", loanApplication.getEnterpriseName());
 
-                            fileDir = RuoYiConfig.getProfile() + "/" + loanApplicationNumber;
+                            String fileDirg = RuoYiConfig.getProfile() + "/upload/" + loanApplicationNumber;
                             //fileName = FileUploadUtils.extractFilenameLoanApplicationNumberNoHzm("股东会决议");
-                            fileName = fj.getShareholderName() + "-股东会决议" + index;
+                            String fileNameg = shareholderName + "-股东会决议" + index;
                             //fileNameHz = fileName + ".docx";
-                            wordPath = WordUtil.createWord(templatePath, fileDir, fileName, params);
+                            wordPath = WordUtil.createWord(templatePath, fileDirg, fileNameg, params);
                             //将文件存入loan_application_fj表
                             LoanApplicationFj loanApplicationFj = new LoanApplicationFj();
                             loanApplicationFj.setLoanApplicationId(loanApplication.getLoanApplicationId());
                             loanApplicationFj.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
-                            loanApplicationFj.setOldName(fileName + ".docx");
-                            loanApplicationFj.setName(fileName + ".docx");
-                            loanApplicationFj.setUrl(RuoYiConfig.getUploadPath() + "/" + loanApplicationNumber + "/" + fileName + ".docx");
+                            loanApplicationFj.setOldName(fileNameg + ".docx");
+                            loanApplicationFj.setName(fileNameg + ".docx");
+                            loanApplicationFj.setUrl(Constants.RESOURCE_PREFIX + "/upload/" + loanApplicationNumber + "/" + fileNameg + ".docx");
                             loanApplicationFj.setBigType(bigType);
                             loanApplicationFj.setType(fileType);
                             loanApplicationFj.setCreateTime(DateUtils.getNowDate());
@@ -2089,21 +2094,25 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 List<GuaranteeInfo> guaranteeInfos = guaranteeInfoMapper.selectGuaranteeInfoList(guaranteeInfo);
                 if (guaranteeInfos != null && guaranteeInfos.size() > 0) {
                     for (GuaranteeInfo info : guaranteeInfos) {
-                        params.put("gsName", info.getGuaranteeName());
+                        String guaranteeName = "";
+                        if(StringUtils.isNotEmpty(info.getGuaranteeName())){
+                            guaranteeName = info.getGuaranteeName();
+                        }
+                        params.put("gsName", guaranteeName);
                         params.put("bgs", loanApplication.getEnterpriseName());
 
-                        fileDir = RuoYiConfig.getProfile() + "/" + loanApplicationNumber;
+                        String fileDirf = RuoYiConfig.getProfile() + "/upload/" + loanApplicationNumber;
                         //fileName = FileUploadUtils.extractFilenameLoanApplicationNumberNoHzm("股东会决议");
-                        fileName = info.getGuaranteeName() + "-股东会决议" + index;
+                        String fileNamef = guaranteeName + "-股东会决议" + index;
                         //fileNameHz = fileName + ".docx";
-                        wordPath = WordUtil.createWord(templatePath, fileDir, fileName, params);
+                        wordPath = WordUtil.createWord(templatePath, fileDirf, fileNamef, params);
                         //将文件存入loan_application_fj表
                         LoanApplicationFj loanApplicationFj = new LoanApplicationFj();
                         loanApplicationFj.setLoanApplicationId(loanApplication.getLoanApplicationId());
                         loanApplicationFj.setLoanApplicationNumber(loanApplication.getLoanApplicationNumber());
-                        loanApplicationFj.setOldName(fileName + ".docx");
-                        loanApplicationFj.setName(fileName + ".docx");
-                        loanApplicationFj.setUrl(RuoYiConfig.getUploadPath() + "/" + loanApplicationNumber + "/" + fileName + ".docx");
+                        loanApplicationFj.setOldName(fileNamef + ".docx");
+                        loanApplicationFj.setName(fileNamef + ".docx");
+                        loanApplicationFj.setUrl(Constants.RESOURCE_PREFIX + "/upload/" + loanApplicationNumber + "/" + fileNamef + ".docx");
                         loanApplicationFj.setBigType(bigType);
                         loanApplicationFj.setType(fileType);
                         loanApplicationFj.setCreateTime(DateUtils.getNowDate());
@@ -2309,7 +2318,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
 
                 path = path + "/" + fileNameHz;
                 break;
-                //todo  担保业务备案表
+            //todo  担保业务备案表
             case "21":
 
                 //分支行
@@ -2330,11 +2339,11 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 loanApplicationFjTzs.setLoanApplicationId(loanApplication.getLoanApplicationId());
                 loanApplicationFjTzs.setType("jj");
                 List<LoanApplicationFj> loanApplicationFjList = loanApplicationFjMapper.selectLoanApplicationFjList(loanApplicationFjTzs);
-                if(loanApplicationFjList!=null && loanApplicationFjList.size()>0){
+                if (loanApplicationFjList != null && loanApplicationFjList.size() > 0) {
                     loanApplicationFjTzs = loanApplicationFjList.get(0);
                 }
 
-                if(StringUtils.isNotEmpty(loanApplicationFjTzs.getUrl())){
+                if (StringUtils.isNotEmpty(loanApplicationFjTzs.getUrl())) {
                     // 上传文件路径
                     String filePath = RuoYiConfig.getUploadPath();
                     //服务器路径
@@ -2454,9 +2463,9 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
         return fileType;
     }
 
-   /* public static void main(String[] args) {
+    /* public static void main(String[] args) {
 
-        *//*File file = new File("D:\\尽职调查报告4.doc");
+     *//*File file = new File("D:\\尽职调查报告4.doc");
         FileInputStream fis = null;
         XWPFDocument document = null;
         XWPFWordExtractor extractor = null;

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

@@ -160,6 +160,29 @@ public class MultiPhaseFileStorageServiceImpl implements MultiPhaseFileStorageSe
             loanApplicationFj.setCreateTime(DateUtils.getNowDate());
             loanApplicationFjMapper.insertLoanApplicationFj(loanApplicationFj);
             System.out.println(loanApplicationFj.toString() + "888888888888888888888888888888");
+        }else{
+            boolean bl = true;
+            for (LoanApplicationFj loanApplicationFj : loanApplicationFjs) {
+                if(fileName.equals(loanApplicationFj.getUrl())){
+                    bl = false;
+                    break;
+                }
+            }
+            if(bl){
+                //将文件存入loan_application_fj表
+                LoanApplicationFj loanApplicationFj = new LoanApplicationFj();
+                loanApplicationFj.setLoanApplicationId(cacheObject.getLoanApplicationId());
+                loanApplicationFj.setLoanApplicationNumber(cacheObject.getLoanApplicationNumber());
+                loanApplicationFj.setOldName(cacheObject.getName());
+                loanApplicationFj.setName(com.ruoyi.common.utils.file.FileUtils.getName(fileName));
+                loanApplicationFj.setUrl(fileName);
+                loanApplicationFj.setBigType(cacheObject.getBigType());
+                loanApplicationFj.setType(cacheObject.getType());
+                loanApplicationFj.setCreateBy(user.getNickName());
+                loanApplicationFj.setCreateTime(DateUtils.getNowDate());
+                loanApplicationFjMapper.insertLoanApplicationFj(loanApplicationFj);
+            }
+
         }