From 60561da44d3f06a50d76bb823ea8e95ecc37e36f Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Tue, 19 Dec 2023 14:01:56 +0800 Subject: [PATCH 01/55] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=A1=88=E4=BB=B6=E7=BC=96=E5=8F=B7=E8=A7=84=E5=88=99=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseNumRuleController.java | 2 ++ .../mapper/CaseNumRuleMapper.java | 4 +++ .../service/ICaseNumRuleService.java | 2 ++ .../service/impl/CaseNumRuleServiceImpl.java | 13 ++++++- .../wisdomarbitrate/CaseNumRuleMapper.xml | 36 ++++++++++++++++++- 5 files changed, 55 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseNumRuleController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseNumRuleController.java index 03e00bf..7d453ca 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseNumRuleController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseNumRuleController.java @@ -28,6 +28,8 @@ public class CaseNumRuleController extends BaseController { return caseNumRuleService.insertCaseNumRule(caseNumRule); } + + /** * 修改案件编号规则 * @param caseNumRule diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseNumRuleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseNumRuleMapper.java index f48f84d..26a2a84 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseNumRuleMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseNumRuleMapper.java @@ -13,4 +13,8 @@ public interface CaseNumRuleMapper { int deleteCaseNumRule(CaseNumRule caseNumRule); List selectCaseNumRules(CaseNumRule caseNumRule); + + int countCaseNumRule(CaseNumRule caseNumRule); + + CaseNumRule selectCaseNumRule(CaseNumRule caseNumRule); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseNumRuleService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseNumRuleService.java index 26d323c..67b26bf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseNumRuleService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseNumRuleService.java @@ -15,4 +15,6 @@ public interface ICaseNumRuleService { AjaxResult deleteCaseNumRule(CaseNumRule caseNumRule); List selectCaseNumRule(CaseNumRule caseNumRule); + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseNumRuleServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseNumRuleServiceImpl.java index cf3c669..754e6dd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseNumRuleServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseNumRuleServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.wisdomarbitrate.domain.CaseNumRule; import com.ruoyi.wisdomarbitrate.mapper.CaseNumRuleMapper; import com.ruoyi.wisdomarbitrate.service.ICaseNumRuleService; @@ -19,6 +20,10 @@ public class CaseNumRuleServiceImpl implements ICaseNumRuleService { @Override @Transactional public AjaxResult insertCaseNumRule(CaseNumRule caseNumRule) { + int countCaseNumRule = caseNumRuleMapper.countCaseNumRule(caseNumRule); + if (countCaseNumRule>0){ + return AjaxResult.error("不能新增相同案件编号规则"); + } int i = caseNumRuleMapper.insertCaseNumRule(caseNumRule); if (i>0){ return AjaxResult.success("新增成功"); @@ -30,11 +35,15 @@ public class CaseNumRuleServiceImpl implements ICaseNumRuleService { @Override @Transactional public AjaxResult updateCaseNumRule(CaseNumRule caseNumRule) { + int countCaseNumRule = caseNumRuleMapper.countCaseNumRule(caseNumRule); + if (countCaseNumRule>0){ + return AjaxResult.error("不能修改相同案件编号规则"); + } int i = caseNumRuleMapper.updateCaseNumRule(caseNumRule); if (i > 0) { return AjaxResult.success("修改成功"); } - return AjaxResult.error(); + return AjaxResult.error("新增失败"); } @@ -58,4 +67,6 @@ public class CaseNumRuleServiceImpl implements ICaseNumRuleService { } + + } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseNumRuleMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseNumRuleMapper.xml index 8d58e5b..0aedfd5 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseNumRuleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseNumRuleMapper.xml @@ -56,7 +56,7 @@ + select count(1) from case_num_rule c + + + AND c.prefixstr = #{prefixstr} + + + AND c.rule_type = #{ruleType} + + + AND c.date_format = #{dateFormat} + + + AND c.dept_name = #{deptName} + + + AND c.dept_name_firchar = #{deptNameFirchar} + + + + + + + + + \ No newline at end of file -- 2.54.0 From 20c95700abc19d75393b70d23ca7900d9bbf71ba Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Wed, 20 Dec 2023 09:15:28 +0800 Subject: [PATCH 02/55] =?UTF-8?q?=E6=A1=88=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 51 ++ .../CaseApplicationController.java | 5 + .../CasePaymentController.java | 14 +- .../com/ruoyi/common/utils/EmailOutUtil.java | 182 +++++- .../ruoyi/wisdomarbitrate/StringIdsReq.java | 22 + .../domain/CaseApplication.java | 6 + .../domain/SealSignRecord.java | 183 +----- .../mapper/CaseApplicationLogMapper.java | 9 +- .../mapper/SealSignRecordMapper.java | 14 + .../service/IAdjudicationService.java | 18 + .../service/ICaseApplicationService.java | 1 + .../service/ICasePaymentService.java | 4 +- .../service/impl/AdjudicationServiceImpl.java | 359 ++++++++--- .../impl/CaseApplicationServiceImpl.java | 22 +- .../service/impl/CaseEvidenceServiceImpl.java | 48 +- .../service/impl/CasePaymentServiceImpl.java | 14 +- .../service/impl/CaseZipImportImpl.java | 574 ++++++++++-------- .../task/CaseZipImportTask.java | 66 ++ .../wisdomarbitrate/utils/CaseLogUtils.java | 24 + .../ruoyi/wisdomarbitrate/utils/OCRUtils.java | 16 +- .../wisdomarbitrate/utils/SignAward.java | 49 +- .../wisdomarbitrate/CaseAffiliateMapper.xml | 14 +- .../CaseApplicationLogMapper.xml | 28 +- .../wisdomarbitrate/CaseApplicationMapper.xml | 315 ++++------ .../wisdomarbitrate/SealSignRecordMapper.xml | 39 +- 25 files changed, 1277 insertions(+), 800 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index 7af5a47..6d2513f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -1,11 +1,15 @@ package com.ruoyi.web.controller.wisdomarbitrate; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.wisdomarbitrate.StringIdsReq; import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO; import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; @@ -22,7 +26,41 @@ public class AdjudicationController extends BaseController { @Autowired private IAdjudicationService adjudicationService; + /** + * 根据签署流程id查询批量签名链接 + */ +// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')") + @PostMapping("/selectBatchSignUrl") + public AjaxResult selectBatchSignUrl(@RequestBody StringIdsReq idsReq) { + if(CollectionUtil.isEmpty(idsReq.getIds())|| StrUtil.isEmpty(idsReq.getPsnAccount())){ + return error("参数校验失败"); + } + SealSignRecord sealSignRecordselect = adjudicationService.selectBatchSignUrl(idsReq); + return success(sealSignRecordselect); + } + /** + * 根据签署流程id查询批量用印链接 + */ +// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')") + @PostMapping("/selectBatchSealUrl") + public AjaxResult selectBatchSealUrl(@RequestBody StringIdsReq idsReq) { + if(CollectionUtil.isEmpty(idsReq.getIds())|| StrUtil.isEmpty(idsReq.getPsnAccount())){ + return error("参数校验失败"); + } + SealSignRecord sealSignRecordselect = adjudicationService.selectBatchSealUrl(idsReq); + return success(sealSignRecordselect); + } + /** + * 根据仲裁员手机号分页查询待签名/待用印的案件 + */ +// @PreAuthorize("@ss.hasPermi('caseManagement:list:selectSignUrl')") + @GetMapping("/pageSignAdjudicate") + public TableDataInfo pageSignAdjudicate(@RequestParam(value = "personAccount",required = false) String personAccount, @RequestParam("caseStatus") Integer caseStatus) { + startPage(); + List list = adjudicationService.selectSealSigning(personAccount,caseStatus); + return getDataTable(list); + } /** @@ -37,6 +75,18 @@ public class AdjudicationController extends BaseController { } return adjudicationService.createDocument(caseApplication); } + /** + * 批量生成裁决书 + * @param caseApplication + * @return + */ + @PostMapping("/batchDocument") + public AjaxResult batchDocument(@Validated @RequestBody BatchCaseApplication caseApplication){ + if (CollectionUtil.isEmpty(caseApplication.getIds())) { + return AjaxResult.error("参数校验失败"); + } + return adjudicationService.batchDocument(caseApplication.getIds()); + } /** * 重新生成裁决书 @@ -81,6 +131,7 @@ public class AdjudicationController extends BaseController { return adjudicationService.signature(caseApplication); } + /** * 归档(暂时只改案件状态) * @param batchCaseApplication diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index da0cdab..43d0ba8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -14,10 +14,12 @@ import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.WxAppletNotifyUtils; import com.ruoyi.util.FileUtil; +import com.ruoyi.wisdomarbitrate.StringIdsReq; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; +import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -40,6 +42,8 @@ import java.util.List; public class CaseApplicationController extends BaseController { @Autowired private ICaseApplicationService caseApplicationService; + @Autowired + private IAdjudicationService adjudicationService; /** @@ -171,6 +175,7 @@ public class CaseApplicationController extends BaseController { return success(sealSignRecordselect); } + /** * 查询用印链接 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java index 6590573..e7d24f8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java @@ -1,6 +1,8 @@ package com.ruoyi.web.controller.wisdomarbitrate; +import cn.hutool.core.collection.CollectionUtil; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import com.ruoyi.wisdomarbitrate.service.ICasePaymentService; @@ -9,6 +11,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; +import java.util.List; + /** * 缴费支付 */ @@ -43,13 +48,16 @@ public class CasePaymentController { /** * 缴费确认 - * @param caseApplication + * @param batchCaseApplication * @return */ // @PreAuthorize("@ss.hasPermi('paymentManagement:list:payconfirm')") @PutMapping("/confirm") - public AjaxResult confirmPayment(@Validated @RequestBody CaseApplication caseApplication) { - return paymentService.confirmPayment(caseApplication); + public AjaxResult confirmPayment(@Validated @RequestBody BatchCaseApplication batchCaseApplication) { + if(CollectionUtil.isEmpty(batchCaseApplication.getIds())){ + return AjaxResult.error("参数校验失败"); + } + return paymentService.confirmPayment(batchCaseApplication.getIds()); } /** * 缴费列表查询 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java index 2b6ebbf..3fef049 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/EmailOutUtil.java @@ -1,6 +1,8 @@ package com.ruoyi.common.utils; + +import com.ruoyi.common.utils.uuid.UUID; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; @@ -14,18 +16,17 @@ import org.springframework.stereotype.Component; import javax.activation.DataHandler; import javax.mail.*; import javax.mail.internet.*; +import javax.mail.search.*; import javax.mail.util.ByteArrayDataSource; import javax.validation.constraints.NotNull; -import java.io.File; -import java.io.IOException; +import java.io.*; import java.nio.file.Files; import java.nio.file.Paths; import java.security.Security; -import java.util.Date; -import java.util.List; -import java.util.Properties; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Stream; /** * @ClassName EmailInUtil @@ -48,10 +49,12 @@ public class EmailOutUtil { // private static String fromOut; @Value("${spring.mail.host}") private String hostOut; - @Value("${spring.mail.username}") - private String usernameOut; - @Value("${spring.mail.password}") - private String passwordOut; +// @Value("${spring.mail.username}") +// private String usernameOut; + private String usernameOut="wq18792927508@163.com"; +// @Value("${spring.mail.password}") +// private String passwordOut; + private String passwordOut= "WDFHKSEMCKVRELEA"; @Value("${spring.mail.port}") private Integer portOut; @@ -98,6 +101,7 @@ public class EmailOutUtil { String messageContent = "

"+message+"。

"; MimeBodyPart messageBodyPart = new MimeBodyPart(); messageBodyPart.setContent(messageContent, "text/html;charset=utf-8"); + messageBodyPart.setContentID(UUID.randomUUID().toString()); Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory"; //设置邮件会话参数 @@ -269,4 +273,164 @@ public class EmailOutUtil { } return flag; } +public void buildReceiveConnect() throws Exception { + + //POP3主机名 + String host = "pop3.163.com"; + //设置传输协议 + String protocol = "pop3"; + //用户账号 + String username = "wq18792927508@163.com"; + //密码或者授权码 + String password = "WDFHKSEMCKVRELEA"; + /* + * 获取Session + */ + Properties props = new Properties(); + //协议 + props.setProperty("mail.store.protocol", protocol); + //POP3主机名 + props.setProperty("mail.pop3.host", host); + props.setProperty("mail.smtp.auth", "true"); + props.setProperty("mail.pop3.default-encoding", "UTF-8"); + Session session = Session.getDefaultInstance(props, new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(usernameOut, passwordOut); + } + }); + URLName urlName = new URLName(protocol, host, 110, null, username, password); + Store store = session.getStore(urlName); + store.connect(username, password); + + + Folder folder = store.getFolder("INBOX"); + + folder.open(Folder.READ_ONLY); + + } + /** + * 接收邮件 + */ + public List receiverMail() { + List messageIds=new ArrayList<>(); + +// session.setDebug(true); + + try { + //POP3主机名 + String host = "pop3.163.com"; + //设置传输协议 + String protocol = "pop3"; + //用户账号 + String username = "wq18792927508@163.com"; + //密码或者授权码 + String password = "WDFHKSEMCKVRELEA"; + /* + * 获取Session + */ + Properties props = new Properties(); + //协议 + props.setProperty("mail.store.protocol", protocol); + //POP3主机名 + props.setProperty("mail.pop3.host", host); + props.setProperty("mail.smtp.auth", "true"); + props.setProperty("mail.pop3.default-encoding", "UTF-8"); + Session session = Session.getDefaultInstance(props, new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(usernameOut, passwordOut); + } + }); + URLName urlName = new URLName(protocol, host, 110, null, username, password); + Store store = session.getStore(urlName); + store.connect(username, password); + + + Folder folder = store.getFolder("INBOX"); + folder.open(Folder.READ_ONLY); + SearchTerm orTerm = new SubjectTerm("退信"); + // Message[] messages = folder.search(orTerm); + Date endTime= new Date(); + long oneDayMillis=24*60*60*1000L; + Date startTime=new Date(endTime.getTime()-oneDayMillis); + // SearchTerm comparisonTermGe = new SentDateTerm(ComparisonTerm.GE, startTime); + // SearchTerm comparisonTermLe = new SentDateTerm(ComparisonTerm.LE, endTime); + // SearchTerm comparisonAndTerm = new AndTerm(comparisonTermGe, comparisonTermLe); + // SearchTerm searchTerm = new AndTerm(comparisonAndTerm, orTerm); + Message[] messages = folder.search(orTerm); + if (messages != null) { + + Arrays.stream(messages).forEach(message -> { + String messageId=""; + try { + messageId = EmailUtil.getMessageId(message,session); + } catch (Exception e) { + e.printStackTrace(); + } + messageIds.add(messageId); + }); + + } + + folder.close(false); + store.close(); + } catch (Exception e) { + return messageIds; + } + return messageIds; + } + + public void analyseMail(Session session, Object content) throws Exception { + + if (content instanceof Multipart) { + Multipart multipart = (Multipart) content; + for (int i = 0; i < multipart.getCount(); i++) { + BodyPart bodyPart = multipart.getBodyPart(i); +// if (bodyPart.isMimeType("message/rfc822")) { if(bodyPart.getContentType().startsWith("Message/Rfc822")); +// MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream()); +// } + if(bodyPart.isMimeType("Message/Rfc822")){ + MimeMessage mimeMessage = new MimeMessage(session, bodyPart.getInputStream()); + } + } + } + } + public static String getMessageId(Part part) throws Exception { + if (!part.isMimeType("multipart/*")) { + return ""; + } + + Multipart multipart = (Multipart) part.getContent(); + for (int i = 0; i < multipart.getCount(); i++) { + BodyPart bodyPart = multipart.getBodyPart(i); + + if (part.isMimeType("message/rfc822")) { + return getMessageId((Part) part.getContent()); + } + InputStream inputStream = bodyPart.getInputStream(); + + try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream))) { + String strLine; + while ((strLine = br.readLine()) != null) { + if (strLine.startsWith("Message_Id:")) { + String[] split = strLine.split("Message_Id:"); + return split.length > 1 ? split[1].trim() : null; + } + } + } + } + + return ""; + } + + +//检查退信邮件 +// Folder folder = ...; //打开收件箱 +// Message[] messages = folder.getMessages(); +// for (Message message : messages) { +// if (message.getSubject().contains("Delivery Status Notification")) { +// System.out.println("Delivery failed for recipient: " + message.getRecipients()[0]); +// } +// } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java new file mode 100644 index 0000000..7e561dd --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/StringIdsReq.java @@ -0,0 +1,22 @@ +package com.ruoyi.wisdomarbitrate; + +import lombok.Data; + +import java.util.List; + +@Data +public class StringIdsReq { + private List ids; + /** + * 签署人账号(即仲裁员手机号) + */ + private String psnAccount; + /** + * 签署人id + */ + private String psnId ; + /** + * 机构账户 + */ + private String orgId ; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index a92310b..1954c3e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -408,4 +408,10 @@ public class CaseApplication extends BaseEntity { * 自定义字段 */ private List columnValues; + /** + * 待办状态,0待办,1已办 + */ + private Integer pendingStatus; + /** e签宝流程id */ + private String signFlowId;; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java index 7365e10..e4e0267 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java @@ -1,7 +1,13 @@ package com.ruoyi.wisdomarbitrate.domain; import com.ruoyi.common.core.domain.BaseEntity; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +@Data +@NoArgsConstructor +@AllArgsConstructor public class SealSignRecord extends BaseEntity { private static final long serialVersionUID = 1L; @@ -25,15 +31,6 @@ public class SealSignRecord extends BaseEntity { private String orgnizeNamepsnName; String fileDownloadUrl; - - public String getFileDownloadUrl() { - return fileDownloadUrl; - } - - public void setFileDownloadUrl(String fileDownloadUrl) { - this.fileDownloadUrl = fileDownloadUrl; - } - /** 流程状态 */ private Integer signFlowStatus; /** 签名状态 */ @@ -44,171 +41,11 @@ public class SealSignRecord extends BaseEntity { /** 签名链接 */ private String signUrl; - public String getSignUrl() { - return signUrl; - } - - public void setSignUrl(String signUrl) { - this.signUrl = signUrl; - } - - public String getSealUrl() { - return sealUrl; - } - - public void setSealUrl(String sealUrl) { - this.sealUrl = sealUrl; - } - /** 用印链接 */ private String sealUrl; private Long caseAppliId; - public Long getCaseAppliId() { - return caseAppliId; - } - - public void setCaseAppliId(Long caseAppliId) { - this.caseAppliId = caseAppliId; - } - - public Integer getPsnsignStatus() { - return psnsignStatus; - } - - public void setPsnsignStatus(Integer psnsignStatus) { - this.psnsignStatus = psnsignStatus; - } - - public Integer getOrgsignStatus() { - return orgsignStatus; - } - - public void setOrgsignStatus(Integer orgsignStatus) { - this.orgsignStatus = orgsignStatus; - } - - public Integer getSignFlowStatus() { - return signFlowStatus; - } - - public void setSignFlowStatus(Integer signFlowStatus) { - this.signFlowStatus = signFlowStatus; - } - - public String getFileid() { - return fileid; - } - - public void setFileid(String fileid) { - this.fileid = fileid; - } - - public String getFilename() { - return filename; - } - - public void setFilename(String filename) { - this.filename = filename; - } - - public String getSignFlowid() { - return signFlowid; - } - - public void setSignFlowid(String signFlowid) { - this.signFlowid = signFlowid; - } - - public String getPensonAccount() { - return pensonAccount; - } - - public void setPensonAccount(String pensonAccount) { - this.pensonAccount = pensonAccount; - } - - public String getPensonName() { - return pensonName; - } - - public void setPensonName(String pensonName) { - this.pensonName = pensonName; - } - - public String getOrgnizeName() { - return orgnizeName; - } - - public void setOrgnizeName(String orgnizeName) { - this.orgnizeName = orgnizeName; - } - - public String getOrgnizeNamePsnAccount() { - return orgnizeNamePsnAccount; - } - - public void setOrgnizeNamePsnAccount(String orgnizeNamePsnAccount) { - this.orgnizeNamePsnAccount = orgnizeNamePsnAccount; - } - - public String getOrgnizeNamepsnName() { - return orgnizeNamepsnName; - } - - public void setOrgnizeNamepsnName(String orgnizeNamepsnName) { - this.orgnizeNamepsnName = orgnizeNamepsnName; - } - - public String getPositionPagepsn() { - return positionPagepsn; - } - - public void setPositionPagepsn(String positionPagepsn) { - this.positionPagepsn = positionPagepsn; - } - - public double getPositionXpsn() { - return positionXpsn; - } - - public void setPositionXpsn(double positionXpsn) { - this.positionXpsn = positionXpsn; - } - - public double getPositionYpsn() { - return positionYpsn; - } - - public void setPositionYpsn(double positionYpsn) { - this.positionYpsn = positionYpsn; - } - - public String getPositionPageorg() { - return positionPageorg; - } - - public void setPositionPageorg(String positionPageorg) { - this.positionPageorg = positionPageorg; - } - - public double getPositionXorg() { - return positionXorg; - } - - public void setPositionXorg(double positionXorg) { - this.positionXorg = positionXorg; - } - - public double getPositionYorg() { - return positionYorg; - } - - public void setPositionYorg(double positionYorg) { - this.positionYorg = positionYorg; - } - /** 签名位置页数 */ private String positionPagepsn; /** 签名位置x坐标 */ @@ -223,13 +60,5 @@ public class SealSignRecord extends BaseEntity { private double positionYorg; - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java index 862074f..ca49a36 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationLogMapper.java @@ -38,7 +38,7 @@ public interface CaseApplicationLogMapper { Integer selectMaxVersionBySecret(@Param("caseAppliId")Long id); /** - * 根据案件id删除案件记录表和案件关联人日志表 + * 删除日志 * @param ids */ void batchDeleteLog(@Param("ids") List ids); @@ -46,4 +46,11 @@ public interface CaseApplicationLogMapper { CaseApplication selectBeforeCase(@Param("caseId") Long caseId, @Param("version")Integer version); Integer batchSave(@Param("list")List caseApplications); + + /** + * 根据案件id查询所有的日志id + * @param ids + * @return + */ + List selectLogsByCaseIds(@Param("ids")List ids); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java index 84bfc9c..13d2cba 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java @@ -2,15 +2,29 @@ package com.ruoyi.wisdomarbitrate.mapper; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; +import org.apache.ibatis.annotations.Param; import java.util.List; public interface SealSignRecordMapper { List selectSealSignRecord(SealSignRecord sealSignRecord); + /** + * 查询已签署和签署中的文件 + * @param sealSignRecord + * @return + */ List selectSealSignRecordbyStat(SealSignRecord sealSignRecord); + /** + * 差询等待签署,签署中的案件 + * @param penSonAccount 签署人员 + * @return + */ + List selectSealSigning(@Param("penSonAccount") String penSonAccount, @Param("caseStatus") Integer caseStatus); + int updataSealSignRecord(SealSignRecord sealSignRecord); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java index 3c94b26..5fa26f4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java @@ -1,8 +1,10 @@ package com.ruoyi.wisdomarbitrate.service; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.StringIdsReq; import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO; import java.util.List; @@ -39,4 +41,20 @@ public interface IAdjudicationService { * @return */ AjaxResult batchDocument(List ids); + + /** + * 根据签署流程id查询批量签名链接 + * @param idsReq + * @return + */ + SealSignRecord selectBatchSignUrl( StringIdsReq idsReq); + + /** + * 根据仲裁员手机号分页查询等待签署,签署中的裁决书 + * @param personAccount + * @return + */ + List selectSealSigning(String personAccount,Integer caseStatus); + + SealSignRecord selectBatchSealUrl(StringIdsReq idsReq); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index c8a1bc4..b9fa706 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -135,4 +135,5 @@ public interface ICaseApplicationService { AjaxResult editCaseApplicationDefineval(CaseApplication caseApplication); CaseAttach downloadCaseZipFile(CaseApplication caseApplication); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java index a5edb44..33665b6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java @@ -6,13 +6,15 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; +import java.util.List; + public interface ICasePaymentService { /** * 案件缴费 */ AjaxResult casePay(CasePayDTO casePayDTO); - AjaxResult confirmPayment(CaseApplication caseApplication); + AjaxResult confirmPayment( List ids); /** * 确认缴费 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 771e3c9..af495a9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -5,15 +5,21 @@ import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.deepoove.poi.data.PictureRenderData; +import com.google.gson.Gson; +import com.google.gson.JsonObject; import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.*; import com.ruoyi.common.utils.thread.MultipleThreadListParam; import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil; import com.ruoyi.system.mapper.SysDictDataMapper; +import com.ruoyi.wisdomarbitrate.StringIdsReq; import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO; import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; import com.ruoyi.wisdomarbitrate.mapper.*; @@ -24,6 +30,7 @@ import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService; +import com.ruoyi.wisdomarbitrate.utils.SignAward; import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; @@ -57,6 +64,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.ruoyi.common.utils.PageUtils.startPage; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @Service @@ -92,9 +100,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService { private FatchRuleMapper fatchRuleMapper; @Autowired private SysDictDataMapper dictDataMapper; + @Autowired + private SealManageMapper sealManageMapper; + @Autowired + private SealSignRecordMapper sealSignRecordMapper; + // 仲裁反请求模板内容 - private final String counterclaim= "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + + private final String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; // 财产保全内容 @@ -104,36 +117,37 @@ public class AdjudicationServiceImpl implements IAdjudicationService { String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" + ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; // 线上开庭时+线上仲裁 - String onLineDate="{{onLineDate}}"; - String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"+onLineDate+"通过仲裁委智慧仲裁平台开庭审理了本案。"; + String onLineDate = "{{onLineDate}}"; + String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + onLineDate + "通过仲裁委智慧仲裁平台开庭审理了本案。"; // 开庭+线下仲裁 - String offLineDate="{{offLineDate}}"; - String offLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于 "+offLineDate+"在仲裁委所在地开庭审理了本案。"; + String offLineDate = "{{offLineDate}}"; + String offLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于 " + offLineDate + "在仲裁委所在地开庭审理了本案。"; //书面仲裁时 - String writtenDate="{{writtenDate}}"; - String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"+writtenDate+"在仲裁委所在地开庭审理了本案。仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,根据《2022年版仲裁规则》第五十八条的规定对本案进行了书面审理。 "; + String writtenDate = "{{writtenDate}}"; + String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + writtenDate + "在仲裁委所在地开庭审理了本案。仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,根据《2022年版仲裁规则》第五十八条的规定对本案进行了书面审理。 "; //开庭+缺席审理 - String absent = "申请人的特别授权委托代理人{{agentName}}"+"出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + + String absent = "申请人的特别授权委托代理人{{agentName}}" + "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" + - " \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。"+"综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + + " \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。" + "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; // 开庭+出席 - String attend="申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 "; + String attend = "申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 "; // 开庭+出席+被申提供证据 - String onLineAttendFile="庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;双方当事人均出示了证据材料并对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 "; + String onLineAttendFile = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;双方当事人均出示了证据材料并对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 "; // 开庭+出席+被申未提供证据 - String onLineAttend="庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 "; + String onLineAttend = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 "; // 被申请人出席答辩意见 - String resAttendOpinion="\n(二)被申请人的答辩意见 \n(三)当事人提供的证据材料及对方的质证意见\n" + + String resAttendOpinion = "\n(二)被申请人的答辩意见 \n(三)当事人提供的证据材料及对方的质证意见\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}\n被申请人对上述材料的质证意见为:{{respondentOpinion}}\n"; // 被申请人出席+被申请人提供了资料 - String resFile="被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" + + String resFile = "被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" + "申请人对上述材料的质证意见为:{{applicantOpinion}}"; // 被申请人缺席 - String resAbsent="(二)当事人提供的证据材料\n" + + String resAbsent = "(二)当事人提供的证据材料\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}"; // 日期格式化年月日 SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); + @Override @Transactional public AjaxResult createDocument(CaseApplication caseApplicationReq) { @@ -161,13 +175,13 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.error("请先指定裁决书模板"); } templatePath = templateManages.get(0).getTemOrigPath(); - if(StrUtil.isEmpty(templatePath)){ + if (StrUtil.isEmpty(templatePath)) { return AjaxResult.error("未找到该模板"); } // todo 部署放开 - if(templatePath!=null){ - templatePath="/home/ruoyi/" +templatePath; + if (templatePath != null) { + templatePath = "/home/ruoyi/" + templatePath; } try { File file = new File(templatePath); @@ -198,15 +212,15 @@ public class AdjudicationServiceImpl implements IAdjudicationService { fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault)); } // 自定义字段,从columnValue值取 - if (fatchRuleMap.size()>0&&fatchRuleMap.containsKey(1)) { + if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) { // 根据案件id查询key-value表 List columnValueList = columnValueMapper.listByCaseId(caseApplicationReq.getId()); if (CollectionUtil.isNotEmpty(columnValueList)) { columnValueList.forEach(columnValue -> valueMap.put(columnValue.getName(), columnValue.getValue())); } } - // 组装内置字段,在主表中查出内容 - buildDefaultColumnValue(dictDataList,caseAffiliates,valueMap,caseApplicationById); + // 组装内置字段,在主表中查出内容 + buildDefaultColumnValue(dictDataList, caseAffiliates, valueMap, caseApplicationById); // 获取模板中的占位符key List bookmarkList = getBookmarkByDocx(templatePath); @@ -214,9 +228,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.success("请检查模板是否配置正确,未获取到占位符"); } // 遍历书签,给书签赋值 - replaceBookmark(bookmarkList,datas,valueMap); + replaceBookmark(bookmarkList, datas, valueMap); // 根据条件替换书签 - conditionReplaceBookmark(caseApplicationById,datas,agentName,resName,arbitrateRecordSelect); + conditionReplaceBookmark(caseApplicationById, datas, agentName, resName, arbitrateRecordSelect); // 裁决书生成时间 LocalDate now = LocalDate.now(); String year = Integer.toString(now.getYear()); @@ -226,7 +240,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 裁决书编号 datas.put("裁决书编号", equipmentNo); // 仲裁费 - datas.put("仲裁费", caseApplicationById.getFeePayable().toString()); + datas.put("仲裁费", caseApplicationById.getFeePayable() != null ? caseApplicationById.getFeePayable().toString() : ""); // 案件创建时间 Date createTime = caseApplicationById.getCreateTime(); // 将日期格式化为字符串 @@ -248,7 +262,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; // String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName; // 将word中的标签替换掉,生成新的word - String docFilePath = wordChangeText(templatePath,datas,saveFolderPath,fileName); + String docFilePath = wordChangeText(templatePath, datas, saveFolderPath, fileName); String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); // 保存裁决书附件 @@ -262,14 +276,15 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 将word中的标签替换掉,生成新的word - * @param modalFilePath 裁决书模板路径 - * @param datas 替换标签的内容 + * + * @param modalFilePath 裁决书模板路径 + * @param datas 替换标签的内容 * @param saveFolderPath 保存路径 - * @param fileName 保存文件名 + * @param fileName 保存文件名 * @return * @throws IOException */ - private String wordChangeText(String modalFilePath, Map datas, String saveFolderPath,String fileName) throws IOException { + private String wordChangeText(String modalFilePath, Map datas, String saveFolderPath, String fileName) throws IOException { String resultFilePath = saveFolderPath + "/" + fileName; // 创建日期目录 File saveFolder = new File(saveFolderPath); @@ -291,13 +306,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 根据条件判断裁决书中是否需要该内容 - * @param caseApplicationById 案件信息 - * @param datas 替换标签值 - * @param agentName 代理人名称 - * @param resName 被申请人名称 - * @param arbitrateRecordSelect 仲裁记录 + * + * @param caseApplicationById 案件信息 + * @param datas 替换标签值 + * @param agentName 代理人名称 + * @param resName 被申请人名称 + * @param arbitrateRecordSelect 仲裁记录 */ - private void conditionReplaceBookmark(CaseApplication caseApplicationById, Map datas,String agentName,String resName, ArbitrateRecord arbitrateRecordSelect ) { + private void conditionReplaceBookmark(CaseApplication caseApplicationById, Map datas, String agentName, String resName, ArbitrateRecord arbitrateRecordSelect) { // 如果有仲裁反请求,该字段设置值 Integer adjudicaCounter = caseApplicationById.getAdjudicaCounter(); if (adjudicaCounter != null && adjudicaCounter == 1) { @@ -344,7 +360,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } // todo 线上仲裁/线下仲裁方式未选择 //线上开庭时+线上仲裁 - if (arbitratMethod!=null&&arbitratMethod == 1) { + if (arbitratMethod != null && arbitratMethod == 1) { String replace = onLine.replace(onLineDate, Optional.of(hearDateStr).orElse("")); datas.put("线上开庭并线上仲裁", replace); // 所有附件 @@ -418,9 +434,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 给模板中的占位符赋值 + * * @param bookmarkList 书签 - * @param datas 书签赋值 - * @param valueMap 案件内容 + * @param datas 书签赋值 + * @param valueMap 案件内容 */ private void replaceBookmark(List bookmarkList, Map datas, Map valueMap) { for (String bookmark : bookmarkList) { @@ -454,9 +471,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 组装案件内置字段值,即主表和相关人员表信息 - * @param dictDataList 内置字段 + * + * @param dictDataList 内置字段 * @param caseAffiliates 关联人员 - * @param valueMap 组装的值 + * @param valueMap 组装的值 */ private void buildDefaultColumnValue(List dictDataList, List caseAffiliates, Map valueMap, CaseApplication caseApplication) { if (CollectionUtil.isNotEmpty(dictDataList)) { @@ -479,6 +497,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { case "被申请人住所": valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili()); break; + case "被申请人联系地址": + valueMap.put(dictData.getDictLabel(), affiliate.getContactAddress()); + break; case "被申请人联系电话": valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphone()); break; @@ -486,13 +507,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService { valueMap.put(dictData.getDictLabel(), affiliate.getEmail()); break; case "被申请人性别": - if (dictData.getDictLabel().equals("被申请人性别")) { - String responSex = affiliate.getResponSex(); - if (responSex.equals("0")) { - valueMap.put(dictData.getDictLabel(), "男"); - } else { - valueMap.put(dictData.getDictLabel(), "女"); - } + String responSex = affiliate.getResponSex(); + if (responSex.equals("0")) { + valueMap.put(dictData.getDictLabel(), "男"); + } else { + valueMap.put(dictData.getDictLabel(), "女"); } break; case "被申请人出生年月日": @@ -545,10 +564,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService { default: break; } - }else { + } else { valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue())); } - }else { + } else { valueMap.put(dictData.getDictLabel(), ObjectFieldUtils.getValue(caseApplication, dictData.getDictValue())); } @@ -558,10 +577,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 保存裁决书附件 - * @param id 案件id - * @param saveName 保存的文件名 - * @param savePath 保存路径 - * @param caseApplicationById 案件基本信息 + * + * @param id 案件id + * @param saveName 保存的文件名 + * @param savePath 保存路径 + * @param caseApplicationById 案件基本信息 * @param arbitrateRecordSelect 出裁决书生成记录 */ private void saveArbitorFile(Long id, String saveName, String savePath, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect) { @@ -770,10 +790,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService { String prefix = "/profile/upload/"; int startIndex = prefix.length(); String path = caseAttach.getAnnexPath() + annexName.substring(startIndex); - File file = new File(path); - if(!file.exists()){ - return AjaxResult.error("未生成裁决书"); - } + File file = new File(path); + // todo 部署放开 + if (!file.exists()) { + return AjaxResult.error("未生成裁决书"); + } } } @@ -798,78 +819,105 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } } - //发送邮件 - boolean b = sendCaseEmail(caseApplication1, appEmail, resEmail,caseAttachList); + //申请人发送邮件 + boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList); SendMailRecord sendMailRecord = new SendMailRecord(); sendMailRecord.setCaseId(id); sendMailRecord.setMailAddress(appEmail); sendMailRecord.setMailContent("您好,审核后的裁决书在附件中请查阅"); +// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅"); sendMailRecord.setMailName("签署后的裁决书"); sendMailRecord.setSendTime(new Date()); sendMailRecord.setCreateBy(getUsername()); - if (b) { + if (appEmailFlag) { sendMailRecord.setSendStatus(1); } else { sendMailRecord.setSendStatus(0); } sendMailRecordMapper.saveSendMailRecord(sendMailRecord); + // 被申请人发送邮件 + boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList); + SendMailRecord sendMailRecord1 = new SendMailRecord(); sendMailRecord1.setCaseId(id); sendMailRecord1.setMailAddress(resEmail); +// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅"); sendMailRecord1.setMailContent("您好,审核后的裁决书在附件中请查阅"); sendMailRecord1.setMailName("签署后的裁决书"); sendMailRecord1.setSendTime(new Date()); sendMailRecord1.setCreateBy(getUsername()); - if (b) { + if (resEmailFlag) { sendMailRecord1.setSendStatus(1); - // 发送短信 - if(CollectionUtil.isNotEmpty(caseAffiliates)) { + }else { + sendMailRecord1.setSendStatus(0); + } + sendMailRecordMapper.saveSendMailRecord(sendMailRecord1); + if(!appEmailFlag&&!resEmailFlag){ + throw new ServiceException("裁决书发送失败"); + } + if(!appEmailFlag){ + throw new ServiceException("申请人裁决书发送失败"); + } + if(!resEmailFlag){ + throw new ServiceException("被申请人裁决书发送失败"); + } + // 发送短信 + if (appEmailFlag||resEmailFlag) { + + if (CollectionUtil.isNotEmpty(caseAffiliates)) { SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); request.setTemplateId("1990362"); for (CaseAffiliate affiliate : caseAffiliates) { + String telphone=null; + if(appEmailFlag&&affiliate.getIdentityType()==1){ + telphone = affiliate.getContactTelphone(); + }else if(resEmailFlag&&affiliate.getIdentityType()==2){ + telphone = affiliate.getContactTelphone(); + } + if(StrUtil.isEmpty(telphone)){ + continue; + } - request.setPhone(affiliate.getContactTelphone()); + request.setPhone(telphone); // if(affiliate.getIdentityType() == 1) { // request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), appEmail}); // }else { // request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), resEmail}); // } - request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum()}); + request.setTemplateParamSet(new String[]{affiliate.getName(), caseApplication1.getCaseNum()}); Boolean aBoolean = SmsUtils.sendSms(request); - // 保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); + // 保存短信发送记录 + SmsSendRecord smsSendRecord = new SmsSendRecord(); + smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); - smsSendRecord.setCaseNum(caseApplication1.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); + smsSendRecord.setCaseNum(caseApplication1.getCaseNum()); + smsSendRecord.setPhone(request.getPhone()); + smsSendRecord.setSendTime(new Date()); // // 尊敬的{1}用户,您的{2}仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。 // if(affiliate.getIdentityType() == 1) { // smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +appEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。"); // }else { // smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +resEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。"); // } - smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。"); + smsSendRecord.setSendContent("尊敬的" + affiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。"); smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); + if (aBoolean) { + smsSendRecord.setSendStatus(1); + } else { + smsSendRecord.setSendStatus(0); + } + smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } - } else { - sendMailRecord1.setSendStatus(0); } - sendMailRecordMapper.saveSendMailRecord(sendMailRecord1); + // 新增日志 CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, ""); @@ -881,10 +929,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService { * 通过邮件发送裁决书文件 * * @param caseApplication1 - * @param appEmail - * @param resEmail */ - private boolean sendCaseEmail(CaseApplication caseApplication1, String appEmail, String resEmail, List caseAttachList) { + private boolean sendCaseEmail(CaseApplication caseApplication1, String email, List caseAttachList) { List fileList = new ArrayList<>(); File file = null; if (caseAttachList != null && caseAttachList.size() > 0) { @@ -894,7 +940,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { String prefix = "/profile/upload/"; int startIndex = prefix.length(); String path = caseAttach.getAnnexPath() + annexName.substring(startIndex); + // todo 部署放开 file = new File(path); +// file = new File("D:\\home\\ruoyi\\uploadPath\\upload\\2023\\09\\b10b20d66cfa44df8995c3999e3b6266.pdf"); fileList.add(file); System.out.println("文件长度==================:" + file.length()); } @@ -903,9 +951,19 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (file != null && file.exists()) { try { - Boolean aBoolean = emailOutUtil.sendEmil(appEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null); - Boolean aBoolean1 = emailOutUtil.sendEmil(resEmail, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null); - if (aBoolean && aBoolean1) { + Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null); + +// String appUid = UUID.randomUUID().toString(); +// Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅", appUid +"裁决书", fileList, null); +// // Thread.sleep(20); + // 收到退信的所有id,即发送失败的uuid + // emailOutUtil.receiverMail(); + // Thread.sleep(3); + // List messageIds = emailOutUtil.receiverMail(); +// if (aBoolean&&(CollectionUtil.isEmpty(messageIds)||!messageIds.contains(appUid))) { +// return Boolean.TRUE; +// } + if (aBoolean) { return Boolean.TRUE; } } catch (Exception e) { @@ -1255,14 +1313,16 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } return AjaxResult.success(bookSendVO); } - private void setExecList(List execList, List columnValueList){ - if(CollectionUtil.isNotEmpty(columnValueList)){ - Function,Integer> function= columnValueMapper::batchSave; - execList.add(new MultipleThreadListParam(function,columnValueList)); + + private void setExecList(List execList, List columnValueList) { + if (CollectionUtil.isNotEmpty(columnValueList)) { + Function, Integer> function = columnValueMapper::batchSave; + execList.add(new MultipleThreadListParam(function, columnValueList)); } } - @Transactional + + @Transactional @Override public AjaxResult batchDocument(List ids) { // todo 多线程生成裁决书 @@ -1283,6 +1343,104 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.success(); } + /** + * 根据签署流程id查询批量签名链接 + * + * @param idsReq + * @return + */ + @Override + public SealSignRecord selectBatchSignUrl(StringIdsReq idsReq) { + SealSignRecord signRecord = new SealSignRecord(); + + try { + EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq); + + Gson gson = new Gson(); + if (StrUtil.isNotEmpty(identityInfo.getBody())) { + JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class); + if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) { + JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data"); + if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) { + idsReq.setPsnId(identityInfoData.get("psnId").getAsString()); + } + } + } + if (StrUtil.isEmpty(idsReq.getPsnId())) { + throw new ServiceException("该用户未认证"); + } + EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq); + if (StrUtil.isNotEmpty(batchSignUrl.getBody())) { + JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class); + if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) { + JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); + if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) { + // 免登录批量签链接(链接有效期2小时) + String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString(); + // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时) + signRecord.setSignUrl(url); + } + } + } + } catch (EsignDemoException e) { + e.printStackTrace(); + } + + return signRecord; + } + + @Override + public SealSignRecord selectBatchSealUrl(StringIdsReq idsReq) { + SealSignRecord signRecord = new SealSignRecord(); + + try { + EsignHttpResponse identityInfo = SignAward.identityInfo(idsReq); + + Gson gson = new Gson(); + if (StrUtil.isNotEmpty(identityInfo.getBody())) { + JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class); + if(identityInfoJsonObject!=null&&!identityInfoJsonObject.get("data").isJsonNull()) { + JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data"); + if (identityInfoData != null && !identityInfoData.get("psnId") .isJsonNull()) { + idsReq.setPsnId(identityInfoData.get("psnId").getAsString()); + } + } + } + if (StrUtil.isEmpty(idsReq.getPsnId())) { + throw new ServiceException("该用户未认证"); + } + EsignHttpResponse batchSignUrl = SignAward.batchSignUrl(idsReq); + if (StrUtil.isNotEmpty(batchSignUrl.getBody())) { + JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class); + if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) { + JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); + if (signUrlData != null&& !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) { + // 免登录批量签链接(链接有效期2小时) + String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString(); + // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时) + signRecord.setSignUrl(url); + } + } + } + } catch (EsignDemoException e) { + e.printStackTrace(); + } + + return signRecord; + } + + /** + * 根据仲裁员手机号分页查询等待签署,签署中的裁决书 + * + * @param personAccount 仲裁员手机号 + * @return + */ + @Override + public List selectSealSigning(String personAccount, Integer caseStatus) { + return sealSignRecordMapper.selectSealSigning(personAccount, caseStatus); + } + + public String getNewEquipmentNo() { Object awardNum = redisCache.getCacheObject("awardNum"); if (awardNum == null) { @@ -1311,33 +1469,34 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 根据裁决书模板获取所有的占位符,占位符必须是{{name}}格式 + * * @param path * @return */ - public List getBookmarkByDocx(String path){ + public List getBookmarkByDocx(String path) { XWPFDocument xwpfDocument = null; try { - log.error("path===="+path); + log.error("path====" + path); FileInputStream fileInputStream = new FileInputStream(path); log.error("fileInputStream===="); xwpfDocument = new XWPFDocument(fileInputStream); - log.error("xwpfDocument===="+xwpfDocument); + log.error("xwpfDocument====" + xwpfDocument); } catch (IOException e) { e.printStackTrace(); } - if(xwpfDocument==null){ + if (xwpfDocument == null) { return new ArrayList<>(); } List paragraphs = xwpfDocument.getParagraphs(); - if(CollectionUtil.isEmpty( xwpfDocument.getParagraphs())){ + if (CollectionUtil.isEmpty(xwpfDocument.getParagraphs())) { return new ArrayList<>(); } String regex = "\\{\\{.*?\\}\\}"; // 定义占位符的正则表达式 Pattern pattern = Pattern.compile(regex); - List bookmarkList=new ArrayList<>(); + List bookmarkList = new ArrayList<>(); for (XWPFParagraph paragraph : paragraphs) { String text = paragraph.getText(); - if(StrUtil.isNotEmpty(text)) { + if (StrUtil.isNotEmpty(text)) { Matcher matcher = pattern.matcher(text); while (matcher.find()) { @@ -1351,6 +1510,4 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } - - } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index ddadc91..d3f24a0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -160,11 +160,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 查询登录人身份证号 SysUser sysUser = sysUserMapper.selectUserById(userId); startPage(); - // 已办案件 - if (caseApplication.getSelectCaseStatus().equals("1")) { - caseApplication.setLoginUserName(sysUser.getUserName()); - return caseApplicationMapper.selectHandledCase(caseApplication); - } else { // 待办案件 + caseApplication.setLoginUserName(sysUser.getUserName()); List roles = sysUser.getRoles(); // 没有角色不能查看案件列表 if (CollectionUtil.isEmpty(roles)) { @@ -228,7 +224,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 // return caseApplicationMapper.selectCaseApplicationList(caseApplication); return caseApplicationMapper.selectCaseApplicationList1(caseApplication); - } } @@ -1083,7 +1078,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setFeePayable(feePayable); caseApplication.setUpdateBy(getUsername()); Integer applicantIsWrittenHear = caseApplication.getApplicantIsWrittenHear(); - if(applicantIsWrittenHear.intValue()==1){ + if(applicantIsWrittenHear!=null&&applicantIsWrittenHear.intValue()==1){ //书面审理 caseApplication.setArbitratMethod(2); }else { @@ -1396,9 +1391,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public int deletecaseApplicationByIds(List ids) { + // 查出所有的日志id + List logIds= caseApplicationLogMapper.selectLogsByCaseIds(ids); int rows = caseApplicationMapper.batchDeletecaseApplication(ids); - caseAffiliateMapper.batchDeletecaseAffiliate(ids); - // caseApplicationLogMapper.batchDeleteLog(ids); + // 删除日志 + if(CollectionUtil.isNotEmpty(logIds)) { + caseApplicationLogMapper.batchDeleteLog(logIds); + } return rows; } @@ -1674,7 +1673,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); - if (agreeOrNotCheck.intValue() == 1) {//同意审核 + if (agreeOrNotCheck!=null&&agreeOrNotCheck.intValue() == 1) {//同意审核 try { //获取当前案件的裁决书 CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); @@ -2917,8 +2916,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional @Override public AjaxResult uploadCaseZipFile(MultipartFile file, Long templateId) { - AjaxResult ajaxResult = caseZipImportImpl.zipImport( file, templateId); - return ajaxResult; + return caseZipImportImpl.zipImport( file, templateId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index 5899238..2d4da31 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -79,22 +79,42 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { //根据案件id查询案件证据材料 List evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id); if (evidenceMaterialList != null && evidenceMaterialList.size() > 0) { - for (CaseAttach caseAttach : evidenceMaterialList) { - //根据附件类型决定返回的路径 - Integer annexType = caseAttach.getAnnexType(); - if (annexType != 1){ - String path = caseAttach.getAnnexName(); +// for (CaseAttach caseAttach : evidenceMaterialList) { +// //根据附件类型决定返回的路径 +// Integer annexType = caseAttach.getAnnexType(); +// if (annexType != 1){ +// String path = caseAttach.getAnnexName(); +// String prefix = "/profile"; +// int startIndex = path.indexOf(prefix); +// startIndex += prefix.length(); +// String extractedPath = "/uploadPath" + path.substring(startIndex); +// caseAttach.setAnnexPath(extractedPath); +// }else { +// String annexPath = caseAttach.getAnnexPath(); +// String result = annexPath.replace("/home/ruoyi", ""); +// caseAttach.setAnnexPath(result); +// } +// } + + for (CaseAttach caseAttach : evidenceMaterialList) { + String annexName = caseAttach.getAnnexName(); String prefix = "/profile"; - int startIndex = path.indexOf(prefix); - startIndex += prefix.length(); - String extractedPath = "/uploadPath" + path.substring(startIndex); - caseAttach.setAnnexPath(extractedPath); - }else { - String annexPath = caseAttach.getAnnexPath(); - String result = annexPath.replace("/home/ruoyi", ""); - caseAttach.setAnnexPath(result); + int startIndex = annexName.indexOf(prefix); + if(startIndex!=-1) { + startIndex += prefix.length(); + + String annexPath = "/uploadPath" + annexName.substring(startIndex); + caseAttach.setAnnexPath(annexPath); + } + int startIndexnew = annexName.lastIndexOf("/"); + if (startIndexnew != -1) { + String annexNamenew = annexName.substring(startIndexnew + 1); + caseAttach.setAnnexName(annexNamenew); + } + + } - } + } caseDetailVO.setEvidenceMaterialList(evidenceMaterialList); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 7e84baa..431493a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -106,10 +106,12 @@ public class CasePaymentServiceImpl implements ICasePaymentService { @Override @Transactional - public AjaxResult confirmPayment(CaseApplication caseApplication) { - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); - int i = caseApplicationMapper.submitCaseApplication(caseApplication); - if (i > 0) { + public AjaxResult confirmPayment( List ids) { + for (Long id : ids) { + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); + caseApplicationMapper.submitCaseApplication(caseApplication); //发送短信通知 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); CaseAffiliate caseAffiliate = new CaseAffiliate(); @@ -185,7 +187,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { return AjaxResult.success(); } } - return AjaxResult.error("暂无需要确认的缴费清单"); + + return AjaxResult.success(); } @Transactional @@ -248,7 +251,6 @@ public class CasePaymentServiceImpl implements ICasePaymentService { caseApplication.setId(caseId); CaseApplication caseApplication1 = caseApplicationService.selectCaseApplication(caseApplication); BigDecimal feePayable = caseApplication1.getFeePayable(); - feePayable = feePayable.multiply(new BigDecimal(100)); sum = sum.add(feePayable); listVO.setTotalFee(sum.intValue()); caseApplicationPay.setCaseAppName(caseApplication1.getApplicantName()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java index 0b19366..476daaa 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java @@ -25,6 +25,7 @@ import com.ruoyi.system.mapper.*; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; import com.ruoyi.wisdomarbitrate.mapper.*; +import com.ruoyi.wisdomarbitrate.task.CaseZipImportTask; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.wisdomarbitrate.utils.OCRUtils; import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils; @@ -37,6 +38,8 @@ import java.io.*; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -70,8 +73,6 @@ public class CaseZipImportImpl { @Autowired private SysUserRoleMapper userRoleMapper; @Autowired - private CaseApplicationLogMapper caseApplicationLogMapper; - @Autowired private CaseAffiliateLogMapper caseAffiliateLogMapper; @Autowired private CaseAttachLogMapper caseAttachLogMapper; @@ -85,11 +86,14 @@ public class CaseZipImportImpl { private ColumnValueLogMapper columnValueLogMapper; @Autowired private CaseAffiliateMapper caseAffiliateMapper; + @Autowired + private CaseApplicationLogMapper caseApplicationLogMapper; // 申请人角色id private long roleId; private Integer maxCaseNum; private Integer maxBatchNumber; + public AjaxResult zipImport(MultipartFile file, Long templateId) { UUID uuid = UUID.randomUUID(); // todo @@ -113,51 +117,14 @@ public class CaseZipImportImpl { boolean unzipSuccess = UnZipFileUtils.unZipFile(zipFile, targetPath); if (!unzipSuccess) { // 解压失败 - return AjaxResult.error("解压失败"); + throw new ServiceException("解压失败"); } // 查询抓取规则 // todo 批次需要再上传压缩包时用户填写 List fatchRuleList = fatchRuleMapper.listByTemplateId(templateId); if (CollectionUtil.isEmpty(fatchRuleList)) { - return error("未设置抓取规则"); + throw new ServiceException("未设置抓取规则"); } - File directory = new File(targetPath); - // fileMap> - Map> fileMap = findAndConvertPDF(directory); - if (fileMap == null || fileMap.size() <= 0) { - // 解压失败 - return AjaxResult.error("未获取到文件"); - } - Map fatchMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(fatchRuleList)) { - - Map> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getFileName)); - // 根据抓取规则循环抓取 - fileMap.forEach((key, fileList) -> { - if (CollectionUtil.isNotEmpty(fileList)) { - for (File caseFile : fileList) { - if (fatchRuleMap.containsKey(caseFile.getName())) { - // 抓取内容 - List fatchRules = fatchRuleMap.get(caseFile.getName()); - getFatchContentList(caseFile, fatchMap, fatchRules, key); - } - } - } - }); - - } - if (fatchMap.size() <= 0) { - return error("从压缩包中未抓取到内容,请检查抓取字段配置"); - } - // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1956159"); - - // 新增的案件 - List caseApplications = new ArrayList<>(); - // 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue - // 抓取规则,0-内置字段,1-自定义字段 - Map> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault)); // 在系统表中查询案件内置字段 SysDictData sysDictData = new SysDictData(); sysDictData.setDictType("case_built_type"); @@ -170,25 +137,8 @@ public class CaseZipImportImpl { deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); } - // 角色用户 - List userRoleList = new ArrayList<>(); // 查询申请人角色id roleId = roleMapper.selectRoleIdByName("申请人"); - - // 案件基本信息 - caseApplications = new ArrayList<>(); - // 自定义字段,组装columnValue表 - List columnValueList = new ArrayList<>(); - // 案件人员 - List caseAffiliates = new ArrayList<>(); - // 组装机构 - List sysDepts = new ArrayList<>(); - // 案件附件 - List caseAttachs = new ArrayList<>(); - //发送短信列表 - List smsSendRecordList = new ArrayList<>(); - // 短信记录 - List smsRequestList = new ArrayList<>(); /** * 用户表已存在的用户 */ @@ -201,186 +151,299 @@ public class CaseZipImportImpl { String currentDay = DateUtils.dateTime(); String caseNum = "zc" + currentDay; maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length()); - // 需要新增的用户 - List addUsers = new ArrayList<>(); - for (Long caseId : fileMap.keySet()) { - if (CollectionUtil.isEmpty(fileMap.get(caseId))) { - continue; + // 抓取内容 + Map fatchMap = new HashMap<>(); + // 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue + // 抓取规则,0-内置字段,1-自定义字段 + Map> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getFileName)); + + File directory = new File(targetPath); + if (!directory.exists()) { + throw new ServiceException("文件不存在"); + } + // 找出案件文件夹 + if (!directory.isDirectory() || directory.listFiles() == null) { + throw new ServiceException("未找到文件夹"); + } + File[] files = directory.listFiles(); + CaseZipImportTask caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap,SecurityUtils.getLoginUser()); + Future> future = ThreadPoolUtil.submit(caseZipImportTask); + try { + if(future.get()!=null){ + return success("导入成功"); } - CaseApplication caseApplication = new CaseApplication(); - caseApplications.add(caseApplication); - caseApplication.setId(caseId); - caseApplication.setTemplateId(templateId); + } catch (InterruptedException e) { + e.printStackTrace(); + } catch (ExecutionException e) { + e.printStackTrace(); + } + return error("无可导入的案件"); - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - caseApplication.setCaseLogId(IdWorkerUtil.getId()); - caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); - caseApplication.setCaseAppliId(caseApplication.getId()); - // 设置批号 - if (StrUtil.isEmpty(caseApplication.getBatchNumber())) { - maxBatchNumber = caseApplicationMapper.selectBatchNumberLike(); - if (maxBatchNumber == null) { - maxBatchNumber = 1; - caseApplication.setBatchNumber(maxBatchNumber.toString()); - } else { - maxBatchNumber = maxBatchNumber + 1; - caseApplication.setBatchNumber(maxBatchNumber.toString()); - } + } + + public CaseApplication buildCaseInfo(File file, Long templateId, List fatchRuleList, Map> fatchRuleMap, Map fatchMap, Map userMap, List dictDataList, Map deptMap,LoginUser loginUser) { + // fileMap> + Map fileMap = findFile(file, fatchRuleList); + if (fileMap != null && fileMap.size()> 0) { + // 根据抓取规则循环抓取 + for (Map.Entry> entry : fatchRuleMap.entrySet()) { + getFatchContent(fileMap, entry.getKey(), fatchMap, entry.getValue()); } - // 设置编号 - String maxCaseNumStr = generateCaseNum(); - caseApplication.setCaseNum(maxCaseNumStr); - caseApplication.setCreateBy(getUsername()); - caseApplication.setVersion(1); - // 组装案件内置字段主表内容 - if (fatchRuleMap.size() > 0 && fatchRuleMap.containsKey(1)) { - List columnRules = fatchRuleMap.get(1); - columnRules.forEach(columnRule -> { - ColumnValue columnValue = new ColumnValue(); - columnValue.setColumn(columnRule.getColumn()); - columnValue.setName(columnRule.getColumnName()); - columnValue.setName(columnRule.getColumnName()); - columnValue.setValue(fatchMap.get(columnRule.getColumnName() + Constants.PDFSTR + caseId)); - columnValue.setIsDefault(1); - columnValue.setCaseId(caseId); - columnValue.setCaseAppliLogId(caseApplication.getCaseLogId()); - columnValueList.add(columnValue); - }); - } - caseApplication.setColumnValues(columnValueList); - // 组装内置字段 - buildDefaultColumn(caseApplication, dictDataList, fatchMap, caseAffiliates, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList); - for (File caseFile : fileMap.get(caseId)) { - String fileUrl = caseFile.getAbsolutePath(); - if (StrUtil.isEmpty(fileUrl)) { - continue; + if (fatchMap.size() > 0) { + + // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信 + SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); + request.setTemplateId("1956159"); + + // 新增的案件 + // 组装案件内置字段主表内容 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(IdWorkerUtil.getId()); + caseApplication.setTemplateId(templateId); + Map> defaultRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getIsDefault)); + // 自定义字段,组装columnValue表 + List columnValueList = new ArrayList<>(); + if (defaultRuleMap.size() > 0 && defaultRuleMap.containsKey(1)) { + List columnRules = defaultRuleMap.get(1); + columnRules.forEach(columnRule -> { + ColumnValue columnValue = new ColumnValue(); + columnValue.setColumn(columnRule.getColumn()); + columnValue.setName(columnRule.getColumnName()); + columnValue.setValue(fatchMap.get(columnRule.getColumnName())); + columnValue.setIsDefault(1); + columnValue.setCaseId(caseApplication.getId()); + columnValueList.add(columnValue); + }); + caseApplication.setColumnValues(columnValueList); } - // 上传 - String filePath = RuoYiConfig.getUploadPath(); - CaseAttach caseAttach = new CaseAttach(); - caseAttach.setCaseAppliId(caseApplication.getId()); - caseAttach.setCaseAppliLogId(caseApplication.getCaseLogId()); - caseAttach.setAnnexPath(filePath); - if (StrUtil.isNotEmpty(fileUrl)) { - String fileName = fileUrl.replace(filePath, "/profile/upload"); - caseAttach.setAnnexName(fileName); - } - // 申请人提供的证据材料 - caseAttach.setAnnexType(2); - caseAttachs.add(caseAttach); - if (fileUrl.contains("仲裁申请书")) { - CaseAttach applyFile = new CaseAttach(); - BeanUtil.copyProperties(caseAttach, applyFile); - applyFile.setAnnexType(1); - caseAttachs.add(applyFile); - } - } - // 案件压缩包导入 - caseApplication.setImportFlag(2); - // 组装短信 + // 角色用户 + List userRoleList = new ArrayList<>(); - } - // 多线程执行 - List execList = new ArrayList<>(); - if (CollectionUtil.isNotEmpty(addUsers)) { - Function, Integer> function = userMapper::batchSave; - execList.add(new MultipleThreadListParam(function, addUsers)); - } - if (CollectionUtil.isNotEmpty(userRoleList)) { - Function, Integer> function = userRoleMapper::batchUserRole; - execList.add(new MultipleThreadListParam(function, userRoleList)); + // 组装机构 + List sysDepts = new ArrayList<>(); + // 案件附件 + List caseAttachs = new ArrayList<>(); + //发送短信列表 + List smsSendRecordList = new ArrayList<>(); + // 短信记录 + List smsRequestList = new ArrayList<>(); - } - if (CollectionUtil.isNotEmpty(sysDepts)) { - Function, Integer> function = sysDeptMapper::batchSave; - execList.add(new MultipleThreadListParam(function, sysDepts)); + // 需要新增的用户 + List addUsers = new ArrayList<>(); + caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + caseApplication.setCaseLogId(IdWorkerUtil.getId()); + caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); + caseApplication.setCaseAppliId(caseApplication.getId()); - } - if (CollectionUtil.isNotEmpty(caseApplications)) { - Function, Integer> function = caseApplicationMapper::batchSave; - execList.add(new MultipleThreadListParam(function, caseApplications)); - Function, Integer> functionLog = caseApplicationLogMapper::batchSave; - execList.add(new MultipleThreadListParam(functionLog, caseApplications)); - - } - if (CollectionUtil.isNotEmpty(caseAffiliates)) { - Function, Integer> function = caseAffiliateMapper::batchCaseAffiliate; - execList.add(new MultipleThreadListParam(function, caseAffiliates)); - Function, Integer> functionLog = caseAffiliateLogMapper::batchCaseAffiliate; - execList.add(new MultipleThreadListParam(functionLog, caseAffiliates)); - } - if (CollectionUtil.isNotEmpty(caseAttachs)) { - Function, Integer> function = caseAttachMapper::batchSave; - execList.add(new MultipleThreadListParam(function, caseAttachs)); - Function, Integer> functionLog = caseAttachLogMapper::batchSave; - execList.add(new MultipleThreadListParam(functionLog, caseAttachs)); - } - if (CollectionUtil.isNotEmpty(columnValueList)) { - Function, Integer> function = columnValueMapper::batchSave; - execList.add(new MultipleThreadListParam(function, columnValueList)); - Function, Integer> functionLog = columnValueLogMapper::batchSave; - execList.add(new MultipleThreadListParam(functionLog, columnValueList)); - } - if (CollectionUtil.isNotEmpty(execList)) { - MultipleThreadWorkUtil.execListFun(execList.toArray(new MultipleThreadListParam[execList.size()])); - } - if (CollectionUtil.isNotEmpty(caseApplications)) { - LoginUser loginUser = SecurityUtils.getLoginUser(); - List logRecords = new ArrayList<>(); - - caseApplications.forEach(caseApplication -> { - CaseLogRecord operLog = new CaseLogRecord(); - // 获取当前的用户 - - if (loginUser != null) { - SysUser user = loginUser.getUser(); - operLog.setCreateBy(user.getUserName()); - operLog.setCreateNickName(user.getNickName()); - operLog.setUpdateBy(user.getUserName()); - } else { - operLog.setCreateBy("admin"); - operLog.setCreateNickName("管理员"); - operLog.setUpdateBy("admin"); - } - operLog.setCaseAppliId(caseApplication.getId()); - operLog.setCaseNode(CaseApplicationConstants.CASE_APPLICATION); - logRecords.add(operLog); + // 设置批号 + if (StrUtil.isEmpty(caseApplication.getBatchNumber())) { + maxBatchNumber = caseApplicationMapper.selectBatchNumberLike(); + if (maxBatchNumber == null) { + maxBatchNumber = 1; + caseApplication.setBatchNumber(maxBatchNumber.toString()); + } else { + maxBatchNumber = maxBatchNumber + 1; + caseApplication.setBatchNumber(maxBatchNumber.toString()); } - ); - // todo 发送短信 - ThreadPoolUtil.execute(() -> { - CaseLogUtils.batchInsertCaseLog(logRecords); - // 发送短信 - if (CollectionUtil.isNotEmpty(smsRequestList)) { - Map sendRecordMap = null; - if (CollectionUtil.isNotEmpty(smsSendRecordList)) { - sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity())); - for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) { - Boolean aBoolean = SmsUtils.sendSms(request); - if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) { - if (aBoolean) { - sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1); - } else { - sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0); - } + } + // 设置编号 + String maxCaseNumStr = generateCaseNum(); + caseApplication.setCaseNum(maxCaseNumStr); + caseApplication.setCreateBy(loginUser!=null?loginUser.getUsername():"admin"); + caseApplication.setVersion(1); + // 组装案件内置字段主表内容 + + // 组装内置字段 + buildDefaultColumn(caseApplication, dictDataList, fatchMap, deptMap, sysDepts, userMap, addUsers, userRoleList, smsSendRecordList, smsRequestList); + // 组装附件 + for (Map.Entry entry : fileMap.entrySet()) { + String fileUrl = entry.getValue(); + if (StrUtil.isEmpty(fileUrl)) { + continue; + } + // 上传 + String filePath = RuoYiConfig.getUploadPath(); + + CaseAttach caseAttach = new CaseAttach(); + caseAttach.setCaseAppliId(caseApplication.getId()); + caseAttach.setAnnexPath(filePath); + if (StrUtil.isNotEmpty(fileUrl)) { + String fileName = fileUrl.replace(filePath, "/profile/upload"); + caseAttach.setAnnexName(fileName); + } + // 申请人提供的证据材料 + caseAttach.setAnnexType(2); + caseAttachs.add(caseAttach); + if (fileUrl.contains("仲裁申请书")) { + CaseAttach applyFile = new CaseAttach(); + BeanUtil.copyProperties(caseAttach, applyFile); + applyFile.setAnnexType(1); + caseAttachs.add(applyFile); + } + + } + caseApplication.setCaseAttachList(caseAttachs); + // 案件压缩包导入 + caseApplication.setImportFlag(2); + caseApplicationMapper.insertCaseApplication(caseApplication); + // 多线程执行 + ThreadPoolUtil.execute(() -> { + caseApplicationLogMapper.insert(caseApplication); + // 多线程执行 + if (CollectionUtil.isNotEmpty(addUsers)) { + userMapper.batchSave(addUsers); + + } + if (CollectionUtil.isNotEmpty(userRoleList)) { + userRoleMapper.batchUserRole(userRoleList); + + } + if (CollectionUtil.isNotEmpty(sysDepts)) { + sysDeptMapper.batchSave(sysDepts); + + } + if (CollectionUtil.isNotEmpty(caseApplication.getCaseAffiliates())) { + caseAffiliateMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); + caseAffiliateLogMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); + } + if (CollectionUtil.isNotEmpty(caseAttachs)) { + caseAttachMapper.batchSave(caseAttachs); + caseAttachLogMapper.batchSave(caseAttachs); + + } + if (CollectionUtil.isNotEmpty(columnValueList)) { + columnValueMapper.batchSave(columnValueList); + columnValueLogMapper.batchSave(columnValueList); + } + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser); + // 发送短信 + if (CollectionUtil.isNotEmpty(smsRequestList)) { + Map sendRecordMap = null; + if (CollectionUtil.isNotEmpty(smsSendRecordList)) { + sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity())); + for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) { + Boolean aBoolean = SmsUtils.sendSms(request); + if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) { + if (aBoolean) { + sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1); + } else { + sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0); } } - smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList); } - - + smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList); } + } - ); + }); + return caseApplication; + } } - // 案件日志 - return success("导入成功"); + return null; + } + /** + * 获取抓取内容 + * + * @param andConvertPDF 文件路径map + * @param mapKey 文件名 + * @param map 抓取内容map + * @param fatchRules 抓取规则 + */ + private void getFatchContent(Map andConvertPDF, String mapKey, Map map, List fatchRules) { + String fileURL = andConvertPDF.get(mapKey); + if (StrUtil.isEmpty(fileURL)) { + return; + } + if (fileURL.endsWith("txt")) { + String readerFile = ReadFileUtils.readerTxtFile(fileURL); + OCRUtils.fatchRuleGetContent(readerFile, fatchRules, map); + } else if (fileURL.endsWith("doc") || fileURL.endsWith("docx")) { + // doc,docx,text识别内容 + String readerFile = null; + try { + readerFile = ReadFileUtils.readWord(fileURL); + } catch (Exception e) { + e.printStackTrace(); + } + OCRUtils.fatchRuleGetContent(readerFile, fatchRules, map); + + } else if (fileURL.endsWith("pdf")) { + //获取文件的页数 + int fileNumPage = getFileNumPage(fileURL); + //文件转成base64 + String base64 = OCRUtils.pdfConvertBase64(fileURL); + if (base64 == null) { + throw new ServiceException("pdf转base64失败"); + // return false; + } + StringBuilder ocrText = new StringBuilder(); // 创建一个StringBuilder对象 + for (int i = 1; i <= fileNumPage; i++) { + //对接腾讯云接口.识别里面的数据 + String text = OCRUtils.pdfIdentifyText(base64, i, fatchRules); + ocrText.append(text); // 拼接当前的字符串 + + + } + // 根据抓取规则截取内容 + OCRUtils.fatchRuleGetContent(ocrText.toString(), fatchRules, map); + } + + + } + + /** + * 查找文件 + * + * @param directory + * @param fatchRuleList + * @return + */ + private Map findFile(File directory, List fatchRuleList) { + Map filePathMap = new HashMap<>(); + if (directory.isFile()) { + String path = ""; + // 如果传入的参数是一个文件 + path = directory.getAbsolutePath(); + filePathMap.put(directory.getName(), path); + + } else if (directory.isDirectory()) { + searchAndConvertPDF(directory, filePathMap); + } else { + return null; + } + return filePathMap; + } + + /** + * 递归查找文件夹 + * + * @param directory + * @param filePathMap + */ + public static void searchAndConvertPDF(File directory, Map filePathMap) { + File[] files = directory.listFiles(); + + if (files != null) { + for (File file : files) { + if (file.getName().contains("zip") || file.getName().contains("rar")) { + continue; + } + if (file.isFile()) { + + filePathMap.put(file.getName(), file.getAbsolutePath()); + } else if (file.isDirectory()) { + // 如果是目录,递归查找 + searchAndConvertPDF(file, filePathMap); + } + } + } } /** @@ -584,13 +647,14 @@ public class CaseZipImportImpl { * @param fatchMap 抓取字段内容 */ private void buildDefaultColumn(CaseApplication caseApplication, List dictDataList, Map fatchMap, - List caseAffiliates, Map deptMap, List sysDepts, + Map deptMap, List sysDepts, Map userMap, List addUsers, List userRoleList, List smsSendRecords, List smsRequestList) { // 组装内置字段 if (CollectionUtil.isEmpty(dictDataList)) { return; } + List caseAffiliates = new ArrayList<>(); // 被申请人 CaseAffiliate debtorAffiliate = new CaseAffiliate(); debtorAffiliate.setCaseAppliId(caseApplication.getId()); @@ -610,27 +674,35 @@ public class CaseZipImportImpl { buildAffilcateColumn(dictData, fatchMap, affiliate, deptMap, sysDepts, userMap, addUsers, userRoleList, caseApplication, smsSendRecords, smsRequestList); } else if (dictData.getDictLabel().contains("合同编号")) { // 合同编号 - String contractNumber = fatchMap.get("合同编号" + Constants.PDFSTR + caseApplication.getId()); + String contractNumber = fatchMap.get("合同编号" ); if (StrUtil.isNotEmpty(contractNumber)) { // 提取字母和数字 String regx = "[^a-zA-Z0-9]"; String replaceAll = contractNumber.replaceAll(regx, ""); caseApplication.setContractNumber(replaceAll.toUpperCase()); } - }else if(dictData.getDictLabel().contains("案件标的")){ - // todo 案件标的名字要改,字典配置中也要改 - if(null!=caseApplication.getCaseSubjectAmount()) { - //todo 暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal(0.01); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); - caseApplication.setFeePayable(feePayable); + } else if (dictData.getDictLabel().contains("案件标的")) { + String caseSubjectAmount = fatchMap.get(dictData.getDictLabel()); + if(StrUtil.isNotEmpty(caseSubjectAmount)) { + try { + BigDecimal bigDecimal = new BigDecimal(caseSubjectAmount); + caseApplication.setCaseSubjectAmount(bigDecimal); + // todo 案件标的名字要改,字典配置中也要改 + //todo 暂时设置计费比率为0.01 + BigDecimal feeRate = new BigDecimal(0.01); + BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); + caseApplication.setFeePayable(feePayable); + + } catch (Exception e) { + } } + } else { - ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); + ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() )); } } else { - ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); + ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() )); } @@ -641,7 +713,7 @@ public class CaseZipImportImpl { if (ObjectUtil.isNotEmpty(debtorAffiliate)) { caseAffiliates.add(debtorAffiliate); } - + caseApplication.setCaseAffiliates(caseAffiliates); } @@ -662,7 +734,7 @@ public class CaseZipImportImpl { // 申请人 switch (dictData.getDictLabel()) { case "申请人姓名": - affiliate.setName((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()))); + affiliate.setName((fatchMap.get(dictData.getDictLabel()))); if (StrUtil.isNotEmpty(affiliate.getName())) { // 组装申请机构 // 将组织机构id设为申请人名称 @@ -690,25 +762,25 @@ public class CaseZipImportImpl { } break; case "统一社会信用代码": - affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()))); + affiliate.setIdentityNum((fatchMap.get(dictData.getDictLabel()))); break; case "法定代表人": - affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); + affiliate.setCompLegalPerson(fatchMap.get(dictData.getDictLabel())); break; case "法定代表人职位": - affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()))); + affiliate.setCompLegalperPost((fatchMap.get(dictData.getDictLabel()))); break; case "申请人住所": - affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()))); + affiliate.setResidenAffili((fatchMap.get(dictData.getDictLabel()))); break; case "申请人联系地址": - affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); + affiliate.setContactAddress(fatchMap.get(dictData.getDictLabel())); break; case "委托代理人姓名": - affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); + affiliate.setNameAgent(fatchMap.get(dictData.getDictLabel())); break; case "委托代理人联系电话": - affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())); + affiliate.setContactTelphoneAgent(fatchMap.get(dictData.getDictLabel())); if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) { SysUser agentUser = null; // 用户已存在 @@ -754,11 +826,11 @@ public class CaseZipImportImpl { } if (addUsers != null) { SysUser finalAgentUser = agentUser; - if(CollectionUtil.isNotEmpty(smsRequestList)&& smsRequestList.stream().noneMatch(smsSendRecord -> smsSendRecord.getPhone().equals(finalAgentUser.getPhonenumber()))){ - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1956159"); - request.setPhone(agentUser.getPhonenumber()); - request.setTemplateParamSet(new String[]{agentUser.getNickName()}); + if (CollectionUtil.isNotEmpty(smsRequestList) && smsRequestList.stream().noneMatch(smsSendRecord -> smsSendRecord.getPhone().equals(finalAgentUser.getPhonenumber()))) { + SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); + request.setTemplateId("1956159"); + request.setPhone(agentUser.getPhonenumber()); + request.setTemplateParamSet(new String[]{agentUser.getNickName()}); smsRequestList.add(request); SmsSendRecord smsSendRecord = new SmsSendRecord(); smsSendRecord.setCaseId(caseApplication.getId()); @@ -777,10 +849,10 @@ public class CaseZipImportImpl { } break; case "委托代理人电子邮件": - affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId())) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseApplication.getId()).replace("\n", "").replaceAll("\\s", "") : null); - + affiliate.setAgentEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel())) ? fatchMap.get(dictData.getDictLabel()).replace("\n", "").replaceAll("\\s", "") : null); break; default: + ObjectFieldUtils.setValue(caseApplication, dictData.getDictValue(), fatchMap.get(dictData.getDictLabel() )); break; } } @@ -813,11 +885,11 @@ public class CaseZipImportImpl { // 被申请人 switch (dictData.getDictLabel()) { case "被申请人姓名": - debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)); + debtorAffiliate.setName(fatchMap.get(dictData.getDictLabel() )); break; case "被申请人身份证号": - String identityNum = fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId); - debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)); + String identityNum = fatchMap.get(dictData.getDictLabel() ); + debtorAffiliate.setIdentityNum(fatchMap.get(dictData.getDictLabel() )); // 出生年月日,从身份证抓取 if (StrUtil.isNotEmpty(identityNum)) { identityNum = identityNum.replace("\n", ""); @@ -839,13 +911,13 @@ public class CaseZipImportImpl { break; case "被申请人住所": - debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)); + debtorAffiliate.setResidenAffili(fatchMap.get(dictData.getDictLabel() )); break; case "被申请人联系电话": - debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)); + debtorAffiliate.setContactTelphone(fatchMap.get(dictData.getDictLabel() )); break; case "被申请人电子邮件": - debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId)) ? fatchMap.get(dictData.getDictLabel() + Constants.PDFSTR + caseId).replace("\n", "").replaceAll("\\s", "") : null); + debtorAffiliate.setEmail(StrUtil.isNotEmpty(fatchMap.get(dictData.getDictLabel() )) ? fatchMap.get(dictData.getDictLabel() ).replace("\n", "").replaceAll("\\s", "") : null); break; default: diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java new file mode 100644 index 0000000..cef7c34 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java @@ -0,0 +1,66 @@ +package com.ruoyi.wisdomarbitrate.task; + + +import com.ruoyi.common.core.domain.entity.SysDictData; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.FatchRule; +import com.ruoyi.wisdomarbitrate.service.impl.CaseZipImportImpl; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; + +/** + * @description rbd调用xfta计算任务类 + * @Author mingYang + * @Date 2021/11/12 15:35 + * @Version V1.0 + **/ + +public class CaseZipImportTask implements Callable> { + private CaseZipImportImpl caseZipImportImpl; + private Long templateId; + private List fatchRuleList; + private Map fatchMap; + private Map> fatchRuleMap; + private Map userMap; + private List dictDataList; + private File[] files; + private Map deptMap; + private LoginUser loginUser; + + public CaseZipImportTask(CaseZipImportImpl caseZipImportImpl, Long templateId, List fatchRuleList, Map fatchMap, Map> fatchRuleMap, Map userMap, List dictDataList, File[] files, Map deptMap, LoginUser loginUser) { + this.caseZipImportImpl = caseZipImportImpl; + this.templateId = templateId; + this.fatchRuleList = fatchRuleList; + this.fatchMap = fatchMap; + this.fatchRuleMap = fatchRuleMap; + this.userMap = userMap; + this.dictDataList = dictDataList; + this.files = files; + this.deptMap = deptMap; + this.loginUser = loginUser; + } + + @Override + public List call() { + List caseApplications = new ArrayList<>(); + for (File file1 : files) { + if (file1.isDirectory() && file1.listFiles() != null) { + + for (File file2 : file1.listFiles()) { + CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, fatchMap, userMap, dictDataList, deptMap, loginUser); + if (caseApplication != null) { + caseApplications.add(caseApplication); + } + } + } + } + + return caseApplications; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java index bcc6bff..64475ac 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java @@ -47,6 +47,30 @@ public class CaseLogUtils operLog.setNotes(notes); caseLogRecordMapper.insertCaseLogRecord(operLog); } + /** + * 新增案件日志 + * @param caseAppliId 案件id,不能为空 + * @param caseNode 案件节点,不能为空 + * @param notes 备注 + */ + public static void insertCaseLog(@NotNull Long caseAppliId, @NotEmpty Integer caseNode, String notes ,LoginUser loginUser ){ + CaseLogRecord operLog = new CaseLogRecord(); + // 获取当前的用户 + if(loginUser!=null) { + SysUser sysUser = userMapper.selectUserById(loginUser.getUserId()); + operLog.setCreateBy(sysUser.getUserName()); + operLog.setCreateNickName(sysUser.getNickName()); + operLog.setUpdateBy(sysUser.getUserName()); + }else { + operLog.setCreateBy("admin"); + operLog.setCreateNickName("管理员"); + operLog.setUpdateBy("admin"); + } + operLog.setCaseAppliId(caseAppliId); + operLog.setCaseNode(caseNode); + operLog.setNotes(notes); + caseLogRecordMapper.insertCaseLogRecord(operLog); + } /** * 批量新增案件日志 * @param list diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java index cfb8539..b64d55d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java @@ -167,14 +167,14 @@ public class OCRUtils { String endContent = fatchRule.getEndContent(); // 开始为空结束为空 if (StrUtil.isEmpty(startContent) && StrUtil.isEmpty(endContent)) { - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(text)); + fatchMap.put(fatchRule.getColumnName(), trimStr(text)); } else if (StrUtil.isNotEmpty(startContent) && StrUtil.isEmpty(endContent)) { // 开始不为空结束为空 int startContIndex = StrUtil.ordinalIndexOf(text, startContent, fatchRule.getStartContentRepeatOrder()); if (startContIndex != -1 && text.length() >= (startContIndex + startContent.length())) { String substring = text.substring(startContIndex + startContent.length()); // 去除\n - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(substring)); + fatchMap.put(fatchRule.getColumnName(), trimStr(substring)); } } else if (StrUtil.isEmpty(startContent) && StrUtil.isNotEmpty(endContent)) { @@ -182,7 +182,7 @@ public class OCRUtils { int endContIndex = StrUtil.ordinalIndexOf(text, endContent, fatchRule.getEndContentRepeatOrder()); if (endContIndex != -1) { String substring = text.substring(0, endContIndex); - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(substring)); + fatchMap.put(fatchRule.getColumnName(), trimStr(substring)); } } else if (StrUtil.isNotEmpty(startContent) && StrUtil.isNotEmpty(endContent)) { // 开始结束不为空 @@ -191,7 +191,7 @@ public class OCRUtils { if (startIndexOf != -1 && endIndexOf != -1 && endIndexOf >= (startIndexOf + startContent.length()) && text.length() >= endIndexOf) { String substring = text.substring(startIndexOf + startContent.length(), endIndexOf); - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(substring)); + fatchMap.put(fatchRule.getColumnName(), trimStr(substring)); } } @@ -221,7 +221,7 @@ public class OCRUtils { } // 开始和结束截取都为空 if (StrUtil.isEmpty(reverseStartContent) && StrUtil.isEmpty(reverseEndContent)) { - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(text)); + fatchMap.put(fatchRule.getColumnName(), trimStr(text)); } else if (StrUtil.isEmpty(reverseStartContent) && StrUtil.isNotEmpty(reverseEndContent)) { // 开始为空,结束不为空 // 根据截取的序号查找出位置 @@ -229,7 +229,7 @@ public class OCRUtils { if (indexOf != -1) { String substring = reverseText.substring(0, indexOf); if (StrUtil.isNotEmpty(substring)) { - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring))); + fatchMap.put(fatchRule.getColumnName(), trimStr(StrUtil.reverse(substring))); } } } else if (StrUtil.isNotEmpty(reverseStartContent) && StrUtil.isEmpty(reverseEndContent)) { @@ -238,7 +238,7 @@ public class OCRUtils { if (indexOf != -1 && (indexOf + reverseStartContent.length() <= text.length())) { String substring = reverseText.substring(indexOf + reverseStartContent.length()); if (StrUtil.isNotEmpty(substring)) { - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring))); + fatchMap.put(fatchRule.getColumnName(), trimStr(StrUtil.reverse(substring))); } } @@ -249,7 +249,7 @@ public class OCRUtils { if (startIndexOf != -1 && endIndexOf != -1 && endIndexOf >= (startIndexOf + reverseStartContent.length()) && text.length() >= endIndexOf) { String substring = reverseText.substring(startIndexOf + reverseStartContent.length(), endIndexOf); if (StrUtil.isNotEmpty(substring)) { - fatchMap.put(fatchRule.getColumnName()+Constants.PDFSTR+caseId, trimStr(StrUtil.reverse(substring))); + fatchMap.put(fatchRule.getColumnName(), trimStr(StrUtil.reverse(substring))); } } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java index 991f94c..5fc8e05 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignAward.java @@ -1,5 +1,7 @@ package com.ruoyi.wisdomarbitrate.utils; +import cn.hutool.json.JSONUtil; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; import com.google.gson.JsonArray; @@ -11,6 +13,7 @@ import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.EsignApplicaConfig; import com.ruoyi.common.utils.EsignHttpHelper; import com.ruoyi.common.utils.SealUtil; +import com.ruoyi.wisdomarbitrate.StringIdsReq; import com.ruoyi.wisdomarbitrate.domain.DeptIdentify; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; @@ -252,7 +255,7 @@ public class SignAward { /* " \"availableSealIds\": [\n" + " \"" + availableSealId + "\"\n" + " ],\n" +*/ - " \"availableSealIds\": " + new Gson().toJson(sealIdList) + ",\n" + + // " \"availableSealIds\": " + new Gson().toJson(sealIdList) + ",\n" + " \"signFieldPosition\": {\n" + " \"positionPage\": \"" + positionPageorg + "\",\n" + @@ -305,6 +308,50 @@ public class SignAward { //发起接口请求 return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false); } + /** + * 获取批量签页面链接 + * + * @return + * @throws EsignDemoException + */ + public static EsignHttpResponse batchSignUrl(StringIdsReq idsReq) throws EsignDemoException { + + List signFlowIds = idsReq.getIds(); + String psnAccount = idsReq.getPsnAccount(); + String apiaddr = "/v3/sign-flow/batch-sign-url"; + JSONObject paramObj = new JSONObject(); + paramObj.put("operatorId",idsReq.getPsnId()); + paramObj.put("signFlowIds",signFlowIds); + paramObj.put("clientType","PC"); + String jsonParm = JSON.toJSONString(paramObj); + //请求方法 + EsignRequestType requestType = EsignRequestType.POST; + //生成请求签名鉴权方式的Header + Map header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false); + //发起接口请求 + return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false); + } + /** + * 根据手机号获取账户id + * + * @return + * @throws EsignDemoException + */ + public static EsignHttpResponse identityInfo(StringIdsReq idsReq) throws EsignDemoException { + + List signFlowIds = idsReq.getIds(); + String psnAccount = idsReq.getPsnAccount(); + String apiaddr = "/v3/persons/identity-info?psnAccount=" +psnAccount; + + String jsonParm = "{}"; + //请求方法 + EsignRequestType requestType = EsignRequestType.GET; + //生成请求签名鉴权方式的Header + Map header = EsignHttpHelper.signAndBuildSignAndJsonHeader(eSignAppId, eSignAppSecret, jsonParm, requestType.name(), apiaddr, false); + //发起接口请求 + return EsignHttpHelper.doCommHttp(eSignHost, apiaddr, requestType, jsonParm, header, false); + } + /** * 获取合同文件用印链接 diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml index d4334ba..1a29b3f 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -37,7 +37,12 @@ + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 76ab5d9..f95d31a 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -62,21 +62,11 @@ t1.loan_start_date,t1.loan_end_date,t1.claim_princi_owed,t1.claim_interest_owed,t1.claim_liquid_damag,t1.fee_payable, t1.begin_video_date,t1.online_video_person,t1.contract_number,t1.create_by,t1.create_time,t1.update_by,t1.update_time, t1.arbitrator_name,t1.name,t1.application_organ_id,t1.applicantName,t1.arbitrator_id,t1.identity_num,t1.identity_type, - t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus,t1.batch_number + t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus,t1.batch_number,t1.pendingStatus from( - + - - select t.id,t.caseLogId,t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method, - t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims , - t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed - ,t.claim_liquid_damag,t.fee_payable , - t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time , - t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName, - t.arbitrator_id,t.identity_num , - t.identity_type,t.filearbitra_url,t.lock_status,t.version,t.updateSubmitStatus,t.batch_number - from( select c.id ,'' AS caseLogId,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' ELSE '无审理方式' @@ -99,78 +89,42 @@ c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name as applicantName, c.arbitrator_id,ca.identity_num ,ca.identity_type,c.filearbitra_url,c.lock_status,c.version,null as - updateSubmitStatus,c.batch_number + updateSubmitStatus,c.batch_number,0 as pendingStatus from case_application c JOIN case_affiliate ca ON ca.case_appli_id = c.id - - - - AND c.case_status = #{caseStatus} - - - AND c.case_num = #{caseNum} - - - AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 - - - and c.case_status in - - #{caseStatus} - - - - AND c.lock_status = #{lockStatus} - - - ) t - or (t.identity_num=#{idCard} AND t.identity_type=2 - + or (ca.identity_num=#{idCard} AND ca.identity_type=2 + and (c.case_status=4 or c.case_status=17) ) - - or (t.identity_type=1 + or ( ca.identity_type=1 and + c.case_status in (7,13,17,18) and - instr (t.arbitrator_id,#{userId})>0) + instr (c.arbitrator_id,#{userId})>0) - - - - - - - - or (t.identity_type=1) - + or (ca.identity_type=1) - or (t.identity_type=1 - + or (ca.identity_type=1 + and c.case_status =#{financeStatus} ) - - or ( - t.application_organ_id in + ca.application_organ_id in #{deptId} - AND t.identity_type=1 - + AND ca.identity_type=1 + and c.case_status in (0,9) ) @@ -206,30 +160,17 @@ c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,(select version from case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1) - as updateSubmitStatus,c.batch_number + as updateSubmitStatus,c.batch_number,0 as pendingStatus from case_application c JOIN case_affiliate ca ON ca.case_appli_id =c.id AND ca.identity_type = 1 - + (c.case_status <= 10 or c.case_status=31) AND ca.identity_type=1 AND ca.application_organ_id = #{applicationOrganId} - - AND c.case_status = #{caseStatus} - - - AND c.case_num = #{caseNum} - - - AND ca.application_organ_id=#{nameId} - - - - AND c.lock_status = #{lockStatus} - union @@ -237,7 +178,6 @@ - select tt.* from( SELECT c.id, '' AS caseLogId, @@ -287,7 +227,7 @@ c.filearbitra_url, c.lock_status,c.version, null as updateSubmitStatus, - c.batch_number + c.batch_number,0 as pendingStatus FROM case_application c JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1 @@ -302,40 +242,9 @@ ) WHERE ca.identity_type=1 - - - - - - AND c.lock_status = #{lockStatus} - - - - AND c.case_num = #{caseNum} - - - AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 - ) tt - - - and tt.case_status in - - #{caseStatus} - - - - AND tt.case_status = #{caseStatus} - - - + and c.case_status in (1,5,8,9,11,14,15,16,17,31) union - select tt2.* from( SELECT l.case_appli_id id, l.id AS caseLogId, @@ -382,7 +291,7 @@ ca.application_organ_id , ca.application_organ_name AS applicantName, c.arbitrator_id,ca.identity_num ,ca.identity_type, - c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus,c.batch_number + c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus,c.batch_number,0 as pendingStatus FROM case_application c JOIN case_application_log l ON c.id = l.case_appli_id @@ -390,33 +299,7 @@ AND ca.identity_type = 1 WHERE l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1 - - - - - - - - - - - - AND c.lock_status = #{lockStatus} - - - AND c.case_num = #{caseNum} - - - AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 - - - - + AND l.version = ( SELECT @@ -425,26 +308,86 @@ case_application_log WHERE c.id = case_appli_id) - ) tt2 - - - - - AND tt2.case_status = #{caseStatus} - - - and tt2.case_status in - - #{caseStatus} - - - + union + + + SELECT + c.id, + '' AS caseLogId, + c.case_num, + c.case_subject_amount, + c.register_date, + c.arbitrat_method, + CASE + c.arbitrat_method + WHEN 1 THEN + '开庭审理' + WHEN 2 THEN + '书面审理' ELSE '无审理方式' + END arbitratMethodName, + c.case_status, + CASE + c.case_status + when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' + when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' + when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' + when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' + when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' + when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核仲裁文书' + when 31 then '待修改开庭时间' ELSE '无案件状态' + END caseStatusName, + c.hear_date, + c.arbitrat_claims, + c.loan_start_date, + c.loan_end_date, + c.claim_princi_owed, + c.claim_interest_owed, + c.claim_liquid_damag, + c.fee_payable, + c.begin_video_date, + c.online_video_person, + c.contract_number, + c.create_by, + c.create_time, + c.update_by, + c.update_time, + c.arbitrator_name, + ca.name, + ca.application_organ_id , + ca.application_organ_name AS applicantName, + c.arbitrator_id,ca.identity_num ,ca.identity_type, + c.filearbitra_url, + c.lock_status,c.version, + null as updateSubmitStatus, + c.batch_number,1 as pendingStatus + from case_log_record r + join case_application c on r.case_appli_id=c.id and r.case_node!=c.case_status + JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1 + WHERE + r.create_by=#{loginUserName} AND ca.identity_type=1 + + ) t1 + + + AND t1.case_status = #{caseStatus} + + + AND t1.lock_status = #{lockStatus} + + + AND t1.case_num = #{caseNum} + + + AND t1.application_organ_id=#{nameId} AND t1.identity_type=1 + + - order by t1.case_num desc + order by t1.pendingStatus asc,t1.case_num desc @@ -563,15 +506,6 @@ and instr (t.arbitrator_id,#{userId})>0) - - - - - - - - - or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1 @@ -663,14 +597,6 @@ and instr (t.arbitrator_id,#{userId})>0) - - - - - - - - or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1 @@ -702,37 +628,7 @@ union - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -904,7 +800,7 @@ insert into case_application( - id , + id , case_name , case_num, case_subject_amount, @@ -938,7 +834,7 @@ batch_number, create_time )values( - #{id} , + #{id} , #{caseName}, #{caseNum}, #{caseSubjectAmount}, @@ -1143,7 +1039,22 @@ where id in #{item} - + ; + delete from case_affiliate + where case_appli_id in + + #{item} + ; + delete from case_attach + where case_appli_id in + + #{item} + ; + delete from column_value + where case_id in + + #{item} + ; + + update seal_sign_record -- 2.54.0 From 1da61f526d3579e4ad35ce5c48a612e9707fa7f7 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Thu, 21 Dec 2023 09:16:26 +0800 Subject: [PATCH 03/55] =?UTF-8?q?=E6=A1=88=E4=BB=B6bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeptIdentifyController.java | 9 +- .../impl/CaseApplicationServiceImpl.java | 4 +- .../service/impl/CaseZipImportImpl.java | 150 +++++--- .../task/CaseZipImportTask.java | 16 +- .../CaseApplicationLogMapper.xml | 16 +- .../wisdomarbitrate/CaseApplicationMapper.xml | 352 ++++++++++++------ 6 files changed, 369 insertions(+), 178 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java index 71bec6b..47b916a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java @@ -222,14 +222,13 @@ public class DeptIdentifyController extends BaseController { /** * 根据模板id查询模板字段列表 - * @param templateManage + * @param id * @return */ @GetMapping("/getTemplateInfoById") - public AjaxResult getTemplateInfoById(@RequestBody TemplateManage templateManage){ - if(templateManage.getId()==null){ - return error("参数校验错误"); - } + public AjaxResult getTemplateInfoById(@RequestParam("id") Long id){ + TemplateManage templateManage = new TemplateManage(); + templateManage.setId(id); List fatchRuleList = deptIdentifyService.getTemplateInfoById(templateManage); return AjaxResult.success(fatchRuleList); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index d3f24a0..28441b8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1093,7 +1093,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if(CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { // 修改自定义字段 for (ColumnValue columnValue : caseApplication.getColumnValues()) { - columnValueMapper.updateColumnValue(columnValue); + if(StrUtil.isNotEmpty(columnValue.getValue())) { + columnValueMapper.updateColumnValue(columnValue); + } } } // 修改记录表状态为同意提交修改的内容 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java index 476daaa..d78af0b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java @@ -32,6 +32,7 @@ import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils; import org.apache.pdfbox.pdmodel.PDDocument; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import java.io.*; @@ -93,7 +94,7 @@ public class CaseZipImportImpl { private Integer maxCaseNum; private Integer maxBatchNumber; - +@Transactional public AjaxResult zipImport(MultipartFile file, Long templateId) { UUID uuid = UUID.randomUUID(); // todo @@ -166,22 +167,30 @@ public class CaseZipImportImpl { throw new ServiceException("未找到文件夹"); } File[] files = directory.listFiles(); - CaseZipImportTask caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap,SecurityUtils.getLoginUser()); - Future> future = ThreadPoolUtil.submit(caseZipImportTask); + CaseZipImportTask caseZipImportTask = null; + try { + caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser()); + } catch (Exception e) { + return error("导入失败"); + } + Future> future = ThreadPoolUtil.submit(caseZipImportTask); try { if(future.get()!=null){ return success("导入成功"); } } catch (InterruptedException e) { e.printStackTrace(); + return success("导入失败"); } catch (ExecutionException e) { + e.printStackTrace(); + return success("导入失败"); } - return error("无可导入的案件"); + return error("导入失败"); } - + @Transactional public CaseApplication buildCaseInfo(File file, Long templateId, List fatchRuleList, Map> fatchRuleMap, Map fatchMap, Map userMap, List dictDataList, Map deptMap,LoginUser loginUser) { // fileMap> Map fileMap = findFile(file, fatchRuleList); @@ -288,57 +297,106 @@ public class CaseZipImportImpl { caseApplication.setCaseAttachList(caseAttachs); // 案件压缩包导入 caseApplication.setImportFlag(2); - caseApplicationMapper.insertCaseApplication(caseApplication); + // 多线程执行 +// List execList = new ArrayList<>(); +// if (CollectionUtil.isNotEmpty(addUsers)) { +// Function, Integer> function = userMapper::batchSave; +// execList.add(new MultipleThreadListParam(function, addUsers)); +// } +// if (CollectionUtil.isNotEmpty(userRoleList)) { +// Function, Integer> function = userRoleMapper::batchUserRole; +// execList.add(new MultipleThreadListParam(function, userRoleList)); +// +// } +// if (CollectionUtil.isNotEmpty(sysDepts)) { +// Function, Integer> function = sysDeptMapper::batchSave; +// execList.add(new MultipleThreadListParam(function, sysDepts)); +// +// } +// if (CollectionUtil.isNotEmpty(caseApplications)) { +// Function, Integer> function = caseApplicationMapper::batchSave; +// execList.add(new MultipleThreadListParam(function, caseApplications)); +// Function, Integer> functionLog = caseApplicationLogMapper::batchSave; +// execList.add(new MultipleThreadListParam(functionLog, caseApplications)); +// +// } +// if (CollectionUtil.isNotEmpty(caseAffiliates)) { +// Function, Integer> function = caseAffiliateMapper::batchCaseAffiliate; +// execList.add(new MultipleThreadListParam(function, caseAffiliates)); +// Function, Integer> functionLog = caseAffiliateLogMapper::batchCaseAffiliate; +// execList.add(new MultipleThreadListParam(functionLog, caseAffiliates)); +// } +// if (CollectionUtil.isNotEmpty(caseAttachs)) { +// Function, Integer> function = caseAttachMapper::batchSave; +// execList.add(new MultipleThreadListParam(function, caseAttachs)); +// Function, Integer> functionLog = caseAttachLogMapper::batchSave; +// execList.add(new MultipleThreadListParam(functionLog, caseAttachs)); +// } +// if (CollectionUtil.isNotEmpty(columnValueList)) { +// Function, Integer> function = columnValueMapper::batchSave; +// execList.add(new MultipleThreadListParam(function, columnValueList)); +// Function, Integer> functionLog = columnValueLogMapper::batchSave; +// execList.add(new MultipleThreadListParam(functionLog, columnValueList)); +// } +// if (CollectionUtil.isNotEmpty(execList)) { +// MultipleThreadWorkUtil.execListFun(execList.toArray(new MultipleThreadListParam[execList.size()])); +// } // 多线程执行 ThreadPoolUtil.execute(() -> { - caseApplicationLogMapper.insert(caseApplication); - // 多线程执行 - if (CollectionUtil.isNotEmpty(addUsers)) { - userMapper.batchSave(addUsers); + try { + caseApplicationMapper.insertCaseApplication(caseApplication); + caseApplicationLogMapper.insert(caseApplication); + // 多线程执行 + if (CollectionUtil.isNotEmpty(addUsers)) { + userMapper.batchSave(addUsers); - } - if (CollectionUtil.isNotEmpty(userRoleList)) { - userRoleMapper.batchUserRole(userRoleList); + } + if (CollectionUtil.isNotEmpty(userRoleList)) { + userRoleMapper.batchUserRole(userRoleList); - } - if (CollectionUtil.isNotEmpty(sysDepts)) { - sysDeptMapper.batchSave(sysDepts); + } + if (CollectionUtil.isNotEmpty(sysDepts)) { + sysDeptMapper.batchSave(sysDepts); - } - if (CollectionUtil.isNotEmpty(caseApplication.getCaseAffiliates())) { - caseAffiliateMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); - caseAffiliateLogMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); - } - if (CollectionUtil.isNotEmpty(caseAttachs)) { - caseAttachMapper.batchSave(caseAttachs); - caseAttachLogMapper.batchSave(caseAttachs); + } + if (CollectionUtil.isNotEmpty(caseApplication.getCaseAffiliates())) { + caseAffiliateMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); + caseAffiliateLogMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); + } + if (CollectionUtil.isNotEmpty(caseAttachs)) { + caseAttachMapper.batchSave(caseAttachs); + caseAttachLogMapper.batchSave(caseAttachs); - } - if (CollectionUtil.isNotEmpty(columnValueList)) { - columnValueMapper.batchSave(columnValueList); - columnValueLogMapper.batchSave(columnValueList); - } - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser); - // 发送短信 - if (CollectionUtil.isNotEmpty(smsRequestList)) { - Map sendRecordMap = null; - if (CollectionUtil.isNotEmpty(smsSendRecordList)) { - sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity())); - for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) { - Boolean aBoolean = SmsUtils.sendSms(request); - if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) { - if (aBoolean) { - sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1); - } else { - sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0); + } + if (CollectionUtil.isNotEmpty(columnValueList)) { + columnValueMapper.batchSave(columnValueList); + columnValueLogMapper.batchSave(columnValueList); + } + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser); + // 发送短信 + if (CollectionUtil.isNotEmpty(smsRequestList)) { + Map sendRecordMap = null; + if (CollectionUtil.isNotEmpty(smsSendRecordList)) { + sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity())); + for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) { + Boolean aBoolean = SmsUtils.sendSms(request); + if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) { + if (aBoolean) { + sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1); + } else { + sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0); + } } } + smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList); } - smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList); + + } - - + } catch (Exception e) { + e.printStackTrace(); + throw new RuntimeException("导入失败,请检查抓取规则是否正确"); } }); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java index cef7c34..a1d04ec 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java @@ -49,16 +49,20 @@ public class CaseZipImportTask implements Callable> { @Override public List call() { List caseApplications = new ArrayList<>(); - for (File file1 : files) { - if (file1.isDirectory() && file1.listFiles() != null) { + try { + for (File file1 : files) { + if (file1.isDirectory() && file1.listFiles() != null) { - for (File file2 : file1.listFiles()) { - CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, fatchMap, userMap, dictDataList, deptMap, loginUser); - if (caseApplication != null) { - caseApplications.add(caseApplication); + for (File file2 : file1.listFiles()) { + CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, fatchMap, userMap, dictDataList, deptMap, loginUser); + if (caseApplication != null) { + caseApplications.add(caseApplication); + } } } } + } catch (Exception e) { + throw new RuntimeException("导入失败"); } return caseApplications; diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml index b1b4945..5aca5c5 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml @@ -204,23 +204,23 @@ delete from case_application_log l where l.id in - - #{id} + + #{item} ; delete from case_affiliate_log l where l.case_appli_log_id in - - #{id} + + #{item} ; delete from case_attach_log l where l.case_appli_log_id in - - #{id} + + #{item} ; delete from column_value_log l where l.case_appli_log_id in - - #{id} + + #{item} ; diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index f95d31a..b354bce 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -5,54 +5,54 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - + + - - - - + + + + - - - - - + + + + + - - - - - + + + + + - - + + @@ -368,6 +368,114 @@ JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1 WHERE r.create_by=#{loginUserName} AND ca.identity_type=1 + and c.id not in( + + + + select c.id + from case_application c + JOIN case_affiliate ca ON ca.case_appli_id = c.id + + + + + or (ca.identity_num=#{idCard} AND ca.identity_type=2 + and (c.case_status=4 or c.case_status=17) + ) + + + + or ( ca.identity_type=1 and + c.case_status in (7,13,17,18) + and + instr (c.arbitrator_id,#{userId})>0) + + + + or (ca.identity_type=1) + + + + or (ca.identity_type=1 + and c.case_status =#{financeStatus} + ) + + + + or ( + ca.application_organ_id in + #{deptId} + + AND ca.identity_type=1 + and c.case_status in (0,9) + ) + + + + union + + + + + + select c.id + from case_application c + JOIN case_affiliate ca ON ca.case_appli_id =c.id AND ca.identity_type = 1 + + + (c.case_status <= 10 or c.case_status=31) AND + ca.identity_type=1 + + + AND ca.application_organ_id = #{applicationOrganId} + + + union + + + + + + SELECT + c.id + FROM + case_application c + JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1 + JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and + l.version + = ( + SELECT + max( version ) version + FROM + case_application_log + WHERE case_appli_id = c.id + ) + WHERE + ca.identity_type=1 + and c.case_status in (1,5,8,9,11,14,15,16,17,31) + union + + SELECT + l.case_appli_id id + FROM + case_application c + JOIN case_application_log l ON c.id = l.case_appli_id + JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id + AND ca.identity_type = 1 + WHERE + l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1 + + + AND l.version = ( + SELECT + max( version ) version + FROM + case_application_log + WHERE + c.id = case_appli_id) + + + ) @@ -391,13 +499,13 @@ - select DISTINCT(c.id) id,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' ELSE '无审理方式' END arbitratMethodName, c.case_status , - CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' + CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' @@ -408,9 +516,11 @@ ELSE '无案件状态' END caseStatusName, c.hear_date ,c.arbitrat_claims , - c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , + c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag + ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.lock_status, - c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url,c.version + c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId + ,ca.application_organ_name as applicantName,c.filearbitra_url,c.version from case_log_record r join case_application c on r.case_appli_id=c.id JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1 @@ -423,10 +533,10 @@ AND c.case_num = #{caseNum} - AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 + AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 - AND r.create_by=#{loginUserName} AND ca.identity_type=1 + AND r.create_by=#{loginUserName} AND ca.identity_type=1 @@ -443,7 +553,8 @@ from( select t.id,t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method, t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims , - t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed ,t.claim_liquid_damag,t.fee_payable , + t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed + ,t.claim_liquid_damag,t.fee_payable , t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time , t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName, t.arbitrator_id,t.identity_num , t.identity_type,t.filearbitra_url,t.lock_status,t.version @@ -480,7 +591,7 @@ AND c.case_num = #{caseNum} - AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 + AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 and c.case_status in @@ -521,7 +632,7 @@ - or (t.identity_type=1 and t.case_status =#{financeStatus}) + or (t.identity_type=1 and t.case_status =#{financeStatus}) @@ -565,7 +676,8 @@ - select DISTINCT(t.id),t.case_status,t.application_organ_id, t.arbitrator_id,t.identity_num , t.identity_type from( + select DISTINCT(t.id),t.case_status,t.application_organ_id, t.arbitrator_id,t.identity_num , + t.identity_type from( select c.id , c.case_status,ca.application_organ_id, c.arbitrator_id,ca.identity_num , ca.identity_type @@ -612,7 +724,7 @@ - or ( t.identity_type=1 and t.case_status =#{financeStatus}) + or ( t.identity_type=1 and t.case_status =#{financeStatus}) @@ -651,12 +763,12 @@ ca.identity_type=1 and c.case_status in (1,5,8,9,11,14,15,16,17,31) - + AND c.case_status = #{caseStatus} @@ -665,7 +777,7 @@ AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 union - select c.id , + select c.id , c.case_status,ca.application_organ_id, c.arbitrator_id,ca.identity_num , ca.identity_type FROM @@ -694,7 +806,7 @@ ELSE '无审理方式' END arbitratMethodName, c.case_status , - CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' + CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' @@ -705,9 +817,11 @@ ELSE '无案件状态' END caseStatusName, c.hear_date ,c.arbitrat_claims , - c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , + c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag + ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,c.lock_status, - c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url,(select version from + c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId + ,ca.application_organ_name as applicantName,c.filearbitra_url,(select version from case_application_log where case_appli_id=c.id order by version desc limit 1) as version,(select update_submit_status from case_application_log where case_appli_id=c.id order by version desc limit 1) as updateSubmitStatus,c.batch_number @@ -726,7 +840,7 @@ AND c.case_num = #{caseNum} - AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 + AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 and c.case_status in @@ -791,7 +905,7 @@ diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateManageMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateManageMapper.xml index e235015..33af308 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateManageMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/TemplateManageMapper.xml @@ -79,6 +79,7 @@ AND del_flag =0 + ORDER BY create_time DESC \ No newline at end of file -- 2.54.0 From afb6b2a4b5b40aeeb274555c685282d6cebda55d Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Wed, 27 Dec 2023 14:38:03 +0800 Subject: [PATCH 07/55] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CasePaymentServiceImpl.java | 4 +--- .../wisdomarbitrate/service/impl/CaseZipImportImpl.java | 7 ++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 76efa4d..6d12eca 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -124,7 +124,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { //查询案件详细信息 CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); if (caseApplication1 == null) { - return AjaxResult.error(); + continue; } String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死 String caseNum = caseApplication1.getCaseNum(); @@ -183,8 +183,6 @@ public class CasePaymentServiceImpl implements ICasePaymentService { casePaymentRecordMapper.update(casePaymentRecord); // 新增日志 CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); - - return AjaxResult.success(); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java index d78af0b..2c5fd94 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java @@ -415,7 +415,12 @@ public class CaseZipImportImpl { * @param fatchRules 抓取规则 */ private void getFatchContent(Map andConvertPDF, String mapKey, Map map, List fatchRules) { - String fileURL = andConvertPDF.get(mapKey); + String fileURL =null; + for (Map.Entry entry : andConvertPDF.entrySet()) { + if(entry.getKey().contains(mapKey)){ + fileURL=entry.getValue(); + } + } if (StrUtil.isEmpty(fileURL)) { return; } -- 2.54.0 From 31a9287a8f98183ba12b16f39d993d3a5f27b198 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Wed, 27 Dec 2023 14:40:26 +0800 Subject: [PATCH 08/55] 1 --- .../controller/wisdomarbitrate/CaseApplicationController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 95f6872..564a736 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -354,7 +354,7 @@ public class CaseApplicationController extends BaseController { - + /** * 发送房间号短信 -- 2.54.0 From 20517eaaaabec9f20f6e77a1254438e59f4001f5 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Thu, 28 Dec 2023 10:30:45 +0800 Subject: [PATCH 09/55] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/wisdomarbitrate/domain/CaseApplication.java | 2 +- .../service/impl/CaseApplicationServiceImpl.java | 11 +++-------- .../service/impl/CaseZipImportImpl.java | 6 +++--- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index b07f7f4..8239489 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -407,7 +407,7 @@ public class CaseApplication extends BaseEntity { /** * 批号 */ - private String batchNumber; + private Integer batchNumber; /** * 自定义字段 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index adb6beb..841a87e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -987,14 +987,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String caseNum = generateCaseNum(); caseApplication.setCaseNum(caseNum); // 设置批号 - if(StrUtil.isEmpty(caseApplication.getBatchNumber())){ - Integer maxBatchNumber = caseApplicationMapper.selectBatchNumberLike(); - if(maxBatchNumber==null){ - caseApplication.setBatchNumber("1"); - }else { - caseApplication.setBatchNumber(maxBatchNumber+1+""); - } - } + + caseApplication.setBatchNumber(0); + caseApplication.setCreateBy(getUsername()); caseApplication.setVersion(1); caseApplication.setId(IdWorkerUtil.getId()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java index 2c5fd94..9eb1fe4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java @@ -248,14 +248,14 @@ public class CaseZipImportImpl { caseApplication.setCaseAppliId(caseApplication.getId()); // 设置批号 - if (StrUtil.isEmpty(caseApplication.getBatchNumber())) { + if (caseApplication.getBatchNumber()==null) { maxBatchNumber = caseApplicationMapper.selectBatchNumberLike(); if (maxBatchNumber == null) { maxBatchNumber = 1; - caseApplication.setBatchNumber(maxBatchNumber.toString()); + caseApplication.setBatchNumber(maxBatchNumber); } else { maxBatchNumber = maxBatchNumber + 1; - caseApplication.setBatchNumber(maxBatchNumber.toString()); + caseApplication.setBatchNumber(maxBatchNumber); } } // 设置编号 -- 2.54.0 From 7a38c4e8a5a79fb95f3706e286f2153cd8d8d226 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Fri, 29 Dec 2023 17:23:09 +0800 Subject: [PATCH 10/55] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=9F=A5=E8=AF=A2=E6=89=B9=E9=87=8F=E5=92=8C?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 24 +++ .../domain/BatchCaseApplication.java | 6 + .../mapper/CaseApplicationMapper.java | 4 + .../service/ICaseApplicationService.java | 3 + .../impl/CaseApplicationServiceImpl.java | 200 +++++++++++++++++- .../service/impl/CasePaymentServiceImpl.java | 3 +- .../wisdomarbitrate/CaseApplicationMapper.xml | 67 ++++++ 7 files changed, 297 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 564a736..585df88 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -12,6 +12,7 @@ import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.WxAppletNotifyUtils; import com.ruoyi.util.FileUtil; import com.ruoyi.wisdomarbitrate.StringIdsReq; @@ -60,6 +61,16 @@ public class CaseApplicationController extends BaseController { return getDataTable(list); } + /** + * 查询批量管理案件列表 + */ + @GetMapping("/listBatch") + public TableDataInfo listBatch(CaseApplication caseApplication) { + startPage(); + List list = caseApplicationService.selectCaseApplicationListBatchByRole(caseApplication); + return getDataTable(list); + } + /** * 根据角色查询待办数量 * @return @@ -120,6 +131,19 @@ public class CaseApplicationController extends BaseController { return toAjax(caseApplicationService.submitCaseApplication(batchCaseApplication.getIds())); } + /** + * 批量提交立案申请 + */ + @Log(title = "批量提交立案申请", businessType = BusinessType.UPDATE) + @PostMapping("/submitCaseApplicationBatch") + public AjaxResult submitCaseApplicationBatch(@RequestBody BatchCaseApplication batchCaseApplication) { + if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber())){ + return error("参数校验失败"); + } + return toAjax(caseApplicationService.submitCaseApplicationBatch(batchCaseApplication.getBatchNumber())); + } + + /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/BatchCaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/BatchCaseApplication.java index 0a81451..72abf5a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/BatchCaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/BatchCaseApplication.java @@ -22,4 +22,10 @@ public class BatchCaseApplication { private Integer opinion; /** 驳回原因 */ private String caseCheckReject; + /** + * 批号 + */ + private String batchNumber; + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index b0f0e94..3145ff4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -133,4 +133,8 @@ public interface CaseApplicationMapper { int batchSave(@Param("list")List caseApplications); int selectCasenum(@Param("userId") String userId); + + List selectAdminCaseApplicationListBatch(CaseApplication caseApplication); + + List listCaseApplicationByBatchNumber(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index b9fa706..d0b1c3f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -136,4 +136,7 @@ public interface ICaseApplicationService { CaseAttach downloadCaseZipFile(CaseApplication caseApplication); + List selectCaseApplicationListBatchByRole(CaseApplication caseApplication); + + int submitCaseApplicationBatch(String batchNumber); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index adb6beb..f9d5640 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -2545,7 +2545,169 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return caseAttach; } + @Override + public List selectCaseApplicationListBatchByRole(CaseApplication caseApplication) { + return caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication); + } + @Override + @Transactional + public int submitCaseApplicationBatch(String batchNumber) { + int rows = 0; + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(batchNumber); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + List ids = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); + if(caseApplications!=null&&caseApplications.size()>0){ + Map applicationMap = caseApplications.stream().collect(Collectors.toMap(CaseApplication::getId, Function.identity(), (n1, n2) -> n2)); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliateByCaseIds(ids); + // 转换为Map>形式 + Map> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliate::getCaseAppliId)); + for (Long id : ids) { + // 查询案件信息,做必填校验,校验不通过,提示,不能提交 + StringBuilder errorMsg = new StringBuilder(); + // 必填校验 + CaseApplication caseApplication = applicationMap.get(id); + String caseNum = caseApplication.getCaseNum(); + // 基本字段校验 + if(caseApplication!=null) { + for (String baseColumn : baseColumns) { + if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseApplication, baseColumn))){ + errorMsg.append(getColumnstr(baseColumn)).append("不能为空,"); +// throw new ServiceException("必填字段未填写,请完善案件信息!"); + } + } + // 校验人员 + if(CollectionUtil.isNotEmpty(caseAffiliates)){ + List affiliateList = caseAffiliateMap.get(id); + if(CollectionUtil.isNotEmpty(affiliateList)){ + for (CaseAffiliate caseAffiliate : affiliateList) { + if(caseAffiliate.getIdentityType()==1){ + // 校验申请人 + for (String applicAffiliateColumn : applicAffiliateColumns) { + if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){ + errorMsg.append(getColumnstr(applicAffiliateColumn)).append("不能为空,"); +// throw new ServiceException("必填字段未填写,请完善案件信息!"); + } + } + }else { + // 校验被申请人 + for (String applicAffiliateColumn : dectborAffiliateColumns) { + if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){ + errorMsg.append(getColumnstr(applicAffiliateColumn)).append("不能为空,"); +// throw new ServiceException("必填字段未填写,请完善案件信息!"); + } + } + } + } + } + } + } + if(StringUtils.isNotEmpty(errorMsg.toString())){ + throw new ServiceException("案件编号" + caseNum + errorMsg.toString()+"请完善案件信息!"); + } + + CaseApplication application = new CaseApplication(); + application.setId(id); + //提交立案申请 + application.setCaseStatus(CaseApplicationConstants.CASE_CHECK); + rows += caseApplicationMapper.submitCaseApplication(application); + // 新增日志 + insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, ""); + } + + }else{ + throw new ServiceException("这个批号没有批量提交的案件"); + } + + return rows; + } + + private String getColumnstr(String columnname) { + String columnstr = ""; + switch (columnname) { + case "caseName": + columnstr = "案件名称"; + break; + case "caseSubjectAmount": + columnstr = "案件标的"; + break; + case "loanStartDate": + columnstr = "借款开始日期"; + break; + case "loanEndDate": + columnstr = "借款结束日期"; + break; + case "contractNumber": + columnstr = "合同编号"; + break; + case "claimInterestOwed": + columnstr = "申请人主张欠利息"; + break; + case "claimLiquidDamag": + columnstr = "申请人主张违约金"; + break; + case "claimPrinciOwed": + columnstr = "申请人主张欠本金"; + break; + case "arbitratClaims": + columnstr = "申请人仲裁请求及事实和理由"; + break; + case "name": + columnstr = "姓名"; + break; + case "identityNum": + columnstr = "身份证号"; + break; + case "contactTelphone": + columnstr = "联系电话"; + break; + case "contactAddress": + columnstr = "联系地址"; + break; + case "workTelphone": + columnstr = "单位电话"; + break; + case "workAddress": + columnstr = "单位地址"; + break; + case "residenAffili": + columnstr = "住所"; + break; + case "compLegalPerson": + columnstr = "法定代表人"; + break; + case "compLegalperPost": + columnstr = "法定代表人职位"; + break; + case "email": + columnstr = "邮箱"; + break; + case "nameAgent": + columnstr = "代理人姓名"; + break; + case "identityNumAgent": + columnstr = "代理人身份证号"; + break; + case "contactTelphoneAgent": + columnstr = "代理人联系电话"; + break; + case "contactAddressAgent": + columnstr = "代理人联系地址"; + break; + case "responSex": + columnstr = "被申请人性别"; + break; + case "responBirth": + columnstr = "被申请人出生年月日"; + break; + default: + columnstr = ""; + } + + return columnstr; + } @Override @@ -2599,9 +2761,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //发送短信通知 1947342 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1947342"); + request.setTemplateId("2033619"); // 发送开庭日期通知短信 - sendHearDateMessage(caseApplication, request, "1947342"); + sendHearDateMessage(caseApplication, request, "2033619"); // 新增日志 insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); @@ -2619,9 +2781,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); String caseNum = caseApplicationselect.getCaseNum(); - //Date hearDate = caseApplicationselect.getHearDate(); + Date hearDate = caseApplicationselect.getHearDate(); + String hearDatestr = ""; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String hearDatestr = null; + if(hearDate!=null) { + hearDatestr = dateFormat.format(hearDate); + } String arbitratorId = caseApplicationselect.getArbitratorId(); // List arbitratorList = new ArrayList<>(); if (StringUtils.isNotEmpty(arbitratorId)) { @@ -2638,7 +2803,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { request.setPhone(user.getPhonenumber()); // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 String name = user.getNickName(); - request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); + if (templateId.equals("2033619")) { + request.setTemplateParamSet(new String[]{name, caseNum}); + } + if (templateId.equals("1975139")) { + request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); + } + Boolean aBoolean = SmsUtils.sendSms(request); //保存短信发送记录 SmsSendRecord smsSendRecord = new SmsSendRecord(); @@ -2647,8 +2818,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { smsSendRecord.setPhone(request.getPhone()); smsSendRecord.setSendTime(new Date()); String content = ""; - if (templateId.equals("1947342")) { - content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已确定为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; + if (templateId.equals("2033619")) { + content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,已组庭,请知晓,如非本人操作,请忽略本短信。"; } if (templateId.equals("1975139")) { content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; @@ -2682,7 +2853,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { request.setPhone(caseAffiliateselect.getContactTelphone()); // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 String name = caseAffiliateselect.getName(); - request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); + if (templateId.equals("2033619")) { + request.setTemplateParamSet(new String[]{name, caseNum}); + } + if (templateId.equals("1975139")) { + request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); + } Boolean aBoolean = SmsUtils.sendSms(request); //保存短信发送记录 SmsSendRecord smsSendRecord = new SmsSendRecord(); @@ -2690,7 +2866,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum()); smsSendRecord.setPhone(request.getPhone()); smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已确定为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; + String content = ""; + if (templateId.equals("2033619")) { + content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,已组庭,请知晓,如非本人操作,请忽略本短信。"; + } + if (templateId.equals("1975139")) { + content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; + } smsSendRecord.setSendContent(content); smsSendRecord.setCreateBy(getUsername()); if (aBoolean) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 6d12eca..c84f938 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -152,12 +152,13 @@ public class CasePaymentServiceImpl implements ICasePaymentService { } smsRecordMapper.saveSmsSendRecord(smsSendRecord); } else { //被申请人 - Boolean aBoolean = SmsUtils.sendSms(request); + request.setPhone(affiliate.getContactTelphone()); request.setTemplateId("1952840"); // 1952840 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信 String name = affiliate.getName(); request.setTemplateParamSet(new String[]{name, caseName, caseNum}); + Boolean aBoolean = SmsUtils.sendSms(request); //保存短信发送记录 SmsSendRecord smsSendRecord = new SmsSendRecord(); smsSendRecord.setCaseId(caseApplication.getId()); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 76756c6..e759328 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -53,6 +53,8 @@ + + @@ -851,6 +853,32 @@ order by c.case_num desc + + + + + + select c.id ,c.case_id ,c.order_number ,c.payment_time ,c.create_time ,c.update_time ,c.payment_status from case_payment_record c - + AND c.order_number = #{orderNumber} -- 2.54.0 From 82b6431be93d7c118b3b55307402999fab745939 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Wed, 3 Jan 2024 17:55:35 +0800 Subject: [PATCH 16/55] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E7=BB=84=E5=BA=AD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseApplicationController.java | 10 ++ .../service/ICaseApplicationService.java | 2 + .../impl/CaseApplicationServiceImpl.java | 97 ++++++++++++++++++- .../service/impl/CasePaymentServiceImpl.java | 2 +- .../wisdomarbitrate/CaseApplicationMapper.xml | 12 +-- 5 files changed, 109 insertions(+), 14 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 67cd0ba..71191be 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -292,6 +292,16 @@ public class CaseApplicationController extends BaseController { return toAjax(caseApplicationService.pendTralSure(caseApplication)); } + /** + * 批量组庭审核 + */ +// @PreAuthorize("@ss.hasPermi('caseManagement:list:checkgroup')") + @Log(title = "批量组庭审核", businessType = BusinessType.UPDATE) + @PostMapping("/pendTralCheckBatch") + public AjaxResult pendTralCheckBatch(@Validated @RequestBody CaseApplication caseApplication) { + return toAjax(caseApplicationService.pendTralCheckBatch(caseApplication)); + } + /** * 修改开庭时间 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index be93e62..9bcfe59 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -141,4 +141,6 @@ public interface ICaseApplicationService { int submitCaseApplicationBatch(String batchNumber); int submitCaseApplicationCheckBatch(String batchNumber, Integer agreeOrNotCheck, String caseCheckReject); + + int pendTralCheckBatch(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 0f0d139..4eefd8b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1692,7 +1692,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { int rows = 0; //同意组庭 if (isAgreePendTral != null && isAgreePendTral == 1) { - rows = caseApplicationMapper.submitCaseApplication(caseApplication); + CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); + if(caseApplicationselect==null){ + throw new ServiceException("案件不存在"); + } + String arbitratorId = caseApplicationselect.getArbitratorId(); + String arbitratorName = caseApplicationselect.getArbitratorName(); + List arbitrators = caseApplication.getArbitrators(); + if(arbitrators != null && arbitrators.size() > 0 && StringUtils.isEmpty(arbitratorId) && StringUtils.isEmpty(arbitratorName)){ + List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); + List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); + String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); + String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(",")); + caseApplication.setArbitratorId(idstr); + caseApplication.setArbitratorName(arbitratorNamestr); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + } } else { List arbitrators = caseApplication.getArbitrators(); // 仲裁员信息 @@ -2543,7 +2558,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override public List selectCaseApplicationListBatchByRole(CaseApplication caseApplication) { - return caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication); + List caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication); + if(caseApplicationlist!=null&&caseApplicationlist.size()>0){ + for(CaseApplication caseApplicationselect : caseApplicationlist){ + Integer batchNumber = caseApplicationselect.getBatchNumber(); + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(batchNumber); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications != null && caseApplications.size() > 0) { + List caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList()); + List caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList()); + List caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList()); + List caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList()); + String caseStatusName = caseStatusNamesnew.stream().map(Object::toString).collect(Collectors.joining(",")); + caseApplicationselect.setCaseStatusName(caseStatusName); + } + } + } + + return caseApplicationlist; } @Override @@ -2704,6 +2737,66 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return rows; } + @Override + @Transactional + public int pendTralCheckBatch(CaseApplication caseApplication) { + Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); + int rows = 0; + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(caseApplication.getBatchNumber()); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications != null && caseApplications.size() > 0) { + List caseNums = caseApplications.stream().map(CaseApplication::getCaseNum).collect(Collectors.toList()); + List caseNumsnew = caseNums.stream().distinct().collect(Collectors.toList()); + String caseNumsstr = caseNumsnew.stream().map(Object::toString).collect(Collectors.joining(",")); + throw new ServiceException("案件编号"+caseNumsstr+"在案件质证节点,请先进行案件质证,然后再批量组庭审核"); + } + + CaseApplication caseApplication1 = new CaseApplication(); + caseApplication1.setBatchNumber(caseApplication.getBatchNumber()); + caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT); + List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); + if (caseApplications1 != null && caseApplications1.size() > 0) { + for(CaseApplication caseApplicationse:caseApplications1){ + //同意组庭 + if (isAgreePendTral != null && isAgreePendTral == 1) { + + String arbitratorId = caseApplicationse.getArbitratorId(); + String arbitratorName = caseApplicationse.getArbitratorName(); + List arbitrators = caseApplication.getArbitrators(); + if(arbitrators != null && arbitrators.size() > 0 && StringUtils.isEmpty(arbitratorId) && StringUtils.isEmpty(arbitratorName)){ + List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); + List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); + String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); + String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(",")); + caseApplicationse.setArbitratorId(idstr); + caseApplicationse.setArbitratorName(arbitratorNamestr); + caseApplicationse.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); + } + } else { + List arbitrators = caseApplication.getArbitrators(); + // 仲裁员信息 + if (arbitrators != null && arbitrators.size() > 0) { + List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); + List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); + String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); + String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(",")); + caseApplicationse.setArbitratorId(idstr); + caseApplicationse.setArbitratorName(arbitratorNamestr); + caseApplicationse.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); + } + } + // 新增日志 + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); + + } + } + return rows; + } + private String getColumnstr(String columnname) { String columnstr = ""; switch (columnname) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 7dfd61c..5d240c7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -330,7 +330,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { String batchNumber = casePayDTO.getBatchNumber(); CaseApplication caseApplicationsel = new CaseApplication(); caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber)); - caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); +// caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); CasePayListVO listVO = new CasePayListVO(); BigDecimal sum = new BigDecimal(0); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 15de2c3..eae5404 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -856,17 +856,7 @@ + + update seal_sign_record -- 2.54.0 From 95cacd287b87744a0c50c08354305f157fb61d60 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Fri, 5 Jan 2024 16:31:22 +0800 Subject: [PATCH 21/55] =?UTF-8?q?=E6=89=B9=E9=87=8F=E9=80=81=E8=BE=BE?= =?UTF-8?q?=E8=A3=81=E5=86=B3=E4=B9=A6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 29 ++- .../service/IAdjudicationService.java | 4 + .../service/impl/AdjudicationServiceImpl.java | 191 ++++++++++++++++++ 3 files changed, 223 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index 5abc938..da230f3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -42,7 +42,7 @@ public class AdjudicationController extends BaseController { /** * 根据批号查询批量签名链接 */ - @PostMapping("/selectBatchSignUrl") + @PostMapping("/getSignUrlBatch") public AjaxResult getSignUrlBatch(@RequestBody StringIdsReq idsReq) { if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){ return error("参数校验失败"); @@ -170,6 +170,19 @@ public class AdjudicationController extends BaseController { return adjudicationService.caseFile(batchCaseApplication.getIds()); } + /** + * 批量归档(暂时只改案件状态) + * @param batchCaseApplication + * @return + */ + @PostMapping("/caseFileBatch") + public AjaxResult caseFileBatch(@RequestBody CaseApplication caseApplication){ + if(StrUtil.isEmpty(caseApplication.getBatchNumber().toString())){ + return error("参数校验失败"); + } + return adjudicationService.caseFileBatch(caseApplication.getBatchNumber()); + } + /** * 送达(不包含发送电子邮件) * @param bookSendVO @@ -180,6 +193,20 @@ public class AdjudicationController extends BaseController { public AjaxResult service(@RequestBody BookSendVO bookSendVO){ return adjudicationService.service(bookSendVO.getId(),bookSendVO.getAppEmail(),bookSendVO.getResEmail(),bookSendVO.getApptrackingNum(),bookSendVO.getRestrackingNum()); } + + /** + * 批量送达仲裁书 + * @param caseApplication + * @return + */ + @PostMapping("/serviceBatch") + public AjaxResult serviceBatch( CaseApplication caseApplication){ + if(StrUtil.isEmpty(caseApplication.getBatchNumber().toString())){ + return error("参数校验失败"); + } + return adjudicationService.serviceBatch(caseApplication.getBatchNumber()); + } + /** * 用印(暂时只改案件状态) * @param caseApplication diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java index 401d67e..9ed4fa2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java @@ -61,4 +61,8 @@ public interface IAdjudicationService { SealSignRecord getSignUrlBatch(StringIdsReq idsReq); SealSignRecord getSealUrlBatch(StringIdsReq idsReq); + + AjaxResult caseFileBatch(Integer batchNumber); + + AjaxResult serviceBatch(Integer batchNumber); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 784a5eb..b27883a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -744,6 +744,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } @Override + @Transactional public AjaxResult signature(CaseApplication caseApplication) { //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); @@ -755,6 +756,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } @Override + @Transactional public AjaxResult caseFile(List ids) { try { for (Long id : ids) { @@ -1529,6 +1531,195 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return signRecord; } + @Override + @Transactional + public AjaxResult caseFileBatch(Integer batchNumber) { + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(batchNumber); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_FILING); + List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications1 != null && caseApplications1.size() > 0) { + List ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList()); + try { + for (Long id : ids) { + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + //更改案件状态(暂时) + caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED); + caseApplicationMapper.submitCaseApplication(caseApplication); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_ARCHIVED, ""); + } + } catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + + }else{ + throw new ServiceException("这个批号没有批量归档的案件"); + } + + return AjaxResult.success("归档成功"); + } + + @Override + @Transactional + public AjaxResult serviceBatch(Integer batchNumber) { + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(batchNumber); + caseApplicationsel.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); + List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications1 != null && caseApplications1.size() > 0) { + List ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList()); + for (Long id : ids) { + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + if (caseApplication1 == null) { + return AjaxResult.error("未查询到相关案件"); + } + List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1); + if (caseAttachList != null && caseAttachList.size() > 0) { + for (CaseAttach caseAttach : caseAttachList) { + if (caseAttach.getAnnexType() == 3) { + String annexName = caseAttach.getAnnexName(); + String prefix = "/profile/upload/"; + int startIndex = prefix.length(); + String path = caseAttach.getAnnexPath() + annexName.substring(startIndex); + File file = new File(path); + // todo 部署放开 + if (!file.exists()) { + return AjaxResult.error("未生成裁决书"); + } + + } + } + } + //修改案件状态 + caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING); + caseApplicationMapper.submitCaseApplication(caseApplication1); + + String appEmail = ""; + String resEmail = ""; + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(id); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + if (caseAffiliates != null && caseAffiliates.size() > 0) { + for (CaseAffiliate affiliate : caseAffiliates) { + if (affiliate.getIdentityType() == 1) { //申请人 + appEmail = affiliate.getSendEmail(); + } else { + resEmail = affiliate.getSendEmail(); + } + } + } + + //申请人发送邮件 + boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList); + SendMailRecord sendMailRecord = new SendMailRecord(); + sendMailRecord.setCaseId(id); + sendMailRecord.setMailAddress(appEmail); + sendMailRecord.setMailContent("您好,审核后的裁决书在附件中请查阅"); +// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅"); + sendMailRecord.setMailName("签署后的裁决书"); + sendMailRecord.setSendTime(new Date()); + sendMailRecord.setCreateBy(getUsername()); + if (appEmailFlag) { + sendMailRecord.setSendStatus(1); + } else { + sendMailRecord.setSendStatus(0); + } + sendMailRecordMapper.saveSendMailRecord(sendMailRecord); + // 被申请人发送邮件 + boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList); + + SendMailRecord sendMailRecord1 = new SendMailRecord(); + sendMailRecord1.setCaseId(id); + sendMailRecord1.setMailAddress(resEmail); +// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅"); + sendMailRecord1.setMailContent("您好,审核后的裁决书在附件中请查阅"); + sendMailRecord1.setMailName("签署后的裁决书"); + sendMailRecord1.setSendTime(new Date()); + sendMailRecord1.setCreateBy(getUsername()); + if (resEmailFlag) { + sendMailRecord1.setSendStatus(1); + }else { + sendMailRecord1.setSendStatus(0); + } + sendMailRecordMapper.saveSendMailRecord(sendMailRecord1); + if(!appEmailFlag&&!resEmailFlag){ + throw new ServiceException("裁决书发送失败"); + } + if(!appEmailFlag){ + throw new ServiceException("申请人裁决书发送失败"); + } + if(!resEmailFlag){ + throw new ServiceException("被申请人裁决书发送失败"); + } + // 发送短信 + if (appEmailFlag||resEmailFlag) { + + if (CollectionUtil.isNotEmpty(caseAffiliates)) { + SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); + request.setTemplateId("1990362"); + for (CaseAffiliate affiliate : caseAffiliates) { + String telphone=null; + if(appEmailFlag&&affiliate.getIdentityType()==1){ + telphone = affiliate.getContactTelphone(); + }else if(resEmailFlag&&affiliate.getIdentityType()==2){ + telphone = affiliate.getContactTelphone(); + } + if(StrUtil.isEmpty(telphone)){ + continue; + } + + request.setPhone(telphone); +// if(affiliate.getIdentityType() == 1) { +// request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), appEmail}); +// }else { +// request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), resEmail}); +// } + request.setTemplateParamSet(new String[]{affiliate.getName(), caseApplication1.getCaseNum()}); + Boolean aBoolean = SmsUtils.sendSms(request); + + // 保存短信发送记录 + SmsSendRecord smsSendRecord = new SmsSendRecord(); + smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); + + smsSendRecord.setCaseNum(caseApplication1.getCaseNum()); + smsSendRecord.setPhone(request.getPhone()); + smsSendRecord.setSendTime(new Date()); +// // 尊敬的{1}用户,您的{2}仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。 +// if(affiliate.getIdentityType() == 1) { +// smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +appEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。"); +// }else { +// smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +resEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。"); +// } + smsSendRecord.setSendContent("尊敬的" + affiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。"); + + + smsSendRecord.setCreateBy(getUsername()); + if (aBoolean) { + smsSendRecord.setSendStatus(1); + } else { + smsSendRecord.setSendStatus(0); + } + smsRecordMapper.saveSmsSendRecord(smsSendRecord); + } + + } + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication1.getId(), CaseApplicationConstants.CASE_FILING, ""); + + } + + } + + }else{ + throw new ServiceException("这个批号没有批量送达裁决书的案件"); + } + return AjaxResult.success("仲裁文书送达成功"); + } + /** * 根据仲裁员手机号分页查询等待签署,签署中的裁决书 * -- 2.54.0 From fb8366fa78158d94d311749de030ffb10d31b8b7 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Fri, 5 Jan 2024 17:53:02 +0800 Subject: [PATCH 22/55] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/wisdomarbitrate/CaseApplicationMapper.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 71c28e9..b5652c9 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -856,7 +856,8 @@ -- 2.54.0 From 293dd52e8c21ac34a3369bccdac6ff8deb616773 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Mon, 8 Jan 2024 14:47:19 +0800 Subject: [PATCH 23/55] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A1=88=E4=BB=B6?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/wisdomarbitrate/domain/CaseApplication.java | 1 + .../service/impl/AdjudicationServiceImpl.java | 1 + .../service/impl/CaseApplicationServiceImpl.java | 6 ++++++ .../service/impl/CaseArbitrateServiceImpl.java | 1 + .../mapper/wisdomarbitrate/CaseApplicationMapper.xml | 7 +++++++ 5 files changed, 16 insertions(+) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 313cc73..b514c80 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -50,6 +50,7 @@ public class CaseApplication extends BaseEntity { /** 案件状态 */ private Integer caseStatus; + private String caseStatusstr; /** 申请人是否书面审理 */ private Integer applicantIsWrittenHear; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index b27883a..3afe6b9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -610,6 +610,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } //修改案件状态 caseApplicationById.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); + caseApplicationById.setLockStatus(1); caseApplicationMapper.submitCaseApplication(caseApplicationById); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 7005ca1..7771695 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -409,6 +409,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { public int updateHeardate(CaseApplication caseApplication) { // caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); + caseApplication.setLockStatus(1); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); //1975139 修改开庭时间通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已改为{3},请知晓,如非本人操作,请忽略本短信 //发送短信通知 @@ -1706,6 +1707,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(",")); caseApplication.setArbitratorId(idstr); caseApplication.setArbitratorName(arbitratorNamestr); + caseApplication.setLockStatus(1); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } } else { @@ -1718,6 +1720,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(",")); caseApplication.setArbitratorId(idstr); caseApplication.setArbitratorName(arbitratorNamestr); + caseApplication.setLockStatus(1); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } } @@ -2571,7 +2574,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList()); List caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList()); String caseStatusName = caseStatusNamesnew.stream().map(Object::toString).collect(Collectors.joining(",")); + String caseStatusstr = caseStatussnew.stream().map(Object::toString).collect(Collectors.joining(",")); caseApplicationselect.setCaseStatusName(caseStatusName); + caseApplicationselect.setCaseStatusstr(caseStatusstr); } } } @@ -3253,6 +3258,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); + caseApplication.setLockStatus(1); Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); int rows = 0; //同意组庭 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index a0f3e34..1737806 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -123,6 +123,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { } } + caseApplication1.setLockStatus(1); int i = caseApplicationMapper.submitCaseApplication(caseApplication1); if (i > 0) { String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理"; diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index b5652c9..d3e063a 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -492,6 +492,9 @@ AND t1.case_num = #{caseNum} + + AND t1.batch_number = #{batchNumber} + AND t1.application_organ_id=#{nameId} AND t1.identity_type=1 @@ -841,6 +844,9 @@ AND c.case_num = #{caseNum} + + AND c.batch_number = #{batchNumber} + AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 @@ -1141,6 +1147,7 @@ objecti_juris = #{objectiJuris}, is_absence = #{isAbsence}, + lock_status = #{lockStatus}, appli_is_absen = #{appliIsAbsen}, respon_cross_opin = #{responCrossOpin}, applica_cross_opin = #{applicaCrossOpin}, -- 2.54.0 From 088bd41d0b77f1c8e8b16b6e81d0cee2c0d7fb84 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Tue, 9 Jan 2024 11:41:16 +0800 Subject: [PATCH 24/55] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E9=80=81=E8=BE=BE=E8=A3=81=E5=86=B3=E4=B9=A6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 2 +- .../mapper/CaseApplicationMapper.java | 2 + .../service/impl/AdjudicationServiceImpl.java | 5 +- .../impl/CaseApplicationServiceImpl.java | 98 ++++++++++++++-- .../wisdomarbitrate/CaseApplicationMapper.xml | 107 ++++++++++++++++++ 5 files changed, 204 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index da230f3..781d79e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -200,7 +200,7 @@ public class AdjudicationController extends BaseController { * @return */ @PostMapping("/serviceBatch") - public AjaxResult serviceBatch( CaseApplication caseApplication){ + public AjaxResult serviceBatch(@Validated @RequestBody CaseApplication caseApplication){ if(StrUtil.isEmpty(caseApplication.getBatchNumber().toString())){ return error("参数校验失败"); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index 3145ff4..0ecd151 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -137,4 +137,6 @@ public interface CaseApplicationMapper { List selectAdminCaseApplicationListBatch(CaseApplication caseApplication); List listCaseApplicationByBatchNumber(CaseApplication caseApplication); + + List selectAdminCaseApplicationListBatch1(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 3afe6b9..09c3c33 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -610,7 +610,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } //修改案件状态 caseApplicationById.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); - caseApplicationById.setLockStatus(1); + Integer arbitratMethod = caseApplicationById.getArbitratMethod(); + if(arbitratMethod==1){ + caseApplicationById.setLockStatus(1); + } caseApplicationMapper.submitCaseApplication(caseApplicationById); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 7771695..556fb5f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -2561,7 +2561,89 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override public List selectCaseApplicationListBatchByRole(CaseApplication caseApplication) { - List caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication); + // 获取登录用户 + LoginUser loginUser = getLoginUser(); + SysUser user = loginUser.getUser(); + Long userId = user.getUserId(); + SysUser sysUser = sysUserMapper.selectUserById(userId); + List roles = sysUser.getRoles(); + // 没有角色不能查看案件列表 + if (CollectionUtil.isEmpty(roles)) { + throw new ServiceException("该用户没有角色权限"); + } + for (SysRole role : roles) { + if (StrUtil.isEmpty(role.getRoleName())) { + continue; + } + if ("超级管理员".equals(role.getRoleName())) { + List caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication); + if(caseApplicationlist!=null&&caseApplicationlist.size()>0){ + for(CaseApplication caseApplicationselect : caseApplicationlist){ + Integer batchNumber = caseApplicationselect.getBatchNumber(); + CaseApplication caseApplicationsel = new CaseApplication(); + caseApplicationsel.setBatchNumber(batchNumber); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + if (caseApplications != null && caseApplications.size() > 0) { + List caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList()); + List caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList()); + List caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList()); + List caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList()); + String caseStatusName = caseStatusNamesnew.stream().map(Object::toString).collect(Collectors.joining(",")); + String caseStatusstr = caseStatussnew.stream().map(Object::toString).collect(Collectors.joining(",")); + caseApplicationselect.setCaseStatusName(caseStatusName); + caseApplicationselect.setCaseStatusstr(caseStatusstr); + } + } + } + return caseApplicationlist; + + } + + if ("仲裁委".equals(role.getRoleName()) + || "部门长".equals(role.getRoleName())) { + List caseStatusList = new ArrayList<>(); + caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); + // caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); + caseApplication.setDeptHeadStatus(caseStatusList); + caseApplication.setIsOtherRole(1); + } + if ("仲裁员".equals(role.getRoleName())) { + caseApplication.setUserId(String.valueOf(userId)); + caseApplication.setIsOtherRole(1); + } + if ("财务".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); + caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); + } + if ("法律顾问".equals(role.getRoleName())) { + // 秘书查看所有案件 + // 查询角色有关的用户部门 + List deptIds = new ArrayList<>(); + deptIds.add(sysUser.getDeptId()); + caseApplication.setDeptIds(deptIds); + } + if ("申请人".equals(role.getRoleName())) { + // caseApplication.setIsOtherRole(1); + // 查询有关的用户部门 + caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId())); + } + if ("被申请人".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); + // + caseApplication.setIdCard(String.valueOf(sysUser.getIdCard())); + } + if ("代理人".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); + // 查询角色有关的用户部门 + // List agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); + List agentDeptIds = new ArrayList<>(); + agentDeptIds.add(sysUser.getDeptId()); + caseApplication.setAgentDeptIds(agentDeptIds); + } + + } + List caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch1(caseApplication); if(caseApplicationlist!=null&&caseApplicationlist.size()>0){ for(CaseApplication caseApplicationselect : caseApplicationlist){ Integer batchNumber = caseApplicationselect.getBatchNumber(); @@ -2895,18 +2977,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); - ArbitrateRecord arbitrateRecordnew = caseApplicationse.getArbitrateRecord(); + + ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); + arbitrateRecordsel.setCaseAppliId(caseApplicationse.getId()); + ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); if(arbitrateRecordnew!=null){ arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion()); arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject()); - arbitrateRecordnew.setCaseAppliId(caseApplicationse.getId()); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew); }else { - ArbitrateRecord arbitrateRecordnew1 = new ArbitrateRecord(); - arbitrateRecordnew1.setCheckOpinion(arbitrateRecord.getCheckOpinion()); - arbitrateRecordnew1.setArbitrateReject(arbitrateRecord.getArbitrateReject()); - arbitrateRecordnew1.setCaseAppliId(caseApplicationse.getId()); - arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordnew1); + arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion()); + arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject()); + arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel); } caseApplicationse.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index d3e063a..08861cf 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -879,6 +879,113 @@ order by c.batch_number desc + + + - - select DISTINCT(c.id) id,0 as pendingStatus,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' ELSE '无审理方式' @@ -860,7 +752,7 @@ order by c.case_num desc - SELECT DISTINCT c.batch_number ,c.arbitrat_method ,c.arbitrator_name , c.arbitrator_id ,a.identity_type ,a.name ,a.application_organ_id as applicationOrganId, a.application_organ_name as applicantName, @@ -879,7 +771,7 @@ order by c.batch_number desc - SELECT DISTINCT t1.batch_number ,t1.arbitrat_method ,t1.arbitrator_name , t1.arbitrator_id ,t1.identity_type ,t1.name ,t1.applicationOrganId , t1.applicantName,t1.arbitratMethodName @@ -1039,7 +931,7 @@ - select count(1) from case_application c @@ -1047,7 +939,7 @@ - + insert into case_application( id , case_name , @@ -1195,7 +1087,7 @@ ; - + update case_application case_subject_amount = #{caseSubjectAmount}, @@ -1238,7 +1130,7 @@ where id = #{id} - + update case_application case_status = #{caseStatus}, @@ -1290,7 +1182,7 @@ update case_application set version = #{version} where id = #{id} - + delete from case_application where id = #{id} @@ -1316,7 +1208,7 @@ ; - select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' ELSE '无审理方式' @@ -1394,7 +1286,7 @@ - select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' ELSE '无审理方式' -- 2.54.0 From 2f3b5645aaad0a5e055318a9969035a859fc319c Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Sun, 28 Apr 2024 13:55:46 +0800 Subject: [PATCH 35/55] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A1=88=E4=BB=B6?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-system/pom.xml | 5 +++++ .../wisdomarbitrate/domain/ArbitrateRecord.java | 2 +- .../com/ruoyi/wisdomarbitrate/domain/CaseAttach.java | 9 +++++---- .../domain/CaseEvidenceDirectory.java | 2 +- .../com/ruoyi/wisdomarbitrate/domain/SealManage.java | 2 +- .../domain/vo/CaseEvidenceDirectoryVO.java | 6 +++--- .../wisdomarbitrate/mapper/CaseAttachMapper.java | 2 +- .../service/impl/AdjudicationServiceImpl.java | 2 +- .../service/impl/CaseApplicationServiceImpl.java | 12 ++++++++---- .../service/impl/CaseArbitrateServiceImpl.java | 2 +- .../service/impl/DeptIdentifyServiceImpl.java | 4 ++-- .../utils/FixSelectFlowDetailUtils.java | 6 +++--- .../wisdomarbitrate/CaseApplicationLogMapper.xml | 2 +- tkgenerator/pom.xml | 2 +- .../src/main/resources/generator/config.properties | 6 +++--- 15 files changed, 37 insertions(+), 27 deletions(-) diff --git a/ruoyi-system/pom.xml b/ruoyi-system/pom.xml index 6e4ef07..5912418 100644 --- a/ruoyi-system/pom.xml +++ b/ruoyi-system/pom.xml @@ -39,6 +39,11 @@ mapper-spring-boot-starter 2.1.5 + + org.projectlombok + lombok + 1.18.22 + \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java index eed8844..f5c36c5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java @@ -28,7 +28,7 @@ public class ArbitrateRecord extends BaseEntity { /** 仲裁员审核裁决书意见 */ private String arbitraCheckOpinion; /** 裁决书附件id */ - private Integer annexId; + private Long annexId; /** 被申请人是否缺席 */ private Integer isAbsence; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java index e39680a..7a3baf2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java @@ -1,19 +1,20 @@ package com.ruoyi.wisdomarbitrate.domain; + import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -@Data @Builder +@Data @AllArgsConstructor @NoArgsConstructor -public class CaseAttach { +public class CaseAttach { /** - * 附件id + * 附件id */ - private Integer annexId; + private Long annexId; /** * 案件申请id */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseEvidenceDirectory.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseEvidenceDirectory.java index 57c29de..a5f3527 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseEvidenceDirectory.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseEvidenceDirectory.java @@ -34,7 +34,7 @@ public class CaseEvidenceDirectory extends BaseEntity { /** * 附件id */ - private Integer annexId; + private Long annexId; /** * 级数 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealManage.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealManage.java index 3b835d8..84371fe 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealManage.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealManage.java @@ -29,7 +29,7 @@ public class SealManage extends BaseEntity { /** * 附件id */ - private Integer annexId; + private Long annexId; /** * 印章审核状态(0未通过,1通过) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceDirectoryVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceDirectoryVO.java index 51e0d62..2cc5d1f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceDirectoryVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceDirectoryVO.java @@ -30,7 +30,7 @@ public class CaseEvidenceDirectoryVO implements Serializable { /** * 附件id */ - private Integer annexId; + private Long annexId; /** * 级数 @@ -105,11 +105,11 @@ public class CaseEvidenceDirectoryVO implements Serializable { this.evidenceName = evidenceName; } - public Integer getAnnexId() { + public Long getAnnexId() { return annexId; } - public void setAnnexId(Integer annexId) { + public void setAnnexId(Long annexId) { this.annexId = annexId; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index ca3bb75..7e0d475 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -25,7 +25,7 @@ public interface CaseAttachMapper { List getCaseAttachByCaseIdAndType(CaseAttach caseAttach); - CaseAttach queryAnnexById(Integer annexId); + CaseAttach queryAnnexById(@Param("annexId")Long annexId); /** * 根据案件id和附件类型删除和上传类型 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 470221c..b7bf1ed 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -604,7 +604,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { int i = caseAttachMapper.save(caseAttach); if (i > 0) { if (arbitrateRecordSelect != null) { - Integer annexId = caseAttach.getAnnexId(); + Long annexId = caseAttach.getAnnexId(); //将附件id保存到仲裁记录表里面 arbitrateRecordSelect.setAnnexId(annexId); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordSelect); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 62bc728..ba797cd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -35,6 +35,7 @@ import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils; import com.ruoyi.wisdomarbitrate.utils.ZipFileUtils; import com.tencentyun.TLSSigAPIv2; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -593,7 +594,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { .annexType(annexType) .build(); int i = caseAttachMapper.save(caseAttach); - Integer annexId = caseAttach.getAnnexId(); + Long annexId = caseAttach.getAnnexId(); //保存到目录表 Long parentId = null; @@ -1368,9 +1369,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (CollectionUtil.isNotEmpty(filterList)) { for (CaseAttach caseAttach : filterList) { // 查询附件表 - CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); - attach.setCaseAppliLogId(caseApplication.getCaseLogId()); - caseAttachLogMapper.save(attach); + Long annexId = caseAttach.getAnnexId(); + CaseAttach attach = caseAttachMapper.queryAnnexById(annexId); + if(attach!=null){ + attach.setCaseAppliLogId(caseApplication.getCaseLogId()); + caseAttachLogMapper.save(attach); + } } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index 1737806..c4cc76c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -609,7 +609,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { int i = caseAttachMapper.save(caseAttach); if (i > 0) { if (arbitrateRecord1 != null) { - Integer annexId = caseAttach.getAnnexId(); + Long annexId = caseAttach.getAnnexId(); //将附件id保存到仲裁记录表里面 arbitrateRecord1.setAnnexId(annexId); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java index 509fce0..8741ab4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java @@ -253,7 +253,7 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { int i1 = caseAttachMapper.save(caseAttach); if (i1 > 0) { //将附件id保存到公章管理表里 - Integer annexId1 = caseAttach.getAnnexId(); + Long annexId1 = caseAttach.getAnnexId(); SealManage sealManage = new SealManage(); sealManage.setSealId(sealId); List selectSealList = sealManageMapper.selectSealList(sealManage); @@ -287,7 +287,7 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { List selectSealList = sealManageMapper.selectSealList(sealManage); if (selectSealList != null && selectSealList.size() > 0) { for (SealManage sealManage1 : selectSealList) { - Integer annexId = sealManage1.getAnnexId(); + Long annexId = sealManage1.getAnnexId(); if (annexId != null) { //根据附件id查询路径 CaseAttach caseAttach = caseAttachMapper.queryAnnexById(annexId); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java index c37bcef..f176afc 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -243,7 +243,7 @@ public class FixSelectFlowDetailUtils { //将印章信息保存到公章管理表里 String sealName1 = sealName.substring(1, sealName.length() - 1); String sealId1 = sealId.substring(1, sealId.length() - 1); - Integer annexId1 = caseAttach.getAnnexId(); + Long annexId1 = caseAttach.getAnnexId(); sealManage.setAnnexId(annexId1); sealManage.setSealId(sealId1); sealManage.setSealName(sealName1); @@ -287,7 +287,7 @@ public class FixSelectFlowDetailUtils { if (sealManageList != null && sealManageList.size() > 0) { for (SealManage sealManage1 : sealManageList) { //查询企业内部印章 - Integer annexId = sealManage1.getAnnexId(); + Long annexId = sealManage1.getAnnexId(); String sealId = sealManage1.getSealId(); DeptIdentify deptIdentify = new DeptIdentify(); deptIdentify.setId(sealManage1.getIdentifyId()); @@ -336,7 +336,7 @@ public class FixSelectFlowDetailUtils { int i1 = caseAttachMapper.save(caseAttach); if (i1 > 0) { //将附件id保存到公章管理表里 - Integer annexId1 = caseAttach.getAnnexId(); + Long annexId1 = caseAttach.getAnnexId(); sealManage1.setAnnexId(annexId1); sealManage1.setSealStatus(1); sealManage1.setIsUse(0); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml index 5aca5c5..78966d3 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationLogMapper.xml @@ -90,7 +90,7 @@ mediation_agreement, create_time )values( - #{id} , + #{caseLogId} , #{caseAppliId}, #{caseName}, #{caseNum}, diff --git a/tkgenerator/pom.xml b/tkgenerator/pom.xml index 46b2da0..ceb1fdb 100644 --- a/tkgenerator/pom.xml +++ b/tkgenerator/pom.xml @@ -14,7 +14,7 @@ tkgenerator tkmappergenerator - 11 + 1.8 diff --git a/tkgenerator/src/main/resources/generator/config.properties b/tkgenerator/src/main/resources/generator/config.properties index e02b6a3..2d91392 100644 --- a/tkgenerator/src/main/resources/generator/config.properties +++ b/tkgenerator/src/main/resources/generator/config.properties @@ -5,8 +5,8 @@ jdbc.password=YMzc157# #目标模块项目路径 targetprojectpath=D:/WorkCode/zhongcai/Arbitrate-Backend/ruoyi-system #模块名称 -moduleName=flow +moduleName=attach #表名 -tableName=gen_table +tableName=case_attach #主键 -premaryId=table_id +premaryId=annex_id -- 2.54.0 From 374841e417f27be4ff907d23c00b4c531c0ee635 Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Sun, 28 Apr 2024 18:36:16 +0800 Subject: [PATCH 36/55] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=81=E8=BE=BE?= =?UTF-8?q?=E7=AD=BE=E6=94=B6=E6=96=87=E4=BB=B6=E4=B8=8B=E8=BD=BD=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/CaseApplication.java | 5 +- .../service/impl/AdjudicationServiceImpl.java | 233 ++++++++---------- .../service/impl/DownFileService.java | 76 ++++++ 3 files changed, 187 insertions(+), 127 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DownFileService.java diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 14b2cf6..ba506ac 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -227,7 +227,10 @@ public class CaseApplication extends BaseEntity { private List caseStatusList; private List annexTypeList; - + /** + * 立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5) + * 被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)、视频录制(9)、公章图片(10)、语音转录文件(11) + */ private Integer annexType; /** * 案件附件列表 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index b7bf1ed..2dd4e37 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -10,64 +10,55 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.constant.FileTransformation; -import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; -import com.ruoyi.common.utils.*; +import com.ruoyi.common.utils.EmailOutUtil; +import com.ruoyi.common.utils.ObjectFieldUtils; +import com.ruoyi.common.utils.SmsUtils; +import com.ruoyi.common.utils.WordUtil; import com.ruoyi.common.utils.file.SaaSAPIFileUtils; import com.ruoyi.common.utils.thread.MultipleThreadListParam; -import com.ruoyi.common.utils.thread.MultipleThreadWorkUtil; import com.ruoyi.system.mapper.SysDictDataMapper; import com.ruoyi.wisdomarbitrate.StringIdsReq; -import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO; -import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; -import com.ruoyi.wisdomarbitrate.mapper.*; -import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.vo.ArchivesDetailVO; +import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO; +import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; import com.ruoyi.wisdomarbitrate.domain.vo.LogisticsInfoVO; +import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService; +import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.wisdomarbitrate.utils.SignAward; import lombok.extern.slf4j.Slf4j; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFParagraph; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBookmark; -import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.MailSendException; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import java.io.*; -import java.math.BigDecimal; import java.net.HttpURLConnection; import java.net.URL; import java.net.URLEncoder; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; -import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.util.*; -import java.util.concurrent.CountDownLatch; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import static com.ruoyi.common.utils.PageUtils.startPage; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @Service @@ -110,15 +101,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 仲裁反请求模板内容 - private final String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + - "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + - "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; + private final String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; // 财产保全内容 - String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + - "第二十八条之规定,将该申请提交至法院。"; + String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + "第二十八条之规定,将该申请提交至法院。"; // 管辖权异议 - String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" + - ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; + String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" + ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; // 线上开庭时+线上仲裁 String onLineDate = "{{onLineDate}}"; String onLine = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + onLineDate + "通过仲裁委智慧仲裁平台开庭审理了本案。"; @@ -129,10 +116,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { String writtenDate = "{{writtenDate}}"; String written = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于" + writtenDate + "在仲裁委所在地开庭审理了本案。仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,根据《2022年版仲裁规则》第五十八条的规定对本案进行了书面审理。 "; //开庭+缺席审理 - String absent = "申请人的特别授权委托代理人{{agentName}}" + "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + - "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" + - " \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。" + "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; + String absent = "申请人的特别授权委托代理人{{agentName}}" + "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明,\" +\n" + " \"发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。" + "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; // 开庭+出席 String attend = "申请人的特别授权委托代理人{{agentName}}和被申请人本人出席了庭审。 "; // 开庭+出席+被申提供证据 @@ -140,14 +124,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 开庭+出席+被申未提供证据 String onLineAttend = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;申请人出示了证据材料,被申请人对对方的证据材料进行了质证; 双方当事人均回答了仲裁庭的提问,进行了辩论,并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。 "; // 被申请人出席答辩意见 - String resAttendOpinion = "\n(二)被申请人的答辩意见 \n(三)当事人提供的证据材料及对方的质证意见\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}\n被申请人对上述材料的质证意见为:{{respondentOpinion}}\n"; + String resAttendOpinion = "\n(二)被申请人的答辩意见 \n(三)当事人提供的证据材料及对方的质证意见\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}\n被申请人对上述材料的质证意见为:{{respondentOpinion}}\n"; // 被申请人出席+被申请人提供了资料 - String resFile = "被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" + - "申请人对上述材料的质证意见为:{{applicantOpinion}}"; + String resFile = "被申请人向仲裁庭提交了如下证据材料:\n{{resFile}}" + "申请人对上述材料的质证意见为:{{applicantOpinion}}"; // 被申请人缺席 - String resAbsent = "(二)当事人提供的证据材料\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}"; + String resAbsent = "(二)当事人提供的证据材料\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:\n{{applicantFile}}"; // 日期格式化年月日 SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); @@ -528,9 +509,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { default: break; } - } else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码") - || dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("法定代表人职位") - || dictData.getDictLabel().contains("代理人")) { + } else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码") || dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("法定代表人职位") || dictData.getDictLabel().contains("代理人")) { CaseAffiliate affiliate = affiliateMap.get(1); if (affiliate == null) { continue; @@ -588,12 +567,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { * @param arbitrateRecordSelect 出裁决书生成记录 */ private void saveArbitorFile(Long id, String saveName, String savePath, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect) { - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(3) - .build(); + CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id).annexName(saveName).annexPath(savePath).annexType(3).build(); //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增 List caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach); if (caseAttachList != null && caseAttachList.size() > 0) { @@ -614,7 +588,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { //修改案件状态 caseApplicationById.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); Integer arbitratMethod = caseApplicationById.getArbitratMethod(); - if(arbitratMethod==1){ + if (arbitratMethod == 1) { caseApplicationById.setLockStatus(1); } caseApplicationMapper.submitCaseApplication(caseApplicationById); @@ -657,12 +631,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService { //电子邮件送达 JavaMailSender javaMailSender = emailOutUtil.rebuildMailSender(); if (appEmail != null) { - emailOutUtil.sendMessageCarryFile(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file - , "hjbjava@163.com", javaMailSender); + emailOutUtil.sendMessageCarryFile(appEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file, "hjbjava@163.com", javaMailSender); } if (resEmail != null) { - emailOutUtil.sendMessageCarryFile(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file - , "hjbjava@163.com", javaMailSender); + emailOutUtil.sendMessageCarryFile(resEmail, "案件裁决书", "您的裁决书已送达,详情请查阅附件", file, "hjbjava@163.com", javaMailSender); } //修改案件状态 @@ -709,10 +681,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { String trackNum = affiliate.getTrackNum(); if (trackNum != null) { // 构造查询字符串参数 - String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d", - URLEncoder.encode(key, "UTF-8"), - URLEncoder.encode(com, "UTF-8"), - URLEncoder.encode(trackNum, "UTF-8"), null); + String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d", URLEncoder.encode(key, "UTF-8"), URLEncoder.encode(com, "UTF-8"), URLEncoder.encode(trackNum, "UTF-8"), null); // 拼接到API URL中 String fullUrl = apiUrl + "?" + queryParameters; URL url = new URL(fullUrl); @@ -782,6 +751,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.success("归档成功,案件状态已改为已归档"); } + @Autowired + DownFileService downFileService; + @Override @Transactional public AjaxResult service(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum) { @@ -800,11 +772,42 @@ public class AdjudicationServiceImpl implements IAdjudicationService { int startIndex = prefix.length(); String path = caseAttach.getAnnexPath() + annexName.substring(startIndex); File file = new File(path); - // todo 部署放开 + //判断文件是否存在 if (!file.exists()) { - return AjaxResult.error("未生成裁决书"); +// return AjaxResult.error("未生成裁决书"); + //若不存在则从e签宝下载PDF文件 + try { + SealSignRecord sealSignRecord = new SealSignRecord(); + sealSignRecord.setCaseAppliId(caseApplication.getId()); + //3为"签署用印记录表"的状态为签署完成 + sealSignRecord.setSignFlowStatus(3); + List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); + if (sealSignRecords != null && sealSignRecords.size() > 0) { + SealSignRecord sealSignRecord1 = sealSignRecords.get(0); + downFileService.downPdfFileFormEsign(sealSignRecord1.getSignFlowid(), caseAttach.getCaseAppliId()); + //下载成功后重新查询 + List caseAttachList1 = caseAttachMapper.queryCaseAttachList(caseApplication1); + for (CaseAttach caseAttach1 : caseAttachList1) { + if (caseAttach1.getAnnexType() == 3) { + annexName = caseAttach.getAnnexName(); + prefix = "/profile/upload/"; + startIndex = prefix.length(); + path = caseAttach.getAnnexPath() + annexName.substring(startIndex); + File file1 = new File(path); + if (!file1.exists()) { + return AjaxResult.error("未生成裁决书"); + } + caseAttachList = caseAttachList1; + break; + } + } + } + } catch (Exception e) { + e.printStackTrace(); + } } - + //找到签署后的PDF文件后调出该循环 + break; } } } @@ -857,33 +860,33 @@ public class AdjudicationServiceImpl implements IAdjudicationService { sendMailRecord1.setCreateBy(getUsername()); if (resEmailFlag) { sendMailRecord1.setSendStatus(1); - }else { + } else { sendMailRecord1.setSendStatus(0); } sendMailRecordMapper.saveSendMailRecord(sendMailRecord1); - if(!appEmailFlag&&!resEmailFlag){ + if (!appEmailFlag && !resEmailFlag) { throw new ServiceException("裁决书发送失败"); } - if(!appEmailFlag){ + if (!appEmailFlag) { throw new ServiceException("申请人裁决书发送失败"); } - if(!resEmailFlag){ + if (!resEmailFlag) { throw new ServiceException("被申请人裁决书发送失败"); } // 发送短信 - if (appEmailFlag||resEmailFlag) { + if (appEmailFlag || resEmailFlag) { if (CollectionUtil.isNotEmpty(caseAffiliates)) { SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); request.setTemplateId("1990362"); for (CaseAffiliate affiliate : caseAffiliates) { - String telphone=null; - if(appEmailFlag&&affiliate.getIdentityType()==1){ - telphone = affiliate.getContactTelphone(); - }else if(resEmailFlag&&affiliate.getIdentityType()==2){ - telphone = affiliate.getContactTelphone(); + String telphone = null; + if (appEmailFlag && affiliate.getIdentityType() == 1) { + telphone = affiliate.getContactTelphone(); + } else if (resEmailFlag && affiliate.getIdentityType() == 2) { + telphone = affiliate.getContactTelphone(); } - if(StrUtil.isEmpty(telphone)){ + if (StrUtil.isEmpty(telphone)) { continue; } @@ -966,9 +969,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅", appUid +"裁决书", fileList, null); // // Thread.sleep(20); // 收到退信的所有id,即发送失败的uuid - // emailOutUtil.receiverMail(); - // Thread.sleep(3); - // List messageIds = emailOutUtil.receiverMail(); + // emailOutUtil.receiverMail(); + // Thread.sleep(3); + // List messageIds = emailOutUtil.receiverMail(); // if (aBoolean&&(CollectionUtil.isEmpty(messageIds)||!messageIds.contains(appUid))) { // return Boolean.TRUE; // } @@ -1085,9 +1088,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("acceptDate", registerDateStr); //反请求 Integer adjudicaCounter = caseApplication1.getAdjudicaCounter(); - String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + - "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + - "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; + String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; if (adjudicaCounter == null) { datas.put("counterclaim", null); } else if (adjudicaCounter == 1) { @@ -1097,8 +1098,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } //财产保全 Integer properPreser = caseApplication1.getProperPreser(); - String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + - "第二十八条之规定,将该申请提交至法院。"; + String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + "第二十八条之规定,将该申请提交至法院。"; if (properPreser == null) { datas.put("preservation", null); } else if (properPreser == 1) { @@ -1108,8 +1108,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } //管辖权异议 Integer objectiJuris = caseApplication1.getObjectiJuris(); - String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" + - ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; + String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" + ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; if (objectiJuris == null) { datas.put("jurisdictionalObjection", null); } else if (objectiJuris == 1) { @@ -1160,14 +1159,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } else if (isAbsence == 1) { //缺席审理 String absent1 = "申请人的特别授权委托代理人"; - String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + - "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。"; - String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," + - "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。"; - String absent4 = "(二/三)当事人提供的证据材料\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; - String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; + String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。"; + String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," + "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。"; + String absent4 = "(二/三)当事人提供的证据材料\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; + String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; datas.put("absent1", absent1); datas.put("absent2", absent2); datas.put("absent3", absent3); @@ -1179,13 +1174,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { String attend1 = "申请人的特别授权委托代理人"; String attend2 = "和被申请人本人/的特别授权委托代理人"; String attend3 = "出席了庭审。"; - String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" + - "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," + - "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," + - "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。"; + String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" + "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," + "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," + "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。"; String attend5 = "(二)被申请人的答辩意见"; - String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; + String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; String attend7 = "被申请人对上述材料的质证意见为:"; datas.put("attend1", attend1); datas.put("attend2", attend2); @@ -1199,13 +1190,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService { datas.put("resAgentName", nameAgentList.get(1)); if (arbitratMethod == 1) { //被申出席+开庭 - String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第五十一条的规定,裁决如下:"; + String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第五十一条的规定,裁决如下:"; datas.put("attend8", attend8); } else { //被申出席+书面 - String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第五十一条、第五十八条的规定,裁决如下:"; + String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第五十一条、第五十八条的规定,裁决如下:"; datas.put("attend9", attend9); } } @@ -1221,8 +1210,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (isImageFile) { String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); System.out.println("路径是===========" + annexPath); - PictureRenderData pictureRenderData = WordUtil - .rebuildImageContent(100, 100, null, annexPath); + PictureRenderData pictureRenderData = WordUtil.rebuildImageContent(100, 100, null, annexPath); datas.put("resEvidenceMaterial", pictureRenderData); } } else if (caseAttach.getAnnexType() == 2) { //申请人证据材料 @@ -1231,8 +1219,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (isImageFile) { String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); System.out.println("路径是===========" + annexPath); - PictureRenderData pictureRenderData = WordUtil - .rebuildImageContent(100, 100, null, annexPath); + PictureRenderData pictureRenderData = WordUtil.rebuildImageContent(100, 100, null, annexPath); //申请人证据材料 datas.put("appEvidenceMaterial", pictureRenderData); } @@ -1270,12 +1257,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { //将裁决书更新到附件表里 - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(3) - .build(); + CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id).annexName(saveName).annexPath(savePath).annexType(3).build(); int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach); @@ -1408,9 +1390,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { Gson gson = new Gson(); if (StrUtil.isNotEmpty(identityInfo.getBody())) { JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class); - if(identityInfoJsonObject!=null&&!identityInfoJsonObject.get("data").isJsonNull()) { + if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) { JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data"); - if (identityInfoData != null && !identityInfoData.get("psnId") .isJsonNull()) { + if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) { idsReq.setPsnId(identityInfoData.get("psnId").getAsString()); } } @@ -1423,7 +1405,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class); if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) { JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); - if (signUrlData != null&& !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) { + if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) { // 免登录批量签链接(链接有效期2小时) String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString(); // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时) @@ -1459,7 +1441,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } Integer batchNumber = idsReq.getBatchNumber(); Integer caseStatus = CaseApplicationConstants.SIGN_ARBITRATION; - List caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber,caseStatus); + List caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber, caseStatus); if (caseApplications != null && caseApplications.size() > 0) { List signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList()); idsReq.setIds(signFlowIds); @@ -1478,7 +1460,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } - }else{ + } else { throw new ServiceException("这个批号没有批量签名的案件"); } @@ -1498,9 +1480,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { Gson gson = new Gson(); if (StrUtil.isNotEmpty(identityInfo.getBody())) { JsonObject identityInfoJsonObject = gson.fromJson(identityInfo.getBody(), JsonObject.class); - if(identityInfoJsonObject!=null&&!identityInfoJsonObject.get("data").isJsonNull()) { + if (identityInfoJsonObject != null && !identityInfoJsonObject.get("data").isJsonNull()) { JsonObject identityInfoData = identityInfoJsonObject.getAsJsonObject("data"); - if (identityInfoData != null && !identityInfoData.get("psnId") .isJsonNull()) { + if (identityInfoData != null && !identityInfoData.get("psnId").isJsonNull()) { idsReq.setPsnId(identityInfoData.get("psnId").getAsString()); } } @@ -1510,7 +1492,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } Integer batchNumber = idsReq.getBatchNumber(); Integer caseStatus = CaseApplicationConstants.ARBITRATED_SEAL; - List caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber,caseStatus); + List caseApplications = sealSignRecordMapper.selectsignFlow(batchNumber, caseStatus); if (caseApplications != null && caseApplications.size() > 0) { List signFlowIds = caseApplications.stream().map(CaseApplication::getSignFlowId).collect(Collectors.toList()); idsReq.setIds(signFlowIds); @@ -1520,7 +1502,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { JsonObject signUrlJsonObject = gson.fromJson(batchSignUrl.getBody(), JsonObject.class); if (signUrlJsonObject != null && !signUrlJsonObject.get("data").isJsonNull()) { JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); - if (signUrlData != null&& !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) { + if (signUrlData != null && !signUrlData.get("batchSignUrlWithoutLogin").isJsonNull()) { // 免登录批量签链接(链接有效期2小时) String url = signUrlData.get("batchSignUrlWithoutLogin").getAsString(); // batchSignUrl 需登录批量签链接(链接有效期2小时),batchSignShortUrl需登录批量签短链接(链接有效期2小时),batchSignShortUrlWithoutLogin免登录批量签短链接(链接有效期2小时) @@ -1529,7 +1511,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } - }else{ + } else { throw new ServiceException("这个批号没有批量用印的案件"); } } catch (EsignDemoException e) { @@ -1561,7 +1543,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.error(e.getMessage()); } - }else{ + } else { throw new ServiceException("这个批号没有批量归档的案件"); } @@ -1698,33 +1680,33 @@ public class AdjudicationServiceImpl implements IAdjudicationService { sendMailRecord1.setCreateBy(getUsername()); if (resEmailFlag) { sendMailRecord1.setSendStatus(1); - }else { + } else { sendMailRecord1.setSendStatus(0); } sendMailRecordMapper.saveSendMailRecord(sendMailRecord1); - if(!appEmailFlag&&!resEmailFlag){ + if (!appEmailFlag && !resEmailFlag) { throw new ServiceException("裁决书发送失败"); } - if(!appEmailFlag){ + if (!appEmailFlag) { throw new ServiceException("申请人裁决书发送失败"); } - if(!resEmailFlag){ + if (!resEmailFlag) { throw new ServiceException("被申请人裁决书发送失败"); } // 发送短信 - if (appEmailFlag||resEmailFlag) { + if (appEmailFlag || resEmailFlag) { if (CollectionUtil.isNotEmpty(caseAffiliates)) { SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); request.setTemplateId("1990362"); for (CaseAffiliate affiliate : caseAffiliates) { - String telphone=null; - if(appEmailFlag&&affiliate.getIdentityType()==1){ + String telphone = null; + if (appEmailFlag && affiliate.getIdentityType() == 1) { telphone = affiliate.getContactTelphone(); - }else if(resEmailFlag&&affiliate.getIdentityType()==2){ + } else if (resEmailFlag && affiliate.getIdentityType() == 2) { telphone = affiliate.getContactTelphone(); } - if(StrUtil.isEmpty(telphone)){ + if (StrUtil.isEmpty(telphone)) { continue; } @@ -1770,7 +1752,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } - }else{ + } else { throw new ServiceException("这个批号没有批量送达裁决书的案件"); } return AjaxResult.success("仲裁文书送达成功"); @@ -1856,5 +1838,4 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return bookmarkList; } - } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DownFileService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DownFileService.java new file mode 100644 index 0000000..19822cf --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DownFileService.java @@ -0,0 +1,76 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.ruoyi.common.constant.FileTransformation; +import com.ruoyi.common.core.domain.entity.EsignHttpResponse; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.common.utils.file.SaaSAPIFileUtils; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.io.File; +import java.io.IOException; +import java.time.LocalDate; +import java.util.UUID; + +/** + * 下载文件 + */ +@Service +public class DownFileService { + @Autowired + CaseAttachMapper caseAttachMapper; + + /** + * 从E签宝下载签署完成后的PDF文件 + */ + public void downPdfFileFormEsign(String signFlowId, Long caseAppliId) throws EsignDemoException, IOException { + Gson gson = new Gson(); + EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId); + JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class); + JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data"); + JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray(); + if (filesArray != null && filesArray.size() > 0) { + JsonObject fileObject = (JsonObject) filesArray.get(0); + String fileDownloadUrl = fileObject.get("downloadUrl").toString(); + LocalDate now = LocalDate.now(); + String year = Integer.toString(now.getYear()); + String month = String.format("%02d", now.getMonthValue()); + String day = String.format("%02d", now.getDayOfMonth()); + String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; + String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf"; + String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + String savePath = "/home/ruoyi/uploadPath/upload/"; + // 创建日期目录 + File saveFolder = new File(saveFolderPath); + if (!saveFolder.exists()) { + saveFolder.mkdirs(); + } + String resultFilePath = saveFolderPath + "/" + fileName; + File resultFilePathFile = new File(resultFilePath); + if (!resultFilePathFile.exists()) { + resultFilePathFile.createNewFile(); + } + String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); + boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath); + if (downLoadFile) { + //立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)、 + // 被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)、视频录制(9)、公章图片(10)、语音转录文件(11) + caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, 3); + CaseAttach caseAttach = new CaseAttach(); + caseAttach.setCaseAppliId(caseAppliId); + caseAttach.setAnnexType(3); + caseAttach.setAnnexPath(savePath); + caseAttach.setAnnexName(saveName); + caseAttachMapper.save(caseAttach); + } + + } + } + +} -- 2.54.0 From 064b88a86aa3db022f733e88b277b2b7ad889bf3 Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Mon, 29 Apr 2024 09:59:11 +0800 Subject: [PATCH 37/55] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=81=E8=BE=BE?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E6=8F=90=E7=A4=BA=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AdjudicationServiceImpl.java | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 2dd4e37..7706308 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -163,7 +163,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.error("未找到该模板"); } - // todo 部署放开 + // 部署放开 if (templatePath != null) { templatePath = "/home/ruoyi/" + templatePath; } @@ -764,9 +764,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.error("未查询到相关案件"); } List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1); + Boolean isExistPdf = false; if (caseAttachList != null && caseAttachList.size() > 0) { for (CaseAttach caseAttach : caseAttachList) { if (caseAttach.getAnnexType() == 3) { + isExistPdf = true; String annexName = caseAttach.getAnnexName(); String prefix = "/profile/upload/"; int startIndex = prefix.length(); @@ -774,8 +776,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService { File file = new File(path); //判断文件是否存在 if (!file.exists()) { -// return AjaxResult.error("未生成裁决书"); - //若不存在则从e签宝下载PDF文件 + isExistPdf = false; + //若不存在裁决书则从e签宝下载PDF文件 try { SealSignRecord sealSignRecord = new SealSignRecord(); sealSignRecord.setCaseAppliId(caseApplication.getId()); @@ -789,18 +791,26 @@ public class AdjudicationServiceImpl implements IAdjudicationService { List caseAttachList1 = caseAttachMapper.queryCaseAttachList(caseApplication1); for (CaseAttach caseAttach1 : caseAttachList1) { if (caseAttach1.getAnnexType() == 3) { - annexName = caseAttach.getAnnexName(); + isExistPdf = true; + annexName = caseAttach1.getAnnexName(); prefix = "/profile/upload/"; startIndex = prefix.length(); - path = caseAttach.getAnnexPath() + annexName.substring(startIndex); + path = caseAttach1.getAnnexPath() + annexName.substring(startIndex); File file1 = new File(path); if (!file1.exists()) { - return AjaxResult.error("未生成裁决书"); + isExistPdf = false; } + annexName = null; + prefix = null; + path = null; caseAttachList = caseAttachList1; break; } } + //若附件中没有裁决书PDF文件则终止 + if (!isExistPdf) { + return AjaxResult.error("未找到签名后的裁决书"); + } } } catch (Exception e) { e.printStackTrace(); @@ -811,6 +821,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } } + if (!isExistPdf) { + return AjaxResult.error("未找到签名后的裁决书"); + } //修改案件状态 caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING); caseApplicationMapper.submitCaseApplication(caseApplication1); -- 2.54.0 From c19c61affd213fca0f35458e132b6bbe64c4f7f1 Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Mon, 29 Apr 2024 11:19:34 +0800 Subject: [PATCH 38/55] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A1=88=E4=BB=B6?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=90=8D=E7=A7=B0=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CaseEvidenceController.java | 2 +- .../constant/CaseApplicationConstants.java | 14 +-- .../domain/CaseApplication.java | 2 +- .../wisdomarbitrate/domain/CaseAttach.java | 2 +- .../wisdomarbitrate/domain/vo/ToDoCount.java | 14 +-- .../service/impl/AdjudicationServiceImpl.java | 10 +-- .../impl/CaseApplicationServiceImpl.java | 56 ++++++------ .../impl/CaseArbitrateServiceImpl.java | 2 +- .../service/impl/DownFileService.java | 2 +- .../wisdomarbitrate/CaseApplicationMapper.xml | 88 +++++++++---------- .../wisdomarbitrate/CaseLogRecordMapper.xml | 4 +- .../wisdomarbitrate/SealSignRecordMapper.xml | 8 +- 12 files changed, 103 insertions(+), 101 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index 152aacb..8e1b22c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -48,7 +48,7 @@ public class CaseEvidenceController extends BaseController { * 案件证据上传 * * @param file 附件 - * @param annexType 附件类型,立案申请书(1)、证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5) + * @param annexType 附件类型,立案申请书(1)、证据材料(2)、裁决书(3)、案件视频(4)、身份证件(5) * @param id 案件申请id * @return */ diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java index e7802e4..4d7d343 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java @@ -28,17 +28,17 @@ public class CaseApplicationConstants { public static final int PENDING_OPENCOURT_HEAR = 8; /** 待书面审理 */ public static final int PENDING_WRIITEN_HEAR = 9; - /** 待生成仲裁文书 */ + /** 待生成裁决书 */ public static final int GENERATED_ARBITRATION = 10; - /**待秘书核验仲裁文书*/ + /**待秘书核验裁决书*/ public static final int VERPRIF_ARBITRATION = 11; - /**待部门长审核仲裁文书*/ + /**待部门长审核裁决书*/ public static final int CHECK_ARBITRATION = 12; - /**待仲裁文书签名*/ + /**待裁决书签名*/ public static final int SIGN_ARBITRATION = 13; - /** 待仲裁文书用印 */ + /** 待裁决书用印 */ public static final int ARBITRATED_SEAL = 14; - /** 待仲裁文书送达 */ + /** 待裁决书送达 */ public static final int ARBITRATION_DELIVERY = 15; /** 待案件归档*/ public static final int CASE_FILING = 16; @@ -47,7 +47,7 @@ public class CaseApplicationConstants { /** 待修改开庭时间*/ public static final int MODIFY_HEARDATE = 31; - /**待仲裁员审核仲裁文书*/ + /**待仲裁员审核裁决书*/ public static final int HEAD_CHECK_ARBITRATION = 18; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index ba506ac..1c4895b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -228,7 +228,7 @@ public class CaseApplication extends BaseEntity { private List annexTypeList; /** - * 立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5) + * 立案申请书(1)、申请人证据材料(2)、裁决书(3)、案件视频(4)、身份证件(5) * 被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)、视频录制(9)、公章图片(10)、语音转录文件(11) */ private Integer annexType; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java index 7a3baf2..1be717c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java @@ -32,7 +32,7 @@ public class CaseAttach { */ private String annexPath; /** - * 附件类型,立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)、被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)' + * 附件类型,立案申请书(1)、申请人证据材料(2)、裁决书(3)、案件视频(4)、身份证件(5)、被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)' */ private Integer annexType; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java index 7817936..cb49866 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/ToDoCount.java @@ -21,14 +21,14 @@ public class ToDoCount { private int caseApplyArbitrateWay=0; // 待审核仲裁方式 private int caseApplyGroupOnline=0; // 待开庭审理 private int caseApplyGroupOffline=0; // 待书面审理 - private int caseApplyAward=0; // 待生成仲裁文书 - private int caseApplyAwardCheck=0; // 待核验仲裁文书 - private int caseApplyAwardConfirm=0; // 待审核仲裁文书 - private int caseApplyAwardSign=0; // 待仲裁文书签名 - private int caseApplyAwardSeal=0; // 待仲裁文书用印 - private int caseApplyAwardSend=0; // 待仲裁文书送达 + private int caseApplyAward=0; // 待生成裁决书 + private int caseApplyAwardCheck=0; // 待核验裁决书 + private int caseApplyAwardConfirm=0; // 待审核裁决书 + private int caseApplyAwardSign=0; // 待裁决书签名 + private int caseApplyAwardSeal=0; // 待裁决书用印 + private int caseApplyAwardSend=0; // 待裁决书送达 private int caseApplyStored=0; // 待案件归档 private int caseApplyArchived=0; // 已归档 private int updateOnlineHearDate=0; // 待修改开庭时间 - private int arbitratorApplyAwardConfirm=0; // 待仲裁员审核仲裁文书 + private int arbitratorApplyAwardConfirm=0; // 待仲裁员审核裁决书 } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 7706308..1fd156a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -658,7 +658,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } - return AjaxResult.success("仲裁文书送达成功"); + return AjaxResult.success("裁决书送达成功"); } catch (MailSendException e) { return AjaxResult.error("发送失败,请检查文件路径"); } @@ -728,7 +728,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 新增日志 CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATED_SEAL, ""); - return AjaxResult.success("签名成功,案件状态已改为待仲裁文书用印"); + return AjaxResult.success("签名成功,案件状态已改为待裁决书用印"); } @Override @@ -947,7 +947,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 新增日志 CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, ""); - return AjaxResult.success("仲裁文书送达成功"); + return AjaxResult.success("裁决书送达成功"); } /** @@ -1008,7 +1008,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 新增日志 CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATION_DELIVERY, ""); - return AjaxResult.success("用印成功,案件状态已改为待仲裁文书送达"); + return AjaxResult.success("用印成功,案件状态已改为待裁决书送达"); } @Override @@ -1768,7 +1768,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } else { throw new ServiceException("这个批号没有批量送达裁决书的案件"); } - return AjaxResult.success("仲裁文书送达成功"); + return AjaxResult.success("裁决书送达成功"); } /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 41fa66f..abb43de 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -739,24 +739,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseLogRecord9.setContent("仲裁员将进行书面审理"); CaseLogRecord caseLogRecord12 = new CaseLogRecord(); caseLogRecord11.setCaseNode(12); - caseLogRecord11.setCaseNodeName("核验仲裁文书"); - caseLogRecord11.setContent("法律顾问将进行核验仲裁文书"); + caseLogRecord11.setCaseNodeName("核验裁决书"); + caseLogRecord11.setContent("法律顾问将进行核验裁决书"); CaseLogRecord caseLogRecord13 = new CaseLogRecord(); caseLogRecord12.setCaseNode(13); - caseLogRecord12.setCaseNodeName("确认仲裁文书"); - caseLogRecord12.setContent("仲裁员将进行确认仲裁文书"); + caseLogRecord12.setCaseNodeName("确认裁决书"); + caseLogRecord12.setContent("仲裁员将进行确认裁决书"); CaseLogRecord caseLogRecord14 = new CaseLogRecord(); caseLogRecord13.setCaseNode(14); - caseLogRecord13.setCaseNodeName("仲裁文书签名"); - caseLogRecord13.setContent("仲裁员将进行仲裁文书签名"); + caseLogRecord13.setCaseNodeName("裁决书签名"); + caseLogRecord13.setContent("仲裁员将进行裁决书签名"); CaseLogRecord caseLogRecord15 = new CaseLogRecord(); caseLogRecord14.setCaseNode(15); - caseLogRecord14.setCaseNodeName("仲裁文书用印"); - caseLogRecord14.setContent("部门长将进行仲裁文书用印"); + caseLogRecord14.setCaseNodeName("裁决书用印"); + caseLogRecord14.setContent("部门长将进行裁决书用印"); CaseLogRecord caseLogRecord16 = new CaseLogRecord(); caseLogRecord15.setCaseNode(16); - caseLogRecord15.setCaseNodeName("仲裁文书送达"); - caseLogRecord15.setContent("法律顾问将进行仲裁文书送达"); + caseLogRecord15.setCaseNodeName("裁决书送达"); + caseLogRecord15.setContent("法律顾问将进行裁决书送达"); CaseLogRecord caseLogRecord17 = new CaseLogRecord(); caseLogRecord16.setCaseNode(17); caseLogRecord16.setCaseNodeName("案件归档"); @@ -985,33 +985,33 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); break; case "11": - caseLogRecord.setCaseNodeName("核验仲裁文书"); + caseLogRecord.setCaseNodeName("核验裁决书"); caseLogRecord.setCaseNode(11); - caseLogRecord.setContent("法律顾问正在进行核验仲裁文书"); + caseLogRecord.setContent("法律顾问正在进行核验裁决书"); caseLogRecord.setNextRoleName("下一节点角色:部门长"); break; case "12": - caseLogRecord.setCaseNodeName("确认仲裁文书"); + caseLogRecord.setCaseNodeName("确认裁决书"); caseLogRecord.setCaseNode(12); - caseLogRecord.setContent("仲裁员正在进行确认仲裁文书"); + caseLogRecord.setContent("仲裁员正在进行确认裁决书"); caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); break; case "13": - caseLogRecord.setCaseNodeName("仲裁文书签名"); + caseLogRecord.setCaseNodeName("裁决书签名"); caseLogRecord.setCaseNode(13); - caseLogRecord.setContent("仲裁员正在进行仲裁文书签名"); + caseLogRecord.setContent("仲裁员正在进行裁决书签名"); caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); break; case "14": - caseLogRecord.setCaseNodeName("仲裁文书用印"); + caseLogRecord.setCaseNodeName("裁决书用印"); caseLogRecord.setCaseNode(14); - caseLogRecord.setContent("部门长正在进行仲裁文书用印"); + caseLogRecord.setContent("部门长正在进行裁决书用印"); caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); break; case "15": - caseLogRecord.setCaseNodeName("仲裁文书送达"); + caseLogRecord.setCaseNodeName("裁决书送达"); caseLogRecord.setCaseNode(15); - caseLogRecord.setContent("法律顾问正在进行仲裁文书送达"); + caseLogRecord.setContent("法律顾问正在进行裁决书送达"); caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); break; case "16": @@ -1916,7 +1916,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public int verificationArbitrateRecord(CaseApplication caseApplication) { - // 秘书核验裁决书,流转到待仲裁员审核仲裁文书 + // 秘书核验裁决书,流转到待仲裁员审核裁决书 caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); @@ -2128,7 +2128,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); String notes=""; if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())){ - notes="部门长驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); + notes="部门长驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); } // 新增日志 insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes); @@ -2147,7 +2147,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public AjaxResult arbitratorCheckArbitrateRecord(CaseApplication caseApplication) { - // 同意后状态改为待部门长审核仲裁文书(CHECK_ARBITRATION = 12),拒绝改为待秘书核验仲裁文书(VERPRIF_ARBITRATION = 11) + // 同意后状态改为待部门长审核裁决书(CHECK_ARBITRATION = 12),拒绝改为待秘书核验裁决书(VERPRIF_ARBITRATION = 11) int rows = 0; Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); if (agreeOrNotCheck.intValue() == 1) { @@ -2168,7 +2168,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); String notes=""; if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())){ - notes="仲裁员驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); + notes="仲裁员驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); } // 新增日志 insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, notes); @@ -2769,6 +2769,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); if (caseApplications != null && caseApplications.size() > 0) { List caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList()); + System.out.println("ceshi:"+caseStatuss.toString()); List caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList()); List caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList()); List caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList()); @@ -2836,6 +2837,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); if (caseApplications != null && caseApplications.size() > 0) { List caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList()); + System.out.println("ceshi:"+caseStatuss.toString()); List caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList()); List caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList()); List caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList()); @@ -3126,7 +3128,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { int rows = 0; if (caseApplications != null && caseApplications.size() > 0) { for(CaseApplication caseApplicationse:caseApplications){ - // 秘书核验裁决书,流转到待仲裁员审核仲裁文书 + // 秘书核验裁决书,流转到待仲裁员审核裁决书 caseApplicationse.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); // ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); @@ -3179,7 +3181,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); String notes=""; if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())){ - notes="仲裁员驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); + notes="仲裁员驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); } // 新增日志 insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, notes); @@ -3392,7 +3394,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationse.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); String notes=""; if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())){ - notes="部门长驳回仲裁文书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); + notes="部门长驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); } // 新增日志 insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index c4cc76c..499233f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -335,7 +335,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { return AjaxResult.error("请检查参数"); } - //生成仲裁文书 + //生成裁决书 private Boolean generateAward(Long id) { try { Map datas = new HashMap<>(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DownFileService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DownFileService.java index 19822cf..9f9337a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DownFileService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DownFileService.java @@ -59,7 +59,7 @@ public class DownFileService { String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath); if (downLoadFile) { - //立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)、 + //立案申请书(1)、申请人证据材料(2)、裁决书(3)、案件视频(4)、身份证件(5)、 // 被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)、视频录制(9)、公章图片(10)、语音转录文件(11) caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, 3); CaseAttach caseAttach = new CaseAttach(); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 637ba5d..7d004bd 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -77,10 +77,10 @@ CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核仲裁文书' + when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' + when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' + when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核裁决书' when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, @@ -145,10 +145,10 @@ CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核仲裁文书' + when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' + when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' + when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核裁决书' when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, @@ -200,10 +200,10 @@ when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核仲裁文书' + when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' + when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' + when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核裁决书' when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, c.hear_date, @@ -267,10 +267,10 @@ when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核仲裁文书' + when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' + when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' + when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核裁决书' when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, c.hear_date, @@ -335,10 +335,10 @@ when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核仲裁文书' + when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' + when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' + when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核裁决书' when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, c.hear_date, @@ -513,10 +513,10 @@ CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核仲裁文书' + when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' + when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' + when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核裁决书' when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, @@ -706,10 +706,10 @@ CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核仲裁文书' + when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' + when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' + when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核裁决书' when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, @@ -1218,10 +1218,10 @@ CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核仲裁文书' + when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' + when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' + when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核裁决书' when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, @@ -1256,10 +1256,10 @@ CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核仲裁文书' + when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' + when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' + when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核裁决书' when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, @@ -1295,10 +1295,10 @@ CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核仲裁文书' + when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' + when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' + when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核裁决书' when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, @@ -1325,10 +1325,10 @@ CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核仲裁文书' + when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' + when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' + when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核裁决书' when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml index 817be20..76e1801 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -36,10 +36,10 @@ when 6 then '组庭审核' when 7 then '组庭确认' when 8 then '当前仲裁方式为开庭审理' when 9 then '当前仲裁方式为书面审理' when 10 then '书面审理' when 11 then '秘书审核裁决书' when 12 then '部门长核验裁决书' when 13 then '同意裁决书' when 14 then '签名成功' - when 15 then '用印成功' when 16 then '送达仲裁文书' when 17 then '案件归档' + when 15 then '用印成功' when 16 then '送达裁决书' when 17 then '案件归档' when 26 then '证据确认成功' when 31 then '修改开庭时间' - when 18 then '仲裁员审核仲裁文书' + when 18 then '仲裁员审核裁决书' ELSE '无案件状态' END content, CASE cl.case_node when 0 then '申请人' when 1 then '申请人' when 2 then '法律顾问' diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml index 92d4635..f7b21cc 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml @@ -51,10 +51,10 @@ CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待部门长审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核仲裁文书' + when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' + when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' + when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' + when 18 then '待仲裁员审核裁决书' when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, -- 2.54.0 From 0e215afa393fa86aba778f5363a9176b91809781 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Mon, 29 Apr 2024 16:51:40 +0800 Subject: [PATCH 39/55] =?UTF-8?q?=E5=8E=8B=E7=BC=A9=E5=8C=85=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=EF=BC=8C=E8=AF=A6=E6=83=85=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SysUserServiceImpl.java | 18 +++ .../impl/CaseApplicationServiceImpl.java | 7 +- .../service/impl/CaseZipImportImpl.java | 125 ++++++++++-------- .../task/CaseZipImportTask.java | 10 +- .../ruoyi/wisdomarbitrate/utils/OCRUtils.java | 15 ++- .../wisdomarbitrate/CaseAffiliateMapper.xml | 32 +++-- .../wisdomarbitrate/CaseApplicationMapper.xml | 2 +- 7 files changed, 132 insertions(+), 77 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 2f93110..5afffb9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.stream.Collectors; import javax.validation.Validator; +import cn.hutool.core.util.StrUtil; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.system.mapper.*; @@ -259,6 +260,13 @@ public class SysUserServiceImpl implements ISysUserService { @Override @Transactional public AjaxResult insertUser(SysUser user) { + // 校验手机号是否重复 + if(StrUtil.isNotEmpty(user.getPhonenumber())){ + if(userMapper.checkPhoneUnique(user.getPhonenumber())!=null){ + return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + } + Long deptId = user.getDeptId(); Long[] postIds = user.getPostIds(); if (deptId != null) { @@ -296,6 +304,11 @@ public class SysUserServiceImpl implements ISysUserService { */ @Override public boolean registerUser(SysUser user) { + if(StrUtil.isNotEmpty(user.getPhonenumber())){ + if(userMapper.checkPhoneUnique(user.getPhonenumber())!=null){ + throw new ServiceException("注册用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + } return userMapper.insertUser(user) > 0; } @@ -524,6 +537,11 @@ public class SysUserServiceImpl implements ISysUserService { BeanValidators.validateWithException(validator, user); user.setPassword(SecurityUtils.encryptPassword(password)); user.setCreateBy(operName); + if(StrUtil.isNotEmpty(user.getPhonenumber())){ + if(userMapper.checkPhoneUnique(user.getPhonenumber())!=null){ + throw new ServiceException("导入用户'" + user.getUserName() + "'失败,手机号码已存在"); + } + } userMapper.insertUser(user); successNum++; successMsg.append("
" + successNum + "、账号 " + user.getUserName() + " 导入成功"); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index abb43de..c32fc1b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -218,6 +218,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { */ @Override public List selectCaseApplicationListByRole(CaseApplication caseApplication) { + // todo 案件列表查询Bug修复,需要看见已办案件 // 获取登录用户 LoginUser loginUser = getLoginUser(); SysUser user = loginUser.getUser(); @@ -236,7 +237,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (StrUtil.isEmpty(role.getRoleName())) { continue; } - // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √ + // 超级管理员和仲裁委(部门长)案件,可查看所有案件 if ("超级管理员".equals(role.getRoleName()) ) { List caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); @@ -2265,7 +2266,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); if (caseAffiliatListeselect != null) { - + caseAffiliatListeselect=new ArrayList<>(caseAffiliatListeselect.stream().collect(Collectors.toMap(CaseAffiliate::getContactTelphone ,Function.identity(), (k1, k2) -> k1)).values()); for (int i = 0; i < caseAffiliatListeselect.size(); i++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); int identityType = caseAffiliateselect.getIdentityType(); @@ -2315,6 +2316,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (CollectionUtil.isEmpty(caseAffiliates)) { return "申请人、被申请人不存在"; } + caseAffiliates=new ArrayList<>(caseAffiliates.stream().collect(Collectors.toMap(CaseAffiliate::getContactTelphone ,Function.identity(), (k1, k2) -> k1)).values()); CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(messageVO.getId()); CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); @@ -3628,7 +3630,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); if (caseAffiliatListeselect != null) { - for (int j = 0; j < caseAffiliatListeselect.size(); j++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j); int identityType = caseAffiliateselect.getIdentityType(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java index 2c568b0..36e9790 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java @@ -150,11 +150,10 @@ public class CaseZipImportImpl { String caseNum = "zc" + currentDay; maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length()); // 抓取内容 - Map fatchMap = new HashMap<>(); + // 从抓取规则表取字段和字典表取基本字段,字典表的字段名塞到基本表,is_default=1自定义字段塞到columnValue // 抓取规则,0-内置字段,1-自定义字段 Map> fatchRuleMap = fatchRuleList.stream().collect(Collectors.groupingBy(FatchRule::getFileName)); - File directory = new File(targetPath); if (!directory.exists()) { throw new ServiceException("文件不存在"); @@ -163,19 +162,26 @@ public class CaseZipImportImpl { if (!directory.isDirectory() || directory.listFiles() == null) { throw new ServiceException("未找到文件夹"); } - Integer batchNumber = caseApplicationMapper.selectBatchNumberLike(); - AtomicInteger maxBatchNumber = new AtomicInteger(); - if (batchNumber == null) { - maxBatchNumber.set(1); - } else { - maxBatchNumber.set(batchNumber+1); - - } File[] files = directory.listFiles(); +// List caseApplications = new ArrayList<>(); +// for (File file1 : files) { +// if (file1.isDirectory() && file1.listFiles() != null) { +// +// for (File file2 : file1.listFiles()) { +// CaseApplication caseApplication = buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, deptMap, SecurityUtils.getLoginUser()); +// if (caseApplication != null) { +// caseApplications.add(caseApplication); +// } +// } +// } +// } +// if(caseApplications.size()>0){ +// return success("导入成功"); +// } CaseZipImportTask caseZipImportTask = null; try { - caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchMap, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser(),maxBatchNumber.get()); + caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser()); } catch (Exception e) { return error("导入失败"); } @@ -193,12 +199,23 @@ public class CaseZipImportImpl { } @Transactional - public CaseApplication buildCaseInfo(File file, Long templateId, List fatchRuleList, Map> fatchRuleMap, Map fatchMap, Map userMap, List dictDataList, Map deptMap,LoginUser loginUser, Integer maxBatchNumber) { + public CaseApplication buildCaseInfo(File file, Long templateId, List fatchRuleList, Map> fatchRuleMap, Map userMap, List dictDataList, Map deptMap,LoginUser loginUser) { // fileMap> + Map fatchMap = new HashMap<>(); + Integer batchNumber = caseApplicationMapper.selectBatchNumberLike(); + AtomicInteger maxBatchNumber = new AtomicInteger(); + if (batchNumber == null) { + maxBatchNumber.set(1); + + } else { + maxBatchNumber.set(batchNumber+1); + + } Map fileMap = findFile(file, fatchRuleList); if (fileMap != null && fileMap.size()> 0) { // 根据抓取规则循环抓取 for (Map.Entry> entry : fatchRuleMap.entrySet()) { + System.out.println("根据抓取规则循环抓取======"+entry.getKey()); getFatchContent(fileMap, entry.getKey(), fatchMap, entry.getValue()); } @@ -250,7 +267,7 @@ public class CaseZipImportImpl { caseApplication.setCaseAppliId(caseApplication.getId()); // 设置批号 - caseApplication.setBatchNumber(maxBatchNumber); + caseApplication.setBatchNumber(maxBatchNumber.get()); // 设置编号 String maxCaseNumStr = generateCaseNum(); caseApplication.setCaseNum(maxCaseNumStr); @@ -315,7 +332,9 @@ public class CaseZipImportImpl { sysDeptMapper.batchSave(sysDepts); } + if (CollectionUtil.isNotEmpty(caseApplication.getCaseAffiliates())) { + caseAffiliateMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); caseAffiliateLogMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); } @@ -331,25 +350,25 @@ public class CaseZipImportImpl { // 新增日志 CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser); // 发送短信 - if (CollectionUtil.isNotEmpty(smsRequestList)) { - Map sendRecordMap = null; - if (CollectionUtil.isNotEmpty(smsSendRecordList)) { - sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity())); - for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) { - Boolean aBoolean = SmsUtils.sendSms(request); - if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) { - if (aBoolean) { - sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1); - } else { - sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0); - } - } - } - smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList); - } - - - } +// if (CollectionUtil.isNotEmpty(smsRequestList)) { +// Map sendRecordMap = null; +// if (CollectionUtil.isNotEmpty(smsSendRecordList)) { +// sendRecordMap = smsSendRecordList.stream().collect(Collectors.toMap(SmsSendRecord::getCaseId, Function.identity())); +// for (SmsUtils.SendSmsRequest sendSmsRequest : smsRequestList) { +// Boolean aBoolean = SmsUtils.sendSms(request); +// if (sendRecordMap != null && sendRecordMap.containsKey(sendSmsRequest.getCaseId())) { +// if (aBoolean) { +// sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(1); +// } else { +// sendRecordMap.get(sendSmsRequest.getCaseId()).setSendStatus(0); +// } +// } +// } +// smsRecordMapper.batchSaveSmsSendRecord(smsSendRecordList); +// } +// +// +// } } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("导入失败,请检查抓取规则是否正确"); @@ -844,27 +863,27 @@ public class CaseZipImportImpl { insertAgentUserRole(agentUser, roleId, userRoleList); } - if (addUsers != null) { - SysUser finalAgentUser = agentUser; - if (CollectionUtil.isNotEmpty(smsRequestList) && smsRequestList.stream().noneMatch(smsSendRecord -> smsSendRecord.getPhone().equals(finalAgentUser.getPhonenumber()))) { - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1956159"); - request.setPhone(agentUser.getPhonenumber()); - request.setTemplateParamSet(new String[]{agentUser.getNickName()}); - smsRequestList.add(request); - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseApplication.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信"; - smsSendRecord.setSendContent(content); - // smsSendRecord.setCreateBy(getUsername()); - smsSendRecords.add(smsSendRecord); - } - - - } +// if (addUsers != null) { +// SysUser finalAgentUser = agentUser; +// if (CollectionUtil.isNotEmpty(smsRequestList) && smsRequestList.stream().noneMatch(smsSendRecord -> smsSendRecord.getPhone().equals(finalAgentUser.getPhonenumber()))) { +// SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); +// request.setTemplateId("1956159"); +// request.setPhone(agentUser.getPhonenumber()); +// request.setTemplateParamSet(new String[]{agentUser.getNickName()}); +// smsRequestList.add(request); +// SmsSendRecord smsSendRecord = new SmsSendRecord(); +// smsSendRecord.setCaseId(caseApplication.getId()); +// smsSendRecord.setCaseNum(caseApplication.getCaseNum()); +// smsSendRecord.setPhone(request.getPhone()); +// smsSendRecord.setSendTime(new Date()); +// String content = "尊敬的" + agentUser.getNickName() + ",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信"; +// smsSendRecord.setSendContent(content); +// // smsSendRecord.setCreateBy(getUsername()); +// smsSendRecords.add(smsSendRecord); +// } +// +// +// } } break; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java index 74409fb..8c4373d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/task/CaseZipImportTask.java @@ -25,27 +25,25 @@ public class CaseZipImportTask implements Callable> { private CaseZipImportImpl caseZipImportImpl; private Long templateId; private List fatchRuleList; - private Map fatchMap; private Map> fatchRuleMap; private Map userMap; private List dictDataList; private File[] files; private Map deptMap; private LoginUser loginUser; - private Integer maxBatchNumber; - public CaseZipImportTask(CaseZipImportImpl caseZipImportImpl, Long templateId, List fatchRuleList, Map fatchMap, Map> fatchRuleMap, Map userMap, List dictDataList, File[] files, Map deptMap, LoginUser loginUser,Integer maxBatchNumber) { + + public CaseZipImportTask(CaseZipImportImpl caseZipImportImpl, Long templateId, List fatchRuleList, Map> fatchRuleMap, Map userMap, List dictDataList, File[] files, Map deptMap, LoginUser loginUser) { this.caseZipImportImpl = caseZipImportImpl; this.templateId = templateId; this.fatchRuleList = fatchRuleList; - this.fatchMap = fatchMap; this.fatchRuleMap = fatchRuleMap; this.userMap = userMap; this.dictDataList = dictDataList; this.files = files; this.deptMap = deptMap; this.loginUser = loginUser; - this.maxBatchNumber = maxBatchNumber; + } @Override @@ -56,7 +54,7 @@ public class CaseZipImportTask implements Callable> { if (file1.isDirectory() && file1.listFiles() != null) { for (File file2 : file1.listFiles()) { - CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, fatchMap, userMap, dictDataList, deptMap, loginUser,maxBatchNumber); + CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, deptMap, loginUser); if (caseApplication != null) { caseApplications.add(caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java index 4aff732..1135903 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/OCRUtils.java @@ -115,13 +115,24 @@ public class OCRUtils { if (StrUtil.isEmpty(ocrText) || CollectionUtil.isEmpty(fatchRules)) { return; } + // 将识别后的字符串英文标点符号全部转为中文标点符号 + String ocrTextReplace = ocrText.replace(",", ",") +// .replace(".", "。") + .replace(":", ":").replace(";", ";").replace("?", "?").replace("!", "!").replace("(", "(") + .replace(")", ")").replace("[", "【").replace("]", "】").replace("{", "{").replace("}", "}") + .replace("<", "《").replace(">", "》").replace("|", "|").replace("\\", "\").replace("_", "_") + .replace("-", "-").replace("+", "+").replace("=", "=").replace("~", "~").replace("`", "`") + .replace("^", "^").replace("$", "¥").replace("@", "@").replace("#", "#").replace("%", "%") + .replace("&", "&").replace("*", "*").replace("(", "(").replace(")", ")").replace("{", "{") + .replace("}", "}").replace("[", "【").replace("]", "】").replace("<", "《").replace(">", "》") + .replace("|", "|").replace("\\", "\").replace("_", "_"); for (FatchRule fatchRule : fatchRules) { // 从后往前抓取 if (fatchRule.getFatchOrder() != null && fatchRule.getFatchOrder() == 1) { - reverseSubstringText(ocrText, fatchRule, fatchMap,null); + reverseSubstringText(ocrTextReplace, fatchRule, fatchMap,null); } else { // 从前往后抓取 - substringText(ocrText, fatchRule, fatchMap,null); + substringText(ocrTextReplace, fatchRule, fatchMap,null); } } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml index 1a29b3f..eece460 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -37,19 +37,24 @@ -- 2.54.0 From f6bf5abc9ff719033422b74193ff0e16e09876b7 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Tue, 30 Apr 2024 12:00:31 +0800 Subject: [PATCH 40/55] =?UTF-8?q?=E6=A1=88=E4=BB=B6=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CaseApplicationServiceImpl.java | 2 -- .../wisdomarbitrate/CaseAffiliateMapper.xml | 17 +++++------------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index c32fc1b..b4a95f6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -2342,8 +2342,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (CaseAffiliate caseAffiliate : caseAffiliates) { request.setPhone(caseAffiliate.getContactTelphone()); - request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo() + caseAffiliate.getUserId()}); - String userId = (null == caseAffiliate.getUserId() ? "" : caseAffiliate.getUserId()); // 1983711 开庭审理预约会议短信通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},会议时间为{4},请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。 request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo() , startFormat + "-" + endFormat}); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml index eece460..b4638af 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -42,14 +42,11 @@ c.contact_address,c.work_address,c.work_telphone ,c.name_agent,c.identity_num_agent,c.contact_telphone_agent, c.comp_legal_person,c.comp_legalper_post,c.respon_sex ,c.respon_birth, c.residen_affili,appli_agent_title, - c.contact_address_agent,c.email, c.send_email,c.track_num,c.applicant_agent_user_id,c.agent_email,s.user_id + c.contact_address_agent,c.email, c.send_email,c.track_num,c.applicant_agent_user_id,c.agent_email from case_affiliate c - left JOIN ( - SELECT phonenumber,user_id, ROW_NUMBER() OVER(PARTITION BY phonenumber ORDER BY user_id ASC) as rn - FROM sys_user - ) s ON c.contact_telphone = s.phonenumber + WHERE - s.rn = 1 + AND c.case_appli_id = #{caseAppliId} @@ -62,14 +59,10 @@ c.contact_address,c.work_address,c.work_telphone ,c.name_agent,c.identity_num_agent,c.contact_telphone_agent, c.comp_legal_person,c.comp_legalper_post,c.respon_sex ,c.respon_birth, c.residen_affili,appli_agent_title, - c.contact_address_agent,c.email, c.send_email,c.track_num,c.applicant_agent_user_id,c.agent_email,s.user_id + c.contact_address_agent,c.email, c.send_email,c.track_num,c.applicant_agent_user_id,c.agent_email from case_affiliate c - left JOIN ( - SELECT phonenumber,user_id, ROW_NUMBER() OVER(PARTITION BY phonenumber ORDER BY user_id ASC) as rn - FROM sys_user - ) s ON c.contact_telphone = s.phonenumber + WHERE - s.rn = 1 and case_appli_id in -- 2.54.0 From 30e0be14933f84bea2d35a2024f0fc05be071525 Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Tue, 30 Apr 2024 14:44:33 +0800 Subject: [PATCH 41/55] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=A1=88=E4=BB=B6=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/pom.xml | 5 +++-- .../com/ruoyi/common/constant/CaseApplicationConstants.java | 2 ++ .../service/impl/CaseApplicationServiceImpl.java | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/pom.xml b/ruoyi-admin/pom.xml index 2186d33..aa89964 100644 --- a/ruoyi-admin/pom.xml +++ b/ruoyi-admin/pom.xml @@ -9,7 +9,8 @@ 4.0.0 jar - ruoyi-admin + SmartArbitrate + 1.1.0 web服务入口 @@ -94,7 +95,7 @@ - ${project.artifactId} + ${project.artifactId}-${project.version} \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java index 4d7d343..b368cdd 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java @@ -6,6 +6,8 @@ package com.ruoyi.common.constant; public class CaseApplicationConstants { /** 立案申请 */ public static final int CASE_APPLICATION = 0; + /** 案件修改 */ + public static final int CASE_EDIT = -1; /** 待立案审查 */ public static final int CASE_CHECK = 1; /** 待缴费 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index c32fc1b..f1a3acc 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1419,6 +1419,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 异步新增案件日志 ThreadPoolUtil.execute(() -> { try { + //新增案件日志记录 + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_EDIT, "修改案件信息"); caseApplication.setCaseAppliId(caseApplication.getId()); caseApplication.setCaseLogId(IdWorkerUtil.getId()); int insertRow = caseApplicationLogMapper.insert(caseApplication); -- 2.54.0 From 25f4ac62c767be04465d69931324c930d52c2893 Mon Sep 17 00:00:00 2001 From: wangqiong <1322446236@qq.com> Date: Tue, 30 Apr 2024 15:15:15 +0800 Subject: [PATCH 42/55] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=9B=BE=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/RuoYiApplication.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index 775f772..52a33e2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -18,15 +18,11 @@ public class RuoYiApplication { // System.setProperty("spring.devtools.restart.enabled", "false"); SpringApplication.run(RuoYiApplication.class, args); - System.out.println("(♥◠‿◠)ノ゙ 若依启动成功 ლ(´ڡ`ლ)゙ \n" + - " .-------. ____ __ \n" + - " | _ _ \\ \\ \\ / / \n" + - " | ( ' ) | \\ _. / ' \n" + - " |(_ o _) / _( )_ .' \n" + - " | (_,_).' __ ___(_ o _)' \n" + - " | |\\ \\ | || |(_,_)' \n" + - " | | \\ `' /| `-' / \n" + - " | | \\ / \\ / \n" + - " ''-' `'-' `-..-' "); + System.out.println(" __ _ \n" + + " ____ / /_ ____ ____ ____ _ _________ _(_)\n" + + "/_ / / __ \\/ __ \\/ __ \\/ __ `/ / ___/ __ `/ / \n" + + " / /_/ / / / /_/ / / / / /_/ / / /__/ /_/ / / \n" + + "/___/_/ /_/\\____/_/ /_/\\__, / \\___/\\__,_/_/ \n" + + " /____/ "); } } -- 2.54.0 From 8c227288552576c99fc9411bd075f2c6315ea310 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Mon, 6 May 2024 18:07:38 +0800 Subject: [PATCH 43/55] =?UTF-8?q?=E7=BC=B4=E8=B4=B9=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E5=8A=A0=E9=A9=B3=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CasePaymentController.java | 4 +- .../domain/ArbitrateRecord.java | 5 +- .../domain/CaseApplication.java | 2 + .../service/ICasePaymentService.java | 3 +- .../impl/CaseApplicationServiceImpl.java | 9 +- .../service/impl/CasePaymentServiceImpl.java | 171 +++++++++++------- .../wisdomarbitrate/ArbitrateRecordMapper.xml | 6 +- .../wisdomarbitrate/CaseAffiliateMapper.xml | 22 +-- 8 files changed, 137 insertions(+), 85 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java index 15a0cd2..47a1ff1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java @@ -75,10 +75,10 @@ public class CasePaymentController { // @PreAuthorize("@ss.hasPermi('paymentManagement:list:payconfirm')") @PutMapping("/confirm") public AjaxResult confirmPayment(@Validated @RequestBody BatchCaseApplication batchCaseApplication) { - if(CollectionUtil.isEmpty(batchCaseApplication.getIds())){ + if(CollectionUtil.isEmpty(batchCaseApplication.getIds()) || batchCaseApplication.getAgreeOrNotCheck()==null){ return AjaxResult.error("参数校验失败"); } - return paymentService.confirmPayment(batchCaseApplication.getIds()); + return paymentService.confirmPayment(batchCaseApplication); } /** * 缴费列表查询 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java index f5c36c5..64f7ef0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java @@ -69,7 +69,10 @@ public class ArbitrateRecord extends BaseEntity { * 部门长确认裁决书驳回 */ private String deptorReject; - + /** + * 缴费确认驳回原因 + */ + private String payRejectReason; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 1c4895b..fc50e84 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -426,4 +426,6 @@ public class CaseApplication extends BaseEntity { * 登录用户名 */ private String userName; + // 缴费确认驳回原因 + private String payRejectReason; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java index 9b4e911..66c81ed 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.service; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.dto.PayRequest; +import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; @@ -14,7 +15,7 @@ public interface ICasePaymentService { */ AjaxResult casePay(CasePayDTO casePayDTO); - AjaxResult confirmPayment( List ids); + AjaxResult confirmPayment(BatchCaseApplication batchCaseApplication); /** * 确认缴费 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 197e405..d504e27 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1721,6 +1721,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationselect.setRespondentName(respondentName.toString()); caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect); caseApplicationselect.setArbitrateRecord(arbitrateRecordselect); + if(arbitrateRecordselect!=null){ + caseApplicationselect.setPayRejectReason(arbitrateRecordselect.getPayRejectReason()); + } } return caseApplicationselect; @@ -2268,13 +2271,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); if (caseAffiliatListeselect != null) { - caseAffiliatListeselect=new ArrayList<>(caseAffiliatListeselect.stream().collect(Collectors.toMap(CaseAffiliate::getContactTelphone ,Function.identity(), (k1, k2) -> k1)).values()); + // caseAffiliatListeselect=new ArrayList<>(caseAffiliatListeselect.stream().collect(Collectors.toMap(CaseAffiliate::getContactTelphone ,Function.identity(), (k1, k2) -> k1)).values()); for (int i = 0; i < caseAffiliatListeselect.size(); i++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); int identityType = caseAffiliateselect.getIdentityType(); - if (identityType == 1) { + if (identityType == 1 && StrUtil.isNotEmpty(caseAffiliateselect.getApplicationOrganId())) { caseApplicationselect.setApplicantName(caseAffiliateselect.getApplicationOrganName()); + }else { + caseApplicationselect.setApplicantName(caseAffiliateselect.getName()); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 968ef42..b5e2939 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.ruoyi.ElegentPay; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.constant.HttpStatus; @@ -44,6 +45,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { private CaseAttachMapper caseAttachMapper; @Autowired private SmsRecordMapper smsRecordMapper; + @Autowired + private ArbitrateRecordMapper arbitrateRecordMapper; @Autowired public CasePaymentServiceImpl(ElegentPay elegentPay @@ -111,11 +114,33 @@ public class CasePaymentServiceImpl implements ICasePaymentService { @Override @Transactional - public AjaxResult confirmPayment( List ids) { - for (Long id : ids) { + public AjaxResult confirmPayment( BatchCaseApplication batchCaseApplication) { + for (Long id : batchCaseApplication.getIds()) { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); + if(batchCaseApplication.getAgreeOrNotCheck().equals(1)){ + // 同意,更新案件状态为案件质证 + caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); + }else { + if(StrUtil.isEmpty(batchCaseApplication.getCaseCheckReject())){ + return AjaxResult.error("请填写拒绝理由"); + } + // 拒绝,更新案件状态为待缴费 + caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); + ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); + arbitrateRecordsel.setCaseAppliId(id); + ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); + if(arbitrateRecordnew!=null){ + arbitrateRecordnew.setPayRejectReason(batchCaseApplication.getCaseCheckReject()); + arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew); + }else { + + arbitrateRecordsel.setPayRejectReason(batchCaseApplication.getCaseCheckReject()); + arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel); + } + + } + caseApplicationMapper.submitCaseApplication(caseApplication); //发送短信通知 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); @@ -134,12 +159,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死 String caseNum = caseApplication1.getCaseNum(); if (identityType == 1) { //申请人 - request.setPhone(affiliate.getContactTelphone()); - request.setTemplateId("1928003"); //传入申请人模板id - // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 - // 模板id:1928003 普通短信 案件受理通知 String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseName, caseNum}); + request.setPhone(affiliate.getContactTelphone()); Boolean aBoolean = SmsUtils.sendSms(request); //保存短信发送记录 SmsSendRecord smsSendRecord = new SmsSendRecord(); @@ -147,8 +168,18 @@ public class CasePaymentServiceImpl implements ICasePaymentService { smsSendRecord.setCaseNum(caseNum); smsSendRecord.setPhone(request.getPhone()); smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理。"; - smsSendRecord.setSendContent(content); + if(batchCaseApplication.getAgreeOrNotCheck().equals(1)){ + // 同意 + request.setTemplateId("1928003"); //案件受理通知 + request.setTemplateParamSet(new String[]{name, caseName, caseNum}); + smsSendRecord.setSendContent("尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理。"); + }else { + //拒绝 2074402,尊敬的{1}用户,您的{2}案件,确认缴费未通过,理由为{3},请知晓,如非本人操作,请忽略本短信 + request.setTemplateId("2074402"); //确认缴费不通过通知 + request.setTemplateParamSet(new String[]{name, caseNum,batchCaseApplication.getCaseCheckReject()}); + smsSendRecord.setSendContent("尊敬的" + name + "用户,您的" + caseNum + "案件,确认缴费未通过,理由为" + batchCaseApplication.getCaseCheckReject() + ",请知晓,如非本人操作,请忽略本短信。"); + } + smsSendRecord.setCreateBy(getUsername()); if (aBoolean) { smsSendRecord.setSendStatus(1); @@ -157,28 +188,30 @@ public class CasePaymentServiceImpl implements ICasePaymentService { } smsRecordMapper.saveSmsSendRecord(smsSendRecord); } else { //被申请人 + if(batchCaseApplication.getAgreeOrNotCheck().equals(1)) { - request.setPhone(affiliate.getContactTelphone()); - request.setTemplateId("1952840"); - // 1952840 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信 - String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseName, caseNum}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseNum); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); + request.setPhone(affiliate.getContactTelphone()); + request.setTemplateId("1952840"); + // 1952840 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信 + String name = affiliate.getName(); + request.setTemplateParamSet(new String[]{name, caseName, caseNum}); + Boolean aBoolean = SmsUtils.sendSms(request); + //保存短信发送记录 + SmsSendRecord smsSendRecord = new SmsSendRecord(); + smsSendRecord.setCaseId(caseApplication.getId()); + smsSendRecord.setCaseNum(caseNum); + smsSendRecord.setPhone(request.getPhone()); + smsSendRecord.setSendTime(new Date()); + String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信"; + smsSendRecord.setSendContent(content); + smsSendRecord.setCreateBy(getUsername()); + if (aBoolean) { + smsSendRecord.setSendStatus(1); + } else { + smsSendRecord.setSendStatus(0); + } + smsRecordMapper.saveSmsSendRecord(smsSendRecord); } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } //更改记录表里的支付状态和支付时间 @@ -188,7 +221,11 @@ public class CasePaymentServiceImpl implements ICasePaymentService { casePaymentRecord.setUpdateTime(new Date()); casePaymentRecordMapper.update(casePaymentRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); + if(batchCaseApplication.getAgreeOrNotCheck().equals(1)) { + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); + }else { + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, "拒绝原因:"+batchCaseApplication.getCaseCheckReject()); + } } } @@ -282,43 +319,45 @@ public class CasePaymentServiceImpl implements ICasePaymentService { caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber)); caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); - List caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); - if(caseApplications!=null&&caseApplications.size()>0){ - if (payDTO.getPayType() != null) { - payDTO.setCaseIds(caseIds); - // 修改支付方式 - CaseConfirmPayDTO caseConfirmPayDTO = new CaseConfirmPayDTO(); - BeanUtils.copyProperties(payDTO, caseConfirmPayDTO); - caseApplicationMapper.updatePayType(caseConfirmPayDTO); - } - for (Long caseId : caseIds) { - if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) { - for (CaseAttach caseAttach : payDTO.getPayOrderList()) { - caseAttach.setCaseAppliId(caseId); - caseAttachMapper.updateCaseAttach(caseAttach); - } - } - // 修改节点状态 - //根据案件id查询案件信息 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(caseId); - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); - //修改案件状态 - int i = caseApplicationMapper.submitCaseApplication(caseApplication1); - if (i > 0) { - // 修改支付状态 - CasePaymentRecord paymentRecord = new CasePaymentRecord(); - paymentRecord.setPayType(payDTO.getPayType()); - paymentRecord.setCaseId(caseId); - paymentRecord.setPaymentStatus(1); - casePaymentRecordMapper.saveRecord(paymentRecord); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, ""); - } + if(CollectionUtil.isNotEmpty(caseApplications)){ + List caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); - } +// if (payDTO.getPayType() != null) { +// payDTO.setCaseIds(caseIds); +// // 修改支付方式 +// CaseConfirmPayDTO caseConfirmPayDTO = new CaseConfirmPayDTO(); +// BeanUtils.copyProperties(payDTO, caseConfirmPayDTO); +// caseApplicationMapper.updatePayType(caseConfirmPayDTO); +// } +// for (Long caseId : caseIds) { +// if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) { +// for (CaseAttach caseAttach : payDTO.getPayOrderList()) { +// caseAttach.setCaseAppliId(caseId); +// caseAttachMapper.updateCaseAttach(caseAttach); +// } +// } +// +// // 修改节点状态 +// //根据案件id查询案件信息 +// CaseApplication caseApplication = new CaseApplication(); +// caseApplication.setId(caseId); +// CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); +// caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); +// //修改案件状态 +// int i = caseApplicationMapper.submitCaseApplication(caseApplication1); +// if (i > 0) { +// // 修改支付状态 +// CasePaymentRecord paymentRecord = new CasePaymentRecord(); +// paymentRecord.setPayType(payDTO.getPayType()); +// paymentRecord.setCaseId(caseId); +// paymentRecord.setPaymentStatus(1); +// casePaymentRecordMapper.saveRecord(paymentRecord); +// // 新增日志 +// CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, ""); +// } +// +// } }else{ throw new ServiceException("这个批号没有批量缴费的案件"); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml index 7947701..9526e81 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml @@ -18,6 +18,7 @@ + @@ -34,6 +35,7 @@ check_opinion, case_check_reject, arbitrate_reject, + pay_reject_reason, create_by, case_focus, case_facts, @@ -51,6 +53,7 @@ #{checkOpinion}, #{caseCheckReject}, #{arbitrateReject}, + #{payRejectReason}, #{createBy}, #{caseFocus}, #{caseFacts}, @@ -81,6 +84,7 @@ case_check_reject = #{caseCheckReject}, arbitrate_reject = #{arbitrateReject}, deptor_reject = #{deptorReject}, + pay_reject_reason = #{payRejectReason}, update_time = sysdate() where id = #{id} @@ -90,7 +94,7 @@ - select c.id, - c.case_appli_id, c.identity_type,c.application_organ_id,c.application_organ_name,c.name,c.identity_num,c.contact_telphone, - c.contact_address,c.work_address,c.work_telphone ,c.name_agent,c.identity_num_agent,c.contact_telphone_agent, - c.comp_legal_person,c.comp_legalper_post,c.respon_sex ,c.respon_birth, - c.residen_affili,appli_agent_title, - c.contact_address_agent,c.email, c.send_email,c.track_num,c.applicant_agent_user_id,c.agent_email + select c.* from case_affiliate c - WHERE + + + AND c.case_appli_id = #{caseAppliId} + + + - - AND c.case_appli_id = #{caseAppliId} - - SELECT a.id ,a.case_appli_id ,a.eviden_determi ,a.fact_determi ,a.case_sketch ,a.arbitrate_think ,a.ruling_follows , - a.verifica_opinion ,a.check_opinion,a.annex_id,a.case_focus,a.case_facts,a.respondent_opinion,a.applicant_opinion, - a.case_check_reject ,a.arbitrate_reject,a.deptor_reject,a.pay_reject_reason + SELECT a.* from arbitrate_record a diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index ce98f79..ea552c2 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -570,129 +570,10 @@ sum( case when t1.case_status=18 then 1 else 0 end) arbitratorApplyAwardConfirm, sum( case when t1.case_status=31 then 1 else 0 end) updateOnlineHearDate from( - - - - select DISTINCT(t.id),t.case_status,t.application_organ_id, t.arbitrator_id,t.identity_num , - t.identity_type from( - select c.id , - c.case_status,ca.application_organ_id, - c.arbitrator_id,ca.identity_num , ca.identity_type - from case_application c - JOIN case_affiliate ca ON ca.case_appli_id = c.id - - - AND c.case_status = #{caseStatus} - - - - and c.case_status in - - #{caseStatus} - - - - ) t - - - - - or (t.identity_num=#{idCard} AND t.identity_type=2 and (t.case_status=4 or t.case_status=17)) - - - - or ( t.identity_type=1 and - t.case_status in (7,13,17,18) - and - instr (t.arbitrator_id,#{userId})>0) - - - - or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1 - and t.case_status in (0,2,17)) - - - - - or (t.identity_type=1 and t.case_status in - - #{caseStatus} - ) - - - - or ( t.identity_type=1 and t.case_status =#{financeStatus}) - - - - - or ( - t.application_organ_id in - #{deptId} - - AND t.identity_type=1 - and t.case_status in (0,9)) - - - - union - - - - - - select c.id , - c.case_status,ca.application_organ_id, - c.arbitrator_id,ca.identity_num , ca.identity_type - FROM - case_application c - JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1 - JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1, 2) and - l.version - = ( - SELECT - max( version ) version - FROM - case_application_log - WHERE case_appli_id = c.id - ) - WHERE - ca.identity_type=1 - - and c.case_status in (1,5,8,9,11,14,15,16,17,31) - - - AND c.case_status = #{caseStatus} - - - - AND ca.application_organ_id=#{nameId} AND ca.identity_type=1 - - union - select c.id , - c.case_status,ca.application_organ_id, - c.arbitrator_id,ca.identity_num , ca.identity_type - FROM - case_application c - JOIN case_application_log l ON c.id = l.case_appli_id - JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id - AND ca.identity_type = 1 - WHERE - l.update_submit_status IN ( 1, 2 ) and ca.identity_type=1 - AND l.version = ( - SELECT - max( version ) version - FROM - case_application_log - WHERE - c.id = case_appli_id) - - + select c.id,c.case_status + from case_application c + JOIN case_affiliate ca ON ca.case_appli_id = c.id + ) t1 @@ -1114,17 +995,13 @@ case_result = #{caseResult}, case_status = #{caseStatus}, proper_preser = #{properPreser}, - appli_iswrit_hear = #{applicantIsWrittenHear}, respon_isWrit_hear = #{respondentIsWrittenHear}, - update_by = #{updateBy}, case_num = #{caseNum}, version = #{version}, facts = #{facts}, - mediation_agreement = - #{mediationAgreement}, - + mediation_agreement = #{mediationAgreement} update_time = sysdate() where id = #{id} @@ -1366,7 +1243,7 @@ SELECT count(1) from case_application c where c.arbitrator_id = #{userId} - and c.case_status in(8,9) + and c.case_status!=17 + + + + + and c.case_status in + + #{caseStatus} + + + + and ca.identity_type=1 + + + + and ca.identity_type=1 + and ( ca.contact_telphone=#{caseApplication.loginUserPhone} + or ca.contact_telphone_agent=#{caseApplication.loginUserPhone} + ) + + + + and ca.identity_type=2 + and ( ca.contact_telphone=#{caseApplication.loginUserPhone} + or ca.contact_telphone_agent=#{caseApplication.loginUserPhone} + ) + + + + and c.arbitrator_id=#{caseApplication.arbitratorId} + + + + diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml index 76e1801..13801b5 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -40,7 +40,7 @@ when 26 then '证据确认成功' when 31 then '修改开庭时间' when 18 then '仲裁员审核裁决书' - ELSE '无案件状态' + ELSE '' END content, CASE cl.case_node when 0 then '申请人' when 1 then '申请人' when 2 then '法律顾问' when 3 then '申请人' when 4 then '财务' when 5 then '被申请人' -- 2.54.0 From 44129c7cd05bef1bf4b7b12ea25276314ed7310b Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 10 May 2024 17:48:42 +0800 Subject: [PATCH 45/55] =?UTF-8?q?=E8=A7=86=E9=A2=91=EF=BC=8C=E7=94=A8?= =?UTF-8?q?=E5=8D=B0=E5=9B=9E=E8=B0=83=EF=BC=8C=E8=A3=81=E5=86=B3=E4=B9=A6?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysDeptController.java | 2 +- .../AdjudicationController.java | 34 +- .../CaseApplicationController.java | 14 +- .../wisdomarbitrate/MsSignSealController.java | 56 ++ .../com/ruoyi/common/constant/Constants.java | 2 + .../domain/CaseApplication.java | 4 +- .../domain/SealSignRecord.java | 8 + .../mapper/CaseApplicationMapper.java | 7 + .../mapper/CaseAttachMapper.java | 8 + .../mapper/CaseEvidenceMapper.java | 2 + .../mapper/SealSignRecordMapper.java | 7 + .../service/ICaseApplicationService.java | 2 +- .../service/MsSignSealService.java | 15 + .../service/impl/AdjudicationServiceImpl.java | 29 +- .../impl/CaseApplicationServiceImpl.java | 850 +++++++----------- .../impl/CaseArbitrateServiceImpl.java | 47 +- .../service/impl/CaseEvidenceServiceImpl.java | 63 +- .../impl/CaseLogRecordServiceImpl.java | 8 +- .../service/impl/CasePaymentServiceImpl.java | 14 +- .../service/impl/MsSignSealServiceImpl.java | 268 ++++++ .../wisdomarbitrate/utils/DigesdateUtils.java | 46 + .../utils/FixSelectFlowDetailUtils.java | 4 +- .../utils/SignVerifyUtils.java | 96 ++ .../wisdomarbitrate/CaseApplicationMapper.xml | 9 + .../wisdomarbitrate/CaseAttachMapper.xml | 7 +- .../wisdomarbitrate/CaseEvidenceMapper.xml | 38 +- .../wisdomarbitrate/CaseLogRecordMapper.xml | 16 +- .../wisdomarbitrate/SealSignRecordMapper.xml | 13 +- 28 files changed, 998 insertions(+), 671 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/MsSignSealService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java index 59e7588..ca6e9fe 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java @@ -37,7 +37,7 @@ public class SysDeptController extends BaseController /** * 获取部门列表 */ - @PreAuthorize("@ss.hasPermi('system:dept:list')") +// @PreAuthorize("@ss.hasPermi('system:dept:list')") @GetMapping("/list") public AjaxResult list(SysDept dept) { diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index d604b3a..5460b45 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -159,16 +159,7 @@ public class AdjudicationController extends BaseController { return AjaxResult.success(logisticsInfo); } - /** - * 签名(暂时只改案件状态) - * @param caseApplication - * @return - */ - @PostMapping("/signature") -// @PreAuthorize("@ss.hasPermi('awardManagement:list:sign')") - public AjaxResult signature(@Validated @RequestBody CaseApplication caseApplication){ - return adjudicationService.signature(caseApplication); - } + /** @@ -222,16 +213,7 @@ public class AdjudicationController extends BaseController { return adjudicationService.serviceBatch(caseApplication.getBatchNumber()); } - /** - * 用印(暂时只改案件状态) - * @param caseApplication - * @return - */ - @PostMapping("/stamp") -// @PreAuthorize("@ss.hasPermi('awardManagement:list:signprint')") - public AjaxResult stamp(@Validated @RequestBody CaseApplication caseApplication){ - return adjudicationService.stamp(caseApplication); - } + /** * 档案详情查询 @@ -255,13 +237,15 @@ public class AdjudicationController extends BaseController { } /** * 开庭审理提交,只改变案件状态为CaseApplicationConstants.VERPRIF_ARBITRATION - * @param id 案件id + * @param caseApplication 案件 * @return */ - @GetMapping("/changeCaseStatus") - public AjaxResult changeCaseStatus(@RequestParam("id") Long id){ - - return adjudicationService.changeCaseStatus(id, CaseApplicationConstants.VERPRIF_ARBITRATION); + @PostMapping("/changeCaseStatus") + public AjaxResult changeCaseStatus(@RequestBody CaseApplication caseApplication){ + if(caseApplication.getId()==null){ + return error("参数校验失败"); + } + return adjudicationService.changeCaseStatus(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 6bb50da..19c7d73 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -271,7 +271,7 @@ public class CaseApplicationController extends BaseController { @Log(title = "组庭审核", businessType = BusinessType.UPDATE) @PostMapping("/pendTralCheck") public AjaxResult pendTralCheck(@Validated @RequestBody CaseApplication caseApplication) { - if(StrUtil.isEmpty(caseApplication.getArbitratorId())|| StrUtil.isEmpty(caseApplication.getArbitratorName())){ + if(CollectionUtil.isEmpty(caseApplication.getArbitrators())){ return error("请选择仲裁员"); } return caseApplicationService.pendTralCheck(caseApplication); @@ -454,19 +454,9 @@ public class CaseApplicationController extends BaseController { return success(schemeUrl); } - /** - * 生成庭审笔录 - * @param arbitrateRecord - * @return - */ - @PostMapping("/creatTrialRecord") -// @PreAuthorize("@ss.hasPermi('caseManagement:list:creatTrialRecord')") - public AjaxResult creatTrialRecord(@Validated @RequestBody ArbitrateRecord arbitrateRecord){ - return caseApplicationService.creatTrialRecord(arbitrateRecord); - } /** - * 记录庭审笔录 + * 确认会议结果 * @param arbitrateRecord * @return */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java new file mode 100644 index 0000000..33d4e80 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java @@ -0,0 +1,56 @@ +package com.ruoyi.web.controller.wisdomarbitrate; + +import com.ruoyi.common.annotation.Anonymous; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.service.MsSignSealService; +import com.ruoyi.wisdomarbitrate.utils.SignVerifyUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Classname MsSignSealController + * @Description TODO + * @Version 1.0.0 + * @Date 2024/5/10 15:07 + * @Created wangqiong + */ +@RestController +@RequestMapping("/mssignSeal") +public class MsSignSealController extends BaseController { + @Autowired + private MsSignSealService msSignSealService; + /** + * 签名用印回调 + */ + @Anonymous + @PostMapping("/signSeaalCaseApplicaCallback") + public AjaxResult signSeaalCaseApplicaCallback() throws Exception { + boolean checkResult= SignVerifyUtils.checkSignuter(); + if(checkResult){ + String reqbodystr =SignVerifyUtils.getRequestBody(); + return msSignSealService.signSeaalCaseApplicaCallback(reqbodystr); + }else { + return AjaxResult.error("error"); + } + + } + + /** + * 印章审核回调 + */ + @Anonymous + @PostMapping("/sealCheckCallback") + public AjaxResult sealCheckCallback() throws Exception { + boolean checkResult= SignVerifyUtils.checkSignuter(); + if(checkResult){ + String reqbodystr =SignVerifyUtils.getRequestBody(); + return msSignSealService.sealCheckCallback(reqbodystr); + }else { + return AjaxResult.error("error"); + } + + } +} diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java index e46e514..64540ce 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java @@ -154,4 +154,6 @@ public class Constants */ public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" }; + // 中文逗号分隔符 + public static final String CN_SPLIT_COMMA = ","; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index f45db4b..8e27c69 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -39,7 +39,7 @@ public class CaseApplication extends BaseEntity { /** 立案日期 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date registerDate; - /** 仲裁方式 */ + /** 仲裁方式 ,1-开庭,2-书面*/ private Integer arbitratMethod; /** * 是否导入,0手动录入,1导入,默认0 @@ -211,7 +211,7 @@ public class CaseApplication extends BaseEntity { */ private Integer financeStatus; /** - * 是否是被申请人,仲裁员,部门长,财务,代理人,0-否,1-是 + * 是否查询全部节点 */ private Integer isOtherRole; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java index e4e0267..00b2748 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SealSignRecord.java @@ -58,6 +58,14 @@ public class SealSignRecord extends BaseEntity { private double positionXorg; /** 印章位置y坐标 */ private double positionYorg; + /** + * 仲裁员签名状态,1-签名 + */ + private Integer signStatusArbitor; + /** + * 用印状态,1用印 + */ + private Integer sealStatus; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index 189815f..630dd6a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -149,4 +149,11 @@ public interface CaseApplicationMapper { List list(@Param("caseApplication") CaseApplication caseApplication, @Param("caseStatusList") List caseStatusList, @Param("roleNames") List roleNames); + + /** + * 查询当前案件节点 + * @param id + * @return + */ + Integer selectCaseApplicationCaseStatus(@Param("id") Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index 7e0d475..e59296f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -35,4 +35,12 @@ public interface CaseAttachMapper { void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType,@Param("isBatchUpload") int isBatchUpload); void deleteCaseAttachByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType); + + /** + * 删除存在的附件不包括该附件 + * @param caseId 附件 + * @param type 附件类型 + * @param annexId 附件id + */ + void deleteCaseAttach(@Param("caseId")Long caseId, @Param("type")int type,@Param("annexId") Long annexId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java index 5f0a4a2..61d6c8d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java @@ -12,5 +12,7 @@ public interface CaseEvidenceMapper { List getCaseListByRespondent(@Param(value = "identityNum" ) String identityNum , @Param(value = "caseStatusList") List caseStatusList , @Param(value = "identityType" ) Integer identityType + , @Param(value = "phone" ) String phone + , @Param(value = "loginUserName" ) String loginUserName ); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java index 7c9ab06..210fa95 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/SealSignRecordMapper.java @@ -31,4 +31,11 @@ public interface SealSignRecordMapper { void insertSealSignRecord(SealSignRecord sealSignRecord); List selectsignFlow(@Param("batchNumber") Integer batchNumber,@Param("caseStatus") Integer caseStatus); + + /** + * 根据签署流程id查询签署记录 + * @param signFlowId + * @return + */ + SealSignRecord selectSealByFlowId(@Param("signFlowId") String signFlowId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index 7f146b4..9194c3d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -57,7 +57,7 @@ public interface ICaseApplicationService { SealSignRecord selectSealUrl(CaseApplication caseApplication) throws EsignDemoException; - AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecord); + CaseApplication selectSignSealUrl(CaseApplication caseApplication) throws EsignDemoException; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/MsSignSealService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/MsSignSealService.java new file mode 100644 index 0000000..de171f9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/MsSignSealService.java @@ -0,0 +1,15 @@ +package com.ruoyi.wisdomarbitrate.service; + +import com.google.gson.Gson; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; + +import java.io.IOException; +import java.util.List; + +public interface MsSignSealService { + AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException; + + AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException; +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index f5bf0e1..f9544e9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -60,6 +60,7 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import static com.ruoyi.common.utils.SecurityUtils.getUsername; +import static com.ruoyi.wisdomarbitrate.utils.CaseLogUtils.insertCaseLog; @Service @Slf4j @@ -730,11 +731,13 @@ public class AdjudicationServiceImpl implements IAdjudicationService { @Override @Transactional public AjaxResult signature(CaseApplication caseApplication) { + // 查询当前案件节点 + Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATED_SEAL, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, ""); return AjaxResult.success("签名成功,案件状态已改为待裁决书用印"); } @@ -746,11 +749,13 @@ public class AdjudicationServiceImpl implements IAdjudicationService { for (Long id : ids) { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); + // 查询当前案件节点 + Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_ARCHIVED, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, ""); } } catch (Exception e) { return AjaxResult.error(e.getMessage()); @@ -771,6 +776,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (caseApplication1 == null) { return AjaxResult.error("未查询到相关案件"); } + Integer currentNode=caseApplication1.getCaseStatus(); List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1); Boolean isExistPdf = false; if (caseAttachList != null && caseAttachList.size() > 0) { @@ -953,7 +959,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentNode, ""); return AjaxResult.success("裁决书送达成功"); } @@ -1010,11 +1016,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService { @Override public AjaxResult stamp(CaseApplication caseApplication) { + Integer caseStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATION_DELIVERY, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), caseStatus, ""); return AjaxResult.success("用印成功,案件状态已改为待裁决书送达"); } @@ -1552,13 +1559,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService { List ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList()); try { for (Long id : ids) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_ARCHIVED, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } } catch (Exception e) { return AjaxResult.error(e.getMessage()); @@ -1587,6 +1595,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (caseApplication1 == null) { return AjaxResult.error("未查询到相关案件"); } + Integer currentCaseNode=caseApplication1.getCaseStatus(); List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1); if (caseAttachList != null && caseAttachList.size() > 0) { @@ -1767,7 +1776,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication1.getId(), CaseApplicationConstants.CASE_FILING, ""); + CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentCaseNode, ""); } @@ -1902,7 +1911,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 保存裁决书附件 saveArbitorFile(req.getId(), saveName, savePath, caseApplicationById, arbitrateRecordSelect,null); - return AjaxResult.success("裁决书已生成"); + return AjaxResult.success(); } @Transactional @@ -1911,10 +1920,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (id == null || caseStatus == null) { return AjaxResult.error("参数校验失败"); } + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); caseApplication.setCaseStatus(caseStatus); + caseApplicationMapper.submitCaseApplication(caseApplication); + // 新增日志 + insertCaseLog(id,currentStatus , ""); return AjaxResult.success(); } @@ -1971,7 +1984,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { xwpfDocument = new XWPFDocument(fileInputStream); log.error("xwpfDocument====" + xwpfDocument); } catch (IOException e) { - e.printStackTrace(); + throw new ServiceException("系统找不到指定的文件。"); } if (xwpfDocument == null) { return new ArrayList<>(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 1ecc523..42cbad5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONArray; @@ -11,6 +12,7 @@ import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.*; import com.ruoyi.common.core.domain.model.LoginUser; @@ -29,6 +31,7 @@ import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.mapper.*; +import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.utils.SignAward; import com.ruoyi.wisdomarbitrate.utils.UnZipFileUtils; @@ -124,6 +127,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Autowired private CaseZipImportImpl caseZipImportImpl; + @Autowired + IAdjudicationService adjudicationService; // 手机号正则 private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); // 邮箱正则 @@ -407,6 +412,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } // 查看所有权限 if("超级管理员".equals(role.getRoleName())){ + caseApplication.setIsOtherRole(1); caseApplications = caseApplicationMapper.list(caseApplication,caseStatusList,null); setArbitorMethod(caseApplications); return caseApplications; @@ -425,20 +431,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseStatusList.add(9); } if("仲裁员".equals(role.getRoleName())){ + caseApplication.setIsOtherRole(1); Integer[] array = {7,8,9,13,18}; caseStatusList.addAll(Arrays.asList(array)); caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId())); } if ("仲裁委".equals(role.getRoleName()) || "部门长".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); // 组庭确定,部门长审核裁决书 caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); } if ("财务".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); } if ("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName()) ) { + caseApplication.setIsOtherRole(1); Integer[] array = {1,5,8,9,11,14,15,16,31}; caseStatusList.addAll(Arrays.asList(array)); } @@ -497,79 +507,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override public ToDoCount selectToDoCount() { - -// // 获取登录用户 -// LoginUser loginUser = getLoginUser(); -// SysUser user = loginUser.getUser(); -// Long userId = user.getUserId(); -// -// // 查询登录人信息 -// SysUser sysUser = sysUserMapper.selectUserById(userId); -// List roles = sysUser.getRoles(); -// // 没有角色不能查看案件列表 -// if (CollectionUtil.isEmpty(roles)) { -// throw new ServiceException("该用户没有角色权限"); -// } -// CaseApplication caseApplication = new CaseApplication(); -// List caseStatusList = new ArrayList<>(); -// for (SysRole role : roles) { -// if (StrUtil.isEmpty(role.getRoleName())) { -// continue; -// } -// // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √ -// if (role.getRoleName().equals("超级管理员") -// ) { -// return caseApplicationMapper.selectAdminCaseToDoCount(); -// } -// if ("仲裁委".equals(role.getRoleName()) -// || "部门长".equals(role.getRoleName())) { -// caseApplication.setIsOtherRole(1); -// caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); -// caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); -// // caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); -// caseApplication.setDeptHeadStatus(caseStatusList); -// } -// if ("仲裁员".equals(role.getRoleName())) { -// caseApplication.setIsOtherRole(1); -// caseApplication.setUserId(String.valueOf(userId)); -// } -// if ("财务".equals(role.getRoleName())) { -// caseApplication.setIsOtherRole(1); -// caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); -// } -// if ("法律顾问".equals(role.getRoleName())) { -// // 查询角色有关的用户部门 -// // List deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); -// List deptIds = new ArrayList<>(); -// deptIds.add(sysUser.getDeptId()); -// caseApplication.setDeptIds(deptIds); -// } -// if ("申请人".equals(role.getRoleName())) { -// caseApplication.setIsOtherRole(1); -// // 查询角色有关的用户部门 -// caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId())); -// } -// if ("被申请人".equals(role.getRoleName())) { -// caseApplication.setIsOtherRole(1); -// // -// caseApplication.setIdCard(String.valueOf(sysUser.getIdCard())); -// } -// if ("代理人".equals(role.getRoleName())) { -// caseApplication.setIsOtherRole(1); -// // 查询角色有关的用户部门 -// // List agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); -// List agentDeptIds = new ArrayList<>(); -// agentDeptIds.add(sysUser.getDeptId()); -// caseApplication.setAgentDeptIds(agentDeptIds); -// } -// } -// -// -// // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 -// ToDoCount toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication); -// if (toDoCount == null) { -// return new ToDoCount(); -// } LoginUser loginUser = getLoginUser(); SysUser user = loginUser.getUser(); Long userId = user.getUserId(); @@ -595,6 +532,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } // 查看所有权限 if("超级管理员".equals(role.getRoleName())){ + caseApplication.setIsOtherRole(1); toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication,caseStatusList,null); if(toDoCount==null){ toDoCount=new ToDoCount(); @@ -616,20 +554,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseStatusList.add(9); } if("仲裁员".equals(role.getRoleName())){ + caseApplication.setIsOtherRole(1); Integer[] array = {7,8,9,13,18}; caseStatusList.addAll(Arrays.asList(array)); caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId())); } if ("仲裁委".equals(role.getRoleName()) || "部门长".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); // 组庭确定,部门长审核裁决书 caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); } if ("财务".equals(role.getRoleName())) { + caseApplication.setIsOtherRole(1); caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); } if ("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName()) ) { + caseApplication.setIsOtherRole(1); Integer[] array = {1,5,8,9,11,14,15,16,31}; caseStatusList.addAll(Arrays.asList(array)); } @@ -647,26 +589,68 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Long id = caseApplication.getId(); CaseLogRecord caseLogRecord = new CaseLogRecord(); caseLogRecord.setCaseAppliId(id); - List records = caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord); CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); // 当前案件节点 Integer caseStatus = caseApplicationselect.getCaseStatus(); - if (caseStatus.intValue() != 0) { - CaseLogRecord caseLogRecordin = getInCasenode(caseStatus); - records.add(caseLogRecordin); + List allCaseNode= getAllCaseNode(caseApplicationselect.getArbitratMethod()); + if(caseApplicationselect.getArbitratMethod()!=null){ + if(caseApplicationselect.getArbitratMethod().equals(1)) { + // 开庭审理 + allCaseNode.removeIf(record -> record.getCaseNode().equals(9)); + } + if(caseApplicationselect.getArbitratMethod().equals(2)) { + // 书面审理 + allCaseNode.removeIf(record -> record.getCaseNode().equals(8) || record.getCaseNode().equals(31)); + } } - - List recordsnofinish = getNofinishCasenode(caseStatus); - records.addAll(recordsnofinish); - datas.put("allCasenode", records); + datas.put("allCasenode", allCaseNode); datas.put("caseStatus", caseStatus); return success(datas); } + /** + * 获取所有案件节点 + * arbitratMethod : 1:开庭诉讼,2:书面诉讼 + * @return + */ + private List getAllCaseNode(Integer arbitratMethod) { + List allCaseNode = new ArrayList<>(); + allCaseNode.add(getLastNodeRecord(null, "立案申请", 0, "申请人将提交案件","下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "立案审查", 1, "法律顾问将立案审查","下一节点角色:申请人")); + allCaseNode.add(getLastNodeRecord(null, "缴费", 2, "申请人将缴费","下一节点角色:财务")); + allCaseNode.add(getLastNodeRecord(null, "缴费确认", 3, "财务将缴费确认","下一节点角色:被申请人")); + allCaseNode.add(getLastNodeRecord(null, "案件质证", 4, "被申请人将案件质证","下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "组庭审核", 5, "法律顾问将组庭审核","下一节点角色:部门长")); + allCaseNode.add(getLastNodeRecord(null, "组庭确定", 6, "部门长将组庭确定","下一节点角色:仲裁员")); + allCaseNode.add(getLastNodeRecord(null, "审核仲裁方式", 7, "仲裁员将审核仲裁方式","下一节点角色:法律顾问")); + if(arbitratMethod==null) { + allCaseNode.add(getLastNodeRecord(null, "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问,仲裁员")); + allCaseNode.add(getLastNodeRecord(null, "开庭审理", 8, "法律顾问,仲裁员,申请人,被申请人将开庭审理", "下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); + }else if(arbitratMethod.equals(1)){ + // 开庭 + allCaseNode.add(getLastNodeRecord(null, "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "开庭审理", 8, "法律顾问,仲裁员,申请人,被申请人将开庭审理", "下一节点角色:法律顾问")); + }else if(arbitratMethod.equals(2)){ + // 书面 + allCaseNode.add(getLastNodeRecord(null, "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); + } + allCaseNode.add(getLastNodeRecord(null, "核验裁决书", 11, "法律顾问将核验裁决书","下一节点角色:仲裁员")); + allCaseNode.add(getLastNodeRecord(null, "仲裁员审核裁决书", 18, "仲裁员将审核裁决书","下一节点角色:部门长")); + allCaseNode.add(getLastNodeRecord(null, "部门长审核裁决书", 12, "部门长将审核裁决书","下一节点角色:仲裁员")); + allCaseNode.add(getLastNodeRecord(null, "裁决书签名", 13, "仲裁员将进行裁决书签名","下一节点角色:部门长")); + allCaseNode.add(getLastNodeRecord(null, "裁决书用印", 14, "部门长将进行裁决书用印","下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "裁决书送达", 15, "法律顾问将送达裁决书","下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "案件归档", 16, "法律顾问将进行案件归档","")); + allCaseNode.add(getLastNodeRecord(null, "案件已归档", 17, "","")); + return allCaseNode; + } + @Override @Transactional public int updateHeardate(CaseApplication caseApplication) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); // caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); caseApplication.setLockStatus(1); @@ -679,7 +663,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 发送开庭日期通知短信 sendHearDateMessage(caseApplication, request, "1975139"); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_OPENCOURT_HEAR, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); return rows; } @@ -732,12 +716,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (allFilestr != null && allFilestr.size() > 0) { for (String filestr : allFilestr) { List allindex = new ArrayList<>(); -// int indexKey = filestr.indexOf("\\"); int indexKey = filestr.indexOf("/"); -// System.out.println("filestr:------------"+filestr); allindex.add(indexKey); while (indexKey != -1) { -// indexKey = filestr.indexOf("\\", indexKey + 1); indexKey = filestr.indexOf("/", indexKey + 1); allindex.add(indexKey); } @@ -888,242 +869,174 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return smsRecordMapper.getSmsSendRecord(smsSendRecord); } - private List getNofinishCasenode(Integer caseStatus) { - CaseLogRecord caseLogRecord1 = new CaseLogRecord(); - caseLogRecord1.setCaseNodeName("立案审查"); - caseLogRecord1.setCaseNode(1); - caseLogRecord1.setContent("法律顾问将进行立案审查"); - CaseLogRecord caseLogRecord2 = new CaseLogRecord(); - caseLogRecord2.setCaseNode(2); - caseLogRecord2.setCaseNodeName("缴费"); - caseLogRecord2.setContent("申请人将进行缴费"); - CaseLogRecord caseLogRecord3 = new CaseLogRecord(); - caseLogRecord3.setCaseNode(3); - caseLogRecord3.setCaseNodeName("缴费确认"); - caseLogRecord3.setContent("财务将进行缴费确认"); - CaseLogRecord caseLogRecord4 = new CaseLogRecord(); - caseLogRecord4.setCaseNode(4); - caseLogRecord4.setCaseNodeName("案件质证"); - caseLogRecord4.setContent("被申请人将进行案件质证"); - CaseLogRecord caseLogRecord5 = new CaseLogRecord(); - caseLogRecord5.setCaseNode(5); - caseLogRecord5.setCaseNodeName("组庭审核"); - caseLogRecord5.setContent("法律顾问将进行组庭审核"); - CaseLogRecord caseLogRecord6 = new CaseLogRecord(); - caseLogRecord6.setCaseNode(6); - caseLogRecord6.setCaseNodeName("修改开庭时间"); - caseLogRecord6.setContent("部门长将修改开庭时间"); + /** + * 获取日志中该节点最新一条记录 + * @param caseNodeRecordMap 日志记录案件状态分组 + * @param caseNodeName 节点名称 + * @param caseNode 案件节点 + * @param content 内容 + * @return + */ + private CaseLogRecord getLastNodeRecord(Map> caseNodeRecordMap, String caseNodeName, int caseNode, String content,String nextRoleName) { + CaseLogRecord lastNodeRecord = new CaseLogRecord(); + if(caseNodeRecordMap!=null && caseNodeRecordMap.containsKey(caseNode)){ + // List nodeRecordList = caseNodeRecordMap.get(caseNode); + // 取出该节点最新一条数据 + // lastNodeRecord = nodeRecordList.get(nodeRecordList.size() - 1); - CaseLogRecord caseLogRecord7 = new CaseLogRecord(); - caseLogRecord6.setCaseNode(7); - caseLogRecord6.setCaseNodeName("组庭确定"); - caseLogRecord6.setContent("部门长将进行组庭确定"); - - CaseLogRecord caseLogRecord8 = new CaseLogRecord(); - caseLogRecord7.setCaseNode(8); - caseLogRecord7.setCaseNodeName("审核仲裁方式"); - caseLogRecord7.setContent("仲裁员将进行审核仲裁方式"); - CaseLogRecord caseLogRecord9 = new CaseLogRecord(); - caseLogRecord8.setCaseNode(9); - caseLogRecord8.setCaseNodeName("开庭审理"); - caseLogRecord8.setContent("仲裁员,申请人,被申请人,法律顾问将进行开庭审理"); - CaseLogRecord caseLogRecord11 = new CaseLogRecord(); - caseLogRecord9.setCaseNode(11); - caseLogRecord9.setCaseNodeName("书面审理"); - caseLogRecord9.setContent("仲裁员将进行书面审理"); - CaseLogRecord caseLogRecord12 = new CaseLogRecord(); - caseLogRecord11.setCaseNode(12); - caseLogRecord11.setCaseNodeName("核验裁决书"); - caseLogRecord11.setContent("法律顾问将进行核验裁决书"); - CaseLogRecord caseLogRecord13 = new CaseLogRecord(); - caseLogRecord12.setCaseNode(13); - caseLogRecord12.setCaseNodeName("确认裁决书"); - caseLogRecord12.setContent("仲裁员将进行确认裁决书"); - CaseLogRecord caseLogRecord14 = new CaseLogRecord(); - caseLogRecord13.setCaseNode(14); - caseLogRecord13.setCaseNodeName("裁决书签名"); - caseLogRecord13.setContent("仲裁员将进行裁决书签名"); - CaseLogRecord caseLogRecord15 = new CaseLogRecord(); - caseLogRecord14.setCaseNode(15); - caseLogRecord14.setCaseNodeName("裁决书用印"); - caseLogRecord14.setContent("部门长将进行裁决书用印"); - CaseLogRecord caseLogRecord16 = new CaseLogRecord(); - caseLogRecord15.setCaseNode(16); - caseLogRecord15.setCaseNodeName("裁决书送达"); - caseLogRecord15.setContent("法律顾问将进行裁决书送达"); - caseLogRecord16.setCaseNode(17); - caseLogRecord16.setCaseNodeName("案件归档"); - caseLogRecord16.setContent("法律顾问将进行案件归档"); - - - List caseLogRecords = new ArrayList<>(); - switch (caseStatus.toString()) { - case "0": - caseLogRecords.add(caseLogRecord1); - caseLogRecords.add(caseLogRecord2); - caseLogRecords.add(caseLogRecord3); - caseLogRecords.add(caseLogRecord4); - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - break; - case "1": - caseLogRecords.add(caseLogRecord2); - caseLogRecords.add(caseLogRecord3); - caseLogRecords.add(caseLogRecord4); - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - break; - case "2": - caseLogRecords.add(caseLogRecord3); - caseLogRecords.add(caseLogRecord4); - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - break; - case "3": - caseLogRecords.add(caseLogRecord4); - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "4": - caseLogRecords.add(caseLogRecord5); - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "5": - caseLogRecords.add(caseLogRecord6); - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "6": - caseLogRecords.add(caseLogRecord7); - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "7": - caseLogRecords.add(caseLogRecord8); - caseLogRecords.add(caseLogRecord9); - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "8": - case "9": - caseLogRecords.add(caseLogRecord11); - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - break; - - case "11": - caseLogRecords.add(caseLogRecord12); - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "12": - caseLogRecords.add(caseLogRecord13); - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "13": - caseLogRecords.add(caseLogRecord14); - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "14": - caseLogRecords.add(caseLogRecord15); - caseLogRecords.add(caseLogRecord16); - - break; - case "15": - caseLogRecords.add(caseLogRecord16); - - break; - default: - List caseLogRecords1 = new ArrayList<>(); } - - return caseLogRecords; - - + lastNodeRecord.setCaseNodeName(caseNodeName); + lastNodeRecord.setCaseNode(caseNode); + lastNodeRecord.setContent(content); + lastNodeRecord.setNextRoleName(nextRoleName); + return lastNodeRecord; } + /** + * 获取已完成节点流程 + * @param caseStatus 当前案件状态 + + * @return + */ private CaseLogRecord getInCasenode(Integer caseStatus) { CaseLogRecord caseLogRecord = new CaseLogRecord(); + switch (caseStatus.toString()) { + case "0": + caseLogRecord.setCaseNodeName("案件提交"); + caseLogRecord.setCaseNode(0); + caseLogRecord.setContent("申请人正在进行案件提交"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; + case "1": + caseLogRecord.setCaseNodeName("立案审查"); + caseLogRecord.setCaseNode(1); + caseLogRecord.setContent("法律顾问正在进行立案审查"); + caseLogRecord.setNextRoleName("下一节点角色:申请人"); + break; + case "2": + caseLogRecord.setCaseNodeName("缴费"); + caseLogRecord.setCaseNode(2); + caseLogRecord.setContent("申请人正在进行缴费"); + caseLogRecord.setNextRoleName("下一节点角色:财务"); + break; + case "3": + caseLogRecord.setCaseNodeName("缴费确认"); + caseLogRecord.setCaseNode(3); + caseLogRecord.setContent("财务正在进行缴费确认"); + caseLogRecord.setNextRoleName("下一节点角色:被申请人"); + break; + case "4": + caseLogRecord.setCaseNodeName("案件质证"); + caseLogRecord.setCaseNode(4); + caseLogRecord.setContent("被申请人将进行案件质证"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; + case "5": + caseLogRecord.setCaseNodeName("组庭审核"); + caseLogRecord.setCaseNode(5); + caseLogRecord.setContent("法律顾问正在进行组庭审核"); + caseLogRecord.setNextRoleName("下一节点角色:部门长"); + break; + case "6": + caseLogRecord.setCaseNodeName("组庭确定"); + caseLogRecord.setCaseNode(6); + caseLogRecord.setContent("部门长正在进行组庭确定"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; + case "7": + caseLogRecord.setCaseNodeName("审核仲裁方式"); + caseLogRecord.setCaseNode(7); + caseLogRecord.setContent("仲裁员正在进行审核仲裁方式"); + caseLogRecord.setNextRoleName("下一节点角色:秘书顾问"); + break; + case "8": + caseLogRecord.setCaseNodeName("开庭审理"); + caseLogRecord.setCaseNode(8); + caseLogRecord.setContent("仲裁员正在进行开庭审理"); + caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); + break; + case "9": + caseLogRecord.setCaseNodeName("书面审理"); + caseLogRecord.setCaseNode(9); + caseLogRecord.setContent("仲裁员正在进行书面审理"); + caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); + break; + case "11": + caseLogRecord.setCaseNodeName("核验裁决书"); + caseLogRecord.setCaseNode(11); + caseLogRecord.setContent("法律顾问正在进行核验裁决书"); + caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); + break; + case "18": + caseLogRecord.setCaseNodeName("仲裁员审核裁决书"); + caseLogRecord.setCaseNode(11); + caseLogRecord.setContent("仲裁员正在进行审核裁决书"); + caseLogRecord.setNextRoleName("下一节点角色:部门长"); + break; + case "12": + caseLogRecord.setCaseNodeName("确认裁决书"); + caseLogRecord.setCaseNode(18); + caseLogRecord.setContent("部门长正在进行确认裁决书"); + caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); + break; + case "13": + caseLogRecord.setCaseNodeName("裁决书签名"); + caseLogRecord.setCaseNode(13); + caseLogRecord.setContent("仲裁员正在进行裁决书签名"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; + case "14": + caseLogRecord.setCaseNodeName("裁决书用印"); + caseLogRecord.setCaseNode(14); + caseLogRecord.setContent("部门长正在进行裁决书用印"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; + case "15": + caseLogRecord.setCaseNodeName("裁决书送达"); + caseLogRecord.setCaseNode(15); + caseLogRecord.setContent("法律顾问正在进行裁决书送达"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; + case "16": + caseLogRecord.setCaseNodeName("案件归档"); + caseLogRecord.setCaseNode(16); + caseLogRecord.setContent("法律顾问正在进行案件归档"); + break; + case "17": + caseLogRecord.setCaseNodeName("案件已归档"); + caseLogRecord.setCaseNode(17); + caseLogRecord.setContent(""); + break; + case "31": + caseLogRecord.setCaseNodeName("修改开庭时间"); + caseLogRecord.setCaseNode(31); + caseLogRecord.setContent("顾问正在修改开庭时间"); + break; + default: + caseLogRecord.setCaseNodeName(""); + caseLogRecord.setContent(""); + + } + return caseLogRecord; + } + /** + * 获取节点流程 + * @param caseStatus 当前案件状态 + + * @return + */ + private CaseLogRecord getInCasenode1(Integer caseStatus) { + CaseLogRecord caseLogRecord = new CaseLogRecord(); + + switch (caseStatus.toString()) { + case "0": + caseLogRecord.setCaseNodeName("案件提交"); + caseLogRecord.setCaseNode(0); + caseLogRecord.setContent("申请人正在进行案件提交"); + caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); + break; case "1": caseLogRecord.setCaseNodeName("立案审查"); caseLogRecord.setCaseNode(1); @@ -1213,6 +1126,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseLogRecord.setCaseNode(16); caseLogRecord.setContent("法律顾问正在进行案件归档"); break; + case "31": + caseLogRecord.setCaseNodeName("修改开庭时间"); + caseLogRecord.setCaseNode(31); + caseLogRecord.setContent("顾问正在修改开庭时间"); + break; default: caseLogRecord.setCaseNodeName(""); caseLogRecord.setContent(""); @@ -1220,7 +1138,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } return caseLogRecord; } - @Override public List selectCaseApplicationList(CaseApplication caseApplication) { return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); @@ -1381,6 +1298,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public int insertcaseApplication1(CaseApplication caseApplication) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 @@ -1455,7 +1373,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAttachMapper.batchSave(caseAttachList); } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); // 新增案件日志表 caseApplication.setCaseAppliId(caseApplication.getId()); @@ -1769,6 +1687,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public int submitCaseApplication(List ids) { + int rows = 0; // 查询案件信息,做必填校验,校验不通过,提示,不能提交 StringBuilder errorMsg = new StringBuilder(); @@ -1780,6 +1699,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 转换为Map>形式 Map> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliate::getCaseAppliId)); for (Long id : ids) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); // 必填校验 CaseApplication caseApplication = applicationMap.get(id); // 基本字段校验 @@ -1827,7 +1747,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { application.setCaseStatus(CaseApplicationConstants.CASE_CHECK); rows += caseApplicationMapper.submitCaseApplication(application); // 新增日志 - insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, ""); + insertCaseLog(application.getId(), currentStatus, ""); } } return rows; @@ -1896,8 +1816,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); } } - StringBuffer applicantName = new StringBuffer(); - StringBuffer respondentName = new StringBuffer(); + StringBuilder applicantName = new StringBuilder(); + StringBuilder respondentName = new StringBuilder(); for (int i = 0; i < caseAffiliatListeselect.size(); i++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); int identityType = caseAffiliateselect.getIdentityType(); @@ -1905,14 +1825,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (StrUtil.isNotEmpty(caseAffiliateselect.getName()) && deptMap.containsKey(caseAffiliateselect.getName())) { caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } - applicantName.append(caseAffiliateselect.getName()).append(","); + applicantName.append(caseAffiliateselect.getName()).append(Constants.CN_SPLIT_COMMA); ; } else if (identityType == 2) { - respondentName.append(caseAffiliateselect.getName()).append(","); + respondentName.append(caseAffiliateselect.getName()).append(Constants.CN_SPLIT_COMMA); } } - caseApplicationselect.setApplicantName(applicantName.toString()); - caseApplicationselect.setRespondentName(respondentName.toString()); + caseApplicationselect.setApplicantName(removeLastComma(applicantName.toString(), Constants.CN_SPLIT_COMMA)); + caseApplicationselect.setRespondentName(removeLastComma(respondentName.toString(), Constants.CN_SPLIT_COMMA)); caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect); caseApplicationselect.setArbitrateRecord(arbitrateRecordselect); if(arbitrateRecordselect!=null){ @@ -1924,7 +1844,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } return caseApplicationselect; } - + /** + * 去除字符串末尾特殊字符 + * @param input 字符串 + * @param str 去除字符串末尾的特殊字符 + * @return + */ + public String removeLastComma(String input,String str) { + if(StrUtil.isEmpty(input)){ + return input; + } + if (input.endsWith(str)) { + return input.substring(0, input.length() - 1); + } + return input; // 如果没有末尾逗号,则直接返回原字符串 + } @Override @Transactional public String importCaseApplication(List caseApplicationList, String operName) { @@ -2073,45 +2007,39 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public AjaxResult pendTralCheck(CaseApplication caseApplication) { - Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); - caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); - int rows = 0; + CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); + if(caseApplicationselect==null){ + throw new ServiceException("案件不存在"); + } + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + for (Arbitrator arbitrator : caseApplication.getArbitrators()) { - CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - if(caseApplicationselect==null){ - throw new ServiceException("案件不存在"); + caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + + if(arbitrator.getId()==null || StrUtil.isEmpty(arbitrator.getArbitratorName())){ + return AjaxResult.warn("请选择仲裁员"); } + caseApplication.setArbitratorId(String.valueOf(arbitrator.getId())); + caseApplication.setArbitratorName(arbitrator.getArbitratorName()); caseApplication.setLockStatus(1); - rows = caseApplicationMapper.submitCaseApplication(caseApplication); - - // List arbitrators = caseApplication.getArbitrators(); - -// if( StringUtils.isEmpty(arbitratorId) && StringUtils.isEmpty(arbitratorName)){ -// List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); -// List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); -// String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); -// String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(",")); -// caseApplication.setArbitratorId(idstr); -// caseApplication.setArbitratorName(arbitratorNamestr); -// caseApplication.setLockStatus(1); -// rows = caseApplicationMapper.submitCaseApplication(caseApplication); -// } - + caseApplicationMapper.submitCaseApplication(caseApplication); + } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); return success(); } @Override @Transactional public int verificationArbitrateRecord(CaseApplication caseApplication) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); // 秘书核验裁决书,流转到待仲裁员审核裁决书 caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); return rows; } @@ -2125,6 +2053,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public AjaxResult checkArbitrateRecord(CaseApplication caseApplication) { int rows = 0; + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); @@ -2310,7 +2239,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(),currentStatus , ""); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 @@ -2320,7 +2249,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { notes="部门长驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes); + insertCaseLog(caseApplication.getId(),currentStatus , notes); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } @@ -2336,6 +2265,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public AjaxResult arbitratorCheckArbitrateRecord(CaseApplication caseApplication) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); // 同意后状态改为待部门长审核裁决书(CHECK_ARBITRATION = 12),拒绝改为待秘书核验裁决书(VERPRIF_ARBITRATION = 11) int rows = 0; Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); @@ -2344,7 +2274,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); if(arbitrateRecord.getId()!=null){ @@ -2360,7 +2290,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { notes="仲裁员驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, notes); + insertCaseLog(caseApplication.getId(), currentStatus, notes); } return success(); } @@ -2373,6 +2303,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //提交立案审查 int rows = 0; for (Long id : ids) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); String notes=""; CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); @@ -2381,13 +2312,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); rows += caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, notes); + insertCaseLog(caseApplication.getId(), currentStatus, notes); } else if (agreeOrNotCheck == 2) {//拒绝审核 notes="驳回立案申请,驳回原因:"+caseCheckReject; caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); rows += caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, notes); + insertCaseLog(caseApplication.getId(), currentStatus, notes); ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); arbitrateRecordsel.setCaseAppliId(id); ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); @@ -2599,187 +2530,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return sealSignRecordReslt; } - @Override - @Transactional - public AjaxResult creatTrialRecord(ArbitrateRecord arbitrateRecordselect) { - //生成仲裁结果 - CaseApplication caseApplicationselect = new CaseApplication(); - caseApplicationselect.setId(arbitrateRecordselect.getCaseAppliId()); - CaseApplication caseApplication = caseApplicationMapper.selectCaseApplication(caseApplicationselect); - String createBy = caseApplication.getCreateBy(); - if (createBy != null) { - arbitrateRecordselect.setCreateBy(createBy); - } - // - CaseApplication caseApplicationupdate = new CaseApplication(); - caseApplicationupdate.setId(arbitrateRecordselect.getCaseAppliId()); - caseApplicationupdate.setIsAbsence(arbitrateRecordselect.getIsAbsence()); - caseApplicationupdate.setAppliIsAbsen(arbitrateRecordselect.getAppliIsAbsen()); - caseApplicationupdate.setRespondentOpinion(arbitrateRecordselect.getRespondentOpinion()); - caseApplicationupdate.setApplicantOpinion(arbitrateRecordselect.getApplicantOpinion()); - caseApplicationupdate.setCaseFacts(arbitrateRecordselect.getCaseFacts()); - caseApplicationupdate.setCaseFocus(arbitrateRecordselect.getCaseFocus()); - caseApplicationMapper.submitCaseApplication(caseApplicationupdate); - //先判断案件是否已经提交过仲裁结果 - ArbitrateRecord arbitrateRecordsele = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordselect); - if (arbitrateRecordsele != null) { - int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordselect); - if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication.getId()); - caseLogRecord.setCaseNode(caseApplication.getCaseStatus()); - if (createBy != null) { - caseLogRecord.setCreateBy(createBy); - } - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); - - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); - - - } - } else { - //提交仲裁结果 - int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordselect); - - if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication.getId()); - caseLogRecord.setCaseNode(caseApplication.getCaseStatus()); - if (createBy != null) { - caseLogRecord.setCreateBy(createBy); - } - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); - - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); - - } - } - - //生成庭审笔录 - try { - Map datas = new HashMap<>(); - Long id = caseApplication.getId(); - if (id == null) { - return null; - } - - //获取仲裁记录表里的相关信息 - ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); - arbitrateRecord.setCaseAppliId(id); - ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); - - //获取案件关联人信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - if (identityType == 1) { //申请人 - datas.put("appName", affiliate.getName()); - datas.put("appIDNo", affiliate.getIdentityNum()); - datas.put("appAddress", affiliate.getContactAddress()); - datas.put("appAgentName", affiliate.getNameAgent()); - datas.put("appAgentIDNo", affiliate.getIdentityNumAgent()); - } else if (identityType == 2) { //被申请人 - datas.put("resName", affiliate.getName()); - datas.put("resIDNo", affiliate.getIdentityNum()); - datas.put("resAddress", affiliate.getContactAddress()); - datas.put("resAgentName", affiliate.getNameAgent()); - datas.put("resAgentIDNo", affiliate.getIdentityNumAgent()); - } - } - } - String arbitratorName = caseApplication.getArbitratorName(); - datas.put("caseName", caseApplication.getCaseName()); - datas.put("caseNum", caseApplication.getCaseNum()); - datas.put("arbitratorName", arbitratorName); - Date hearDate = caseApplication.getHearDate(); - if (hearDate != null) { - LocalDate localDate = hearDate.toInstant() - .atZone(ZoneId.systemDefault()) - .toLocalDate(); - datas.put("hearYear", localDate.getYear()); - datas.put("hearMonths", localDate.getMonthValue()); - datas.put("hearDay", localDate.getDayOfMonth()); - } else { - datas.put("hearYear", null); - datas.put("hearMonths", null); - datas.put("hearDay", null); - } - datas.put("appArbitrationClaims", caseApplication.getArbitratClaims()); - datas.put("evidenDetermi", "认定为申请人证据充足"); - datas.put("factDetermi", "被申请人欠款属实"); - datas.put("caseSketch", "申请人所求通过"); - datas.put("arbitrateThink", "被申请人应按约定还款"); - datas.put("rulingFollows", "被申请人依法偿还申请人欠款"); - datas.put("legalProvisions", "仲裁法"); - LocalDate now = LocalDate.now(); - String year = Integer.toString(now.getYear()); - String month = String.format("%02d", now.getMonthValue()); - String day = String.format("%02d", now.getDayOfMonth()); - datas.put("year", year); - datas.put("months", month); - datas.put("day", day); - String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx"; -// String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx"; - String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; -// String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth(); - String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; - String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; - String resultFilePath = saveFolderPath + "/" + fileName; - // 创建日期目录 - File saveFolder = new File(saveFolderPath); - if (!saveFolder.exists()) { - saveFolder.mkdirs(); - } - Path sourcePath = new File(modalFilePath).toPath(); - Path destinationPath = new File(resultFilePath).toPath(); - Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); - String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); - String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); - -// String savePath = saveFolderPath; -// saveName = fileName; - - caseApplication.setAnnexType(7); - List caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplication); - if (caseAttachs != null && caseAttachs.size() > 0) { - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(7) - .build(); - int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach); - - } else { - //将庭审笔录保存到附件表里 - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(7) - .build(); - int i = caseAttachMapper.save(caseAttach); - - } - - //获取案件详细信息 - CaseApplication caseApplicationSelct = selectCaseApplication(caseApplication); - return success(caseApplicationSelct); - } catch (IOException e) { - e.printStackTrace(); - return AjaxResult.error("生成庭审笔录异常"); - } - - } @Override @Transactional @@ -2800,7 +2551,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //提交仲裁结果 int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordselect); } - return success(); + // 生成裁决书 + return adjudicationService.caseJudgment(caseApplicationupdate); } @@ -3045,6 +2797,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public int submitCaseApplicationBatch(String batchNumber) { + int rows = 0; CaseApplication caseApplicationsel = new CaseApplication(); caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber)); @@ -3057,6 +2810,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 转换为Map>形式 Map> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliate::getCaseAppliId)); for (Long id : ids) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); // 查询案件信息,做必填校验,校验不通过,提示,不能提交 StringBuilder errorMsg = new StringBuilder(); // 必填校验 @@ -3106,7 +2860,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { application.setCaseStatus(CaseApplicationConstants.CASE_CHECK); rows += caseApplicationMapper.submitCaseApplication(application); // 新增日志 - insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, ""); + insertCaseLog(application.getId(),currentStatus , ""); } }else{ @@ -3127,6 +2881,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List ids = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); if(caseApplications!=null&&caseApplications.size()>0){ for (Long id : ids) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); String notes=""; CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); @@ -3136,14 +2891,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); rows += caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, notes); + insertCaseLog(caseApplication.getId(), currentStatus, notes); } else if (agreeOrNotCheck == 2) { //拒绝审核 notes="驳回立案申请,驳回原因:"+caseCheckReject; caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); rows += caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, notes); + insertCaseLog(caseApplication.getId(), currentStatus, notes); ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); arbitrateRecordsel.setCaseAppliId(id); ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); @@ -3226,6 +2981,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); if (caseApplications1 != null && caseApplications1.size() > 0) { for(CaseApplication caseApplicationse:caseApplications1){ + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); //同意组庭 if (isAgreePendTral != null && isAgreePendTral == 1) { @@ -3257,7 +3013,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); } }else{ @@ -3277,6 +3033,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); if (caseApplications != null && caseApplications.size() > 0) { for(CaseApplication caseApplicationse:caseApplications){ + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); caseApplicationse.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); caseApplicationse.setIsAgreePendTral(isAgreePendTral); if (isAgreePendTral != null && isAgreePendTral == 1) { @@ -3299,7 +3056,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { request.setTemplateId("2033619"); sendHearDateMessage(caseApplicationse, request, "2033619"); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION_METHOD, ""); + insertCaseLog(caseApplication.getId(),currentStatus , ""); } }else{ @@ -3318,13 +3075,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { int rows = 0; if (caseApplications != null && caseApplications.size() > 0) { for(CaseApplication caseApplicationse:caseApplications){ + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); // 秘书核验裁决书,流转到待仲裁员审核裁决书 caseApplicationse.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); // ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); // arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); // 新增日志 - insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, ""); + insertCaseLog(caseApplicationse.getId(), currentStatus, ""); } }else{ throw new ServiceException("这个批号没有批量核验裁决书的案件"); @@ -3345,12 +3103,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); if (caseApplications1 != null && caseApplications1.size() > 0) { for(CaseApplication caseApplicationse:caseApplications1){ + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); if (agreeOrNotCheck.intValue() == 1) { caseApplicationse.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION); rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); + insertCaseLog(caseApplication.getId(),currentStatus, ""); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); @@ -3374,7 +3133,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { notes="仲裁员驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); } // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, notes); + insertCaseLog(caseApplication.getId(), currentStatus, notes); } } @@ -3396,6 +3155,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); if (caseApplications1 != null && caseApplications1.size() > 0) { for(CaseApplication caseApplicationse:caseApplications1){ + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); if (agreeOrNotCheck.intValue() == 1) { try { //获取当前案件的裁决书 @@ -3578,7 +3338,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseApplicationse.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); // 新增日志 - insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.SIGN_ARBITRATION, ""); + insertCaseLog(caseApplicationse.getId(),currentStatus, ""); rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); } else if (agreeOrNotCheck.intValue() == 2) { caseApplicationse.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); @@ -3587,7 +3347,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { notes="部门长驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); } // 新增日志 - insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes); + insertCaseLog(caseApplicationse.getId(), currentStatus, notes); rows = caseApplicationMapper.submitCaseApplication(caseApplicationse); @@ -3714,7 +3474,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public int pendTralSure(CaseApplication caseApplication) { // caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); - + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); caseApplication.setLockStatus(1); Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); @@ -3742,7 +3502,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 发送开庭日期通知短信 sendHearDateMessage(caseApplication, request, "2033619"); // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + insertCaseLog(caseApplication.getId(), currentStatus, ""); return rows; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index 499233f..fc4b082 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -65,6 +65,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { if (caseApplication1 == null) { return AjaxResult.success(); } + Integer currentStatus = caseApplication1.getCaseStatus(); Integer arbitratMethodOriral = caseApplication.getArbitratMethod(); String caseNum = caseApplication1.getCaseNum(); @@ -76,14 +77,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { //修改案件状态为待修改开庭时间 // caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } else { caseApplication1.setArbitratMethod(2); //修改案件状态为待书面审理 caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } } else if (opinion == 1 ) { @@ -92,16 +93,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { caseApplication1.setArbitratMethod(2); caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } else { //修改案件状态为待修改开庭时间 caseApplication1.setArbitratMethod(1); caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); - //修改案件状态为待修改开庭时间 -// caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, ""); } }else if (opinion == 2) { @@ -110,16 +109,14 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { caseApplication1.setArbitratMethod(2); caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } else { //修改案件状态为待修改开庭时间 caseApplication1.setArbitratMethod(1); caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); - //修改案件状态为待修改开庭时间 -// caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } } @@ -174,20 +171,21 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); if (caseApplications1 != null && caseApplications1.size() > 0) { for(CaseApplication caseApplicationse:caseApplications1){ + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); String caseNum = caseApplicationse.getCaseNum(); Integer arbitratMethod = caseApplication.getArbitratMethod(); if (arbitratMethod == 1) { caseApplicationse.setArbitratMethod(1); caseApplicationse.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); }else if (arbitratMethod == 2) { //修改案件状态为待书面审理 caseApplicationse.setArbitratMethod(2); caseApplicationse.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } int i = caseApplicationMapper.submitCaseApplication(caseApplicationse); @@ -255,13 +253,8 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { caseApplication.setId(caseId); CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication1.getId()); - caseLogRecord.setCaseNode(caseApplication1.getCaseStatus()); - caseLogRecord.setCreateBy(getUsername()); - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), caseApplication1.getCaseStatus(), ""); // 生成裁决书 CaseApplication application = new CaseApplication(); @@ -297,28 +290,18 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { if (arbitrateRecord1 != null) { int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication1.getId()); - caseLogRecord.setCaseNode(caseApplication1.getCaseStatus()); - caseLogRecord.setCreateBy(getUsername()); - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); + // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), caseApplication1.getCaseStatus(), ""); } } else { //提交仲裁结果 int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord); if (i > 0) { - //案件日志表里添加数据 - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(caseApplication1.getId()); - caseLogRecord.setCaseNode(caseApplication1.getCaseStatus()); - caseLogRecord.setCreateBy(getUsername()); - caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); + // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), caseApplication1.getCaseStatus(), ""); } } // 生成裁决书 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index b1694c6..aecff46 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -182,7 +182,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { IdentityAuthentication authentication = new IdentityAuthentication(); LoginUser loginUser = SecurityUtils.getLoginUser(); // 查询该用户的角色 - // 查询登录人身份证号 + // 查询登录人手机号 SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId()); String username = sysUser.getUserName(); List roles = sysUser.getRoles(); @@ -196,25 +196,27 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } } } - if(adMinFlag!=1) { - authentication.setUserName(username); - IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication); - if (authentication1 != null) { - identityNum = authentication1.getIdentityNo(); - } - } - +// if(adMinFlag!=1) { +// authentication.setUserName(username); +// IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication); +// if (authentication1 != null) { +// identityNum = authentication1.getIdentityNo(); +// } +// } + String phone=sysUser.getPhonenumber(); List caseStatusList = Arrays.asList(caseStatus); - return getCaseEvidenceVOList(identityNum, caseStatusList, 2); +// return getCaseEvidenceVOList(identityNum, caseStatusList, 2); + return getCaseEvidenceVOListByPhone(phone, caseStatusList, 2); } @Override public AjaxResult evidenceConfirmation(CaseApplication caseApplication) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); int i = caseApplicationMapper.submitCaseApplication(caseApplication); if (i > 0) { // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_TRIAL, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, ""); return AjaxResult.success("证据确认成功"); } @@ -252,7 +254,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { int i = caseApplicationMapper.submitCaseApplication(caseApplication1); if (i > 0) { // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), caseStatus, ""); return AjaxResult.success("提交成功"); } @@ -430,18 +432,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { .userId(userId) .userName(username) .build(); - - CaseApplication caseApplicationsel = new CaseApplication(); - caseApplicationsel.setId(id); - caseApplicationsel.setAnnexType(7); - List caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplicationsel); - if(caseAttachs!=null&&caseAttachs.size()>0){ - caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,7); - int count = caseAttachMapper.save(caseAttach); - }else { - int count = caseAttachMapper.save(caseAttach); - } - + caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,annexType); + int count = caseAttachMapper.save(caseAttach); return AjaxResult.success("上传成功"); } catch (IOException e) { e.printStackTrace(); @@ -488,7 +480,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } private List getCaseEvidenceVOList(String identityNum, List caseStatusList, Integer identityType) { - List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType); + List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType,null,SecurityUtils.getUsername()); // todo 返回房间号和开庭时间 if (caseListByRespondent != null && caseListByRespondent.size() > 0) { for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { @@ -508,4 +500,25 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } return null; } + private List getCaseEvidenceVOListByPhone(String phone, List caseStatusList, Integer identityType) { + List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(null, caseStatusList, identityType,phone,SecurityUtils.getUsername()); + // todo 返回房间号和开庭时间 + if (caseListByRespondent != null && caseListByRespondent.size() > 0) { + for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { + //根据案件id查询姓名 + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + for (CaseAffiliate affiliate : caseAffiliates) { + if (affiliate.getIdentityType() == 1) { //申请人 + caseEvidenceVO.setApplicantName(affiliate.getName()); + } else { + caseEvidenceVO.setRespondentName(affiliate.getName()); + } + } + } + return caseListByRespondent; + } + return null; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java index 78ff7f5..a4d0544 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java @@ -4,12 +4,15 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; +import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -17,10 +20,13 @@ import java.util.Optional; public class CaseLogRecordServiceImpl implements ICaseLogRecordService { @Autowired private CaseLogRecordMapper caseLogRecordMapper; - + @Autowired + private CaseApplicationMapper applicationMapper; @Override public List selectCaseLogRecordList(CaseLogRecord caseLogRecord) { + CaseApplication caseApplicationReq = new CaseApplication(); + caseApplicationReq.setId(caseLogRecord.getCaseAppliId()); List records = caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord); if(CollectionUtil.isNotEmpty(records)){ records.forEach(record->{ diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index b5e2939..71764bf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -118,6 +118,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { for (Long id : batchCaseApplication.getIds()) { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); + // 查询当前案件节点 + Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(id); if(batchCaseApplication.getAgreeOrNotCheck().equals(1)){ // 同意,更新案件状态为案件质证 caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); @@ -222,9 +224,9 @@ public class CasePaymentServiceImpl implements ICasePaymentService { casePaymentRecordMapper.update(casePaymentRecord); // 新增日志 if(batchCaseApplication.getAgreeOrNotCheck().equals(1)) { - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); }else { - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, "拒绝原因:"+batchCaseApplication.getCaseCheckReject()); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "拒绝原因:"+batchCaseApplication.getCaseCheckReject()); } } } @@ -247,6 +249,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) { for (CaseAttach caseAttach : payDTO.getPayOrderList()) { caseAttach.setCaseAppliId(caseId); + // 先删除该案件缴费凭证,类型为8,在新增 + caseAttachMapper.deleteCaseAttach(caseId,8,caseAttach.getAnnexId()); caseAttachMapper.updateCaseAttach(caseAttach); } } @@ -255,6 +259,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(caseId); CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + Integer currentStatus=caseApplication1.getCaseStatus(); caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); //修改案件状态 int i = caseApplicationMapper.submitCaseApplication(caseApplication1); @@ -266,7 +271,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { paymentRecord.setPaymentStatus(1); casePaymentRecordMapper.saveRecord(paymentRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus ,""); } } @@ -399,6 +404,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { if (caseApplications != null && caseApplications.size() > 0) { List caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); for (Long caseId : caseIds) { + Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseId); CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(caseId); caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); @@ -475,7 +481,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { casePaymentRecord.setUpdateTime(new Date()); casePaymentRecordMapper.update(casePaymentRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java new file mode 100644 index 0000000..73a3e00 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java @@ -0,0 +1,268 @@ +package com.ruoyi.wisdomarbitrate.service.impl; + + +import com.alibaba.fastjson.JSONObject; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.ruoyi.common.constant.FileTransformation; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.EsignHttpResponse; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.common.utils.EmailOutUtil; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.SaaSAPIFileUtils; +import com.ruoyi.system.mapper.SysUserMapper; +import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.mapper.*; +import com.ruoyi.wisdomarbitrate.service.MsSignSealService; +import com.ruoyi.wisdomarbitrate.utils.SignAward; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import java.io.File; +import java.io.IOException; +import java.time.LocalDate; +import java.util.*; +import static com.ruoyi.common.core.domain.AjaxResult.error; + + +@Slf4j +@Service +public class MsSignSealServiceImpl implements MsSignSealService { + + + @Autowired + private CaseApplicationMapper caseApplicationMapper; + @Autowired + private SealSignRecordMapper sealSignRecordMapper; + @Autowired + private CaseAttachMapper caseAttachMapper; + @Autowired + private DeptIdentifyMapper deptIdentifyMapper; + @Autowired + private SealManageMapper sealManageMapper; + @Autowired + private CaseLogRecordMapper caseLogRecordMapper; + + /** + * 签署流程回调,即签名用印回调 + * + * @param reqbodystr + * @return + * @throws EsignDemoException + * @throws IOException + */ + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult signSeaalCaseApplicaCallback(String reqbodystr) throws EsignDemoException, IOException { + JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr); + Gson gson = new Gson(); + if (jsonObjectCallback != null) { + log.info("签名回调======" + jsonObjectCallback); + int signResult = jsonObjectCallback.getIntValue("signResult"); + String action = jsonObjectCallback.getString("action"); + String signFlowId = jsonObjectCallback.getString("signFlowId"); + Long operateTime = jsonObjectCallback.getLongValue("operateTime"); + JSONObject operator = jsonObjectCallback.getJSONObject("operator"); + JSONObject psnAccount = operator.getJSONObject("psnAccount"); + String accountMobile = psnAccount.getString("accountMobile"); + + SealSignRecord sealSignRecordsel = sealSignRecordMapper.selectSealByFlowId(signFlowId); + if (sealSignRecordsel == null) { + return error("未找到签署流程"); + } + + String pensonAccount = sealSignRecordsel.getPensonAccount(); + String orgnNamePsnAcc = sealSignRecordsel.getOrgnizeNamePsnAccount(); + String pensonName = sealSignRecordsel.getPensonName(); + String orgnNamePsnName = sealSignRecordsel.getOrgnizeNamepsnName(); + Date dateOperate = new Date(operateTime); + Long caseAppliId = sealSignRecordsel.getCaseAppliId(); + CaseApplication req = new CaseApplication(); + req.setId(caseAppliId); + + if ("SIGN_MISSON_COMPLETE".equals(action) && signResult == 2) { + if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(pensonAccount)) { + //申请人签名 + sealSignRecordsel.setSignStatusArbitor(1); + sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); + CaseLogRecord operLog = new CaseLogRecord(); + operLog.setCreateNickName(pensonName); + operLog.setCaseAppliId(caseAppliId); + operLog.setCaseNode(13); + operLog.setCreateTime(dateOperate); + caseLogRecordMapper.insertCaseLogRecord(operLog); + + CaseApplication application = new CaseApplication(); + application.setId(caseAppliId); + // 修改状态为待用印 + application.setCaseStatus(14); + caseApplicationMapper.updataCaseApplication(application); + + + } else if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(orgnNamePsnAcc)) { + //用印 + sealSignRecordsel.setSealStatus(1); + + sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); + CaseLogRecord operLog = new CaseLogRecord(); + operLog.setCreateNickName(orgnNamePsnName); + operLog.setCaseNode(14); + operLog.setCaseAppliId(caseAppliId); + operLog.setCreateTime(dateOperate); + caseLogRecordMapper.insertCaseLogRecord(operLog); + CaseApplication application = new CaseApplication(); + application.setId(caseAppliId); + // 案件状态为待送达 + application.setCaseStatus(15); + caseApplicationMapper.updataCaseApplication(application); + //下载审核完成的裁决书, + EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowId); + JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class); + JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data"); + JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray(); + if (filesArray != null && filesArray.size() > 0) { + JsonObject fileObject = (JsonObject) filesArray.get(0); + String fileDownloadUrl = fileObject.get("downloadUrl").toString(); + ///修改"签署用印记录表"的状态为完成 + sealSignRecordsel.setSignFlowStatus(3); + sealSignRecordsel.setFileDownloadUrl(fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1)); + sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); + + String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); + application.setFilearbitraUrl(filearbitraUrl); + caseApplicationMapper.submitCaseApplication(application); + + LocalDate now = LocalDate.now(); + String year = Integer.toString(now.getYear()); + String month = String.format("%02d", now.getMonthValue()); + String day = String.format("%02d", now.getDayOfMonth()); + String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; + String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf"; + String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + String savePath = "/home/ruoyi/uploadPath/upload/"; + + // 创建日期目录 + File saveFolder = new File(saveFolderPath); + if (!saveFolder.exists()) { + saveFolder.mkdirs(); + } + String resultFilePath = saveFolderPath + "/" + fileName; + File resultFilePathFile = new File(resultFilePath); + if (!resultFilePathFile.exists()) { + resultFilePathFile.createNewFile(); + } + + String fileDownloadUrlnew = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); + boolean downLoadFile = FileTransformation.downLoadFileByUrl(fileDownloadUrlnew, resultFilePath); + if (downLoadFile) { + CaseAttach caseAttach = new CaseAttach(); + caseAttach.setCaseAppliId(caseAppliId); + caseAttach.setAnnexType(3); + caseAttach.setAnnexPath(savePath); + caseAttach.setAnnexName(saveName); + caseAttachMapper.updateCaseAttachBycaseid(caseAttach); + } + + } + + + } + + } + + } else { + return AjaxResult.error("error"); + } + return AjaxResult.success("success"); + } + + + + + @Override + @Transactional(rollbackFor = Exception.class) + public AjaxResult sealCheckCallback(String reqbodystr) throws EsignDemoException, IOException { + JSONObject jsonObjectCallback = JSONObject.parseObject(reqbodystr); + Gson gson = new Gson(); + if (jsonObjectCallback != null) { + int auditStatus = jsonObjectCallback.getIntValue("auditStatus"); + String action = jsonObjectCallback.getString("action"); + String orgId = jsonObjectCallback.getString("orgId"); + String sealId = jsonObjectCallback.getString("sealId"); + + SealManage sealManage = new SealManage(); + DeptIdentify deptIdentify1 = new DeptIdentify(); + deptIdentify1.setOrgId(orgId); + List deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify1); + if (deptIdentifies != null && deptIdentifies.size() > 0) { + Long iddeptIdent = deptIdentifies.get(0).getId(); + SealManage sealManageSel = new SealManage(); + sealManageSel.setIdentifyId(iddeptIdent); + sealManageSel.setSealId(sealId); + List sealIdList = new ArrayList<>(); + List selectSealList = sealManageMapper.selectSealList(sealManageSel); + if (selectSealList != null && selectSealList.size() > 0) { + sealManage = selectSealList.get(0); + } + } + + if ("SEAL_AUDIT".equals(action) && auditStatus == 1) { + EsignHttpResponse response = SignAward.getOrgSeal(orgId, sealId); + JSONObject jsonObject = JSONObject.parseObject(response.getBody()); + int code = jsonObject.getIntValue("code"); + if (code == 0) { + JSONObject data = jsonObject.getJSONObject("data"); + int sealStatus = data.getIntValue("sealStatus"); + if (sealStatus == 1) {//印章状态 1已启用,2待审核,3审核不通过,4 挂起 + //已启用证明审核通过,下载到数据库 + String sealImageDownloadUrl = data.getString("sealImageDownloadUrl"); + LocalDate now = LocalDate.now(); + String year = Integer.toString(now.getYear()); + String month = String.format("%02d", now.getMonthValue()); + String day = String.format("%02d", now.getDayOfMonth()); + String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; + String fileName = UUID.randomUUID().toString().replace("-", "") + ".jpg"; + String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + String savePath = "/home/ruoyi/uploadPath/upload/"; + // 创建日期目录 + File saveFolder = new File(saveFolderPath); + if (!saveFolder.exists()) { + saveFolder.mkdirs(); + } + String resultFilePath = saveFolderPath + "/" + fileName; + File resultFilePathFile = new File(resultFilePath); + if (!resultFilePathFile.exists()) { + resultFilePathFile.createNewFile(); + } + boolean downLoadFile = FileTransformation.downLoadFileByUrl(sealImageDownloadUrl, resultFilePath); + if (downLoadFile) { + CaseAttach caseAttach = new CaseAttach(); + caseAttach.setAnnexType(10); //10代表印章图片 + caseAttach.setAnnexPath(savePath); + caseAttach.setAnnexName(saveName); + int i1 = caseAttachMapper.save(caseAttach); + if (i1 > 0) { + //将附件id保存到公章管理表里 + Long annexId1 = caseAttach.getAnnexId(); + sealManage.setAnnexId(annexId1); + sealManage.setSealStatus(1); + sealManage.setIsUse(0); + sealManageMapper.updateSealManage(sealManage); + } + } + } + } + } + } else { + return AjaxResult.error("error"); + } + return AjaxResult.success("success"); + } + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java new file mode 100644 index 0000000..f3f87d0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/DigesdateUtils.java @@ -0,0 +1,46 @@ +package com.ruoyi.wisdomarbitrate.utils; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.io.UnsupportedEncodingException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; + +public class DigesdateUtils { + + public static String getSignStr(String paramsStr, String accessSec ) { + Mac macDiges = null; + try { + macDiges = Mac.getInstance("HmacSHA256"); + SecretKeySpec accessSecKey = new SecretKeySpec(accessSec.getBytes("UTF-8"), "HmacSHA256"); + macDiges.init(accessSecKey); + macDiges.update(paramsStr.getBytes("UTF-8")); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + return null; + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + return null; + } catch (InvalidKeyException e) { + e.printStackTrace(); + return null; + } + return byteTrasferhex(macDiges.doFinal()); + } + + public static String byteTrasferhex(byte[] byteArrayData) { + StringBuilder hashBuilder = new StringBuilder(); + String stmpHex; + for (int n = 0; byteArrayData != null && n < byteArrayData.length; n++) { + stmpHex = Integer.toHexString(byteArrayData[n] & 0XFF); + if (stmpHex.length() == 1) + hashBuilder.append('0'); + hashBuilder.append(stmpHex); + } + return hashBuilder.toString(); + } + + + + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java index f176afc..913e297 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -43,7 +43,7 @@ public class FixSelectFlowDetailUtils { /* 定时查询签署流程详情 */ - @Scheduled(cron = "0/10 * * * * ?") +// @Scheduled(cron = "0/10 * * * * ?") @Transactional public void fixExecuteSelectFlowDetailUtils() { Gson gson = new Gson(); @@ -277,7 +277,7 @@ public class FixSelectFlowDetailUtils { /** * 定时查询印章审核状态 */ - @Scheduled(cron = "0/30 * * * * ?") +// @Scheduled(cron = "0/30 * * * * ?") @Transactional public void searchForInstitutionalSeal() { try { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java new file mode 100644 index 0000000..b344dad --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/SignVerifyUtils.java @@ -0,0 +1,96 @@ +package com.ruoyi.wisdomarbitrate.utils; + +import com.ruoyi.common.utils.EsignApplicaConfig; +import com.ruoyi.common.utils.StringUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.List; + +public class SignVerifyUtils { + private static String eSignAppSecret = EsignApplicaConfig.EsignAppSecret; + + + + public static boolean checkSignuter() throws Exception { + HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + String orialsignature = httprequest.getHeader("X-Tsign-Open-SIGNATURE"); + String timestampreq = httprequest.getHeader("X-Tsign-Open-TIMESTAMP"); + String reqQuerystr =getHttpreqQuery(); + //获取请求参数 + String reqbodystr =getRequestBody(); + String signOriaData = timestampreq + reqQuerystr + reqbodystr; + String newDisgSignuter= DigesdateUtils.getSignStr(signOriaData, eSignAppSecret); + + + if (StringUtils.equals(orialsignature, newDisgSignuter)) { + return true; + }else { + return false; + } + } + + + + public static String getHttpreqQuery() { + HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + List reqNames= new ArrayList(); + Enumeration httpreqEle =httprequest.getParameterNames(); + while (httpreqEle.hasMoreElements()){ + reqNames.add(httpreqEle.nextElement()); + } + Collections.sort(reqNames); + String httpreqQuery = ""; + for (String reqName : reqNames) { + String reqvalue = httprequest.getParameter(reqName); + httpreqQuery += reqvalue == null ? "" : reqvalue; + } + return httpreqQuery; + } + + public static String getRequestBody() { + HttpServletRequest httprequest = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest(); + String requestBody = ""; + int reqContentLen = httprequest.getContentLength(); + if (reqContentLen < 0) { + return null; + } + byte bufByteArray[] = new byte[reqContentLen]; + try { + for (int i = 0; i < reqContentLen;) { + int lengthReadInputStream = httprequest.getInputStream().read(bufByteArray, i, reqContentLen - i); + if (lengthReadInputStream == -1) { + break; + } + i += lengthReadInputStream; + } + } catch (IOException e) { + e.printStackTrace(); + } + try { + requestBody = new String(bufByteArray, "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return requestBody; + } + + + + + + + + + + + + + +} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index ea552c2..e7704b2 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -1291,6 +1291,11 @@ and c.arbitrator_id=#{caseApplication.arbitratorId} + + + and ca.identity_type=1 + + + + diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index af5aa3a..a5ec19d 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -119,6 +119,9 @@
- - + + delete from case_attach + where case_appli_id = #{caseId} + and annex_type = #{type} and annex_id!=#{annexId} + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml index 445d757..7bed4fe 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml @@ -11,7 +11,8 @@ \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml index 13801b5..bd37136 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -31,15 +31,17 @@ - SELECT s.id ,s.case_appli_id ,s.file_id ,s.sign_flow_id,s.penson_account ,s.orgnize_name ,s.orgn_name_psn_acc + SELECT s.* from seal_sign_record s @@ -42,7 +44,7 @@ @@ -102,9 +104,14 @@ sign_flow_status = #{signFlowStatus}, file_download_url = #{fileDownloadUrl} + sign_status_arbitor = #{signStatusArbitor} + seal_status = #{sealStatus} where id = #{id} + \ No newline at end of file -- 2.54.0 From 42c9a823636766679bd77a2c6cf6e0a0416d8e91 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Sat, 11 May 2024 09:05:59 +0800 Subject: [PATCH 46/55] =?UTF-8?q?=E4=BB=B2=E8=A3=81bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomarbitrate/CaseApplicationLogController.java | 2 +- .../service/impl/AdjudicationServiceImpl.java | 3 --- .../service/impl/CaseApplicationServiceImpl.java | 5 ----- .../service/impl/CaseEvidenceServiceImpl.java | 2 -- .../wisdomarbitrate/service/impl/CaseZipImportImpl.java | 1 - .../mapper/wisdomarbitrate/CaseLogRecordMapper.xml | 6 +++--- 6 files changed, 4 insertions(+), 15 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java index e980e1c..63f1e41 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationLogController.java @@ -65,7 +65,7 @@ public class CaseApplicationLogController { if(vo.getCaseId()==null || vo.getVersion()==null){ return AjaxResult.error("参数校验错误"); } - // todo 需确定 + return caseApplicationLogService.revoke(vo); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index f9544e9..a5aff97 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -141,7 +141,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService { @Override @Transactional public AjaxResult createDocument(CaseApplication caseApplicationReq) { - // todo 生成裁决书单独出接口,即确定审理结果接口,提交按钮只改变案件状态和生成签名链接 String templatePath = ""; String templateName = ""; @@ -348,7 +347,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService { hearDateStr = sdf.format(hearDate); datas.put("审理日期", hearDateStr); } - // todo 线上仲裁/线下仲裁方式未选择 //线上开庭时+线上仲裁 if (arbitratMethod != null && arbitratMethod == 1) { String replace = onLine.replace(onLineDate, Optional.of(hearDateStr).orElse("")); @@ -1344,7 +1342,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService { @Transactional @Override public AjaxResult batchDocument(List ids) { - // todo 多线程生成裁决书 // List execList=new ArrayList<>(); // if(CollectionUtil.isNotEmpty(columnValueList)) { // setExecList(execList, columnValueList); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 42cbad5..37ebea5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -223,7 +223,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { */ @Override public List selectCaseApplicationListByRole(CaseApplication caseApplication) { - // todo 案件列表查询Bug修复,需要看见已办案件 // 获取登录用户 LoginUser loginUser = getLoginUser(); SysUser user = loginUser.getUser(); @@ -386,7 +385,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { */ public List page(CaseApplication caseApplication) { List caseApplications= new ArrayList<>(); - // todo 案件列表查询Bug修复,需要看见已办案件 // 获取登录用户 LoginUser loginUser = getLoginUser(); SysUser user = loginUser.getUser(); @@ -1707,7 +1705,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (String baseColumn : baseColumns) { if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseApplication, baseColumn))){ errorMsg.append(baseColumn).append("不能为空,"); - // todo 暂抛出异常,后边改为提示具体的字段 throw new ServiceException("必填字段未填写,请完善案件信息!"); } } @@ -1721,7 +1718,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (String applicAffiliateColumn : applicAffiliateColumns) { if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){ errorMsg.append(applicAffiliateColumn).append("不能为空,"); - // todo 暂抛出异常,后边改为提示具体的字段 throw new ServiceException("必填字段未填写,请完善案件信息!"); } } @@ -1731,7 +1727,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (String applicAffiliateColumn : dectborAffiliateColumns) { if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){ errorMsg.append(applicAffiliateColumn).append("不能为空,"); - // todo 暂抛出异常,后边改为提示具体的字段 throw new ServiceException("必填字段未填写,请完善案件信息!"); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index aecff46..dd2a5b9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -481,7 +481,6 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { private List getCaseEvidenceVOList(String identityNum, List caseStatusList, Integer identityType) { List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType,null,SecurityUtils.getUsername()); - // todo 返回房间号和开庭时间 if (caseListByRespondent != null && caseListByRespondent.size() > 0) { for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { //根据案件id查询姓名 @@ -502,7 +501,6 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } private List getCaseEvidenceVOListByPhone(String phone, List caseStatusList, Integer identityType) { List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(null, caseStatusList, identityType,phone,SecurityUtils.getUsername()); - // todo 返回房间号和开庭时间 if (caseListByRespondent != null && caseListByRespondent.size() > 0) { for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { //根据案件id查询姓名 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java index 8bec27c..3635d83 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java @@ -692,7 +692,6 @@ public class CaseZipImportImpl { try { BigDecimal bigDecimal = new BigDecimal(caseSubjectAmount); caseApplication.setCaseSubjectAmount(bigDecimal); - // todo 案件标的名字要改,字典配置中也要改 //todo 暂时设置计费比率为0.01 BigDecimal feeRate = new BigDecimal(0.01); BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml index bd37136..4fb0e78 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -35,9 +35,9 @@ when 3 then '缴费确认' when 4 then '案件质证' when 5 then '组庭审核' when 6 then '组庭确定' when 7 then '审核仲裁方式' when 8 then '开庭审理' when 9 then '书面审理' - when 11 then '法律顾问核验裁决书' - when 18 then '仲裁员审核裁决书' - when 12 then '部门长审核裁决书' when 13 then '裁决书签名' when 14 then '裁决书用印' + when 11 then '核验裁决书' + when 18 then '审核裁决书' + when 12 then '审核裁决书' when 13 then '裁决书签名' when 14 then '裁决书用印' when 15 then '决书送达' when 16 then '案件归档' when 17 then '已归档' when 26 then '证据确认成功' when 31 then '修改开庭时间' -- 2.54.0 From bf43517b5c751930f3792466dcbcbfe0b0a85b89 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Sat, 11 May 2024 15:21:25 +0800 Subject: [PATCH 47/55] =?UTF-8?q?=E5=9B=9E=E8=B0=83=E5=8F=8A=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/common/CommonController.java | 29 +++- .../controller/system/SysMenuController.java | 9 ++ .../CaseApplicationController.java | 21 ++- .../wisdomarbitrate/VideoController.java | 131 +++++++++++++++++- .../ruoyi/system/service/ISysMenuService.java | 7 + .../service/impl/SysMenuServiceImpl.java | 9 ++ .../domain/ArbitrateRecord.java | 2 +- .../domain/CaseApplication.java | 6 +- .../wisdomarbitrate/domain/CaseAttach.java | 4 + .../service/ICaseApplicationService.java | 6 + .../wisdomarbitrate/service/VideoService.java | 1 + .../service/impl/AdjudicationServiceImpl.java | 78 +++++++++-- .../impl/CaseApplicationServiceImpl.java | 38 ++++- .../impl/CaseLogRecordServiceImpl.java | 6 +- .../service/impl/MsSignSealServiceImpl.java | 5 +- .../service/impl/VideoServiceImpl.java | 61 +++++++- .../resources/mapper/system/SysMenuMapper.xml | 2 +- .../wisdomarbitrate/ArbitrateRecordMapper.xml | 4 +- .../wisdomarbitrate/CaseApplicationMapper.xml | 3 + .../wisdomarbitrate/CaseAttachMapper.xml | 15 +- .../wisdomarbitrate/SealSignRecordMapper.xml | 17 ++- 21 files changed, 406 insertions(+), 48 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java index cec5006..af3c92e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java @@ -4,14 +4,15 @@ import java.util.ArrayList; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.Constants; @@ -36,6 +37,8 @@ public class CommonController private ServerConfig serverConfig; private static final String FILE_DELIMETER = ","; + @Autowired + CaseAttachMapper caseAttachMapper; /** * 通用下载请求 @@ -160,4 +163,22 @@ public class CommonController log.error("下载文件失败", e); } } + /** + * 根据案件id获取附件 + * @param caseAppliId + * @param annexTypeList + * @param + * @return + */ + @GetMapping("/fileList") + public AjaxResult fileList(@RequestParam("caseAppliId")Long caseAppliId, @RequestParam(value = "annexTypeList",required = false) List annexTypeList){ + if(caseAppliId==null){ + return AjaxResult.error("案件id不能为空"); + } + CaseApplication msCaseApplicationVO = new CaseApplication(); + msCaseApplicationVO.setId(caseAppliId); + msCaseApplicationVO.setAnnexTypeList(annexTypeList); + List caseAttachList = caseAttachMapper.queryCaseAttachList(msCaseApplicationVO); + return AjaxResult.success(caseAttachList); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java index 03b6b65..f519d6d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysMenuController.java @@ -139,4 +139,13 @@ public class SysMenuController extends BaseController } return toAjax(menuService.deleteMenuById(menuId)); } + /** + * 根据用户查询菜单权限字符 + */ + @GetMapping("/getMenuPermsByUser") + public AjaxResult getMenuPermsByUser() + { + + return menuService.getMenuPermsByUser(); + } } \ No newline at end of file diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 19c7d73..2ea1a73 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -152,7 +152,7 @@ public class CaseApplicationController extends BaseController { } /** - * 查询立案信息 + * 查询立案详情 */ // @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')") @PostMapping("/selectCaseApplication") @@ -161,6 +161,18 @@ public class CaseApplicationController extends BaseController { CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication); return success(caseApplicationselect); } + /** + * 视频会议中查询立案详情 + */ +// @PreAuthorize("@ss.hasPermi('caseManagement:list:detail')") + @GetMapping("/selectById") + public AjaxResult selectById(@RequestParam(required = false) Long id ,@RequestParam(required = false) String caseNum) { + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + caseApplication.setCaseNum(caseNum); + CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplication(caseApplication); + return success(caseApplicationselect); + } /** * 查询已签署裁决书URL @@ -460,9 +472,12 @@ public class CaseApplicationController extends BaseController { * @param arbitrateRecord * @return */ - @PostMapping("/creatTrialRecordnew") + @PostMapping("/confirmMeetingResult") // @PreAuthorize("@ss.hasPermi('caseManagement:list:creatTrialRecord')") - public AjaxResult creatTrialRecordnew(@Validated @RequestBody ArbitrateRecord arbitrateRecord){ + public AjaxResult creatTrialRecordnew( @RequestBody ArbitrateRecord arbitrateRecord){ + if(arbitrateRecord.getCaseAppliId()==null || arbitrateRecord.getAppliIsAbsen()==null || arbitrateRecord.getIsAbsence()==null){ + return error("参数校验失败"); + } return caseApplicationService.creatTrialRecordnew(arbitrateRecord); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java index db1f865..c02c52a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java @@ -2,13 +2,23 @@ package com.ruoyi.web.controller.wisdomarbitrate; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.annotation.Anonymous; +import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.common.utils.file.FileUtils; +import com.ruoyi.framework.config.ServerConfig; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO; +import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.service.VideoService; import com.ruoyi.wisdomarbitrate.service.WeChatUserService; import com.tencentcloudapi.common.Credential; @@ -25,6 +35,9 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import java.io.IOException; +import java.util.Objects; + +import static com.google.common.io.Files.getFileExtension; /** * @author wangqiong @@ -36,7 +49,12 @@ import java.io.IOException; public class VideoController extends BaseController { @Autowired private VideoService videoService; - + @Autowired + private ServerConfig serverConfig; + @Autowired + private CaseAttachMapper caseAttachMapper; + @Autowired + private ICaseApplicationService caseApplicationService; /** * 从腾讯云下载文件到本地 * @param @@ -144,6 +162,117 @@ public class VideoController extends BaseController { return videoService.attachListByCaseId(caseAppliId,annexType); } + /** + * 根据案件id查询申请人/被申请人会议上传附件按钮权限 + * @param caseId + * @return + */ + @Anonymous + @GetMapping("selectRoleMenuByCaseId") + public AjaxResult selectRoleMenuByCaseId( @RequestParam(value = "caseId",required = true) Long caseId) { + return videoService.selectRoleMenuByCaseId(caseId); + } + /** + * 通用上传请求(单个) + * param officeFlag: 是否上传到onlyoffice,0-否,1-是 + * param isMediaBook: 是否上仲裁书,1-是,其余为否 + */ + @PostMapping("/upload") + public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, @RequestParam(value = "isMediaBook",required = false) Integer isMediaBook, @RequestParam("annexType") Integer annexType, @RequestParam(value = "officeFlag", required = false) Integer officeFlag,@RequestParam(value = "caseId",required = false) Long caseId) throws Exception + { + try + { + // 上传文件路径 + String filePath = RuoYiConfig.getUploadPath(); + // 上传并返回新文件名称 + String fileName = FileUploadUtils.upload(filePath, file); + String suffix = getFileExtension(fileName); + if(StrUtil.isNotEmpty(suffix)&& suffix.contains("doc")){ + // 上传到onlyoffice + officeFlag=1; + } + String url = serverConfig.getUrl() + fileName; + if(officeFlag != null && officeFlag == 1){ + // officeFlag,fileName为annexPath + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,caseId); + if(jsonArray!=null && jsonArray.size() > 0) { + // 先删除之前的裁决书附件 + if(Objects.equals(annexType,3) && caseId!=null) { + caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType); + } + CaseAttach caseAttach=null; + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + caseAttach = CaseAttach.builder() + .caseAppliId(caseId) + .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"") + .annexType(annexType) + .onlyOfficeFileId(jsonObject.getString("fileId")) + .build(); + if(jsonObject.get("filePath")!=null){ + String officePath = jsonObject.getString("filePath"); + String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); + caseAttach.setAnnexPath(replace); + + } + caseAttachMapper.save(caseAttach); + } + if(caseAttach==null){ + return AjaxResult.error("上传失败"); + } + AjaxResult ajax = AjaxResult.success(); + ajax.put("annexId", caseAttach.getAnnexId()); + ajax.put("annexType", annexType); + // ajax.put("url", url); + ajax.put("fileName", fileName); + ajax.put("newFileName", FileUtils.getName(fileName)); + ajax.put("originalFilename", file.getOriginalFilename()); + return ajax; + }else { + return AjaxResult.error("上传失败"); + } + }else { + // 如果是调解书并且是pdf,则删除之前的在新增 +// if(isMediaBook != null && isMediaBook == 1 ){ +// if(StrUtil.isNotEmpty(suffix)&&!suffix.equals("pdf")){ +// return AjaxResult.error("请上传pdf格式文件"); +// } +// annexType=AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode(); +// // 先删除之前的附件 +// if(caseId!=null) { +// msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType); +// } +// } + Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId); + + AjaxResult ajax = AjaxResult.success(); + ajax.put("annexId", annexId); + ajax.put("annexType", annexType); + ajax.put("url", url); + ajax.put("fileName", fileName); + ajax.put("newFileName", FileUtils.getName(fileName)); + ajax.put("originalFilename", file.getOriginalFilename()); + return ajax; + } + } + catch (Exception e) + { + return AjaxResult.error(e.getMessage()); + } + } + private Long saveCaseAttach(Integer annexType, String path, String originalFilename,Long caseId) { + CaseAttach caseAttach = CaseAttach.builder() + .annexName(originalFilename) + .caseAppliId(caseId) + .annexPath(path) + .annexType(annexType) + .userId(SecurityUtils.getUserId()) + .userName(SecurityUtils.getUsername()) + .build(); + + caseAttachMapper.save(caseAttach); + return caseAttach.getAnnexId(); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java index 7d60696..6c33221 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java @@ -2,6 +2,8 @@ package com.ruoyi.system.service; import java.util.List; import java.util.Set; + +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.TreeSelect; import com.ruoyi.common.core.domain.entity.SysMenu; import com.ruoyi.system.domain.vo.RouterVo; @@ -141,4 +143,9 @@ public interface ISysMenuService * @return 结果 */ public boolean checkMenuNameUnique(SysMenu menu); + /** + * 根据用户查询菜单权限字符 + * @return + */ + AjaxResult getMenuPermsByUser(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java index 225c280..e0c565e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java @@ -8,6 +8,8 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; import java.util.stream.Collectors; + +import com.ruoyi.common.core.domain.AjaxResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.common.constant.Constants; @@ -528,4 +530,11 @@ public class SysMenuServiceImpl implements ISysMenuService return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, "." }, new String[] { "", "", "", "/" }); } + @Override + public AjaxResult getMenuPermsByUser() { + AjaxResult result = AjaxResult.success(); + List perms = menuMapper.selectMenuPermsByUserId(SecurityUtils.getUserId()); + result.put("perms",perms); + return result; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java index 64f7ef0..a86b846 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/ArbitrateRecord.java @@ -62,7 +62,7 @@ public class ArbitrateRecord extends BaseEntity { */ private String caseCheckReject; /** - * 仲裁员确认裁决书驳回 + * 裁决书驳回原因 */ private String arbitrateReject; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 8e27c69..7f1cf71 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -433,7 +433,11 @@ public class CaseApplication extends BaseEntity { // 缴费确认驳回原因 private String payRejectReason; /** - * 仲裁员确认裁决书驳回 + * 仲裁员确认裁决书驳回原因 */ private String arbitrateReject; + /** + * deptorReject:部门长驳回原因 + */ + private String deptorReject; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java index 1be717c..31c502f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java @@ -23,6 +23,10 @@ public class CaseAttach { * 案件记录id */ private Long caseAppliLogId; + /** + * onlyOffice附件id + */ + private String onlyOfficeFileId; /** * 附件名称 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index 9194c3d..2276ed7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -1,5 +1,6 @@ package com.ruoyi.wisdomarbitrate.service; +import com.alibaba.fastjson.JSONArray; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.wisdomarbitrate.domain.*; @@ -155,4 +156,9 @@ public interface ICaseApplicationService { AjaxResult arbitratorCheckArbitrateRecordBatch(CaseApplication caseApplication); AjaxResult checkArbitrateRecordBatch(CaseApplication caseApplication); + /** + * 附件上传到onlyoffice服务器 + * @param annexPath + */ + JSONArray uploadOnlyOffice(String annexPath, Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java index c1c8c71..1f287a1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java @@ -55,4 +55,5 @@ public interface VideoService { * @return */ AjaxResult attachListByCaseId(Long caseAppliId, Integer annexType); + AjaxResult selectRoleMenuByCaseId(Long caseId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index a5aff97..b43e75b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.deepoove.poi.data.PictureRenderData; import com.google.gson.Gson; @@ -39,6 +40,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFParagraph; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.mail.MailSendException; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Service; @@ -59,6 +61,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.google.common.io.Files.getFileExtension; import static com.ruoyi.common.utils.SecurityUtils.getUsername; import static com.ruoyi.wisdomarbitrate.utils.CaseLogUtils.insertCaseLog; @@ -66,7 +69,8 @@ import static com.ruoyi.wisdomarbitrate.utils.CaseLogUtils.insertCaseLog; @Slf4j public class AdjudicationServiceImpl implements IAdjudicationService { private final String apiUrl = "http://api.cainiaoapi.com/api/exp/v1/index"; - + @Value("${onlyOfficeConfig.url}") + private String onlyOfficeUrl; @Autowired private CaseApplicationMapper caseApplicationMapper; @Autowired @@ -252,10 +256,37 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName; // 将word中的标签替换掉,生成新的word String docFilePath = wordChangeText(templatePath, datas, saveFolderPath, fileName); + String annexPath=saveName.replace("/profile/upload/","/home/ruoyi/uploadPath/upload/"); + // 上传到onlyoffice + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath,caseApplicationReq.getId()); + CaseAttach caseAttach=null; + if(jsonArray!=null && jsonArray.size() > 0){ - String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); - // 保存裁决书附件 - saveArbitorFile(id, saveName, savePath, caseApplicationById, arbitrateRecordSelect,CaseApplicationConstants.VERPRIF_ARBITRATION); + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + caseAttach= CaseAttach.builder() + .caseAppliId(caseApplicationReq.getId()) + .annexName(jsonObject.getString("fileName")) + .annexPath("/home/ruoyi/uploadPath/onlyoffice/") + .annexType(3) + .onlyOfficeFileId(jsonObject.getString("fileId")) + .build(); + + if(jsonObject.get("filePath")!=null){ + String officePath = jsonObject.getString("filePath"); + String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); + caseAttach.setAnnexName(replace); + + } + + } + } + if(caseAttach!=null) { + // 保存裁决书附件 + saveArbitorFile(caseAttach, caseApplicationById, arbitrateRecordSelect, CaseApplicationConstants.VERPRIF_ARBITRATION); + }else { + return AjaxResult.error("上传onlyoffice服务器失败"); + } return AjaxResult.success("裁决书已生成"); } catch (IOException e) { @@ -564,15 +595,11 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 保存裁决书附件 * - * @param id 案件id - * @param saveName 保存的文件名 - * @param savePath 保存路径 * @param caseApplicationById 案件基本信息 * @param arbitrateRecordSelect 出裁决书生成记录 * @param caseStatus 案件状态,不为空则更新案件状态 */ - private void saveArbitorFile(Long id, String saveName, String savePath, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect,Integer caseStatus) { - CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id).annexName(saveName).annexPath(savePath).annexType(3).build(); + private void saveArbitorFile( CaseAttach caseAttach, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect,Integer caseStatus) { //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增 List caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach); if (caseAttachList != null && caseAttachList.size() > 0) { @@ -1903,10 +1930,37 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } catch (IOException e) { throw new ServiceException("生成裁决书失败"); } + String annexPath=saveName.replace("/profile/upload/","/home/ruoyi/uploadPath/upload/"); + // 上传到onlyoffice + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath,req.getId()); + CaseAttach caseAttach=null; + if(jsonArray!=null && jsonArray.size() > 0){ - String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); - // 保存裁决书附件 - saveArbitorFile(req.getId(), saveName, savePath, caseApplicationById, arbitrateRecordSelect,null); + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + caseAttach= CaseAttach.builder() + .caseAppliId(req.getId()) + .annexName(jsonObject.getString("fileName")) + .annexPath("/home/ruoyi/uploadPath/onlyoffice/") + .annexType(3) + .onlyOfficeFileId(jsonObject.getString("fileId")) + .build(); + + if(jsonObject.get("filePath")!=null){ + String officePath = jsonObject.getString("filePath"); + String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); + caseAttach.setAnnexName(replace); + + } + + } + } + if(caseAttach!=null) { + // 保存裁决书附件 + saveArbitorFile(caseAttach, caseApplicationById, arbitrateRecordSelect, null); + }else { + return AjaxResult.error("上传onlyoffice服务器失败"); + } return AjaxResult.success(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 37ebea5..60eba70 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -4,6 +4,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; @@ -78,6 +79,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 腾讯云即时通信密钥 @Value("${imConfig.sdkSecretKey}") private String sdkSecretKey; + @Value("${onlyOfficeConfig.url}") + private String onlyOfficeUrl; @Autowired private CaseApplicationMapper caseApplicationMapper; @@ -637,8 +640,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { allCaseNode.add(getLastNodeRecord(null, "核验裁决书", 11, "法律顾问将核验裁决书","下一节点角色:仲裁员")); allCaseNode.add(getLastNodeRecord(null, "仲裁员审核裁决书", 18, "仲裁员将审核裁决书","下一节点角色:部门长")); allCaseNode.add(getLastNodeRecord(null, "部门长审核裁决书", 12, "部门长将审核裁决书","下一节点角色:仲裁员")); - allCaseNode.add(getLastNodeRecord(null, "裁决书签名", 13, "仲裁员将进行裁决书签名","下一节点角色:部门长")); - allCaseNode.add(getLastNodeRecord(null, "裁决书用印", 14, "部门长将进行裁决书用印","下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "裁决书签名", 13, "仲裁员将进行裁决书签名","下一节点角色:法律顾问")); + allCaseNode.add(getLastNodeRecord(null, "裁决书用印", 14, "法律顾问将进行裁决书用印","下一节点角色:法律顾问")); allCaseNode.add(getLastNodeRecord(null, "裁决书送达", 15, "法律顾问将送达裁决书","下一节点角色:法律顾问")); allCaseNode.add(getLastNodeRecord(null, "案件归档", 16, "法律顾问将进行案件归档","")); allCaseNode.add(getLastNodeRecord(null, "案件已归档", 17, "","")); @@ -1834,6 +1837,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationselect.setPayRejectReason(arbitrateRecordselect.getPayRejectReason()); // 仲裁员审核驳回原因 caseApplicationselect.setArbitrateReject(arbitrateRecordselect.getArbitrateReject()); + caseApplicationselect.setDeptorReject(arbitrateRecordselect.getDeptorReject()); } } @@ -2241,7 +2245,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); String notes=""; if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())){ - notes="部门长驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); + notes="驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); } // 新增日志 insertCaseLog(caseApplication.getId(),currentStatus , notes); @@ -3138,7 +3142,35 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return success(rows); } + /** + * 附件上传到onlyoffice服务器 + * @param annexPath + */ + @Override + @Transactional + public JSONArray uploadOnlyOffice(String annexPath,Long caseId) { + annexPath=annexPath.replace("/profile/","/home/ruoyi/uploadPath/"); + File file = new File(annexPath); + if (file.exists()) { + // 调用onlyoffice + try { + Map params = new HashMap<>(); + params.put("file", file); + String postResult = HttpUtil.post(onlyOfficeUrl+ "/"+String.valueOf(caseId), params); + if(StrUtil.isNotEmpty(postResult)){ + // 转为jsonArray + JSONArray jsonArray = JSONArray.parseArray(postResult); + return jsonArray; + } + } catch (Exception e) { + throw new ServiceException("上传OnlyOffice服务器失败"); + } + }else { + throw new ServiceException("文件不存在"); + } + return null; + } @Override @Transactional public AjaxResult checkArbitrateRecordBatch(CaseApplication caseApplication) { diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java index a4d0544..2c09206 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseLogRecordServiceImpl.java @@ -36,7 +36,11 @@ public class CaseLogRecordServiceImpl implements ICaseLogRecordService { caseNodeTime= DateUtil.format(record.getCaseNodeTime(), DatePattern.NORM_DATETIME_FORMATTER); } - contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime); + contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")); + if(StrUtil.isNotEmpty(record.getCreateBy())) { + contentBuilder.append("(").append(record.getCreateBy()).append(")"); + } + contentBuilder.append("于").append(caseNodeTime); if(StrUtil.isNotEmpty(record.getContent())){ contentBuilder.append(record.getContent()); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java index 73a3e00..28e2199 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java @@ -105,9 +105,6 @@ public class MsSignSealServiceImpl implements MsSignSealService { } else if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(orgnNamePsnAcc)) { - //用印 - sealSignRecordsel.setSealStatus(1); - sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); CaseLogRecord operLog = new CaseLogRecord(); operLog.setCreateNickName(orgnNamePsnName); @@ -130,9 +127,9 @@ public class MsSignSealServiceImpl implements MsSignSealService { String fileDownloadUrl = fileObject.get("downloadUrl").toString(); ///修改"签署用印记录表"的状态为完成 sealSignRecordsel.setSignFlowStatus(3); + sealSignRecordsel.setSealStatus(1); sealSignRecordsel.setFileDownloadUrl(fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1)); sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); - String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); application.setFilearbitraUrl(filearbitraUrl); caseApplicationMapper.submitCaseApplication(application); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java index a23c1a9..6f73494 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java @@ -23,15 +23,13 @@ import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.mapper.SysRoleMapper; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.mapper.SysUserRoleMapper; +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO; -import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; -import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; -import com.ruoyi.wisdomarbitrate.mapper.IdentityAuthenticationMapper; -import com.ruoyi.wisdomarbitrate.mapper.WeChatUserMapper; +import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.service.VideoService; import com.ruoyi.wisdomarbitrate.service.WeChatUserService; import com.tencentcloudapi.common.Credential; @@ -63,6 +61,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +import static com.ruoyi.common.core.domain.AjaxResult.error; import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.utils.file.FileUploadUtils.getAbsoluteFile; import static com.ruoyi.common.utils.file.FileUploadUtils.getPathFileName; @@ -90,10 +89,13 @@ public class VideoServiceImpl implements VideoService { @Autowired private CaseApplicationMapper caseApplicationMapper; @Autowired + private CaseAffiliateMapper affiliateMapper; + @Autowired private CaseAttachMapper caseAttachMapper; @Autowired private SysRoleMapper roleMapper; - + @Autowired + private SysUserMapper userMapper; /** * 功能:第三方回调sign校验 * 参数: @@ -489,6 +491,55 @@ public class VideoServiceImpl implements VideoService { return ""; } + + /** + * 根据案件查找是否申请人和被申请人 + * @param caseId + * @return + */ + @Override + public AjaxResult selectRoleMenuByCaseId(Long caseId) { + AjaxResult result = success(); + CaseAffiliate caseAffiliate = new CaseAffiliate(); + caseAffiliate.setCaseAppliId(caseId); + // 根据案件id查询相关人员 + List msCaseAffiliates = affiliateMapper.selectCaseAffiliate(caseAffiliate); + if (CollectionUtil.isEmpty(msCaseAffiliates)) { + return error("未找到案件相关人员"); + } + Long userId = SecurityUtils.getUserId(); + if (userId == null) { + return error("未找到当前登录用户"); + } + SysUser sysUser = userMapper.selectUserById(userId); + if (sysUser == null) { + return error("未找到当前登录用户"); + } + for (CaseAffiliate affiliate : msCaseAffiliates) { + if (StrUtil.isEmpty(sysUser.getPhonenumber())) { + continue; + } + // 申请人,根据电话判断用户在该案件是否为申请人 + if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent()) && sysUser.getPhonenumber().equals(affiliate.getContactTelphoneAgent())) { + if (affiliate.getIdentityType() == 1) { + result.put("appFlag", "1"); + } else if (affiliate.getIdentityType() == 2) { + // 申请人代理人 + result.put("resFlag", "1"); + } + } else if (StrUtil.isNotEmpty(affiliate.getContactTelphone()) && sysUser.getPhonenumber().equals(affiliate.getContactTelphone())) { + if (affiliate.getIdentityType() == 1) { + // 在该案件中为申请人或者申请代理人 + result.put("appFlag", "1"); + } else if (affiliate.getIdentityType() == 2) { + // 在该案件中为被申请人或者被申请代理人 + result.put("resFlag", "1"); + } + + } + } + return result; + } /** * @param key 回调秘钥 * @param body 入参 diff --git a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml index 6762007..fcd6d98 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml @@ -108,7 +108,7 @@ left join sys_role_menu rm on m.menu_id = rm.menu_id left join sys_user_role ur on rm.role_id = ur.role_id left join sys_role r on r.role_id = ur.role_id - where m.status = '0' and r.status = '0' and ur.user_id = #{userId} + where m.status = '0' and r.status = '0' and ur.user_id = #{userId} and m.perms is not null and m.perms!='' diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index a5ec19d..dcc7cc4 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -13,18 +13,19 @@ + - INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload) - VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus},#{isBatchUpload}) + INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload,only_office_file_id) + VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus},#{isBatchUpload},#{onlyOfficeFileId}) - INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload) + INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload,only_office_file_id) VALUES - (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus},#{item.isBatchUpload}) + (#{item.caseAppliId}, #{item.annexName}, #{item.annexPath},#{item.annexType},#{item.note},#{item.userId},#{item.userName},#{item.sealStatus},#{item.isBatchUpload},#{item.onlyOfficeFileId}) @@ -44,13 +45,13 @@ - select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account + select * from case_attach diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml index f16f349..47b3375 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SealSignRecordMapper.xml @@ -19,14 +19,25 @@ + + + + + + + + + + + @@ -103,9 +114,9 @@ update seal_sign_record sign_flow_status = #{signFlowStatus}, - file_download_url = #{fileDownloadUrl} - sign_status_arbitor = #{signStatusArbitor} - seal_status = #{sealStatus} + file_download_url = #{fileDownloadUrl}, + sign_status_arbitor = #{signStatusArbitor}, + seal_status = #{sealStatus}, where id = #{id} -- 2.54.0 From 48752c2712dffb73543ec6a385008974b023ef89 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Tue, 14 May 2024 16:54:42 +0800 Subject: [PATCH 48/55] =?UTF-8?q?=E4=BB=B2=E8=A3=81=E7=B3=BB=E7=BB=9Fbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/RuoYiApplication.java | 27 ++++ .../CaseApplicationController.java | 13 ++ .../CaseEvidenceController.java | 9 +- .../src/main/resources/application-druid.yml | 3 +- .../src/main/resources/application.yml | 20 ++- .../ruoyi/common/constant/CacheConstants.java | 12 ++ .../wisdomarbitrate/domain/CaseAttach.java | 6 + .../domain/vo/CaseEvidenceVO.java | 4 + .../mapper/CaseAttachMapper.java | 2 +- .../service/ICaseApplicationService.java | 7 + .../service/ICaseEvidenceService.java | 2 +- .../impl/CaseApplicationServiceImpl.java | 25 ++++ .../service/impl/CaseEvidenceServiceImpl.java | 116 ++++++++++------ .../service/impl/CaseZipImportImpl.java | 129 +++++++++++++----- .../service/impl/MsSignSealServiceImpl.java | 7 +- .../wisdomarbitrate/CaseApplicationMapper.xml | 2 +- .../wisdomarbitrate/CaseEvidenceMapper.xml | 31 ++++- 17 files changed, 320 insertions(+), 95 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java index 52a33e2..6aa07d8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiApplication.java @@ -1,10 +1,20 @@ package com.ruoyi; +import cn.hutool.core.collection.CollectionUtil; +import com.ruoyi.common.constant.CacheConstants; +import com.ruoyi.common.core.domain.entity.SysRole; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.system.mapper.SysRoleMapper; +import com.ruoyi.system.mapper.SysUserMapper; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.scheduling.annotation.EnableScheduling; +import java.util.List; + /** * 启动程序 * @@ -24,5 +34,22 @@ public class RuoYiApplication " / /_/ / / / /_/ / / / / /_/ / / /__/ /_/ / / \n" + "/___/_/ /_/\\____/_/ /_/\\__, / \\___/\\__,_/_/ \n" + " /____/ "); + // 启动成功后,查询用户表,将用户信息存到redis + RedisCache redisCache = SpringUtils.getBean(RedisCache.class); + SysUserMapper userMapper = SpringUtils.getBean(SysUserMapper.class); + List sysUsers = userMapper.selectUserListByIds(null); + if(CollectionUtil.isNotEmpty(sysUsers)){ + for (SysUser sysUser : sysUsers) { + redisCache.setCacheObject(CacheConstants.USER_KEY+sysUser.getUserId(),sysUser); + } + } + // 初始化角色redis + SysRoleMapper roleMapper = SpringUtils.getBean(SysRoleMapper.class); + List roles = roleMapper.selectRoleList(new SysRole()); + if(CollectionUtil.isNotEmpty(roles)){ + for (SysRole role : roles) { + redisCache.setCacheObject(CacheConstants.ROLE_KEY+role.getRoleName(),role.getRoleId()); + } + } } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index 2ea1a73..a490cc9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -585,4 +585,17 @@ public class CaseApplicationController extends BaseController { } return caseApplicationService.updateCaseIdByAnnexId(caseAttach); } + /** + * 保存onlyOffice在线编辑的文件 + * @param + * @return + */ + @PostMapping("/saveOnlyOfficeFile") + public AjaxResult saveOnlyOfficeFile( @RequestBody CaseAttach caseAttach) { + if(caseAttach.getCaseAppliId()==null||StrUtil.isEmpty(caseAttach.getOnlyOfficeFileId())||StrUtil.isEmpty(caseAttach.getAnnexPath())){ + return error("参数校验失败"); + } + + return caseApplicationService.saveOnlyOfficeFile(caseAttach); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index 8e1b22c..c7f29ec 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -6,6 +6,7 @@ import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import com.ruoyi.wisdomarbitrate.domain.CaseEvidenceDirectory; import com.ruoyi.wisdomarbitrate.domain.dto.CaseEvidenceDTO; import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO; @@ -101,16 +102,16 @@ public class CaseEvidenceController extends BaseController { /** * 删除附件 - * @param fileIds + * @param caseAttach * @return */ @PostMapping("/deleteFile") - public AjaxResult deleteFile( @RequestParam("fileIds") List fileIds){ + public AjaxResult deleteFile(@RequestBody CaseAttach caseAttach){ - if(CollectionUtil.isEmpty(fileIds)){ + if(CollectionUtil.isEmpty(caseAttach.getFileIds())){ return error("附件id不能为空"); } - return toAjax(caseEvidenceService.deleteFile( fileIds)); + return success(caseEvidenceService.deleteFile( caseAttach.getFileIds())); } diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index fb697f9..2058ef9 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -6,7 +6,8 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false + url: jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false +# url: jdbc:mysql://121.40.189.20:3306/smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false username: root password: YMzc157# # 从库数据源 diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 22aa6db..e9ecfa1 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -17,7 +17,7 @@ ruoyi: # 开发环境配置 server: - # 服务器的HTTP端口,默认为8080 + # 服务器的HTTP端口,默认为8001,正式9001 port: 8001 servlet: # 应用的访问路径 @@ -58,9 +58,9 @@ spring: servlet: multipart: # 单个文件大小 - max-file-size: 50MB + max-file-size: 1000MB # 设置总上传的文件大小 - max-request-size: 500MB + max-request-size: 10000MB # 服务模块 devtools: restart: @@ -72,8 +72,8 @@ spring: host: 121.40.189.20 # 端口,默认为6379 port: 6389 - # 数据库索引 - database: 0 + # 数据库索引,2-正式,3-测试 + database: 3 # 密码 password: # 连接超时时间 @@ -121,7 +121,7 @@ token: # 令牌密钥 secret: abcdefghijklmnopqrstuvwxyz # 令牌有效期(默认30分钟) - expireTime: 30 + expireTime: 1200 # MyBatis配置 mybatis: @@ -183,6 +183,14 @@ imConfig: secretId: AKID3xfHgroY4MQHvLXUXMwIQL1UjmbBX1Tv # 腾讯云密钥 secretKey: INDrIXcT8YmomZBcsy0oNirnU0LTN4X7 +# onlyOffice系统url配置 +onlyOfficeConfig: + # url: http://172.16.0.254:9090/files/upload + url: http://121.40.189.20:9090/files/upload +# 调解机构代码配置 +organizeConfig: + # creditCode + creditCode: 910000058386410044 #jodconverter: # local: # host: 121.40.189.20 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java index 30d3a56..3b8220a 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java @@ -42,4 +42,16 @@ public class CacheConstants */ public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:"; public static final String WE_CHAT_SMS_VERIFY_CODE_KEY="we_chat_sms_verify_code:"; + /** + * 所有用户 redis key + */ +public static final String USER_KEY = "user_key:"; + /** + * 用户邮箱 redis key + */ +// public static final String USER_EMAIL_KEY = "user_email_key:"; + /** + * 角色 redis key + */ + public static final String ROLE_KEY = "role_key:"; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java index 31c502f..14cea94 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java @@ -6,6 +6,8 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.List; + @Builder @Data @AllArgsConstructor @@ -59,5 +61,9 @@ public class CaseAttach { * 是否是证据上传,0-否,1-是 */ private Integer isBatchUpload; + /** + * 附件ids + */ + private List fileIds; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java index da1e6f2..8abeccf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseEvidenceVO.java @@ -37,4 +37,8 @@ public class CaseEvidenceVO { */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date scheduleStartTime; + /** + * 案件编号 + */ + private String caseStatusName; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index e59296f..37fd106 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -21,7 +21,7 @@ public interface CaseAttachMapper { int updateCaseAttachBycaseid(CaseAttach caseAttach); - int deleteByFileIds(@Param("ids") List fileIds); + int deleteByFileIds(@Param("ids") List fileIds); List getCaseAttachByCaseIdAndType(CaseAttach caseAttach); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index 2276ed7..c3667e2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -161,4 +161,11 @@ public interface ICaseApplicationService { * @param annexPath */ JSONArray uploadOnlyOffice(String annexPath, Long id); + /** + * 保存onlyOffice在线编辑的文件 + * @param + * @return + */ + + AjaxResult saveOnlyOfficeFile(CaseAttach caseAttach); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java index 1e8d4d1..7d8affe 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java @@ -36,7 +36,7 @@ public interface ICaseEvidenceService { AjaxResult fileList(Long caseAppliId, List annexTypeList); - int deleteFile( List fileIds); + int deleteFile( List fileIds); List selectEvidenceTreeList(CaseEvidenceDirectory caseEvidenceDirectory); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 60eba70..aae1376 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -63,6 +63,8 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.zip.ZipOutputStream; +import static cn.hutool.system.SystemUtil.getUserInfo; +import static com.google.common.io.Files.getFileExtension; import static com.ruoyi.common.core.domain.AjaxResult.error; import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.utils.PageUtils.startPage; @@ -3945,7 +3947,30 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAttachMapper.updateCaseAttach(caseAttach); return success(); } + /** + * 保存onlyOffice在线编辑的文件 + * @param + * @return + */ + @Transactional + @Override + public AjaxResult saveOnlyOfficeFile(CaseAttach caseAttach) { + if(StrUtil.isNotEmpty(caseAttach.getAnnexPath())){ + String replace = caseAttach.getAnnexPath().replace("/home/ruoyi/uploadPath/", "/profile/"); + caseAttach.setAnnexName(replace); + } + caseAttach.setAnnexPath("/home/ruoyi/uploadPath/onlyoffice/"); + + caseAttach.setAnnexType(3); + caseAttach.setUserId(SecurityUtils.getUserId()); + caseAttach.setUserName(SecurityUtils.getUsername()); + // 先删除之前的在新增 + caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAttach.getCaseAppliId(), caseAttach.getAnnexType()); + caseAttachMapper.save(caseAttach); + + return AjaxResult.success(); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index dd2a5b9..afce097 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -1,7 +1,10 @@ package com.ruoyi.wisdomarbitrate.service.impl; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; @@ -11,9 +14,11 @@ import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.file.FileUtils; import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceDirectoryVO; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.wisdomarbitrate.domain.*; @@ -32,6 +37,7 @@ import java.io.IOException; import java.util.*; import java.util.stream.Collectors; +import static com.google.common.io.Files.getFileExtension; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @Service @@ -50,6 +56,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { private SysUserMapper sysUserMapper; @Autowired private SmsRecordMapper smsRecordMapper; + @Autowired + private ICaseApplicationService caseApplicationService; @Override @Transactional @@ -134,15 +142,39 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { String filePath = RuoYiConfig.getUploadPath(); // 上传 String fileName = FileUploadUtils.upload(filePath, file); - CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) - .annexName(fileName) - .annexPath(filePath) - .annexType(annexType) - .userId(userId) - .userName(userName) - .build(); - int count = caseAttachMapper.save(caseAttach); - if (count > 0 && annexType != null && annexType != 8) { + String suffix = getFileExtension(fileName); + if(StrUtil.isNotEmpty(suffix)&& suffix.contains("doc")){ + // 上传到onlyoffice + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,id); + if(jsonArray!=null && jsonArray.size() > 0) { + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + CaseAttach caseAttach = CaseAttach.builder() + .caseAppliId(id) + .annexType(annexType) + .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"") + .onlyOfficeFileId(jsonObject.getString("fileId")) + .build(); + if(jsonObject.get("filePath")!=null){ + String officePath = jsonObject.getString("filePath"); + String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); + caseAttach.setAnnexPath(replace); + + } + caseAttachMapper.save(caseAttach); + } + } + }else { + CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) + .annexName(fileName) + .annexPath(filePath) + .annexType(annexType) + .userId(userId) + .userName(userName) + .build(); + int count = caseAttachMapper.save(caseAttach); + } + if ( annexType != null && annexType != 8) { if (id != null) { //修改案件状态 CaseApplication caseApplication = new CaseApplication(); @@ -151,18 +183,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { caseApplicationMapper.submitCaseApplication(caseApplication); } } - CaseAttach caseAttachselect = new CaseAttach(); - caseAttachselect.setAnnexId(caseAttach.getAnnexId()); - String annexName = caseAttach.getAnnexName(); - if(StrUtil.isNotEmpty(annexName)) { - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } - } - caseAttachselect.setAnnexType(caseAttach.getAnnexType()); - return AjaxResult.success("上传成功", caseAttachselect); + return AjaxResult.success(); } catch (IOException e) { e.printStackTrace(); } @@ -265,27 +286,44 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { @Transactional @Override public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id, String userName, Long userId) { - List successList = new ArrayList<>(); try { String filePath = RuoYiConfig.getUploadPath(); for (MultipartFile file : files) { // 上传 String fileName = FileUploadUtils.upload(filePath, file); - CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) - .annexName(fileName) - .annexPath(filePath) - .annexType(annexType) - .userId(userId) - .userName(userName) - .isBatchUpload(1) - .build(); - int count = caseAttachMapper.save(caseAttach); - if (count > 0 && annexType != null && annexType != 8) { - CaseAttach caseAttachselect = new CaseAttach(); - caseAttachselect.setAnnexId(caseAttach.getAnnexId()); - caseAttachselect.setAnnexName(caseAttach.getAnnexName()); - caseAttachselect.setAnnexType(caseAttach.getAnnexType()); - successList.add(caseAttachselect); + String suffix = getFileExtension(fileName); + if (StrUtil.isNotEmpty(suffix) && suffix.contains("doc")) { + // 上传onlyoffice + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileName,id); + if(jsonArray!=null && jsonArray.size() > 0) { + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + CaseAttach caseAttach = CaseAttach.builder() + .caseAppliId(id) + .annexType(annexType) + .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"") + + .onlyOfficeFileId(jsonObject.getString("fileId")) + .build(); + if(jsonObject.get("filePath")!=null){ + String officePath = jsonObject.getString("filePath"); + String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); + caseAttach.setAnnexPath(replace); + + } + caseAttachMapper.save(caseAttach); + } + } + }else { + CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) + .annexName(fileName) + .annexPath(filePath) + .annexType(annexType) + .userId(userId) + .userName(userName) + .isBatchUpload(1) + .build(); + int count = caseAttachMapper.save(caseAttach); } } @@ -333,7 +371,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } - return AjaxResult.success("上传成功", successList); + return AjaxResult.success("上传成功"); } @@ -363,7 +401,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } @Override - public int deleteFile(List fileIds) { + public int deleteFile(List fileIds) { return caseAttachMapper.deleteByFileIds(fileIds); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java index 3635d83..c904ec1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java @@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.entity.SysDept; @@ -47,6 +49,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.google.common.io.Files.getFileExtension; import static com.ruoyi.common.core.domain.AjaxResult.error; import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @@ -93,6 +96,8 @@ public class CaseZipImportImpl { // 申请人角色id private long roleId; private Integer maxCaseNum; + @Autowired + private CaseZipImportImpl caseZipImportImpl; @Transactional @@ -164,22 +169,39 @@ public class CaseZipImportImpl { } File[] files = directory.listFiles(); - CaseZipImportTask caseZipImportTask = null; - try { - caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser()); - } catch (Exception e) { + // todo + List caseApplications = new ArrayList<>(); + for (File file1 : files) { + if (file1.isDirectory() && file1.listFiles() != null) { + + for (File file2 : file1.listFiles()) { + + CaseApplication caseApplication = caseZipImportImpl.buildCaseInfo(file2, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, deptMap, SecurityUtils.getLoginUser()); + if (caseApplication != null) { + caseApplications.add(caseApplication); + } + } + } + } + if (CollectionUtil.isEmpty(caseApplications)) { return error("导入失败"); } - Future> future = ThreadPoolUtil.submit(caseZipImportTask); - try { - if(future.get()!=null){ - return success("导入成功"); - } - } catch (InterruptedException | ExecutionException e) { - e.printStackTrace(); - return error(e.getMessage()); - } - return error("导入失败"); +// CaseZipImportTask caseZipImportTask = null; +// try { +// caseZipImportTask = new CaseZipImportTask(this, templateId, fatchRuleList, fatchRuleMap, userMap, dictDataList, files , deptMap, SecurityUtils.getLoginUser()); +// } catch (Exception e) { +// return error("导入失败"); +// } +// Future> future = ThreadPoolUtil.submit(caseZipImportTask); +// try { +// if(future.get()!=null){ +// return success("导入成功"); +// } +// } catch (InterruptedException | ExecutionException e) { +// e.printStackTrace(); +// return error(e.getMessage()); +// } + return success("导入成功"); } @@ -207,8 +229,8 @@ public class CaseZipImportImpl { if (fatchMap.size() > 0) { // 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1956159"); +// SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); +// request.setTemplateId("1956159"); // 新增的案件 // 组装案件内置字段主表内容 @@ -268,26 +290,58 @@ public class CaseZipImportImpl { if (StrUtil.isEmpty(fileUrl)) { continue; } - // 上传 - String filePath = RuoYiConfig.getUploadPath(); + String suffix = getFileExtension(fileUrl); + if (StrUtil.isNotEmpty(suffix) && suffix.contains("doc")) { + // 上传onlyoffice + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(fileUrl,caseApplication.getId()); + if(jsonArray!=null && jsonArray.size() > 0) { + for (Object obj : jsonArray) { + JSONObject jsonObject = (JSONObject) obj; + CaseAttach caseAttach = CaseAttach.builder() + .caseAppliId(caseApplication.getId()) + .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"") - CaseAttach caseAttach = new CaseAttach(); - caseAttach.setCaseAppliId(caseApplication.getId()); - caseAttach.setAnnexPath(filePath); - if (StrUtil.isNotEmpty(fileUrl)) { - String fileName = fileUrl.replace(filePath, "/profile/upload"); - caseAttach.setAnnexName(fileName); - } - // 申请人提供的证据材料 - caseAttach.setAnnexType(2); - caseAttachs.add(caseAttach); - if (fileUrl.contains("仲裁申请书")) { - CaseAttach applyFile = new CaseAttach(); - BeanUtil.copyProperties(caseAttach, applyFile); - applyFile.setAnnexType(1); - caseAttachs.add(applyFile); - } + .onlyOfficeFileId(jsonObject.getString("fileId")) + .build(); + if(jsonObject.get("filePath")!=null){ + String officePath = jsonObject.getString("filePath"); + String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); + caseAttach.setAnnexPath(replace); + } + if(fileUrl.contains("申请书")){ + CaseAttach applyFile = new CaseAttach(); + BeanUtil.copyProperties(caseAttach, applyFile); + applyFile.setAnnexType(1); + caseAttachs.add(applyFile); + } + caseAttach.setAnnexType(2); + caseAttachs.add(caseAttach); + + } + } + } else { + // 上传 + String filePath = RuoYiConfig.getUploadPath(); + + CaseAttach caseAttach = new CaseAttach(); + caseAttach.setCaseAppliId(caseApplication.getId()); + caseAttach.setAnnexPath(filePath); + if (StrUtil.isNotEmpty(fileUrl)) { + String fileName = fileUrl.replace(filePath, "/profile/upload"); + caseAttach.setAnnexName(fileName); + } + // 申请人提供的证据材料 + caseAttach.setAnnexType(2); + caseAttachs.add(caseAttach); + if (fileUrl.contains("申请书")) { + CaseAttach applyFile = new CaseAttach(); + BeanUtil.copyProperties(caseAttach, applyFile); + applyFile.setAnnexType(1); + caseAttachs.add(applyFile); + } + + } } caseApplication.setCaseAttachList(caseAttachs); // 案件压缩包导入 @@ -300,8 +354,9 @@ public class CaseZipImportImpl { // } // 多线程执行 - ThreadPoolUtil.execute(() -> { +// ThreadPoolUtil.execute(() -> { try { + caseApplicationMapper.insertCaseApplication(caseApplication); // 新增日志 CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser); @@ -337,10 +392,10 @@ public class CaseZipImportImpl { } catch (Exception e) { e.printStackTrace(); - throw new RuntimeException("导入失败,请检查抓取规则是否正确"); + throw new RuntimeException("案件导入失败"); } - }); +// }); return caseApplication; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java index 28e2199..357bc84 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java @@ -10,6 +10,7 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.utils.EmailOutUtil; +import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.file.SaaSAPIFileUtils; import com.ruoyi.system.mapper.SysUserMapper; @@ -162,7 +163,11 @@ public class MsSignSealServiceImpl implements MsSignSealService { caseAttach.setAnnexType(3); caseAttach.setAnnexPath(savePath); caseAttach.setAnnexName(saveName); - caseAttachMapper.updateCaseAttachBycaseid(caseAttach); + caseAttach.setUserName(SecurityUtils.getUsername()); + caseAttach.setUserId(SecurityUtils.getUserId()); + // 删除已存在的 + caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, 3); + caseAttachMapper.save(caseAttach); } } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index e3a8e2f..4a95010 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -1113,7 +1113,7 @@ c.batch_number, c.facts, c.appli_iswrit_hear,c.respon_isWrit_hear, - c.mediation_agreement,c.template_id templateId + c.mediation_agreement,c.template_id templateId,c.appli_iswrit_hear,c.respon_isWrit_hear from case_application c LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml index 7bed4fe..93edae9 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseEvidenceMapper.xml @@ -7,12 +7,24 @@ + - + \ No newline at end of file -- 2.54.0 From b3f445fdd4fc29debc36c395f2fb8d4c33b9be95 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Thu, 16 May 2024 16:10:02 +0800 Subject: [PATCH 49/55] =?UTF-8?q?=E4=BB=B2=E8=A3=81=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomarbitrate/domain/CaseLogRecord.java | 12 + .../impl/CaseApplicationServiceImpl.java | 312 ++---------------- 2 files changed, 46 insertions(+), 278 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java index 0441575..295f91a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseLogRecord.java @@ -42,6 +42,18 @@ public class CaseLogRecord extends BaseEntity { * 下一个节点角色名称 */ private String nextRoleName; + /** + * 当前节点角色名称 + */ + private String currentRoleName; + + public String getCurrentRoleName() { + return currentRoleName; + } + + public void setCurrentRoleName(String currentRoleName) { + this.currentRoleName = currentRoleName; + } public String getNextRoleName() { return nextRoleName; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index aae1376..29a66a6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -481,9 +481,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationsel.setArbitraMethodIssame(1); if(applicantIsWrittenHear.intValue()==1&&respondentIsWrittenHear.intValue()==1){ caseApplicationsel.setArbitratMethod(2); + caseApplicationsel.setArbitratMethodName("书面审理"); }else { caseApplicationsel.setArbitratMethod(1); + caseApplicationsel.setArbitratMethodName("开庭审理"); } + }else { caseApplicationsel.setArbitraMethodIssame(2); String applicantarbitratMethod = ""; @@ -590,8 +593,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { public AjaxResult selectCaseProgress(CaseApplication caseApplication) { Map datas = new HashMap<>(); Long id = caseApplication.getId(); - CaseLogRecord caseLogRecord = new CaseLogRecord(); - caseLogRecord.setCaseAppliId(id); CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); // 当前案件节点 Integer caseStatus = caseApplicationselect.getCaseStatus(); @@ -619,34 +620,39 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { */ private List getAllCaseNode(Integer arbitratMethod) { List allCaseNode = new ArrayList<>(); - allCaseNode.add(getLastNodeRecord(null, "立案申请", 0, "申请人将提交案件","下一节点角色:法律顾问")); - allCaseNode.add(getLastNodeRecord(null, "立案审查", 1, "法律顾问将立案审查","下一节点角色:申请人")); - allCaseNode.add(getLastNodeRecord(null, "缴费", 2, "申请人将缴费","下一节点角色:财务")); - allCaseNode.add(getLastNodeRecord(null, "缴费确认", 3, "财务将缴费确认","下一节点角色:被申请人")); - allCaseNode.add(getLastNodeRecord(null, "案件质证", 4, "被申请人将案件质证","下一节点角色:法律顾问")); - allCaseNode.add(getLastNodeRecord(null, "组庭审核", 5, "法律顾问将组庭审核","下一节点角色:部门长")); - allCaseNode.add(getLastNodeRecord(null, "组庭确定", 6, "部门长将组庭确定","下一节点角色:仲裁员")); - allCaseNode.add(getLastNodeRecord(null, "审核仲裁方式", 7, "仲裁员将审核仲裁方式","下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:申请人", "立案申请", 0, "申请人将提交案件","下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "立案审查", 1, "法律顾问将立案审查","下一节点角色:申请人")); + allCaseNode.add(getCaseNode("当前节点角色:申请人", "缴费", 2, "申请人将缴费","下一节点角色:财务")); + allCaseNode.add(getCaseNode("当前节点角色:财务", "缴费确认", 3, "财务将缴费确认","下一节点角色:被申请人")); + allCaseNode.add(getCaseNode("当前节点角色:被申请人", "案件质证", 4, "被申请人将案件质证","下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "组庭审核", 5, "法律顾问将组庭审核","下一节点角色:部门长")); + allCaseNode.add(getCaseNode("当前节点角色:部门长", "组庭确定", 6, "部门长将组庭确定","下一节点角色:仲裁员")); +// allCaseNode.add(getLastNodeRecord("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式","下一节点角色:法律顾问")); if(arbitratMethod==null) { - allCaseNode.add(getLastNodeRecord(null, "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问,仲裁员")); - allCaseNode.add(getLastNodeRecord(null, "开庭审理", 8, "法律顾问,仲裁员,申请人,被申请人将开庭审理", "下一节点角色:法律顾问")); - allCaseNode.add(getLastNodeRecord(null, "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式","下一节点角色:法律顾问或仲裁员")); + + allCaseNode.add(getCaseNode("当前节点角色:法律顾问或仲裁员", "修改开庭时间或书面审理", 31, "法律顾问将修改开庭时间或仲裁员将书面审理", "下一节点角色:法律顾问,仲裁员,申请人,被申请人或仲裁员")); + // allCaseNode.add(getLastNodeRecord("当前节点角色:法律顾问", "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问,仲裁员,申请人,被申请人")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问,仲裁员,申请人,被申请人或仲裁员", "开庭审理或书面审理", 8, "法律顾问,仲裁员,申请人,被申请人将开庭审理或仲裁员将书面审理", "下一节点角色:法律顾问")); + // allCaseNode.add(getLastNodeRecord("当前节点角色:仲裁员", "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); }else if(arbitratMethod.equals(1)){ + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式","下一节点角色:法律顾问")); // 开庭 - allCaseNode.add(getLastNodeRecord(null, "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问")); - allCaseNode.add(getLastNodeRecord(null, "开庭审理", 8, "法律顾问,仲裁员,申请人,被申请人将开庭审理", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问,仲裁员,申请人,被申请人")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问,仲裁员,申请人,被申请人", "开庭审理", 8, "法律顾问,仲裁员,申请人,被申请人将开庭审理", "下一节点角色:法律顾问")); }else if(arbitratMethod.equals(2)){ + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式","下一节点角色:仲裁员")); // 书面 - allCaseNode.add(getLastNodeRecord(null, "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); } - allCaseNode.add(getLastNodeRecord(null, "核验裁决书", 11, "法律顾问将核验裁决书","下一节点角色:仲裁员")); - allCaseNode.add(getLastNodeRecord(null, "仲裁员审核裁决书", 18, "仲裁员将审核裁决书","下一节点角色:部门长")); - allCaseNode.add(getLastNodeRecord(null, "部门长审核裁决书", 12, "部门长将审核裁决书","下一节点角色:仲裁员")); - allCaseNode.add(getLastNodeRecord(null, "裁决书签名", 13, "仲裁员将进行裁决书签名","下一节点角色:法律顾问")); - allCaseNode.add(getLastNodeRecord(null, "裁决书用印", 14, "法律顾问将进行裁决书用印","下一节点角色:法律顾问")); - allCaseNode.add(getLastNodeRecord(null, "裁决书送达", 15, "法律顾问将送达裁决书","下一节点角色:法律顾问")); - allCaseNode.add(getLastNodeRecord(null, "案件归档", 16, "法律顾问将进行案件归档","")); - allCaseNode.add(getLastNodeRecord(null, "案件已归档", 17, "","")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "核验裁决书", 11, "法律顾问将核验裁决书","下一节点角色:仲裁员")); + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "仲裁员审核裁决书", 18, "仲裁员将审核裁决书","下一节点角色:部门长")); + allCaseNode.add(getCaseNode("当前节点角色:部门长", "部门长审核裁决书", 12, "部门长将审核裁决书","下一节点角色:仲裁员")); + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "裁决书签名", 13, "仲裁员将进行裁决书签名","下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "裁决书用印", 14, "法律顾问将进行裁决书用印","下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "裁决书送达", 15, "法律顾问将送达裁决书","下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "案件归档", 16, "法律顾问将进行案件归档","")); + allCaseNode.add(getCaseNode(null, "结束", 17, "","")); return allCaseNode; } @@ -874,273 +880,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** - * 获取日志中该节点最新一条记录 - * @param caseNodeRecordMap 日志记录案件状态分组 + * 获取每个节点的流程 + * @param currentRoleName 当前节点角色 * @param caseNodeName 节点名称 * @param caseNode 案件节点 * @param content 内容 * @return */ - private CaseLogRecord getLastNodeRecord(Map> caseNodeRecordMap, String caseNodeName, int caseNode, String content,String nextRoleName) { + private CaseLogRecord getCaseNode(String currentRoleName, String caseNodeName, int caseNode, String content,String nextRoleName) { CaseLogRecord lastNodeRecord = new CaseLogRecord(); - if(caseNodeRecordMap!=null && caseNodeRecordMap.containsKey(caseNode)){ - // List nodeRecordList = caseNodeRecordMap.get(caseNode); - // 取出该节点最新一条数据 - // lastNodeRecord = nodeRecordList.get(nodeRecordList.size() - 1); - - } lastNodeRecord.setCaseNodeName(caseNodeName); lastNodeRecord.setCaseNode(caseNode); lastNodeRecord.setContent(content); lastNodeRecord.setNextRoleName(nextRoleName); + lastNodeRecord.setCurrentRoleName(currentRoleName); return lastNodeRecord; } - /** - * 获取已完成节点流程 - * @param caseStatus 当前案件状态 - - * @return - */ - private CaseLogRecord getInCasenode(Integer caseStatus) { - CaseLogRecord caseLogRecord = new CaseLogRecord(); - - switch (caseStatus.toString()) { - case "0": - caseLogRecord.setCaseNodeName("案件提交"); - caseLogRecord.setCaseNode(0); - caseLogRecord.setContent("申请人正在进行案件提交"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "1": - caseLogRecord.setCaseNodeName("立案审查"); - caseLogRecord.setCaseNode(1); - caseLogRecord.setContent("法律顾问正在进行立案审查"); - caseLogRecord.setNextRoleName("下一节点角色:申请人"); - break; - case "2": - caseLogRecord.setCaseNodeName("缴费"); - caseLogRecord.setCaseNode(2); - caseLogRecord.setContent("申请人正在进行缴费"); - caseLogRecord.setNextRoleName("下一节点角色:财务"); - break; - case "3": - caseLogRecord.setCaseNodeName("缴费确认"); - caseLogRecord.setCaseNode(3); - caseLogRecord.setContent("财务正在进行缴费确认"); - caseLogRecord.setNextRoleName("下一节点角色:被申请人"); - break; - case "4": - caseLogRecord.setCaseNodeName("案件质证"); - caseLogRecord.setCaseNode(4); - caseLogRecord.setContent("被申请人将进行案件质证"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "5": - caseLogRecord.setCaseNodeName("组庭审核"); - caseLogRecord.setCaseNode(5); - caseLogRecord.setContent("法律顾问正在进行组庭审核"); - caseLogRecord.setNextRoleName("下一节点角色:部门长"); - break; - case "6": - caseLogRecord.setCaseNodeName("组庭确定"); - caseLogRecord.setCaseNode(6); - caseLogRecord.setContent("部门长正在进行组庭确定"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "7": - caseLogRecord.setCaseNodeName("审核仲裁方式"); - caseLogRecord.setCaseNode(7); - caseLogRecord.setContent("仲裁员正在进行审核仲裁方式"); - caseLogRecord.setNextRoleName("下一节点角色:秘书顾问"); - break; - case "8": - caseLogRecord.setCaseNodeName("开庭审理"); - caseLogRecord.setCaseNode(8); - caseLogRecord.setContent("仲裁员正在进行开庭审理"); - caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); - break; - case "9": - caseLogRecord.setCaseNodeName("书面审理"); - caseLogRecord.setCaseNode(9); - caseLogRecord.setContent("仲裁员正在进行书面审理"); - caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); - break; - case "11": - caseLogRecord.setCaseNodeName("核验裁决书"); - caseLogRecord.setCaseNode(11); - caseLogRecord.setContent("法律顾问正在进行核验裁决书"); - caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); - break; - case "18": - caseLogRecord.setCaseNodeName("仲裁员审核裁决书"); - caseLogRecord.setCaseNode(11); - caseLogRecord.setContent("仲裁员正在进行审核裁决书"); - caseLogRecord.setNextRoleName("下一节点角色:部门长"); - break; - case "12": - caseLogRecord.setCaseNodeName("确认裁决书"); - caseLogRecord.setCaseNode(18); - caseLogRecord.setContent("部门长正在进行确认裁决书"); - caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); - break; - case "13": - caseLogRecord.setCaseNodeName("裁决书签名"); - caseLogRecord.setCaseNode(13); - caseLogRecord.setContent("仲裁员正在进行裁决书签名"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "14": - caseLogRecord.setCaseNodeName("裁决书用印"); - caseLogRecord.setCaseNode(14); - caseLogRecord.setContent("部门长正在进行裁决书用印"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "15": - caseLogRecord.setCaseNodeName("裁决书送达"); - caseLogRecord.setCaseNode(15); - caseLogRecord.setContent("法律顾问正在进行裁决书送达"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "16": - caseLogRecord.setCaseNodeName("案件归档"); - caseLogRecord.setCaseNode(16); - caseLogRecord.setContent("法律顾问正在进行案件归档"); - break; - case "17": - caseLogRecord.setCaseNodeName("案件已归档"); - caseLogRecord.setCaseNode(17); - caseLogRecord.setContent(""); - break; - case "31": - caseLogRecord.setCaseNodeName("修改开庭时间"); - caseLogRecord.setCaseNode(31); - caseLogRecord.setContent("顾问正在修改开庭时间"); - break; - default: - caseLogRecord.setCaseNodeName(""); - caseLogRecord.setContent(""); - - } - return caseLogRecord; - } - /** - * 获取节点流程 - * @param caseStatus 当前案件状态 - - * @return - */ - private CaseLogRecord getInCasenode1(Integer caseStatus) { - CaseLogRecord caseLogRecord = new CaseLogRecord(); - - switch (caseStatus.toString()) { - case "0": - caseLogRecord.setCaseNodeName("案件提交"); - caseLogRecord.setCaseNode(0); - caseLogRecord.setContent("申请人正在进行案件提交"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "1": - caseLogRecord.setCaseNodeName("立案审查"); - caseLogRecord.setCaseNode(1); - caseLogRecord.setContent("法律顾问正在进行立案审查"); - caseLogRecord.setNextRoleName("下一节点角色:申请人"); - break; - case "2": - caseLogRecord.setCaseNodeName("缴费"); - caseLogRecord.setCaseNode(2); - caseLogRecord.setContent("申请人正在进行缴费"); - caseLogRecord.setNextRoleName("下一节点角色:仲裁财务"); - break; - case "3": - caseLogRecord.setCaseNodeName("缴费确认"); - caseLogRecord.setCaseNode(3); - caseLogRecord.setContent("财务正在进行缴费确认"); - caseLogRecord.setNextRoleName("下一节点角色:被申请人"); - break; - case "4": - caseLogRecord.setCaseNodeName("案件质证"); - caseLogRecord.setCaseNode(4); - caseLogRecord.setContent("被申请人将进行案件质证"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "5": - caseLogRecord.setCaseNodeName("组庭审核"); - caseLogRecord.setCaseNode(5); - caseLogRecord.setContent("法律顾问正在进行组庭审核"); - caseLogRecord.setNextRoleName("下一节点角色:部门长"); - break; - case "6": - caseLogRecord.setCaseNodeName("组庭确定"); - caseLogRecord.setCaseNode(6); - caseLogRecord.setContent("部门长正在进行组庭确定"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "7": - caseLogRecord.setCaseNodeName("审核仲裁方式"); - caseLogRecord.setCaseNode(7); - caseLogRecord.setContent("仲裁员正在进行审核仲裁方式"); - caseLogRecord.setNextRoleName("下一节点角色:秘书顾问"); - break; - case "8": - caseLogRecord.setCaseNodeName("开庭审理"); - caseLogRecord.setCaseNode(8); - caseLogRecord.setContent("仲裁员正在进行开庭审理"); - caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); - break; - case "9": - caseLogRecord.setCaseNodeName("书面审理"); - caseLogRecord.setCaseNode(9); - caseLogRecord.setContent("仲裁员正在进行书面审理"); - caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); - break; - case "11": - caseLogRecord.setCaseNodeName("核验裁决书"); - caseLogRecord.setCaseNode(11); - caseLogRecord.setContent("法律顾问正在进行核验裁决书"); - caseLogRecord.setNextRoleName("下一节点角色:部门长"); - break; - case "12": - caseLogRecord.setCaseNodeName("确认裁决书"); - caseLogRecord.setCaseNode(12); - caseLogRecord.setContent("仲裁员正在进行确认裁决书"); - caseLogRecord.setNextRoleName("下一节点角色:仲裁员"); - break; - case "13": - caseLogRecord.setCaseNodeName("裁决书签名"); - caseLogRecord.setCaseNode(13); - caseLogRecord.setContent("仲裁员正在进行裁决书签名"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "14": - caseLogRecord.setCaseNodeName("裁决书用印"); - caseLogRecord.setCaseNode(14); - caseLogRecord.setContent("部门长正在进行裁决书用印"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "15": - caseLogRecord.setCaseNodeName("裁决书送达"); - caseLogRecord.setCaseNode(15); - caseLogRecord.setContent("法律顾问正在进行裁决书送达"); - caseLogRecord.setNextRoleName("下一节点角色:法律顾问"); - break; - case "16": - caseLogRecord.setCaseNodeName("案件归档"); - caseLogRecord.setCaseNode(16); - caseLogRecord.setContent("法律顾问正在进行案件归档"); - break; - case "31": - caseLogRecord.setCaseNodeName("修改开庭时间"); - caseLogRecord.setCaseNode(31); - caseLogRecord.setContent("顾问正在修改开庭时间"); - break; - default: - caseLogRecord.setCaseNodeName(""); - caseLogRecord.setContent(""); - - } - return caseLogRecord; - } @Override public List selectCaseApplicationList(CaseApplication caseApplication) { return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); -- 2.54.0 From e9c734684363466f0e1c5819b5c22a27547bcbd5 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 17 May 2024 15:55:08 +0800 Subject: [PATCH 50/55] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomarbitrate/MsSignSealController.java | 1 + .../java/com/ruoyi/common/utils/PdfUtils.java | 2 +- .../service/impl/CaseApplicationServiceImpl.java | 15 +++++++++++++++ .../service/impl/MsSignSealServiceImpl.java | 7 +------ .../wisdomarbitrate/CaseApplicationMapper.xml | 2 +- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java index 33d4e80..92cdc19 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/MsSignSealController.java @@ -3,6 +3,7 @@ package com.ruoyi.web.controller.wisdomarbitrate; import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; import com.ruoyi.wisdomarbitrate.service.MsSignSealService; import com.ruoyi.wisdomarbitrate.utils.SignVerifyUtils; import org.springframework.beans.factory.annotation.Autowired; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java index 05afb65..089ebb0 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/PdfUtils.java @@ -44,7 +44,7 @@ public class PdfUtils { document.setMarginMirroring(false); document.open(); // 解决PDF中文不显示 - String fontPath = "/D:/simsun.ttf"; //字体文件路径 + String fontPath = "/home/ruoyi/uploadPath/songfont/simsun.ttf"; //字体文件路径 XMLWorkerFontProvider provider = new XMLWorkerFontProvider(XMLWorkerFontProvider.DONTLOOKFORFONTS); provider.register(fontPath);//注册字体 log.error("注册字体"); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 29a66a6..acd88a2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -2283,6 +2283,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); String url = signUrlData.get("url").getAsString(); sealSignRecordReslt.setSealUrl(url); + if(StrUtil.isEmpty(SecurityUtils.getUsername())){ + throw new ServiceException("未获取到当前登录用户"); + } + SysUser sysUser = sysUserMapper.selectUserByUserName(getUsername()); + if(sysUser==null){ + throw new ServiceException("未获取到当前登录用户"); + } + CaseLogRecord operLog = new CaseLogRecord(); + operLog.setCreateNickName(sysUser.getNickName()); + operLog.setCaseNode(14); + operLog.setCreateBy(sysUser.getUserName()); + operLog.setCaseAppliId(caseApplication.getId()); + operLog.setCaseNodeName("待用印"); + operLog.setCreateTime(new Date()); + caseLogRecordMapper.insertCaseLogRecord(operLog); } return sealSignRecordReslt; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java index 357bc84..a73e243 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java @@ -106,13 +106,8 @@ public class MsSignSealServiceImpl implements MsSignSealService { } else if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(orgnNamePsnAcc)) { + // 用印 sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); - CaseLogRecord operLog = new CaseLogRecord(); - operLog.setCreateNickName(orgnNamePsnName); - operLog.setCaseNode(14); - operLog.setCaseAppliId(caseAppliId); - operLog.setCreateTime(dateOperate); - caseLogRecordMapper.insertCaseLogRecord(operLog); CaseApplication application = new CaseApplication(); application.setId(caseAppliId); // 案件状态为待送达 diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 4a95010..aa3e30a 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -1412,7 +1412,7 @@ AND t1.lock_status = #{caseApplication.lockStatus} - AND t1.case_num = #{caseApplication.caseNum} + AND t1.case_num like concat('%',#{caseApplication.caseNum},'%') AND t1.batch_number = #{caseApplication.batchNumber} -- 2.54.0 From 0f8ee6e6fe657d2f279fce1b304b5b21f0153c71 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Tue, 21 May 2024 13:49:08 +0800 Subject: [PATCH 51/55] =?UTF-8?q?=E4=BB=B2=E8=A3=81bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomarbitrate/VideoController.java | 16 +++++++------- .../wisdomarbitrate/service/VideoService.java | 2 +- .../service/impl/VideoServiceImpl.java | 21 +++++++++++++++++-- .../wisdomarbitrate/CaseAttachMapper.xml | 4 +++- 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java index c02c52a..25b30c8 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java @@ -132,9 +132,9 @@ public class VideoController extends BaseController { */ @Anonymous @GetMapping("secretaryRoleByUserId") - public AjaxResult secretaryRoleByUserId( @RequestParam(value = "userId",required = true) Long userId) { + public AjaxResult secretaryRoleByUserId( @RequestParam(value = "userId",required = true) Long userId,@RequestParam(value = "caseId",required = true) Long caseId) { - return videoService.secretaryRoleByUserId(userId); + return videoService.secretaryRoleByUserId(userId,caseId); } /** * 根据html字符串转pdf并和案件关联 @@ -235,16 +235,16 @@ public class VideoController extends BaseController { } }else { // 如果是调解书并且是pdf,则删除之前的在新增 -// if(isMediaBook != null && isMediaBook == 1 ){ + if(annexType!=null && annexType.equals(3) ){ // if(StrUtil.isNotEmpty(suffix)&&!suffix.equals("pdf")){ // return AjaxResult.error("请上传pdf格式文件"); // } // annexType=AnnexTypeEnum.MEDIATE_BOOK_PDF.getCode(); -// // 先删除之前的附件 -// if(caseId!=null) { -// msCaseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType); -// } -// } + // 先删除之前的附件 + if(caseId!=null) { + caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType); + } + } Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId); AjaxResult ajax = AjaxResult.success(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java index 1f287a1..b0033fe 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/VideoService.java @@ -39,7 +39,7 @@ public interface VideoService { * @param userId * @return */ - AjaxResult secretaryRoleByUserId(Long userId); + AjaxResult secretaryRoleByUserId(Long userId,Long caseId); /** * 根据html字符串转pdf并和案件关联 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java index 6f73494..352b0a8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java @@ -321,11 +321,28 @@ public class VideoServiceImpl implements VideoService { } @Override - public AjaxResult secretaryRoleByUserId(Long userId) { + public AjaxResult secretaryRoleByUserId(Long userId,Long caseId) { + CaseApplication application = new CaseApplication(); + application.setId(caseId); + // 根据案件id查询案件 + CaseApplication caseApplication = caseApplicationMapper.selectCaseApplication(application); + if(caseApplication==null){ + return AjaxResult.error("案件不存在"); + } List roles = roleMapper.selectRolePermissionByUserId(userId); JSONObject jsonObject = new JSONObject(); boolean isSecretaryRole=false; - if(CollectionUtil.isNotEmpty(roles)){ + if(caseApplication.getArbitratorId()!=null&& Objects.equals(userId, caseApplication.getArbitratorId())){ + // 是调解员 + if(CollectionUtil.isNotEmpty(roles)){ + for (SysRole role : roles) { + if("仲裁员".equals(role.getRoleName())){ + isSecretaryRole=true; + break; + } + } + } + }else if(CollectionUtil.isNotEmpty(roles)){ for (SysRole role : roles) { if("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName())){ isSecretaryRole=true; diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index dcc7cc4..058b16c 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -108,7 +108,8 @@ update case_attach annex_name = #{annexName}, - annex_path = #{annexPath} + annex_path = #{annexPath}, + only_office_file_id = #{onlyOfficeFileId} @@ -117,6 +118,7 @@ AND annex_type = #{annexType} + -- 2.54.0 From 084c22a00f6d03c7668be7bf7b5732f1066e7e6c Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 24 May 2024 15:39:58 +0800 Subject: [PATCH 52/55] =?UTF-8?q?=E4=BB=B2=E8=A3=81=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdjudicationController.java | 48 +- .../ArbitrateApplicationController.java | 5 +- .../CaseApplicationController.java | 77 +- .../CaseEvidenceController.java | 34 +- .../wisdomarbitrate/VideoController.java | 26 +- .../constant/CaseApplicationConstants.java | 4 + .../common/core/domain/entity/SysDept.java | 62 + .../common/core/domain/entity/SysUser.java | 69 + .../ruoyi/system/mapper/SysDeptMapper.java | 7 + .../ruoyi/system/mapper/SysUserMapper.java | 13 + .../system/mapper/SysUserRoleMapper.java | 9 + .../service/impl/SysUserServiceImpl.java | 22 +- .../domain/CaseApplication.java | 22 +- .../domain/dto/CaseApplicationDTO.java | 309 ++ .../domain/entity/CaseAffiliateEntity.java | 129 + .../domain/vo/CaseAffiliateBase.java | 33 + .../domain/vo/CaseAffiliateVO.java | 32 + .../mapper/CaseAffiliateLogMapper.java | 3 +- .../mapper/CaseAffiliateMapper.java | 36 +- .../mapper/CaseApplicationMapper.java | 35 +- .../mapper/CaseEvidenceMapper.java | 7 +- .../service/IAdjudicationService.java | 7 +- .../service/ICaseApplicationService.java | 75 +- .../service/ICaseEvidenceService.java | 4 +- .../service/impl/AdjudicationServiceImpl.java | 956 ++--- .../impl/CaseApplicationLogServiceImpl.java | 147 +- .../impl/CaseApplicationServiceImpl.java | 3344 +++++++++-------- .../impl/CaseArbitrateServiceImpl.java | 432 +-- .../service/impl/CaseEvidenceServiceImpl.java | 387 +- .../service/impl/CasePaymentServiceImpl.java | 147 +- .../service/impl/CaseZipImportImpl.java | 54 +- .../service/impl/DeptIdentifyServiceImpl.java | 4 +- .../service/impl/MsSignSealServiceImpl.java | 15 +- .../service/impl/VideoServiceImpl.java | 75 +- .../utils/FixSelectFlowDetailUtils.java | 4 +- .../resources/mapper/system/SysDeptMapper.xml | 20 +- .../resources/mapper/system/SysUserMapper.xml | 36 +- .../mapper/system/SysUserRoleMapper.xml | 10 +- .../wisdomarbitrate/ArbitrateRecordMapper.xml | 1 + .../CaseAffiliateLogMapper.xml | 19 +- .../wisdomarbitrate/CaseAffiliateMapper.xml | 276 +- .../wisdomarbitrate/CaseApplicationMapper.xml | 1559 +++----- .../wisdomarbitrate/CaseEvidenceMapper.xml | 75 - .../wisdomarbitrate/CaseLogRecordMapper.xml | 22 +- .../wisdomarbitrate/SealSignRecordMapper.xml | 9 +- 45 files changed, 4202 insertions(+), 4458 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationDTO.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/CaseAffiliateEntity.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateBase.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateVO.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java index 5460b45..208af01 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java @@ -45,14 +45,14 @@ public class AdjudicationController extends BaseController { /** * 根据批号查询批量签名链接 */ - @PostMapping("/getSignUrlBatch") - public AjaxResult getSignUrlBatch(@RequestBody StringIdsReq idsReq) { - if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){ - return error("参数校验失败"); - } - SealSignRecord sealSignRecordselect = adjudicationService.getSignUrlBatch(idsReq); - return success(sealSignRecordselect); - } +// @PostMapping("/getSignUrlBatch") +// public AjaxResult getSignUrlBatch(@RequestBody StringIdsReq idsReq) { +// if(StrUtil.isEmpty(idsReq.getBatchNumber().toString())|| StrUtil.isEmpty(idsReq.getPsnAccount())){ +// return error("参数校验失败"); +// } +// SealSignRecord sealSignRecordselect = adjudicationService.getSignUrlBatch(idsReq); +// return success(sealSignRecordselect); +// } /** * 根据签署流程id查询批量用印链接 @@ -127,15 +127,7 @@ public class AdjudicationController extends BaseController { return adjudicationService.batchDocument(caseApplication.getIds()); } - /** - * 重新生成裁决书 - * @param caseApplication - * @return - */ - @PostMapping("/regenerationDocument") - public AjaxResult regenerationDocument(@Validated @RequestBody CaseApplication caseApplication){ - return adjudicationService.regenerationDocument(caseApplication); - } + /** * 裁决书送达(电子邮件) @@ -152,12 +144,12 @@ public class AdjudicationController extends BaseController { * @param caseApplication * @return */ - @GetMapping("/logistics") -// @PreAuthorize("@ss.hasPermi('delivery:detail')") - public AjaxResult getLogisticsInfo(CaseApplication caseApplication){ - List logisticsInfo = adjudicationService.getLogisticsInfo(caseApplication); - return AjaxResult.success(logisticsInfo); - } +// @GetMapping("/logistics") +//// @PreAuthorize("@ss.hasPermi('delivery:detail')") +// public AjaxResult getLogisticsInfo(CaseApplication caseApplication){ +// List logisticsInfo = adjudicationService.getLogisticsInfo(caseApplication); +// return AjaxResult.success(logisticsInfo); +// } @@ -220,11 +212,11 @@ public class AdjudicationController extends BaseController { * @param id 案件id * @return */ - @GetMapping("/archives") - public AjaxResult getArchivesDetail(Long id){ - - return adjudicationService.getArchivesDetail(id); - } +// @GetMapping("/archives") +// public AjaxResult getArchivesDetail(Long id){ +// +// return adjudicationService.getArchivesDetail(id); +// } /** * 根据案件id获取邮箱 * @param id 案件id diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitrateApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitrateApplicationController.java index 993d31c..a3d82ad 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitrateApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/ArbitrateApplicationController.java @@ -6,6 +6,7 @@ import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.CheckSignatuerUtils; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; import com.ruoyi.wisdomarbitrate.domain.vo.CaseApplicationVO; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import org.springframework.beans.BeanUtils; @@ -32,10 +33,10 @@ public class ArbitrateApplicationController extends BaseController { String paramsbody = JSONUtil.toJsonStr(caseApplicationVO); boolean checkResult= CheckSignatuerUtils.checkSignuter(paramsbody); if(checkResult){ - CaseApplication caseApplication = new CaseApplication(); + CaseApplicationDTO caseApplication = new CaseApplicationDTO(); BeanUtils.copyProperties(caseApplicationVO,caseApplication); caseApplication.setCreateBy(getUsername()); - return toAjax(caseApplicationService.insertcaseApplication1(caseApplication)); + return caseApplicationService.insertOrUpdate(caseApplication); }else { return AjaxResult.error("签名验证失败"); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java index a490cc9..54332cb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java @@ -12,6 +12,7 @@ import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.WxAppletNotifyUtils; import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; @@ -37,8 +38,17 @@ public class CaseApplicationController extends BaseController { private ICaseApplicationService caseApplicationService; @Autowired private IAdjudicationService adjudicationService; + /** + * 根据登录人返回用户信息 + */ + @GetMapping("/getUserInfo") + public AjaxResult getUserInfo() + { + return success(caseApplicationService.getUserInfo()); + } + /** * 查询立案数据 */ @@ -53,15 +63,15 @@ public class CaseApplicationController extends BaseController { return getDataTable(list); } - /** - * 查询批量管理案件列表 - */ - @GetMapping("/listBatch") - public TableDataInfo listBatch(CaseApplication caseApplication) { - startPage(); - List list = caseApplicationService.selectCaseApplicationListBatchByRole(caseApplication); - return getDataTable(list); - } +// /** +// * 查询批量管理案件列表 +// */ +// @GetMapping("/listBatch") +// public TableDataInfo listBatch(CaseApplication caseApplication) { +// startPage(); +// List list = caseApplicationService.selectCaseApplicationListBatchByRole(caseApplication); +// return getDataTable(list); +// } /** * 根据角色查询待办数量 @@ -81,24 +91,24 @@ public class CaseApplicationController extends BaseController { // @PreAuthorize("@ss.hasPermi('caseManagement:list:add')") @Log(title = "新增立案数据", businessType = BusinessType.INSERT) @PostMapping("/addCaseApplication") - public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplication caseApplication) + public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplicationDTO caseApplication) { caseApplication.setCreateBy(getUsername()); - return toAjax(caseApplicationService.insertcaseApplication(caseApplication)); + return caseApplicationService.insertOrUpdate(caseApplication); } /** * 修改立案数据 */ // @PreAuthorize("@ss.hasPermi('caseManagement:list:update')") - @Log(title = "修改立案数据", businessType = BusinessType.UPDATE) - @PostMapping("/editCaseApplication") - public AjaxResult editCaseApplication(@Validated @RequestBody CaseApplication caseApplication) { - - caseApplication.setUpdateBy(getUsername()); - return caseApplicationService.editCaseApplication(caseApplication); - } +// @Log(title = "修改立案数据", businessType = BusinessType.UPDATE) +// @PostMapping("/editCaseApplication") +// public AjaxResult editCaseApplication(@Validated @RequestBody CaseApplicationDTO caseApplication) { +// +// caseApplication.setUpdateBy(getUsername()); +// return caseApplicationService.editCaseApplication(caseApplication); +// } /** * 修改立案数据自定义字段 @@ -132,7 +142,7 @@ public class CaseApplicationController extends BaseController { if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber())){ return error("参数校验失败"); } - return toAjax(caseApplicationService.submitCaseApplicationBatch(batchCaseApplication.getBatchNumber())); + return caseApplicationService.submitCaseApplicationBatch(batchCaseApplication.getBatchNumber()); } @@ -411,15 +421,6 @@ public class CaseApplicationController extends BaseController { return success(caseApplicationService.submitCaseApplicationCheck(batchCaseApplication.getIds(),batchCaseApplication.getAgreeOrNotCheck(),batchCaseApplication.getCaseCheckReject())); } - /** - * 确认缴费查询立案信息 - */ -// @PreAuthorize("@ss.hasPermi('paymentManagement:list:detail')") - @PostMapping("/selectCaseApplicationConfirm") - public AjaxResult selectCaseApplicationConfirm(@Validated @RequestBody CaseApplication caseApplication) { - CaseApplication caseApplicationselect = caseApplicationService.selectCaseApplicationConfirm(caseApplication); - return success(caseApplicationselect); - } /** * 批量提交立案审查 @@ -430,18 +431,18 @@ public class CaseApplicationController extends BaseController { if(StringUtils.isEmpty(batchCaseApplication.getBatchNumber()) || batchCaseApplication.getAgreeOrNotCheck()==null){ return error("参数校验失败"); } - return success(caseApplicationService.submitCaseApplicationCheckBatch(batchCaseApplication.getBatchNumber(),batchCaseApplication.getAgreeOrNotCheck(),batchCaseApplication.getCaseCheckReject())); + return caseApplicationService.submitCaseApplicationCheckBatch(batchCaseApplication.getBatchNumber(),batchCaseApplication.getAgreeOrNotCheck(),batchCaseApplication.getCaseCheckReject()); } - /** - * 下载案件压缩包 - */ - @PostMapping("/downloadCaseZipFile") - public AjaxResult downloadCaseZipFile(@Validated @RequestBody CaseApplication caseApplication) { - - CaseAttach caseAttach = caseApplicationService.downloadCaseZipFile(caseApplication); - return success(caseAttach); - } +// /** +// * 下载案件压缩包 +// */ +// @PostMapping("/downloadCaseZipFile") +// public AjaxResult downloadCaseZipFile(@Validated @RequestBody CaseApplication caseApplication) { +// +// CaseAttach caseAttach = caseApplicationService.downloadCaseZipFile(caseApplication); +// return success(caseAttach); +// } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index c7f29ec..a10e304 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -33,17 +33,17 @@ public class CaseEvidenceController extends BaseController { this.caseEvidenceService = caseEvidenceService; } - /** - * 根据案件id查询案件详情 - * - * @param id - * @return - */ - @GetMapping("/{id}") - public AjaxResult getCaseDetailsById(@PathVariable Long id) { - String username = this.getUsername(); - return caseEvidenceService.getCaseDetailsById(id, username); - } +// /** +// * 根据案件id查询案件详情 +// * +// * @param id +// * @return +// */ +// @GetMapping("/{id}") +// public AjaxResult getCaseDetailsById(@PathVariable Long id) { +// String username = this.getUsername(); +// return caseEvidenceService.getCaseDetailsById(id, username); +// } /** * 案件证据上传 @@ -121,12 +121,12 @@ public class CaseEvidenceController extends BaseController { * @param caseStatus * @return */ - @GetMapping("/all") - public AjaxResult getCaseListAll(@RequestParam("caseStatus") Integer caseStatus) { - - return success(caseEvidenceService.getCaseListAll(caseStatus)); - - } +// @GetMapping("/all") +// public AjaxResult getCaseListAll(@RequestParam("caseStatus") Integer caseStatus) { +// +// return success(caseEvidenceService.getCaseListAll(caseStatus)); +// +// } /** * 证据确认 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java index 25b30c8..6b40fc7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/VideoController.java @@ -133,7 +133,6 @@ public class VideoController extends BaseController { @Anonymous @GetMapping("secretaryRoleByUserId") public AjaxResult secretaryRoleByUserId( @RequestParam(value = "userId",required = true) Long userId,@RequestParam(value = "caseId",required = true) Long caseId) { - return videoService.secretaryRoleByUserId(userId,caseId); } /** @@ -186,6 +185,7 @@ public class VideoController extends BaseController { // 上传文件路径 String filePath = RuoYiConfig.getUploadPath(); + String name=file.getOriginalFilename(); // 上传并返回新文件名称 String fileName = FileUploadUtils.upload(filePath, file); String suffix = getFileExtension(fileName); @@ -205,18 +205,22 @@ public class VideoController extends BaseController { CaseAttach caseAttach=null; for (Object obj : jsonArray) { JSONObject jsonObject = (JSONObject) obj; + String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):""; + path=path.replace("/home/ruoyi/uploadPath/","profile/"); caseAttach = CaseAttach.builder() .caseAppliId(caseId) - .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"") +// .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"") + .annexName(name) .annexType(annexType) .onlyOfficeFileId(jsonObject.getString("fileId")) + .annexPath(path) .build(); - if(jsonObject.get("filePath")!=null){ - String officePath = jsonObject.getString("filePath"); - String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); - caseAttach.setAnnexPath(replace); - - } +// if(jsonObject.get("filePath")!=null){ +// String officePath = jsonObject.getString("filePath"); +// String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); +// caseAttach.setAnnexPath(replace); +// +// } caseAttachMapper.save(caseAttach); } if(caseAttach==null){ @@ -226,7 +230,7 @@ public class VideoController extends BaseController { ajax.put("annexId", caseAttach.getAnnexId()); ajax.put("annexType", annexType); // ajax.put("url", url); - ajax.put("fileName", fileName); + ajax.put("fileName", name); ajax.put("newFileName", FileUtils.getName(fileName)); ajax.put("originalFilename", file.getOriginalFilename()); return ajax; @@ -245,13 +249,13 @@ public class VideoController extends BaseController { caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseId, annexType); } } - Long annexId = saveCaseAttach(annexType, fileName, file.getOriginalFilename(), caseId); + Long annexId = saveCaseAttach(annexType, name, file.getOriginalFilename(), caseId); AjaxResult ajax = AjaxResult.success(); ajax.put("annexId", annexId); ajax.put("annexType", annexType); ajax.put("url", url); - ajax.put("fileName", fileName); + ajax.put("fileName", name); ajax.put("newFileName", FileUtils.getName(fileName)); ajax.put("originalFilename", file.getOriginalFilename()); return ajax; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java index 0952ae7..c08a512 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/CaseApplicationConstants.java @@ -6,6 +6,10 @@ package com.ruoyi.common.constant; public class CaseApplicationConstants { /** 申请人/代理人,立案申请 */ public static final int CASE_APPLICATION = 0; + /** + * 案件新增 + */ + public static final int CASE_INSERT = -2; /** 申请人/代理人,案件修改 */ public static final int CASE_EDIT = -1; /** 顾问,待立案审查 */ diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java index f98291a..2b94d71 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java @@ -54,6 +54,68 @@ public class SysDept extends BaseEntity /** 父部门名称 */ private String parentName; + /** + * 代码(统一社会信用代码或者身份证号) + */ + private String code; + + /** + * 法定代表人 + */ + private String compLegalPerson; + /** + * 住所 + */ + private String home; + /** + * 联系地址 + */ + private String address; + /** + * + * 国籍,0-国内,1-国外 + */ + private Integer nationality; + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCompLegalPerson() { + return compLegalPerson; + } + + public void setCompLegalPerson(String compLegalPerson) { + this.compLegalPerson = compLegalPerson; + } + + public String getHome() { + return home; + } + + public void setHome(String home) { + this.home = home; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public Integer getNationality() { + return nationality; + } + + public void setNationality(Integer nationality) { + this.nationality = nationality; + } public Integer getDeptType() { return deptType; diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index 4fd0af0..1073d80 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -49,6 +49,23 @@ public class SysUser extends BaseEntity public void setNickNameAndNum(String nickNameAndNum) { this.nickNameAndNum = nickNameAndNum; } + /** 身份类别,0-身份证,1-护照,默认0 */ + private Integer idType; + /** 国籍,0-国内,1-国外,默认0 */ + + private Integer nationality; + /** + * 生日 + */ + private Date birth; + /** + * 住所 + */ + private String home; + /** + * 联系地址 + */ + private String address; /** 用户身份证号 */ @Excel(name = "身份证号") @@ -105,12 +122,64 @@ public class SysUser extends BaseEntity /** 角色ID */ private Long roleId; + /** + * 职位 + */ + private String position; + + public String getPosition() { + return position; + } + + public void setPosition(String position) { + this.position = position; + } public SysUser() { } + public Integer getIdType() { + return idType; + } + + public void setIdType(Integer idType) { + this.idType = idType; + } + + public Integer getNationality() { + return nationality; + } + + public void setNationality(Integer nationality) { + this.nationality = nationality; + } + + public Date getBirth() { + return birth; + } + + public void setBirth(Date birth) { + this.birth = birth; + } + + public String getHome() { + return home; + } + + public void setHome(String home) { + this.home = home; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + public SysUser(Long userId) { this.userId = userId; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java index 4ef0d06..4270b36 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java @@ -124,4 +124,11 @@ public interface SysDeptMapper * @return */ int batchSave(@Param("list")List sysDepts); + + /** + * 根据部门名称查询部门信息 + * @param deptName + * @return + */ + public SysDept selectDeptByName(@Param("deptName") String deptName); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index e23c18f..cf2cc6b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -171,4 +171,17 @@ public interface SysUserMapper * @return */ int batchSave(@Param("list")List addUsers); + /** + * 根据邮箱查询用户信息 + * @param email + * @return + */ + SysUser selectUserByEmail(String email); + + /** + * 根据角色查询用户 + * @param 法律顾问 + * @return + */ + SysUser selectUserByRole(String 法律顾问); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java index 3143ec8..8942a7b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java @@ -59,4 +59,13 @@ public interface SysUserRoleMapper * @return 结果 */ public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); + + /** + * 根据用户id查询关联的角色id + * @param userId + * @return + */ + List selectRoleIdsByUserId(Long userId); + + void insertUserRole(@Param("userId") Long userId,@Param("roleId") Long roleId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index a5ad9b0..0684335 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -13,8 +13,10 @@ import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.system.mapper.*; import com.ruoyi.wisdomarbitrate.domain.Arbitrator; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper; import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -73,6 +75,8 @@ public class SysUserServiceImpl implements ISysUserService { @Autowired protected Validator validator; + @Autowired + protected ICaseApplicationService caseApplicationService; /** * 根据条件分页查询用户列表 @@ -94,25 +98,21 @@ public class SysUserServiceImpl implements ISysUserService { @Override public List selectUserListByAdRole(Arbitrator arbitrator) { // 根据案件id查询案件 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(arbitrator.getCaseId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - List phoneList=new ArrayList<>(); + List caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(arbitrator.getCaseId()); + List userIds=new ArrayList<>(); if(CollectionUtil.isNotEmpty(caseAffiliates)){ - for (CaseAffiliate affiliate : caseAffiliates) { - if(StrUtil.isNotEmpty(affiliate.getContactTelphone())) { - phoneList.add(affiliate.getContactTelphone()); - } - if(StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent())) { - phoneList.add(affiliate.getContactTelphoneAgent()); + for (CaseAffiliateEntity affiliate : caseAffiliates) { + if(null!=affiliate.getUserId()) { + userIds.add(affiliate.getUserId()); } + } } List sysUsers = userMapper.selectUserListByAdRole(arbitrator); List arbitrators = new ArrayList<>(); if(CollectionUtil.isNotEmpty(sysUsers)){ for(SysUser sysUser: sysUsers){ - if(!phoneList.contains(sysUser.getPhonenumber())) { + if(!userIds.contains(sysUser.getUserId())) { Long userId = sysUser.getUserId(); int todoCount = caseApplicationMapper.selectCasenum(userId.toString()); String nickName = sysUser.getNickName(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 7f1cf71..4d9b7e6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.domain; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.wisdomarbitrate.domain.vo.CaseAffiliateVO; import lombok.Data; import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; @@ -17,6 +18,19 @@ public class CaseApplication extends BaseEntity { * 查询案件时区分是否待办案件,0待办案件,1已办案件 */ private String selectCaseStatus; + /** + * 房间号 + */ + private String roomId; + /** + * 仲裁员,0-否,1-是 + */ + private Integer arbitratorFlag; + /** + * 第三方代理人,0-否,1-是 + */ + private Integer agentFlag; + /** ID */ private Long id; @@ -26,6 +40,10 @@ public class CaseApplication extends BaseEntity { /** 案件编号 */ // @Excel(name = "案件编号") private String caseNum; + /** + * 是否同意,0-否 + */ + private Integer opinion; /** 案件标的 */ @Excel(name = "案件标的") private BigDecimal caseSubjectAmount; @@ -188,7 +206,7 @@ public class CaseApplication extends BaseEntity { /** * 用户id */ - private String userId; + private Long userId; /** * 登录用户用户名 */ @@ -223,7 +241,7 @@ public class CaseApplication extends BaseEntity { /** 是否指派仲裁员 */ private int pendingAppointArbotrar; /** 案件关联人信息 */ - private List caseAffiliates; + private CaseAffiliateVO affiliate; /** 案件仲裁员 */ private List arbitrators; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationDTO.java new file mode 100644 index 0000000..3ea30ce --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseApplicationDTO.java @@ -0,0 +1,309 @@ +package com.ruoyi.wisdomarbitrate.domain.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import com.ruoyi.wisdomarbitrate.domain.vo.CaseAffiliateVO; +import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * @Classname CaseApplicationDTO + * @Description 案件申请表 + * @Version 1.0.0 + * @Date 2024/5/22 9:19 + * @Created wangqiong + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class CaseApplicationDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + private Long id; + + /** + * 案件编号 + */ + private String caseNum; + + /** + * 案件标的 + */ + private BigDecimal caseSubjectAmount; + + /** + * 立案日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date registerDate; + + /** + * 仲裁方式,视频仲裁(1)、书面仲裁(2) + */ + private Long arbitratMethod; + + /** + * 案件状态,立案申请(0)、待立案审查(1)、 待缴费(2)、待缴费确认(3)、 待案件质证(4)、 + */ + private Integer caseStatus; + + /** + * 开庭日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date hearDate; + + /** + * 申请人仲裁请求及事实和理由 + */ + private String arbitratClaims; + + /** + * 借款开始日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date loanStartDate; + + /** + * 借款结束日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date loanEndDate; + + /** + * 申请人主张欠本金 + */ + private BigDecimal claimPrinciOwed; + + /** + * 申请人主张欠利息 + */ + private BigDecimal claimInterestOwed; + + /** + * 申请人主张违约金 + */ + private BigDecimal claimLiquidDamag; + + /** + * 仲裁应缴费用 + */ + private BigDecimal feePayable; + + + /** + * 合同编号 + */ + private String contractNumber; + + /** + * 创建时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 更新时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai") + private Date updateTime; + + /** + * 创建者 + */ + private String createBy; + + /** + * 仲裁员id + */ + private String arbitratorId; + + /** + * 案件名称 + */ + private String caseName; + + /** + * 仲裁结果 + */ + private String caseResult; + + /** + * 是否同意组庭,0否,1是 + */ + private Integer isAgreePendTral; + + /** + * 是否有异议需要举证,1是,0否 + */ + private Integer objectionAddEviden; + + + /** + * 案件实缴费用 + */ + private BigDecimal paidExpenses; + + /** + * 裁决书URL + */ + private String filearbitraUrl; + + /** + * 支付方式(0线上支付,1线下支付) + */ + private String payType; + + /** + * 申请人请求仲裁庭裁决 + */ + private String requestRule; + + /** + * 是否仲裁反请求,1是,0否 + */ + private Integer adjudicaCounter; + + /** + * 仲裁反请求原因 + */ + private String adjudicaCounterReason; + + /** + * 是否财产保全申请,1是,0否 + */ + private Integer properPreser; + + /** + * 是否管辖异议申请,1是,0否 + */ + private Integer objectiJuris; + + /** + * 被申请人是否缺席,1是,0否 + */ + private Integer isAbsence; + + /** + * 被申请人质证意见 + */ + private String responCrossOpin; + + /** + * 申请人质证意见 + */ + private String applicaCrossOpin; + + /** + * 被申请人的答辩意见 + */ + private String responDefenOpini; + + /** + * 申请人是否缺席,1是,0否 + */ + private Integer appliIsAbsen; + + /** + * 是否锁定,0-否,1-是 + */ + private Integer lockStatus; + + /** + * 视频会议房间号id + */ + private String roomId; + + /** + * 是否导入,0手动录入,1导入,默认0 + */ + private Integer importFlag=0; + + /** + * 版本号 + */ + private Integer version; + + /** + * 事实和理由 + */ + private String facts; + + /** + * 批次 + */ + private Integer batchNumber; + + /** + * 模板id + */ + private Long templateId; + + /** + * 调解内容 + */ + private String mediationAgreement; + + /** + * 申请人是否书面审理 ,0否,1是 + */ + private Integer appliIswritHear; + + /** + * 被申请人是否书面审理 + */ + private Integer responIsWritHear; + + /** + * 案件附件相关表 + */ + private List caseAttachList; + /** + * 附件类型 + */ + private List annexTypeList; + /** + * 附件类型 + */ + private Integer annexType; + /** + * 自定义字段 + */ + private List columnValueList; + /** + * 案件相关人员 + */ + private CaseAffiliateVO affiliate; + /** + * 待办状态,0-待办,1-已办 + */ + private Integer pendingStatus; + /** + * 仲裁方式名称,1-线上调解,2-线下调解 + */ + private String arbitratMethodName; + /** + * 申请机构名称 + */ + private String applicationName; + /** + * 被申请人姓名 + */ + private String respondentName; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/CaseAffiliateEntity.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/CaseAffiliateEntity.java new file mode 100644 index 0000000..c11dce4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/entity/CaseAffiliateEntity.java @@ -0,0 +1,129 @@ +package com.ruoyi.wisdomarbitrate.domain.entity; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.util.Date; + +@Getter +@Setter +@ToString +@Data +public class CaseAffiliateEntity { + /** + * id + */ + private Long id; + /** + * 案件主表id,案件申请表主键 + */ + private Long caseAppliId; + /** + * 案件日志表id + */ + private Long caseAppliLogId; + /** + * 用户id,用户表user_id关联 + */ + private Long userId; + /** + * 申请机构id,和部门表id关联 + */ + private Long applicantDeptId; + + /** + * 代码(统一社会信用代码或者身份证号) + */ + private String code; + /** + * 用户名 + */ + private String userName; + + /** + * 法定代表人 + */ + private String compLegalPerson; + /** + * 角色类别,1-申请操作人/申请人,2-申请人代理人,3-被申请人操作人/被申请人,4-被申请人代理人 + */ + private Integer roleType=1; + /** + * 组别 + */ + private Integer groupOrder; + /** + * 是否操作人,0-否,1-是 + */ + private Integer operatorFlag=1; + /** + * 是否机构申请,0-自然人,1-申请机构,默认0 + */ + private Integer organizeFlag=0; + /** + * 电话 + */ + private String phone; + /** + * 邮箱 + */ + private String email; + /** + * 姓名 + */ + private String name; + /** + * 住所 + */ + private String home; + /** + * 联系地址 + */ + private String address; + /** + * 身份证号 + */ + private String idCard; + + /** + * '身份类别,0-身份证,1-护照,默认0' + */ + private Integer idType; + /** + * 国籍,0-境内,1-境外,默认0 + */ + private Integer nationality; + /** + * 生日 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai") + private Date birth; + /** + * 性别,0-男,1-女 + */ + private String sex; + /** + * 被申请人姓名 + */ + private String resName; + /** + * 角色名称 + */ + private String roleName; + /** + * 申请机构名称 + */ + private String applicantOrgName; + /** + * 角色id + */ + private Long roleId; + /** + * 职位 + */ + private String position; + +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateBase.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateBase.java new file mode 100644 index 0000000..70a2324 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateBase.java @@ -0,0 +1,33 @@ +package com.ruoyi.wisdomarbitrate.domain.vo; + +import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; +import lombok.Data; + +/** + * @Classname MsCaseAffiliateList + * @Description 案件人员表 + * @Version 1.0.0 + * @Date 2024/3/27 16:08 + * @Created wangqiong + */ +@Data +public class CaseAffiliateBase { + /** + * 申请人/操作人 + */ + private CaseAffiliateEntity applicant; + /** + * 申请人代理人 + */ + private CaseAffiliateEntity applicantAgent; + /** + * 被申请人/操作人 + */ + private CaseAffiliateEntity res; + /** + * 被申请人代理人 + */ + private CaseAffiliateEntity resAgent; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateVO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateVO.java new file mode 100644 index 0000000..6f099f9 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/CaseAffiliateVO.java @@ -0,0 +1,32 @@ +package com.ruoyi.wisdomarbitrate.domain.vo; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.util.List; + +/** + * @Classname MsCaseAffiliateVO + * @Description 案件人员表 + * @Version 1.0.0 + * @Date 2024/3/22 11:46 + * @Created wangqiong + */ +@Getter +@Setter +@ToString +@Data +public class CaseAffiliateVO { + /** + * 申请人/操作人 + */ + private List applicant; + + /** + * 被申请人/操作人 + */ + private List res; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java index 7e5affd..b56b105 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateLogMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @@ -10,7 +11,7 @@ import java.util.List; public interface CaseAffiliateLogMapper { - int batchCaseAffiliate(List caseAffiliates); + int batchCaseAffiliate(List caseAffiliates); void deletecaseAffiliate(CaseApplication caseApplication); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java index 97eca71..f98a5cf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAffiliateMapper.java @@ -3,6 +3,8 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO; import org.apache.ibatis.annotations.Param; @@ -18,28 +20,26 @@ public interface CaseAffiliateMapper { void batchDeletecaseAffiliate(@Param("ids") List ids); - List selectCaseAffiliate(CaseAffiliate caseAffiliate); - List selectCaseAffiliateByCaseIds(@Param("ids") List ids); - CaseAffiliate selectCaseAffiliateByIdentityType(@Param("caseAppliId") Long caseAppliId, @Param("identityType")int identityType); - - int updataCaseAffiliate(CaseAffiliate caseAffiliate); - - /** - * 根据案件查询邮箱 - * @param id - * @return - */ - List emailByCaseId(@Param("caseAppliId")Long id); - - /** - * 批量修改 - * @param affiliateLogList - */ - void updateCaseAffiliateByCaseId(@Param("caseAppliId")Long caseAppliId,@Param("list") List affiliateLogList); + List selectCaseAffiliate(CaseAffiliateEntity entity); + List selectCaseAffiliateByCaseIds(@Param("caseIds") List ids); /** * 根据案件id删除 * @param caseId */ void deleteByCaseId(@Param("caseAppliId") Long caseId); + + /** + * 新增人员 + * @param affiliate + */ + + void insert(CaseAffiliateEntity affiliate); + + /** + * 根据案件id查询邮箱 + * @param id + * @return + */ + List emailByCaseId(Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index 630dd6a..f771d46 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -4,6 +4,7 @@ import com.ruoyi.wisdomarbitrate.domain.Arbitrator; import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; import org.apache.ibatis.annotations.Param; @@ -11,17 +12,9 @@ import org.apache.ibatis.annotations.Param; import java.util.List; public interface CaseApplicationMapper { - List selectCaseApplicationList(CaseApplication caseApplication); int selectCaseApplicationCount(CaseApplication caseApplication); - /** - * 查询超级管理员案件 - * @param caseApplication - * @return - */ - List selectAdminCaseApplicationList(CaseApplication caseApplication); - int insertCaseApplication(CaseApplication caseApplication); @@ -40,7 +33,7 @@ public interface CaseApplicationMapper { */ List listCaseApplicationByIds(@Param("ids")List ids); - CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication); + /** * 查询最大编号 @@ -64,12 +57,11 @@ public interface CaseApplicationMapper { void updatePayType(CaseConfirmPayDTO payDTO); - ToDoCount selectAdminCaseToDoCount(); ToDoCount selectTodoCountByRole(@Param("caseApplication") CaseApplication caseApplication, @Param("caseStatusList") List caseStatusList, - @Param("roleNames") List roleNames); + @Param("roleIds") List roleIds); /** * 修改案件锁定状态 @@ -100,12 +92,6 @@ public interface CaseApplicationMapper { */ Long selectCaseIdByRoomId(@Param("roomId")String roomId); - /** - * 查询已办案件 - * @param caseApplication - * @return - */ - List selectHandledCase(CaseApplication caseApplication); /** * 查询最大房间号 * @return @@ -124,7 +110,7 @@ public interface CaseApplicationMapper { * 查询最大批号 * @return */ - Integer selectBatchNumberLike(); + Integer selectMaxBatchNumber(); /** * 批量新增案件 @@ -139,7 +125,7 @@ public interface CaseApplicationMapper { List listCaseApplicationByBatchNumber(CaseApplication caseApplication); - List selectAdminCaseApplicationListBatch1(CaseApplication caseApplication); + /** * 案件列表查询 @@ -148,7 +134,7 @@ public interface CaseApplicationMapper { */ List list(@Param("caseApplication") CaseApplication caseApplication, @Param("caseStatusList") List caseStatusList, - @Param("roleNames") List roleNames); + @Param("roleIds") List roleIds); /** * 查询当前案件节点 @@ -156,4 +142,13 @@ public interface CaseApplicationMapper { * @return */ Integer selectCaseApplicationCaseStatus(@Param("id") Long id); + + /** + * 新增 + * @param caseApplication + * @return + */ + int insert(CaseApplicationDTO caseApplication); + int update(CaseApplicationDTO caseApplication); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java index 61d6c8d..77ee77a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseEvidenceMapper.java @@ -9,10 +9,5 @@ import java.util.List; @Mapper public interface CaseEvidenceMapper { - List getCaseListByRespondent(@Param(value = "identityNum" ) String identityNum - , @Param(value = "caseStatusList") List caseStatusList - , @Param(value = "identityType" ) Integer identityType - , @Param(value = "phone" ) String phone - , @Param(value = "loginUserName" ) String loginUserName - ); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java index 9cf782e..9478c73 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IAdjudicationService.java @@ -16,19 +16,16 @@ public interface IAdjudicationService { AjaxResult sendDocumentByEmail(Long id,String appEmail,String resEmail ,String apptrackingNum,String restrackingNum); - List getLogisticsInfo(CaseApplication caseApplication); +// List getLogisticsInfo(CaseApplication caseApplication); - AjaxResult signature(CaseApplication caseApplication); AjaxResult caseFile( List ids); AjaxResult service(Long id, String appEmail, String resEmail, String apptrackingNum, String restrackingNum); - AjaxResult stamp(CaseApplication caseApplication); - AjaxResult getArchivesDetail(Long id); - AjaxResult regenerationDocument(CaseApplication caseApplication); + /** * 根据案件id查询邮箱 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index c3667e2..6ff1f1c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -2,12 +2,12 @@ package com.ruoyi.wisdomarbitrate.service; import com.alibaba.fastjson.JSONArray; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.wisdomarbitrate.domain.*; -import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; -import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; -import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; -import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; +import com.ruoyi.wisdomarbitrate.domain.vo.*; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MultipartFile; @@ -16,17 +16,15 @@ import java.util.List; import java.util.Map; public interface ICaseApplicationService { - List selectCaseApplicationList(CaseApplication caseApplication); - List selectCaseApplicationListByRole(CaseApplication caseApplication); - int insertcaseApplication(CaseApplication caseApplication); +// int insertcaseApplication(CaseApplication caseApplication); - int insertcaseApplication1(CaseApplication caseApplication); +// int insertcaseApplication1(CaseApplication caseApplication); int selectCaseApplicationCount(CaseApplication caseApplication); - AjaxResult editCaseApplication(CaseApplication caseApplication); +// AjaxResult editCaseApplication(CaseApplication caseApplication); int submitCaseApplication( List ids); @@ -50,8 +48,6 @@ public interface ICaseApplicationService { int submitCaseApplicationCheck(List ids, Integer agreeOrNotCheck,String caseCheckReject); - CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication); - String sendRoomNoMessage(SendRoomNoMessageVO messageVO); SealSignRecord selectSignUrl(CaseApplication caseApplication) throws EsignDemoException; @@ -139,13 +135,13 @@ public interface ICaseApplicationService { CaseAttach downloadCaseZipFile(CaseApplication caseApplication); - List selectCaseApplicationListBatchByRole(CaseApplication caseApplication); +// List selectCaseApplicationListBatchByRole(CaseApplication caseApplication); public List page(CaseApplication caseApplication) ; - int submitCaseApplicationBatch(String batchNumber); + AjaxResult submitCaseApplicationBatch(String batchNumber); - int submitCaseApplicationCheckBatch(String batchNumber, Integer agreeOrNotCheck, String caseCheckReject); + AjaxResult submitCaseApplicationCheckBatch(String batchNumber, Integer agreeOrNotCheck, String caseCheckReject); int pendTralCheckBatch(CaseApplication caseApplication); @@ -168,4 +164,55 @@ public interface ICaseApplicationService { */ AjaxResult saveOnlyOfficeFile(CaseAttach caseAttach); + + /** + * 新增或编辑 + * @param caseApplication + * @return + */ + + AjaxResult insertOrUpdate(CaseApplicationDTO caseApplication); + + /** + * 设置案件相关信息 + * @param caseApplication + * @param affiliate + * @param groupOrder 组别 + * @param operatorCount 操作人数量 + * @param updateFlag 是否修改案件 + */ + public int setCaseAfflicate(List affliates,CaseApplicationDTO caseApplication, CaseAffiliateEntity affiliate, int groupOrder, int operatorCount, boolean updateFlag); + + /** + * 新增案件 + * @param caseApplication + */ + void insert(CaseApplicationDTO caseApplication); + + /** + * 修改案件 + * @param caseApplication + */ + + void update(CaseApplicationDTO caseApplication); + /** + * 新增案件相关人员信息 + * @param affiliate 相关人员信息 + * @param roleIdList 角色id + * @param updateFlag 是否修改案件 + + */ + public void insertAfficateUser(CaseAffiliateEntity affiliate, List roleIdList,boolean updateFlag); + + void insertCaseAfflicate(CaseAffiliateVO caseAffiliateVO, List affliates,CaseApplicationDTO caseApplication); + + /** + * 根据案件id查询相关人员 + * @param id + * @return + */ + + List selectAfflicatesByCaseId(Long id); + + SysUser getUserInfo(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java index 7d8affe..fefde22 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java @@ -13,11 +13,11 @@ import java.util.List; public interface ICaseEvidenceService { - AjaxResult getCaseDetailsById(Long id,String userName); +// AjaxResult getCaseDetailsById(Long id,String userName); AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id,String userName,Long userId); - List getCaseListAll(Integer caseStatus); +// List getCaseListAll(Integer caseStatus); AjaxResult evidenceConfirmation(CaseApplication caseApplication); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index b43e75b..8da713d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -26,6 +26,8 @@ import com.ruoyi.common.utils.thread.MultipleThreadListParam; import com.ruoyi.system.mapper.SysDictDataMapper; import com.ruoyi.wisdomarbitrate.StringIdsReq; import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import com.ruoyi.wisdomarbitrate.domain.vo.ArchivesDetailVO; import com.ruoyi.wisdomarbitrate.domain.vo.BookSendVO; import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; @@ -104,7 +106,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService { @Autowired private SealSignRecordMapper sealSignRecordMapper; - + @Autowired + private IAdjudicationService adjudicationService; // 仲裁反请求模板内容 private final String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; // 财产保全内容 @@ -139,6 +142,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 生成裁决书 + * * @param caseApplicationReq * @return */ @@ -183,9 +187,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } templateName = templateManages.get(0).getFileName(); // 查询案件相关表信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + List caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(id); //获取仲裁记录表里的相关信息 ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); arbitrateRecord.setCaseAppliId(id); @@ -256,35 +258,38 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName; // 将word中的标签替换掉,生成新的word String docFilePath = wordChangeText(templatePath, datas, saveFolderPath, fileName); - String annexPath=saveName.replace("/profile/upload/","/home/ruoyi/uploadPath/upload/"); + String annexPath = saveName.replace("/profile/upload/", "/home/ruoyi/uploadPath/upload/"); // 上传到onlyoffice - JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath,caseApplicationReq.getId()); - CaseAttach caseAttach=null; - if(jsonArray!=null && jsonArray.size() > 0){ + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath, caseApplicationReq.getId()); + CaseAttach caseAttach = null; + if (jsonArray != null && jsonArray.size() > 0) { for (Object obj : jsonArray) { JSONObject jsonObject = (JSONObject) obj; - caseAttach= CaseAttach.builder() + String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):""; + path=path.replace("/home/ruoyi/uploadPath/","/profile/"); + String name = jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):""; + caseAttach = CaseAttach.builder() .caseAppliId(caseApplicationReq.getId()) - .annexName(jsonObject.getString("fileName")) - .annexPath("/home/ruoyi/uploadPath/onlyoffice/") + .annexName(name) + .annexPath(path) .annexType(3) .onlyOfficeFileId(jsonObject.getString("fileId")) .build(); - if(jsonObject.get("filePath")!=null){ - String officePath = jsonObject.getString("filePath"); - String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); - caseAttach.setAnnexName(replace); - - } +// if (jsonObject.get("filePath") != null) { +// String officePath = jsonObject.getString("filePath"); +// String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); +// caseAttach.setAnnexName(replace); +// +// } } } - if(caseAttach!=null) { + if (caseAttach != null) { // 保存裁决书附件 saveArbitorFile(caseAttach, caseApplicationById, arbitrateRecordSelect, CaseApplicationConstants.VERPRIF_ARBITRATION); - }else { + } else { return AjaxResult.error("上传onlyoffice服务器失败"); } @@ -383,7 +388,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { String replace = onLine.replace(onLineDate, Optional.of(hearDateStr).orElse("")); datas.put("线上开庭并线上仲裁", replace); // 所有附件 - List caseAttachList = caseApplicationById.getCaseAttachList(); + List caseAttachList = caseAttachMapper.queryAnnexPathByCaseId(caseApplicationById.getId()); Map> caseAttachMap = new HashMap<>(); if (caseAttachList != null && caseAttachList.size() > 0) { caseAttachMap = caseAttachList.stream().collect(Collectors.groupingBy(CaseAttach::getAnnexType)); @@ -495,38 +500,45 @@ public class AdjudicationServiceImpl implements IAdjudicationService { * @param caseAffiliates 关联人员 * @param valueMap 组装的值 */ - private void buildDefaultColumnValue(List dictDataList, List caseAffiliates, Map valueMap, CaseApplication caseApplication) { + private void buildDefaultColumnValue(List dictDataList, List caseAffiliates, Map valueMap, CaseApplication caseApplication) { if (CollectionUtil.isNotEmpty(dictDataList)) { - Map affiliateMap = caseAffiliates.stream().collect(Collectors.toMap(CaseAffiliate::getIdentityType, Function.identity(), (n1, n2) -> n2)); + // 申请操作人 + Optional applicantAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + Optional applicantAgentAffiliateOpt = caseAffiliates.stream().filter(affiliate -> StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(2))).findFirst(); + // 被申请操作人 + Optional resAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); + Optional resAgentAffiliateOpt = caseAffiliates.stream().filter(affiliate -> StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(4))).findFirst(); + if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) { + throw new ServiceException("未找到案件操作人员"); + } + for (SysDictData dictData : dictDataList) { if (StrUtil.isNotEmpty(dictData.getDictLabel())) { if (dictData.getDictLabel().contains("被申请人")) { - CaseAffiliate affiliate = affiliateMap.get(2); - if (affiliate == null) { - continue; - } + CaseAffiliateEntity res = resAffiliateOpt.get(); + // 被申请人 switch (dictData.getDictLabel()) { case "被申请人姓名": - valueMap.put(dictData.getDictLabel(), affiliate.getName()); + valueMap.put(dictData.getDictLabel(), res.getName()); break; case "被申请人身份证号": - valueMap.put(dictData.getDictLabel(), affiliate.getIdentityNum()); + valueMap.put(dictData.getDictLabel(), res.getIdCard()); break; case "被申请人住所": - valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili()); + valueMap.put(dictData.getDictLabel(), res.getHome()); break; case "被申请人联系地址": - valueMap.put(dictData.getDictLabel(), affiliate.getContactAddress()); + valueMap.put(dictData.getDictLabel(), res.getAddress()); break; case "被申请人联系电话": - valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphone()); + valueMap.put(dictData.getDictLabel(), res.getPhone()); break; case "被申请人电子邮件": - valueMap.put(dictData.getDictLabel(), affiliate.getEmail()); + valueMap.put(dictData.getDictLabel(), res.getEmail()); break; case "被申请人性别": - String responSex = affiliate.getResponSex(); + String responSex = res.getSex(); if (responSex.equals("0")) { valueMap.put(dictData.getDictLabel(), "男"); } else { @@ -534,7 +546,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } break; case "被申请人出生年月日": - Date responBirth = affiliate.getResponBirth(); + Date responBirth = res.getBirth(); if (responBirth != null) { valueMap.put(dictData.getDictLabel(), sdf.format(responBirth)); } else { @@ -545,38 +557,42 @@ public class AdjudicationServiceImpl implements IAdjudicationService { break; } } else if (dictData.getDictLabel().contains("申请人") || dictData.getDictLabel().contains("统一社会信用代码") || dictData.getDictLabel().contains("法定代表人") || dictData.getDictLabel().contains("法定代表人职位") || dictData.getDictLabel().contains("代理人")) { - CaseAffiliate affiliate = affiliateMap.get(1); - if (affiliate == null) { - continue; - } + CaseAffiliateEntity app = applicantAffiliateOpt.get(); + CaseAffiliateEntity appAgent = applicantAgentAffiliateOpt.orElse(null); // 申请人 switch (dictData.getDictLabel()) { case "申请人姓名": - valueMap.put(dictData.getDictLabel(), affiliate.getName()); + valueMap.put(dictData.getDictLabel(), app.getName()); break; case "统一社会信用代码": - valueMap.put(dictData.getDictLabel(), affiliate.getIdentityNum()); + valueMap.put(dictData.getDictLabel(), app.getCode()); break; case "法定代表人": - valueMap.put(dictData.getDictLabel(), affiliate.getCompLegalPerson()); + valueMap.put(dictData.getDictLabel(), app.getCompLegalPerson()); break; case "法定代表人职位": - valueMap.put(dictData.getDictLabel(), affiliate.getCompLegalperPost()); + valueMap.put(dictData.getDictLabel(), app.getPosition()); break; case "申请人住所": - valueMap.put(dictData.getDictLabel(), affiliate.getResidenAffili()); + valueMap.put(dictData.getDictLabel(), app.getHome()); break; case "申请人联系地址": - valueMap.put(dictData.getDictLabel(), affiliate.getContactAddress()); + valueMap.put(dictData.getDictLabel(), app.getAddress()); break; case "委托代理人姓名": - valueMap.put(dictData.getDictLabel(), affiliate.getNameAgent()); + if (appAgent != null) { + valueMap.put(dictData.getDictLabel(), appAgent.getName()); + } break; case "委托代理人联系电话": - valueMap.put(dictData.getDictLabel(), affiliate.getContactTelphoneAgent()); + if (appAgent != null) { + valueMap.put(dictData.getDictLabel(), appAgent.getPhone()); + } break; case "委托代理人电子邮件": - valueMap.put(dictData.getDictLabel(), affiliate.getAgentEmail()); + if (appAgent != null) { + valueMap.put(dictData.getDictLabel(), appAgent.getEmail()); + } break; default: break; @@ -597,9 +613,9 @@ public class AdjudicationServiceImpl implements IAdjudicationService { * * @param caseApplicationById 案件基本信息 * @param arbitrateRecordSelect 出裁决书生成记录 - * @param caseStatus 案件状态,不为空则更新案件状态 + * @param caseStatus 案件状态,不为空则更新案件状态 */ - private void saveArbitorFile( CaseAttach caseAttach, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect,Integer caseStatus) { + private void saveArbitorFile(CaseAttach caseAttach, CaseApplication caseApplicationById, ArbitrateRecord arbitrateRecordSelect, Integer caseStatus) { //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增 List caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach); if (caseAttachList != null && caseAttachList.size() > 0) { @@ -618,7 +634,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } //修改案件状态 - if(caseStatus!=null) { + if (caseStatus != null) { caseApplicationById.setCaseStatus(caseStatus); } Integer arbitratMethod = caseApplicationById.getArbitratMethod(); @@ -675,22 +691,22 @@ public class AdjudicationServiceImpl implements IAdjudicationService { caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING); caseApplicationMapper.submitCaseApplication(caseApplication1); //保存邮箱信息和快递单号到关联人表 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - if (affiliate.getIdentityType() == 1) { //申请人 - affiliate.setSendEmail(appEmail); - affiliate.setTrackNum(apptrackingNum); - caseAffiliateMapper.updataCaseAffiliate(affiliate); - } else { - affiliate.setSendEmail(resEmail); - affiliate.setTrackNum(restrackingNum); - caseAffiliateMapper.updataCaseAffiliate(affiliate); - } - } - } +// CaseAffiliate caseAffiliate = new CaseAffiliate(); +// caseAffiliate.setCaseAppliId(id); +// List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); +// if (caseAffiliates != null && caseAffiliates.size() > 0) { +// for (CaseAffiliate affiliate : caseAffiliates) { +// if (affiliate.getIdentityType() == 1) { //申请人 +// affiliate.setSendEmail(appEmail); +// affiliate.setTrackNum(apptrackingNum); +// caseAffiliateMapper.updataCaseAffiliate(affiliate); +// } else { +// affiliate.setSendEmail(resEmail); +// affiliate.setTrackNum(restrackingNum); +// caseAffiliateMapper.updataCaseAffiliate(affiliate); +// } +// } +// } return AjaxResult.success("裁决书送达成功"); } catch (MailSendException e) { @@ -698,74 +714,61 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } } - @Override - public List getLogisticsInfo(CaseApplication caseApplication) { - try { - //快递单号查询 - String key = "729437f92468910aee6c12dbfeaee3c1"; - String com = "auto"; - //根据案件id查询单号信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - List logisticsInfoVOList = new ArrayList<>(); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - LogisticsInfoVO logisticsInfoVO = new LogisticsInfoVO(); - String trackNum = affiliate.getTrackNum(); - if (trackNum != null) { - // 构造查询字符串参数 - String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d", URLEncoder.encode(key, "UTF-8"), URLEncoder.encode(com, "UTF-8"), URLEncoder.encode(trackNum, "UTF-8"), null); - // 拼接到API URL中 - String fullUrl = apiUrl + "?" + queryParameters; - URL url = new URL(fullUrl); - HttpURLConnection connection = (HttpURLConnection) url.openConnection(); - connection.setRequestMethod("GET"); - int responseCode = connection.getResponseCode(); - if (responseCode == HttpURLConnection.HTTP_OK) { - BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); - String line; - StringBuilder response = new StringBuilder(); - while ((line = reader.readLine()) != null) { - response.append(line); - } - reader.close(); - // 处理返回的响应数据\ - JSONObject jsonObject = JSON.parseObject(response.toString()); - // 提取 "data" 字段并转换为字符串 - String data = jsonObject.getString("data"); - if (data != null) { - logisticsInfoVO.setIdentityType(affiliate.getIdentityType()); - logisticsInfoVO.setLogisticsInfo(data); - logisticsInfoVOList.add(logisticsInfoVO); - } - } else { - // 请求失败 - return null; - } - } - } - return logisticsInfoVOList; - } - } catch (IOException e) { - e.printStackTrace(); - } - return null; - } +// @Override +// public List getLogisticsInfo(CaseApplication caseApplication) { +// try { +// //快递单号查询 +// String key = "729437f92468910aee6c12dbfeaee3c1"; +// String com = "auto"; +// //根据案件id查询单号信息 +// CaseAffiliate caseAffiliate = new CaseAffiliate(); +// caseAffiliate.setCaseAppliId(caseApplication.getId()); +// List logisticsInfoVOList = new ArrayList<>(); +// List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); +// if (caseAffiliates != null && caseAffiliates.size() > 0) { +// for (CaseAffiliate affiliate : caseAffiliates) { +// LogisticsInfoVO logisticsInfoVO = new LogisticsInfoVO(); +// String trackNum = affiliate.getTrackNum(); +// if (trackNum != null) { +// // 构造查询字符串参数 +// String queryParameters = String.format("key=%s&com=%s&no=%s&phone=%d", URLEncoder.encode(key, "UTF-8"), URLEncoder.encode(com, "UTF-8"), URLEncoder.encode(trackNum, "UTF-8"), null); +// // 拼接到API URL中 +// String fullUrl = apiUrl + "?" + queryParameters; +// URL url = new URL(fullUrl); +// HttpURLConnection connection = (HttpURLConnection) url.openConnection(); +// connection.setRequestMethod("GET"); +// int responseCode = connection.getResponseCode(); +// if (responseCode == HttpURLConnection.HTTP_OK) { +// BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); +// String line; +// StringBuilder response = new StringBuilder(); +// while ((line = reader.readLine()) != null) { +// response.append(line); +// } +// reader.close(); +// // 处理返回的响应数据\ +// JSONObject jsonObject = JSON.parseObject(response.toString()); +// // 提取 "data" 字段并转换为字符串 +// String data = jsonObject.getString("data"); +// if (data != null) { +// logisticsInfoVO.setIdentityType(affiliate.getIdentityType()); +// logisticsInfoVO.setLogisticsInfo(data); +// logisticsInfoVOList.add(logisticsInfoVO); +// } +// } else { +// // 请求失败 +// return null; +// } +// } +// } +// return logisticsInfoVOList; +// } +// } catch (IOException e) { +// e.printStackTrace(); +// } +// return null; +// } - @Override - @Transactional - public AjaxResult signature(CaseApplication caseApplication) { - // 查询当前案件节点 - Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); - //更改案件状态(暂时) - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); - caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, ""); - - return AjaxResult.success("签名成功,案件状态已改为待裁决书用印"); - } @Override @Transactional @@ -775,12 +778,12 @@ public class AdjudicationServiceImpl implements IAdjudicationService { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); // 查询当前案件节点 - Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, ""); } } catch (Exception e) { return AjaxResult.error(e.getMessage()); @@ -801,17 +804,19 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (caseApplication1 == null) { return AjaxResult.error("未查询到相关案件"); } - Integer currentNode=caseApplication1.getCaseStatus(); + Integer currentNode = caseApplication1.getCaseStatus(); List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1); Boolean isExistPdf = false; + String path=null; if (caseAttachList != null && caseAttachList.size() > 0) { for (CaseAttach caseAttach : caseAttachList) { if (caseAttach.getAnnexType() == 3) { isExistPdf = true; - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile/upload/"; - int startIndex = prefix.length(); - String path = caseAttach.getAnnexPath() + annexName.substring(startIndex); + String filePath = caseAttach.getAnnexPath(); + if (StrUtil.isEmpty(filePath)) { + throw new ServiceException("未找到文件"); + } + path = filePath.replace("/profile/", "/home/ruoyi/uploadPath/"); File file = new File(path); //判断文件是否存在 if (!file.exists()) { @@ -831,16 +836,16 @@ public class AdjudicationServiceImpl implements IAdjudicationService { for (CaseAttach caseAttach1 : caseAttachList1) { if (caseAttach1.getAnnexType() == 3) { isExistPdf = true; - annexName = caseAttach1.getAnnexName(); - prefix = "/profile/upload/"; - startIndex = prefix.length(); - path = caseAttach1.getAnnexPath() + annexName.substring(startIndex); + filePath = caseAttach.getAnnexPath(); + if (StrUtil.isEmpty(filePath)) { + throw new ServiceException("未找到文件"); + } + path = filePath.replace("/profile/", "/home/ruoyi/uploadPath/"); File file1 = new File(path); if (!file1.exists()) { isExistPdf = false; } - annexName = null; - prefix = null; + path = null; caseAttachList = caseAttachList1; break; @@ -866,25 +871,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService { //修改案件状态 caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING); caseApplicationMapper.submitCaseApplication(caseApplication1); - //保存邮箱信息和快递单号到关联人表 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - if (affiliate.getIdentityType() == 1) { //申请人 - affiliate.setSendEmail(appEmail); - affiliate.setTrackNum(apptrackingNum); - caseAffiliateMapper.updataCaseAffiliate(affiliate); - } else { - affiliate.setSendEmail(resEmail); - affiliate.setTrackNum(restrackingNum); - caseAffiliateMapper.updataCaseAffiliate(affiliate); - } - } - } //申请人发送邮件 - boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList); + boolean appEmailFlag = sendCaseEmail(appEmail, path); SendMailRecord sendMailRecord = new SendMailRecord(); sendMailRecord.setCaseId(id); sendMailRecord.setMailAddress(appEmail); @@ -900,7 +888,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } sendMailRecordMapper.saveSendMailRecord(sendMailRecord); // 被申请人发送邮件 - boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList); + boolean resEmailFlag = sendCaseEmail( resEmail, path); SendMailRecord sendMailRecord1 = new SendMailRecord(); sendMailRecord1.setCaseId(id); @@ -927,46 +915,36 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } // 发送短信 if (appEmailFlag || resEmailFlag) { - - if (CollectionUtil.isNotEmpty(caseAffiliates)) { + // 查询案件相关人员 + CaseAffiliateEntity affiliateEntity = new CaseAffiliateEntity(); + affiliateEntity.setCaseAppliId(id); + List affiliateEntities = caseAffiliateMapper.selectCaseAffiliate(affiliateEntity); +// 申请操作人 + Optional applicantAffiliateOpt = affiliateEntities.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + // 被申请操作人 + Optional resAffiliateOpt = affiliateEntities.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); + List operatorList = new ArrayList<>(); + if (applicantAffiliateOpt.isPresent() && StrUtil.isNotEmpty(applicantAffiliateOpt.get().getPhone())) { + operatorList.add(applicantAffiliateOpt.get()); + } + if (resAffiliateOpt.isPresent() && StrUtil.isNotEmpty(resAffiliateOpt.get().getPhone())) { + operatorList.add(resAffiliateOpt.get()); + } + if (CollectionUtil.isNotEmpty(operatorList)) { SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); request.setTemplateId("1990362"); - for (CaseAffiliate affiliate : caseAffiliates) { - String telphone = null; - if (appEmailFlag && affiliate.getIdentityType() == 1) { - telphone = affiliate.getContactTelphone(); - } else if (resEmailFlag && affiliate.getIdentityType() == 2) { - telphone = affiliate.getContactTelphone(); - } - if (StrUtil.isEmpty(telphone)) { - continue; - } - + for (CaseAffiliateEntity affiliate : operatorList) { + String telphone = affiliate.getPhone(); request.setPhone(telphone); -// if(affiliate.getIdentityType() == 1) { -// request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), appEmail}); -// }else { -// request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), resEmail}); -// } request.setTemplateParamSet(new String[]{affiliate.getName(), caseApplication1.getCaseNum()}); Boolean aBoolean = SmsUtils.sendSms(request); - // 保存短信发送记录 SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); - + smsSendRecord.setCaseId(id); smsSendRecord.setCaseNum(caseApplication1.getCaseNum()); smsSendRecord.setPhone(request.getPhone()); smsSendRecord.setSendTime(new Date()); -// // 尊敬的{1}用户,您的{2}仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。 -// if(affiliate.getIdentityType() == 1) { -// smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +appEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。"); -// }else { -// smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +resEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。"); -// } smsSendRecord.setSendContent("尊敬的" + affiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。"); - - smsSendRecord.setCreateBy(getUsername()); if (aBoolean) { smsSendRecord.setSendStatus(1); @@ -984,7 +962,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentNode, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.ARBITRATION_DELIVERY, ""); return AjaxResult.success("裁决书送达成功"); } @@ -1016,17 +994,6 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (file != null && file.exists()) { try { Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null); - -// String appUid = UUID.randomUUID().toString(); -// Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅", appUid +"裁决书", fileList, null); -// // Thread.sleep(20); - // 收到退信的所有id,即发送失败的uuid - // emailOutUtil.receiverMail(); - // Thread.sleep(3); - // List messageIds = emailOutUtil.receiverMail(); -// if (aBoolean&&(CollectionUtil.isEmpty(messageIds)||!messageIds.contains(appUid))) { -// return Boolean.TRUE; -// } if (aBoolean) { return Boolean.TRUE; } @@ -1039,321 +1006,53 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return Boolean.FALSE; } - @Override - public AjaxResult stamp(CaseApplication caseApplication) { - Integer caseStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); - //更改案件状态(暂时) - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); - caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), caseStatus, ""); - - return AjaxResult.success("用印成功,案件状态已改为待裁决书送达"); - } - - @Override - public AjaxResult getArchivesDetail(Long id) { - ArchivesDetailVO archivesDetailVO = new ArchivesDetailVO(); - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - //查询案件信息 -// CaseApplication caseApplication1 = caseApplicationService.selectCaseApplication(caseApplication); -// if (caseApplication1 != null) { -// archivesDetailVO.setCaseApplication(caseApplication1); -// } - //查询案件日志信息 -// CaseLogRecord caseLogRecord = new CaseLogRecord(); -// caseLogRecord.setCaseAppliId(id); -// List caseLogRecords = caseLogRecordService.selectCaseLogRecordList(caseLogRecord); -// if (caseLogRecords != null && caseLogRecords.size() > 0) { -// archivesDetailVO.setCaseLogRecordList(caseLogRecords); -// } - //查询快递信息 - List logisticsInfo = this.getLogisticsInfo(caseApplication); - if (logisticsInfo != null && logisticsInfo.size() > 0) { - archivesDetailVO.setLogisticsInfoVOList(logisticsInfo); + /** + * 通过邮件发送裁决书文件 + * + * @param + */ + private boolean sendCaseEmail(String email, String path) { + if(StrUtil.isEmpty(path)){ + return Boolean.FALSE; } - return AjaxResult.success(archivesDetailVO); - } + List fileList = new ArrayList<>(); + File file = new File(path); + fileList.add(file); + System.out.println("文件长度==================:" + file.length()); - @Override - @Transactional - public AjaxResult regenerationDocument(CaseApplication caseApplication) { - try { - Map datas = new HashMap<>(); - Long id = caseApplication.getId(); - if (id == null) { - return null; - } - //获取案件详细信息 - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - //生成编码 - String equipmentNo = getNewEquipmentNo(); - datas.put("num", equipmentNo); - //获取仲裁记录相关信息 - ArbitrateRecord arbitrateRecord1 = caseApplication.getArbitrateRecord(); - //获取案件关联人信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - List nameAgentList = new ArrayList<>(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - if (identityType == 1) { //申请人 - datas.put("appName", affiliate.getName()); - datas.put("appAddress", affiliate.getResidenAffili()); - datas.put("appContactAddress", affiliate.getContactAddress()); - datas.put("appLegalPerson", affiliate.getCompLegalPerson()); - datas.put("appLegalPersonTitle", affiliate.getCompLegalperPost()); - datas.put("appAgentName", affiliate.getNameAgent()); - datas.put("appAgentTitle", affiliate.getAppliAgentTitle()); - nameAgentList.add(affiliate.getNameAgent()); - } else if (identityType == 2) { //被申请人 - datas.put("resName", affiliate.getName()); - datas.put("resAddress", affiliate.getResidenAffili()); - String responSex = affiliate.getResponSex(); - if (responSex.equals("0")) { - datas.put("resSex", "男"); - } else { - datas.put("resSex", "女"); - } - Date responBirth = affiliate.getResponBirth(); - if (responBirth != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String responBirthStr = sdf.format(responBirth); - datas.put("resDateOfBirth", responBirthStr); - } - datas.put("resContactAddress", affiliate.getContactAddress()); - nameAgentList.add(affiliate.getNameAgent()); - } + if (file != null && file.exists()) { + try { + Boolean aBoolean = emailOutUtil.sendEmil(email, "您好,审核后的裁决书在附件中请查阅", "签署后的裁决书", fileList, null); + if (aBoolean) { + return Boolean.TRUE; } + } catch (Exception e) { + System.out.println("邮件发送失败++++++++++++++++++++++++++++++++"); + System.out.println(e.toString()); + return Boolean.FALSE; } - Date createTime = caseApplication1.getCreateTime(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - // 将日期格式化为字符串 - String createTimeStr = sdf.format(createTime); - datas.put("submissionDate", createTimeStr); - Date registerDate = caseApplication1.getRegisterDate(); - String registerDateStr = sdf.format(registerDate); - datas.put("acceptDate", registerDateStr); - //反请求 - Integer adjudicaCounter = caseApplication1.getAdjudicaCounter(); - String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; - if (adjudicaCounter == null) { - datas.put("counterclaim", null); - } else if (adjudicaCounter == 1) { - datas.put("counterclaim", counterclaim); - } else { - datas.put("counterclaim", null); - } - //财产保全 - Integer properPreser = caseApplication1.getProperPreser(); - String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + "第二十八条之规定,将该申请提交至法院。"; - if (properPreser == null) { - datas.put("preservation", null); - } else if (properPreser == 1) { - datas.put("preservation", preservation); - } else { - datas.put("preservation", null); - } - //管辖权异议 - Integer objectiJuris = caseApplication1.getObjectiJuris(); - String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《管辖异议申请书》,认为" + ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; - if (objectiJuris == null) { - datas.put("jurisdictionalObjection", null); - } else if (objectiJuris == 1) { - datas.put("jurisdictionalObjection", jurisdictionalObjection); - } else { - datas.put("jurisdictionalObjection", null); - } - String arbitratorName = caseApplication1.getArbitratorName(); - datas.put("arbitratorName", arbitratorName); - Integer arbitratMethod = caseApplication1.getArbitratMethod(); - Date hearDate = caseApplication1.getHearDate(); - String hearDateStr = ""; - if (hearDate != null) { - hearDateStr = sdf.format(hearDate); - } - //线上开庭时 - if (arbitratMethod == 1) { - String onLine1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"; - String onLine2 = "通过仲裁委智慧仲裁平台开庭审理了本案。"; - datas.put("onLine1", onLine1); - datas.put("hearDate", hearDateStr); - datas.put("onLine2", onLine2); - } else { - //书面仲裁时 - String written1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"; - String written2 = "在仲裁委所在地开庭审理了本案。"; - datas.put("written1", written1); - datas.put("hearDate1", hearDateStr); - datas.put("written2", written2); - } - Integer isAbsence = caseApplication1.getIsAbsence(); - if (isAbsence == null) { - datas.put("absent1", null); - datas.put("absent2", null); - datas.put("absent3", null); - datas.put("absent4", null); - datas.put("absent5", null); - datas.put("attend1", null); - datas.put("attend2", null); - datas.put("attend3", null); - datas.put("attend4", null); - datas.put("attend5", null); - datas.put("attend6", null); - datas.put("attend7", null); - datas.put("appAgentName1", null); - datas.put("appAgentName2", null); - datas.put("resAgentName", null); - } else if (isAbsence == 1) { - //缺席审理 - String absent1 = "申请人的特别授权委托代理人"; - String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。"; - String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," + "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。"; - String absent4 = "(二/三)当事人提供的证据材料\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; - String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; - datas.put("absent1", absent1); - datas.put("absent2", absent2); - datas.put("absent3", absent3); - datas.put("absent4", absent4); - datas.put("absent5", absent5); - datas.put("appAgentName1", nameAgentList.get(0)); - } else { - //出席审理 - String attend1 = "申请人的特别授权委托代理人"; - String attend2 = "和被申请人本人/的特别授权委托代理人"; - String attend3 = "出席了庭审。"; - String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" + "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," + "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," + "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。"; - String attend5 = "(二)被申请人的答辩意见"; - String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" + "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; - String attend7 = "被申请人对上述材料的质证意见为:"; - datas.put("attend1", attend1); - datas.put("attend2", attend2); - datas.put("attend3", attend3); - datas.put("attend4", attend4); - datas.put("attend5", attend5); - datas.put("attend6", attend6); - datas.put("attend7", attend7); - datas.put("responCrossOpin", caseApplication1.getResponCrossOpin()); - datas.put("appAgentName2", nameAgentList.get(0)); - datas.put("resAgentName", nameAgentList.get(1)); - if (arbitratMethod == 1) { - //被申出席+开庭 - String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第五十一条的规定,裁决如下:"; - datas.put("attend8", attend8); - } else { - //被申出席+书面 - String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + "第五十一条、第五十八条的规定,裁决如下:"; - datas.put("attend9", attend9); - } - } - datas.put("claims", caseApplication1.getArbitratClaims()); - datas.put("request", caseApplication1.getRequestRule()); - CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); - List caseAttachList1 = caseApplication2.getCaseAttachList(); - if (caseAttachList1 != null && caseAttachList1.size() > 0) { - for (CaseAttach caseAttach : caseAttachList1) { - if (caseAttach.getAnnexType() == 6) { //被申请人证据材料 - String annexName = caseAttach.getAnnexName(); - boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); - if (isImageFile) { - String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); - System.out.println("路径是===========" + annexPath); - PictureRenderData pictureRenderData = WordUtil.rebuildImageContent(100, 100, null, annexPath); - datas.put("resEvidenceMaterial", pictureRenderData); - } - } else if (caseAttach.getAnnexType() == 2) { //申请人证据材料 - String annexName = caseAttach.getAnnexName(); - boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); - if (isImageFile) { - String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); - System.out.println("路径是===========" + annexPath); - PictureRenderData pictureRenderData = WordUtil.rebuildImageContent(100, 100, null, annexPath); - //申请人证据材料 - datas.put("appEvidenceMaterial", pictureRenderData); - } - } - } - } - datas.put("applicaCrossOpin", "被申请人证据不足,无法说明事实"); - - datas.put("factDetermi", "被申请人欠款属实"); - datas.put("arbitrateThink", "被申请人应按约定还款"); - datas.put("rulingFollows", "被申请人依法偿还申请人欠款"); - - LocalDate now = LocalDate.now(); - String year = Integer.toString(now.getYear()); - datas.put("year", year); - String month = String.format("%02d", now.getMonthValue()); - String day = String.format("%02d", now.getDayOfMonth()); - String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx"; -// String modalFilePath = "D:/develop/新裁决书模板.docx"; - String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; -// String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day; - String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; - String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; - String resultFilePath = saveFolderPath + "/" + fileName; - // 创建日期目录 - File saveFolder = new File(saveFolderPath); - if (!saveFolder.exists()) { - saveFolder.mkdirs(); - } - Path sourcePath = new File(modalFilePath).toPath(); - Path destinationPath = new File(resultFilePath).toPath(); - Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); - String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); - String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); - - - //将裁决书更新到附件表里 - CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id).annexName(saveName).annexPath(savePath).annexType(3).build(); - int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach); - - - if (i > 0) { - if (arbitrateRecord1 != null) { - //将仲裁记录更新到仲裁记录表 - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1); - } - } - - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseAttach.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } - - return AjaxResult.success(caseAttach); - } catch (IOException e) { - e.printStackTrace(); - return AjaxResult.error("重新生成裁决书异常"); } + return Boolean.FALSE; } + + + @Override public AjaxResult emailByCaseId(Long id) { - List list = caseAffiliateMapper.emailByCaseId(id); + List list = caseAffiliateMapper.emailByCaseId(id); BookSendVO bookSendVO = new BookSendVO(); if (CollectionUtil.isNotEmpty(list)) { - for (CaseAffiliate caseAffiliate : list) { - // 申请人邮箱 - if (caseAffiliate.getIdentityType() == 1) { - bookSendVO.setAppEmail(caseAffiliate.getEmail()); - } else { - // 被申请人邮箱 - bookSendVO.setResEmail(caseAffiliate.getEmail()); - } + // 申请操作人 + Optional applicantAffiliateOpt = list.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getEmail()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + // 被申请操作人 + Optional resAffiliateOpt = list.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getEmail()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); + if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) { + throw new ServiceException("未找到案件操作人员"); } + bookSendVO.setAppEmail(applicantAffiliateOpt.get().getEmail()); + bookSendVO.setResEmail(resAffiliateOpt.get().getEmail()); } return AjaxResult.success(bookSendVO); } @@ -1583,14 +1282,14 @@ public class AdjudicationServiceImpl implements IAdjudicationService { List ids = caseApplications1.stream().map(CaseApplication::getId).collect(Collectors.toList()); try { for (Long id : ids) { - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); //更改案件状态(暂时) caseApplication.setCaseStatus(CaseApplicationConstants.CASE_ARCHIVED); caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_FILING, ""); } } catch (Exception e) { return AjaxResult.error(e.getMessage()); @@ -1606,6 +1305,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { @Override @Transactional public AjaxResult serviceBatch(Integer batchNumber) throws EsignDemoException, IOException { + List operatorList = new ArrayList<>(); CaseApplication caseApplicationsel = new CaseApplication(); caseApplicationsel.setBatchNumber(batchNumber); caseApplicationsel.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); @@ -1615,197 +1315,37 @@ public class AdjudicationServiceImpl implements IAdjudicationService { for (Long id : ids) { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); if (caseApplication1 == null) { return AjaxResult.error("未查询到相关案件"); } - Integer currentCaseNode=caseApplication1.getCaseStatus(); - List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication1); - - if (caseAttachList != null && caseAttachList.size() > 0) { - for (CaseAttach caseAttach : caseAttachList) { - if (caseAttach.getAnnexType() == 3) { - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile/upload/"; - int startIndex = prefix.length(); - String path = caseAttach.getAnnexPath() + annexName.substring(startIndex); - File file = new File(path); - // todo 部署放开 - if (!file.exists()) { - Gson gson = new Gson(); - SealSignRecord sealSignRecord = new SealSignRecord(); - sealSignRecord.setCaseAppliId(id); - List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); - if (sealSignRecords != null && sealSignRecords.size() > 0) { - String signFlowid = sealSignRecords.get(0).getSignFlowid(); - EsignHttpResponse fileDownload = SaaSAPIFileUtils.fileDownloadUrl(signFlowid); - JsonObject fileDownloadJsonObject = gson.fromJson(fileDownload.getBody(), JsonObject.class); - JsonObject fileDownloadData = fileDownloadJsonObject.getAsJsonObject("data"); - JsonArray filesArray = fileDownloadData.get("files").getAsJsonArray(); - if (filesArray != null && filesArray.size() > 0) { - JsonObject fileObject = (JsonObject) filesArray.get(0); - String fileDownloadUrl = fileObject.get("downloadUrl").toString(); - String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); - - LocalDate now = LocalDate.now(); - String year = Integer.toString(now.getYear()); - String month = String.format("%02d", now.getMonthValue()); - String day = String.format("%02d", now.getDayOfMonth()); - String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; - String fileName = UUID.randomUUID().toString().replace("-", "") + ".pdf"; - String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; - String savePath = "/home/ruoyi/uploadPath/upload/"; - - // 创建日期目录 - File saveFolder = new File(saveFolderPath); - if (!saveFolder.exists()) { - saveFolder.mkdirs(); - } - String resultFilePath = saveFolderPath + "/" + fileName; - File resultFilePathFile = new File(resultFilePath); - if (!resultFilePathFile.exists()) { - resultFilePathFile.createNewFile(); - } - - boolean downLoadFile = FileTransformation.downLoadFileByUrl(filearbitraUrl, resultFilePath); - if (downLoadFile) { - CaseAttach caseAttach1 = new CaseAttach(); - caseAttach1.setCaseAppliId(id); - caseAttach1.setAnnexType(3); - caseAttach1.setAnnexPath(savePath); - caseAttach1.setAnnexName(saveName); - caseAttachMapper.updateCaseAttachBycaseid(caseAttach1); - - caseAttach.setAnnexPath(savePath); - caseAttach.setAnnexName(saveName); - } - } - } - } - } - } - } - - //修改案件状态 - caseApplication1.setCaseStatus(CaseApplicationConstants.CASE_FILING); - caseApplicationMapper.submitCaseApplication(caseApplication1); String appEmail = ""; String resEmail = ""; CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); + List caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(id); if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - if (affiliate.getIdentityType() == 1) { //申请人 - appEmail = affiliate.getEmail(); - } else { - resEmail = affiliate.getEmail(); - } +// 申请操作人 + Optional applicantAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + // 被申请操作人 + Optional resAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); + if (applicantAffiliateOpt.isPresent()) { + operatorList.add(applicantAffiliateOpt.get()); + appEmail = applicantAffiliateOpt.get().getEmail(); } - } - - //申请人发送邮件 - boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList); - SendMailRecord sendMailRecord = new SendMailRecord(); - sendMailRecord.setCaseId(id); - sendMailRecord.setMailAddress(appEmail); - sendMailRecord.setMailContent("您好,审核后的裁决书在附件中请查阅"); -// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅"); - sendMailRecord.setMailName("签署后的裁决书"); - sendMailRecord.setSendTime(new Date()); - sendMailRecord.setCreateBy(getUsername()); - if (appEmailFlag) { - sendMailRecord.setSendStatus(1); - } else { - sendMailRecord.setSendStatus(0); - } - sendMailRecordMapper.saveSendMailRecord(sendMailRecord); - // 被申请人发送邮件 - boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList); - - SendMailRecord sendMailRecord1 = new SendMailRecord(); - sendMailRecord1.setCaseId(id); - sendMailRecord1.setMailAddress(resEmail); -// sendMailRecord.setMailContent("您好,您的{"+caseApplication1.getCaseNum()+"}案件,审核后的裁决书在附件中请查阅"); - sendMailRecord1.setMailContent("您好,审核后的裁决书在附件中请查阅"); - sendMailRecord1.setMailName("签署后的裁决书"); - sendMailRecord1.setSendTime(new Date()); - sendMailRecord1.setCreateBy(getUsername()); - if (resEmailFlag) { - sendMailRecord1.setSendStatus(1); - } else { - sendMailRecord1.setSendStatus(0); - } - sendMailRecordMapper.saveSendMailRecord(sendMailRecord1); - if (!appEmailFlag && !resEmailFlag) { - throw new ServiceException("裁决书发送失败"); - } - if (!appEmailFlag) { - throw new ServiceException("申请人裁决书发送失败"); - } - if (!resEmailFlag) { - throw new ServiceException("被申请人裁决书发送失败"); - } - // 发送短信 - if (appEmailFlag || resEmailFlag) { - - if (CollectionUtil.isNotEmpty(caseAffiliates)) { - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1990362"); - for (CaseAffiliate affiliate : caseAffiliates) { - String telphone = null; - if (appEmailFlag && affiliate.getIdentityType() == 1) { - telphone = affiliate.getContactTelphone(); - } else if (resEmailFlag && affiliate.getIdentityType() == 2) { - telphone = affiliate.getContactTelphone(); - } - if (StrUtil.isEmpty(telphone)) { - continue; - } - - request.setPhone(telphone); -// if(affiliate.getIdentityType() == 1) { -// request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), appEmail}); -// }else { -// request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplication1.getCaseNum(), resEmail}); -// } - request.setTemplateParamSet(new String[]{affiliate.getName(), caseApplication1.getCaseNum()}); - Boolean aBoolean = SmsUtils.sendSms(request); - - // 保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); - - smsSendRecord.setCaseNum(caseApplication1.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); -// // 尊敬的{1}用户,您的{2}仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。 -// if(affiliate.getIdentityType() == 1) { -// smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +appEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。"); -// }else { -// smsSendRecord.setSendContent("尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达至" +resEmail+"邮箱,请知晓,如非本人操作,请忽略本短信。"); -// } - smsSendRecord.setSendContent("尊敬的" + affiliate.getName() + "用户,您的" + caseApplication1.getCaseNum() + "仲裁案件,裁决书已送达,请知晓,如非本人操作,请忽略本短信。"); - - - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } - + if (resAffiliateOpt.isPresent()) { + operatorList.add(resAffiliateOpt.get()); + resEmail = resAffiliateOpt.get().getEmail(); } - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication1.getId(), currentCaseNode, ""); } + adjudicationService.service(id, appEmail, resEmail, "",""); } + } else { throw new ServiceException("这个批号没有批量送达裁决书的案件"); } @@ -1815,6 +1355,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { /** * 开庭审理,确定审理结果,生成裁决书 + * * @param req * @return */ @@ -1836,7 +1377,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { if (CollectionUtil.isEmpty(templateManages)) { return AjaxResult.error("请先指定裁决书模板"); } - String templatePath = templateManages.get(0).getTemOrigPath(); + String templatePath = templateManages.get(0).getTemOrigPath(); if (StrUtil.isEmpty(templatePath)) { return AjaxResult.error("未找到该模板"); } @@ -1847,10 +1388,8 @@ public class AdjudicationServiceImpl implements IAdjudicationService { return AjaxResult.error("未找到该模板"); } // 查询案件相关表信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(req.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if(CollectionUtil.isEmpty(caseAffiliates)){ + List caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(req.getId()); + if (CollectionUtil.isEmpty(caseAffiliates)) { return AjaxResult.error("未找到案件相关人员"); } // 在系统表中查询案件内置字段 @@ -1892,7 +1431,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { // 遍历书签,给书签赋值 replaceBookmark(bookmarkList, datas, valueMap); // 根据条件替换书签 - conditionReplaceBookmark(caseApplicationById, datas,"", "", arbitrateRecordSelect); + conditionReplaceBookmark(caseApplicationById, datas, "", "", arbitrateRecordSelect); // 裁决书生成时间 LocalDate now = LocalDate.now(); String year = Integer.toString(now.getYear()); @@ -1930,35 +1469,38 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } catch (IOException e) { throw new ServiceException("生成裁决书失败"); } - String annexPath=saveName.replace("/profile/upload/","/home/ruoyi/uploadPath/upload/"); + String annexPath = saveName.replace("/profile/upload/", "/home/ruoyi/uploadPath/upload/"); // 上传到onlyoffice - JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath,req.getId()); - CaseAttach caseAttach=null; - if(jsonArray!=null && jsonArray.size() > 0){ + JSONArray jsonArray = caseApplicationService.uploadOnlyOffice(annexPath, req.getId()); + CaseAttach caseAttach = null; + if (jsonArray != null && jsonArray.size() > 0) { for (Object obj : jsonArray) { JSONObject jsonObject = (JSONObject) obj; - caseAttach= CaseAttach.builder() + String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):""; + path=path.replace("/home/ruoyi/uploadPath/","/profile/"); + String name = jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):""; + caseAttach = CaseAttach.builder() .caseAppliId(req.getId()) - .annexName(jsonObject.getString("fileName")) - .annexPath("/home/ruoyi/uploadPath/onlyoffice/") + .annexName(name) + .annexPath(path) .annexType(3) .onlyOfficeFileId(jsonObject.getString("fileId")) .build(); - if(jsonObject.get("filePath")!=null){ - String officePath = jsonObject.getString("filePath"); - String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); - caseAttach.setAnnexName(replace); - - } +// if (jsonObject.get("filePath") != null) { +// String officePath = jsonObject.getString("filePath"); +// String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); +// caseAttach.setAnnexName(replace); +// +// } } } - if(caseAttach!=null) { + if (caseAttach != null) { // 保存裁决书附件 saveArbitorFile(caseAttach, caseApplicationById, arbitrateRecordSelect, null); - }else { + } else { return AjaxResult.error("上传onlyoffice服务器失败"); } @@ -1978,7 +1520,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(id,currentStatus , ""); + insertCaseLog(id, CaseApplicationConstants.PENDING_OPENCOURT_HEAR, ""); return AjaxResult.success(); } @@ -2035,7 +1577,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { xwpfDocument = new XWPFDocument(fileInputStream); log.error("xwpfDocument====" + xwpfDocument); } catch (IOException e) { - throw new ServiceException("系统找不到指定的文件。"); + throw new ServiceException("系统找不到指定的文件。"); } if (xwpfDocument == null) { return new ArrayList<>(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java index d879caf..0d142dd 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationLogServiceImpl.java @@ -247,7 +247,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService CaseApplication beforeCase = caseApplicationService.selectCaseApplication(caseApplication); // 查询案件关联人员 - afterCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(afterCase.getCaseLogId())); + // afterCase.setAffiliate(caseAffiliateLogMapper.selectCaseAffiliate(afterCase.getCaseLogId())); // 查询自定义字段表 afterCase.setColumnValues(columnValueLogMapper.listBycaseAppliLogId(afterCase.getCaseLogId())); // 查询附件 @@ -259,17 +259,10 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService List afterAttachList = caseAttachLogMapper.getCaseAttachByCaseIdAndType(caseAttach); if (CollectionUtil.isNotEmpty(afterAttachList)) { for (CaseAttach attach : afterAttachList) { - String annexName = attach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - attach.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - attach.setAnnexName(annexNamenew); - } + String path = attach.getAnnexPath()==null?"":attach.getAnnexPath(); + attach.setAnnexPath(path); + attach.setAnnexName(attach.getAnnexName()); + } afterCase.setCaseAttachList(afterAttachList); } @@ -299,7 +292,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService } // 对比案件人员字段 - compareAffilate(beforeCase, afterCase); +// compareAffilate(beforeCase, afterCase); // 对比申请人证据资料 compareCaseVO.setChangeColumn(compareApplicantFile(beforeCase, afterCase, changeColumn).toString()); // 对比自定义字段 @@ -385,70 +378,70 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService * @param beforeCase * @param afterCase */ - private void compareAffilate(CaseApplication beforeCase, CaseApplication afterCase) { - // 对比人员字段 - List beforeCaseCaseAffiliates = beforeCase.getCaseAffiliates(); - List afterCaseCaseAffiliates = afterCase.getCaseAffiliates(); - Map beforeCaseCaseAffiliateMap = null; - if (CollectionUtil.isNotEmpty(beforeCaseCaseAffiliates)) { - // 转为map - beforeCaseCaseAffiliateMap = beforeCaseCaseAffiliates.stream().collect(Collectors.toMap(CaseAffiliate::getIdentityType, v -> v, (n1, n2) -> n2)); - } - StringBuilder affiliateChangeColumn; - // 如果上一个版本和现版本有一个为空,那么所有字段都修改 - if (beforeCaseCaseAffiliates != null && afterCaseCaseAffiliates == null) { - affiliateChangeColumn = new StringBuilder(); - for (String column : affiliateColumns) { - - affiliateChangeColumn.append(column).append(","); - } - - } else if (beforeCaseCaseAffiliates == null && afterCaseCaseAffiliates != null) { - affiliateChangeColumn = new StringBuilder(); - for (String column : affiliateColumns) { - - affiliateChangeColumn.append(column).append(","); - } - } else if (beforeCaseCaseAffiliates != null && afterCaseCaseAffiliates != null) { - for (CaseAffiliate afterCaseCaseAffiliate : afterCaseCaseAffiliates) { - // 找到相同身份类型的数据,进行对比 - affiliateChangeColumn = new StringBuilder(); - int identityType = afterCaseCaseAffiliate.getIdentityType(); - if (beforeCaseCaseAffiliateMap != null && beforeCaseCaseAffiliateMap.containsKey(identityType)) { - CaseAffiliate beforeCaseCaseAffiliate = beforeCaseCaseAffiliateMap.get(identityType); - for (String column : affiliateColumns) { - String beforeValue = ObjectFieldUtils.getValue(beforeCaseCaseAffiliate, column); - String afterValue = ObjectFieldUtils.getValue(afterCaseCaseAffiliate, column); - if (StrUtil.isEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue)) { - affiliateChangeColumn.append(column).append(","); - continue; - } - if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isEmpty(afterValue)) { - affiliateChangeColumn.append(column).append(","); - continue; - } - if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue) && !Objects.equals(beforeValue, afterValue)) { - affiliateChangeColumn.append(column).append(","); - continue; - - } - - } - - - } else { - for (String column : affiliateColumns) { - - affiliateChangeColumn.append(column).append(","); - } - } - afterCaseCaseAffiliate.setChangeColumn(affiliateChangeColumn.toString()); - - } - - - } - } +// private void compareAffilate(CaseApplication beforeCase, CaseApplication afterCase) { +// // 对比人员字段 +// List beforeCaseCaseAffiliates = beforeCase.getCaseAffiliates(); +// List afterCaseCaseAffiliates = afterCase.getCaseAffiliates(); +// Map beforeCaseCaseAffiliateMap = null; +// if (CollectionUtil.isNotEmpty(beforeCaseCaseAffiliates)) { +// // 转为map +// beforeCaseCaseAffiliateMap = beforeCaseCaseAffiliates.stream().collect(Collectors.toMap(CaseAffiliate::getIdentityType, v -> v, (n1, n2) -> n2)); +// } +// StringBuilder affiliateChangeColumn; +// // 如果上一个版本和现版本有一个为空,那么所有字段都修改 +// if (beforeCaseCaseAffiliates != null && afterCaseCaseAffiliates == null) { +// affiliateChangeColumn = new StringBuilder(); +// for (String column : affiliateColumns) { +// +// affiliateChangeColumn.append(column).append(","); +// } +// +// } else if (beforeCaseCaseAffiliates == null && afterCaseCaseAffiliates != null) { +// affiliateChangeColumn = new StringBuilder(); +// for (String column : affiliateColumns) { +// +// affiliateChangeColumn.append(column).append(","); +// } +// } else if (beforeCaseCaseAffiliates != null && afterCaseCaseAffiliates != null) { +// for (CaseAffiliate afterCaseCaseAffiliate : afterCaseCaseAffiliates) { +// // 找到相同身份类型的数据,进行对比 +// affiliateChangeColumn = new StringBuilder(); +// int identityType = afterCaseCaseAffiliate.getIdentityType(); +// if (beforeCaseCaseAffiliateMap != null && beforeCaseCaseAffiliateMap.containsKey(identityType)) { +// CaseAffiliate beforeCaseCaseAffiliate = beforeCaseCaseAffiliateMap.get(identityType); +// for (String column : affiliateColumns) { +// String beforeValue = ObjectFieldUtils.getValue(beforeCaseCaseAffiliate, column); +// String afterValue = ObjectFieldUtils.getValue(afterCaseCaseAffiliate, column); +// if (StrUtil.isEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue)) { +// affiliateChangeColumn.append(column).append(","); +// continue; +// } +// if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isEmpty(afterValue)) { +// affiliateChangeColumn.append(column).append(","); +// continue; +// } +// if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue) && !Objects.equals(beforeValue, afterValue)) { +// affiliateChangeColumn.append(column).append(","); +// continue; +// +// } +// +// } +// +// +// } else { +// for (String column : affiliateColumns) { +// +// affiliateChangeColumn.append(column).append(","); +// } +// } +// afterCaseCaseAffiliate.setChangeColumn(affiliateChangeColumn.toString()); +// +// } +// +// +// } +// } /** * 同意撤销 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index acd88a2..624fe14 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -12,11 +12,13 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; +import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.*; import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.enums.UpdateSubmitStatus; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; @@ -26,11 +28,10 @@ import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.thread.ThreadPoolUtil; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.mapper.*; -import com.ruoyi.wisdomarbitrate.domain.vo.ColumnValue; -import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; -import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseApplicationDTO; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; +import com.ruoyi.wisdomarbitrate.domain.vo.*; import com.ruoyi.wisdomarbitrate.domain.*; -import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; @@ -58,6 +59,7 @@ import java.time.LocalDate; import java.time.ZoneId; import java.util.*; import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -65,6 +67,7 @@ import java.util.zip.ZipOutputStream; import static cn.hutool.system.SystemUtil.getUserInfo; import static com.google.common.io.Files.getFileExtension; +import static com.ruoyi.common.constant.CaseApplicationConstants.HEAD_CHECK_ARBITRATION; import static com.ruoyi.common.core.domain.AjaxResult.error; import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.utils.PageUtils.startPage; @@ -134,249 +137,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private CaseZipImportImpl caseZipImportImpl; @Autowired IAdjudicationService adjudicationService; + @Autowired + private RedisCache redisCache; // 手机号正则 private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); // 邮箱正则 private static final Pattern EMAIL_PATTERN = Pattern.compile("^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$"); // 基本字段校验 - private static final String[] baseColumns = {"caseName","caseSubjectAmount","loanStartDate", "loanEndDate","contractNumber","claimInterestOwed","claimLiquidDamag", - "claimPrinciOwed","arbitratClaims"}; + private static final String[] baseColumns = {"caseName", "caseSubjectAmount", "loanStartDate", "loanEndDate", "contractNumber", "claimInterestOwed", "claimLiquidDamag", + "claimPrinciOwed", "arbitratClaims"}; // 申请人字段校验 - private static final String[] applicAffiliateColumns = {"name", "contactTelphone","contactAddress","workTelphone","workAddress", - "residenAffili","compLegalPerson", - "compLegalperPost","email","nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent"}; - // 申请人/被申请人代理人字段校验 - private static final String[] applicAgentAffiliateColumns = {"nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent"}; + private static final String[] applicAffiliateColumns = {"name", "phone", "address", "home", "email"}; // 被申请人字段校验 - private static final String[] dectborAffiliateColumns = {"name", "identityNum","contactTelphone","contactAddress","workTelphone","workAddress", - "residenAffili","responSex","responBirth","email","nameAgent", "identityNumAgent","contactTelphoneAgent","contactAddressAgent"}; - /** - * 案件列表查询 - * - * @param req - * @return - */ -// public List list(CaseApplication req) { -// // 查询的案件状态 -// List caseStatusList=new ArrayList<>(); -// // 根据用户查询角色 -// LoginUser loginUser = SecurityUtils.getLoginUser(); -// // 根据id查询用户 -// SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId()); -// List roles = sysUser.getRoles(); -// req.setUserName(sysUser.getUserName()); -// if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) { -// startPage(); -// List list = caseApplicationMapper.list(req, null,null); -// // 设置申请人被申请人及签名按钮限 -// // setAfflicate(new HashMap<>(),list,loginUser.getUserId(),roles); -// return list; -// } -// if(CollectionUtil.isEmpty(roles) ){ -// throw new RuntimeException("用户未分配角色,请联系管理员"); -// } -// List roleIds = roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()); -// -// // 流程名称分组 -// Map flowNameMap = allCaseFlows.stream().collect(Collectors.toMap(MsCaseFlow::getCaseStatusName, MsCaseFlow::getSort, (k1, k2) -> k2)); -// -// // 是否查询所有 -// boolean isSelectAll = false; -// -// for (SysRole role : roles) { -// if(StrUtil.isNotEmpty(role.getRoleName())){ -// if(StrUtil.contains(role.getRoleName(),"财务") -// ||StrUtil.contains(role.getRoleName(),"法律顾问") -// ||StrUtil.contains(role.getRoleName(),"部门长") -// ){ -// isSelectAll=true; -// roleIds=null; -// } -// if(StrUtil.equals(role.getRoleName(),"调解员")) { -// req.setMediatorId(String.valueOf(sysUser.getUserId())); -// } -// } -// } -// if(!isSelectAll){ -// req.setUserId(String.valueOf(loginUser.getUserId())); -// } -// if(req.getMediationMethod()!=null){ -// // 查询视频审理 -// req.setCaseFlowId(9); -// } -// startPage(); -// -// // 查询案件列表 -// List list = caseApplicationMapper.list(req, caseFlowIds,roleIds); -// // 设置申请人被申请人及签名按钮限 -// // setAfflicate(flowNameMap,list,loginUser.getUserId(),roles); -// return list; -// } - - /** - * 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态 - * 2.申请人:金融机构下,可以看到改机构的所有的案件 - * 3.被申请人:可以看到自己相关的案件(案件有被申请人相关的信息) - * 4.仲裁员:案件选定了某个仲裁员后,该仲裁员就可以查看该案件 - * 5.仲裁委(部门长):可以查看所有的案件 - * 6.法律顾问秘书:可以属于多个机构,可以查看相关机构的所有案件 - * 7.超级管理员:可以查看所有的信息和数据 - * - * @param caseApplication - * @return - */ - @Override - public List selectCaseApplicationListByRole(CaseApplication caseApplication) { - // 获取登录用户 - LoginUser loginUser = getLoginUser(); - SysUser user = loginUser.getUser(); - Long userId = user.getUserId(); - // 查询登录人身份证号 - SysUser sysUser = sysUserMapper.selectUserById(userId); - startPage(); - caseApplication.setLoginUserName(sysUser.getUserName()); - List roles = sysUser.getRoles(); - // 没有角色不能查看案件列表 - if (CollectionUtil.isEmpty(roles)) { - throw new ServiceException("该用户没有角色权限"); - } - - for (SysRole role : roles) { - if (StrUtil.isEmpty(role.getRoleName())) { - continue; - } - // 超级管理员和仲裁委(部门长)案件,可查看所有案件 - if ("超级管理员".equals(role.getRoleName()) - ) { - List caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); - if(caseApplicationlist!=null&&caseApplicationlist.size()>0){ - for(CaseApplication caseApplicationsel : caseApplicationlist){ - Integer caseStatus = caseApplicationsel.getCaseStatus(); - if(caseStatus.intValue() == CaseApplicationConstants.CHECK_ARBITRATION_METHOD){ - Integer applicantIsWrittenHear = caseApplicationsel.getApplicantIsWrittenHear(); - Integer respondentIsWrittenHear = caseApplicationsel.getRespondentIsWrittenHear(); - if(applicantIsWrittenHear!=null&&respondentIsWrittenHear!=null){ - if(applicantIsWrittenHear.intValue()==respondentIsWrittenHear.intValue()){ - caseApplicationsel.setArbitraMethodIssame(1); - if(applicantIsWrittenHear.intValue()==1&&respondentIsWrittenHear.intValue()==1){ - caseApplicationsel.setArbitratMethod(2); - }else { - caseApplicationsel.setArbitratMethod(1); - } - }else { - caseApplicationsel.setArbitraMethodIssame(2); - String applicantarbitratMethod = ""; - String respondentbitratMethod = ""; - if(applicantIsWrittenHear.intValue()==1){ - applicantarbitratMethod = "书面审理"; - }else { - applicantarbitratMethod = "开庭审理"; - } - if(respondentIsWrittenHear.intValue()==1){ - respondentbitratMethod = "书面审理"; - }else { - respondentbitratMethod = "开庭审理"; - } - String arbitratMethodIllustrate = "当前案件开庭方式:申请人选择开庭方式为"+applicantarbitratMethod+ - "被申请人选择开庭方式为"+respondentbitratMethod+",请确定开庭方式。"; - caseApplicationsel.setArbitratMethodIllustrate(arbitratMethodIllustrate); - } - } - - } - } - } - return caseApplicationlist; - } - if ("仲裁委".equals(role.getRoleName()) - || "部门长".equals(role.getRoleName())) { - List caseStatusList = new ArrayList<>(); - caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); - caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); - // caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); - caseApplication.setDeptHeadStatus(caseStatusList); - caseApplication.setIsOtherRole(1); - } - if ("仲裁员".equals(role.getRoleName())) { - caseApplication.setUserId(String.valueOf(userId)); - caseApplication.setIsOtherRole(1); - } - if ("财务".equals(role.getRoleName())) { - caseApplication.setIsOtherRole(1); - caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); - } - if ("法律顾问".equals(role.getRoleName())) { - // 秘书查看所有案件 - // 查询角色有关的用户部门 - List deptIds = new ArrayList<>(); - deptIds.add(sysUser.getDeptId()); - caseApplication.setDeptIds(deptIds); - } - if ("申请人".equals(role.getRoleName())) { - // caseApplication.setIsOtherRole(1); - // 查询有关的用户部门 - caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId())); - } - if ("被申请人".equals(role.getRoleName())) { - caseApplication.setIsOtherRole(1); - // - caseApplication.setIdCard(String.valueOf(sysUser.getIdCard())); - } - if ("代理人".equals(role.getRoleName())) { - caseApplication.setIsOtherRole(1); - // 查询角色有关的用户部门 - // List agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); - List agentDeptIds = new ArrayList<>(); - agentDeptIds.add(sysUser.getDeptId()); - caseApplication.setAgentDeptIds(agentDeptIds); - } - } - - - // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 -// return caseApplicationMapper.selectCaseApplicationList(caseApplication); - List caseApplications = caseApplicationMapper.selectCaseApplicationList(caseApplication); - if(caseApplications!=null&&caseApplications.size()>0){ - for(CaseApplication caseApplicationsel : caseApplications){ - Integer caseStatus = caseApplicationsel.getCaseStatus(); - if(caseStatus.intValue() == CaseApplicationConstants.CHECK_ARBITRATION_METHOD){ - Integer applicantIsWrittenHear = caseApplicationsel.getApplicantIsWrittenHear(); - Integer respondentIsWrittenHear = caseApplicationsel.getRespondentIsWrittenHear(); - if(applicantIsWrittenHear!=null&&respondentIsWrittenHear!=null){ - if(applicantIsWrittenHear.intValue()==respondentIsWrittenHear.intValue()){ - caseApplicationsel.setArbitraMethodIssame(1); - if(applicantIsWrittenHear.intValue()==1&&respondentIsWrittenHear.intValue()==1){ - caseApplicationsel.setArbitratMethod(2); - }else { - caseApplicationsel.setArbitratMethod(1); - } - }else { - caseApplicationsel.setArbitraMethodIssame(2); - String applicantarbitratMethod = ""; - String respondentbitratMethod = ""; - if(applicantIsWrittenHear.intValue()==1){ - applicantarbitratMethod = "书面审理"; - }else { - applicantarbitratMethod = "开庭审理"; - } - if(respondentIsWrittenHear.intValue()==1){ - respondentbitratMethod = "书面审理"; - }else { - respondentbitratMethod = "开庭审理"; - } - String arbitratMethodIllustrate = "当前案件开庭方式:申请人选择开庭方式为"+applicantarbitratMethod+ - "被申请人选择开庭方式为"+respondentbitratMethod+",请确定开庭方式。"; - caseApplicationsel.setArbitratMethodIllustrate(arbitratMethodIllustrate); - } - } - - } - } - } - return caseApplications; - - } +// private static final String[] dectborAffiliateColumns = {"name", "identityNum", "contactTelphone", "contactAddress", "workTelphone", "workAddress", +// "residenAffili", "responSex", "responBirth", "email", "nameAgent", "identityNumAgent", "contactTelphoneAgent", "contactAddressAgent"}; + private static final String[] dectborAffiliateColumns = {"name", "phone", "address", "home", "email"}; /** * 分页查询 @@ -389,14 +165,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { * @return */ public List page(CaseApplication caseApplication) { - List caseApplications= new ArrayList<>(); + List caseApplications = new ArrayList<>(); // 获取登录用户 LoginUser loginUser = getLoginUser(); SysUser user = loginUser.getUser(); Long userId = user.getUserId(); // 查询登录人,根据邮箱查询 SysUser sysUser = sysUserMapper.selectUserById(userId); - if(sysUser==null){ + if (sysUser == null) { throw new ServiceException("未获取到登录用户信息"); } @@ -406,109 +182,161 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (CollectionUtil.isEmpty(roles)) { throw new ServiceException("该用户没有角色权限"); } + // 是否嗲三方代理人 + boolean agentFlag = false; List caseStatusList = new ArrayList<>(); - List roleNames = roles.stream().map(SysRole::getRoleName).collect(Collectors.toList()); + List roleIds = roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()); startPage(); + // 查看所有权限 + if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) { + startPage(); + caseApplication.setIsOtherRole(1); + caseApplications = caseApplicationMapper.list(caseApplication, caseStatusList, null); + setArbitorMethod(caseApplications, agentFlag); + return caseApplications; + } + for (SysRole role : roles) { - if(StrUtil.isEmpty(role.getRoleName())){ + if (StrUtil.isEmpty(role.getRoleName())) { continue; } - // 查看所有权限 - if("超级管理员".equals(role.getRoleName())){ - caseApplication.setIsOtherRole(1); - caseApplications = caseApplicationMapper.list(caseApplication,caseStatusList,null); - setArbitorMethod(caseApplications); - return caseApplications; + if (StrUtil.contains(role.getRoleName(), "财务") + || StrUtil.contains(role.getRoleName(), "法律顾问") + || StrUtil.contains(role.getRoleName(), "部门长") + ) { + roleIds = null; } - caseApplication.setLoginUserName(sysUser.getUserName()); - caseApplication.setLoginUserPhone(sysUser.getPhonenumber()); - if("申请人".equals(role.getRoleName())){ - // 申请人在生成裁决书之前都可以修改案件 - Integer[] array = {0,-1,1,2,3,4,5,6,7,8,9,10,31}; - caseStatusList.addAll(Arrays.asList(array)); + if ("申请人".equals(role.getRoleName()) || "被申请人".equals(role.getRoleName())) { + caseApplication.setUserId(userId); } - if("被申请人".equals(role.getRoleName())) { - // 案件质证,开庭审理,书面审理 - caseStatusList.add(4); - caseStatusList.add(8); - caseStatusList.add(9); + if (StrUtil.contains(role.getRoleName(), "代理")) { + caseApplication.setCreateBy(String.valueOf(sysUser.getUserName())); + agentFlag = true; + } - if("仲裁员".equals(role.getRoleName())){ - caseApplication.setIsOtherRole(1); - Integer[] array = {7,8,9,13,18}; - caseStatusList.addAll(Arrays.asList(array)); + if (StrUtil.equals(role.getRoleName(), "仲裁员")) { caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId())); } - if ("仲裁委".equals(role.getRoleName()) - || "部门长".equals(role.getRoleName())) { - caseApplication.setIsOtherRole(1); - // 组庭确定,部门长审核裁决书 - caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); - caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); - } - if ("财务".equals(role.getRoleName())) { - caseApplication.setIsOtherRole(1); - caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); - } - if ("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName()) ) { - caseApplication.setIsOtherRole(1); - Integer[] array = {1,5,8,9,11,14,15,16,31}; - caseStatusList.addAll(Arrays.asList(array)); - } +// if ("申请人".equals(role.getRoleName())) { +// // 申请人在生成裁决书之前都可以修改案件 +// Integer[] array = {0, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 31}; +// caseStatusList.addAll(Arrays.asList(array)); +// } +// if ("被申请人".equals(role.getRoleName())) { +// // 案件质证,开庭审理,书面审理 +// caseStatusList.add(4); +// caseStatusList.add(8); +// caseStatusList.add(9); +// } +// if ("仲裁员".equals(role.getRoleName())) { +// caseApplication.setIsOtherRole(1); +// Integer[] array = {7, 8, 9, 13, 18}; +// caseStatusList.addAll(Arrays.asList(array)); +// caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId())); +// } +// if ("仲裁委".equals(role.getRoleName()) +// || "部门长".equals(role.getRoleName())) { +// caseApplication.setIsOtherRole(1); +// // 组庭确定,部门长审核裁决书 +// caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); +// caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); +// } +// if ("财务".equals(role.getRoleName())) { +// caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); +// } +// if ("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName())) { +// Integer[] array = {1, 5, 8, 9, 11, 14, 15, 16, 31}; +// caseStatusList.addAll(Arrays.asList(array)); +// } } - caseApplications = caseApplicationMapper.list(caseApplication,caseStatusList, roleNames); - setArbitorMethod(caseApplications); + startPage(); + caseApplications = caseApplicationMapper.list(caseApplication, caseStatusList, roleIds); + setArbitorMethod(caseApplications, agentFlag); return caseApplications; } /** * 设置仲裁方式 - * @param caseApplications + * + * @param list + * @param agentFlag 是否第三方代理人 */ - private void setArbitorMethod(List caseApplications) { + private void setArbitorMethod(List list, boolean agentFlag) { - if(CollectionUtil.isEmpty(caseApplications)){ + if (CollectionUtil.isEmpty(list)) { return; } - for(CaseApplication caseApplicationsel : caseApplications){ - Integer caseStatus = caseApplicationsel.getCaseStatus(); - if(caseStatus.intValue() == CaseApplicationConstants.CHECK_ARBITRATION_METHOD){ - Integer applicantIsWrittenHear = caseApplicationsel.getApplicantIsWrittenHear(); - Integer respondentIsWrittenHear = caseApplicationsel.getRespondentIsWrittenHear(); - if(applicantIsWrittenHear!=null&&respondentIsWrittenHear!=null){ - if(applicantIsWrittenHear.intValue()==respondentIsWrittenHear.intValue()){ - caseApplicationsel.setArbitraMethodIssame(1); - if(applicantIsWrittenHear.intValue()==1&&respondentIsWrittenHear.intValue()==1){ - caseApplicationsel.setArbitratMethod(2); - caseApplicationsel.setArbitratMethodName("书面审理"); - }else { - caseApplicationsel.setArbitratMethod(1); - caseApplicationsel.setArbitratMethodName("开庭审理"); - } + // 是否调解员 + boolean isMediatorRole = false; + List caseIds = list.stream().map(CaseApplication::getId).collect(Collectors.toList()); + List affiliatesList = caseAffiliateMapper.selectCaseAffiliateByCaseIds(caseIds); + // 根据案件id分组 + Map> affiliateMap=new HashMap<>(); + if(CollectionUtil.isNotEmpty(affiliatesList)){ + affiliateMap = affiliatesList.stream().collect(Collectors.groupingBy(CaseAffiliateEntity::getCaseAppliId)); + } + for (CaseApplication vo : list) { + if (StrUtil.isNotEmpty(vo.getArbitratorId()) && vo.getArbitratorId().equals(String.valueOf(SecurityUtils.getUserId()))) { + isMediatorRole = true; + vo.setArbitratorFlag(1); + } else { + vo.setArbitratorFlag(0); + } + // 第三方代理人标志 + if (StrUtil.isNotEmpty(vo.getCreateBy())) { + if (StrUtil.isEmpty(SecurityUtils.getUsername())) { + vo.setAgentFlag(0); + } else { + // todo 如果案件流程id变了需要改 + if (StrUtil.equals(SecurityUtils.getUsername(), vo.getCreateBy()) && agentFlag ) { + vo.setAgentFlag(1); + } else { + vo.setAgentFlag(0); + } + } + } else { + vo.setAgentFlag(0); + } + // 设置申请人和被申请人 + if ( affiliateMap.containsKey(vo.getId())) { + List affiliates = affiliateMap.get(vo.getId()); + StringBuilder applicantName = new StringBuilder(); + StringBuilder respondentName = new StringBuilder(); + for (CaseAffiliateEntity affiliate : affiliates) { - }else { - caseApplicationsel.setArbitraMethodIssame(2); - String applicantarbitratMethod = ""; - String respondentbitratMethod = ""; - if(applicantIsWrittenHear.intValue()==1){ - applicantarbitratMethod = "书面审理"; - }else { - applicantarbitratMethod = "开庭审理"; - } - if(respondentIsWrittenHear.intValue()==1){ - respondentbitratMethod = "书面审理"; - }else { - respondentbitratMethod = "开庭审理"; - } - String arbitratMethodIllustrate = "当前案件开庭方式:申请人选择开庭方式为"+applicantarbitratMethod+ - "被申请人选择开庭方式为"+respondentbitratMethod+",请确定开庭方式。"; - caseApplicationsel.setArbitratMethodIllustrate(arbitratMethodIllustrate); + if (affiliate.getOrganizeFlag() == null || affiliate.getOrganizeFlag() != 1) { + if (StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("申请人") + && affiliate.getRoleType() != null && affiliate.getRoleType() == 1 && StrUtil.isNotEmpty(affiliate.getName()) + && !applicantName.toString().contains(affiliate.getName() + Constants.CN_SPLIT_COMMA)) { + applicantName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA); + } + } else { + // 组织机构 + if (affiliate.getRoleType() != null && affiliate.getRoleType() == 1 && StrUtil.isNotEmpty(affiliate.getApplicantOrgName()) + && !applicantName.toString().contains(affiliate.getApplicantOrgName() + Constants.CN_SPLIT_COMMA)) { + applicantName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA); + } + } + if (affiliate.getOrganizeFlag() == null || affiliate.getOrganizeFlag() != 1) { + if (StrUtil.isNotEmpty(affiliate.getRoleName()) && affiliate.getRoleName().equals("被申请人") + && affiliate.getRoleType() != null && affiliate.getRoleType() == 3 && StrUtil.isNotEmpty(affiliate.getName()) + && !respondentName.toString().contains(affiliate.getName() + Constants.CN_SPLIT_COMMA)) { + + respondentName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA); + } + } else { + // 组织机构 + if (affiliate.getRoleType() != null && affiliate.getRoleType() == 3 && StrUtil.isNotEmpty(affiliate.getApplicantOrgName()) && !respondentName.toString().contains(affiliate.getApplicantOrgName() + Constants.CN_SPLIT_COMMA)) { + respondentName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA); } } } + vo.setApplicantName(removeLastComma(applicantName.toString(), Constants.CN_SPLIT_COMMA)); + vo.setRespondentName(removeLastComma(respondentName.toString(), Constants.CN_SPLIT_COMMA)); } + } } @Override @@ -518,73 +346,93 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Long userId = user.getUserId(); // 查询登录人,根据邮箱查询 SysUser sysUser = sysUserMapper.selectUserById(userId); - if(sysUser==null){ + if (sysUser == null) { throw new ServiceException("未获取到登录用户信息"); } - - - List roles = sysUser.getRoles(); - // 没有角色不能查看案件列表 - if (CollectionUtil.isEmpty(roles)) { - throw new ServiceException("该用户没有角色权限"); - } - List caseStatusList = new ArrayList<>(); - List roleNames = roles.stream().map(SysRole::getRoleName).collect(Collectors.toList()); - ToDoCount toDoCount=null; + ToDoCount toDoCount = null; CaseApplication caseApplication = new CaseApplication(); - for (SysRole role : roles) { - if(StrUtil.isEmpty(role.getRoleName())){ - continue; + List caseStatusList = new ArrayList<>(); + if (StrUtil.equals(SecurityUtils.getUsername(), "admin")) { + caseApplication.setCreateBy(String.valueOf(sysUser.getUserName())); + toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication, caseStatusList, null); + if (toDoCount == null) { + toDoCount = new ToDoCount(); } - // 查看所有权限 - if("超级管理员".equals(role.getRoleName())){ - caseApplication.setIsOtherRole(1); - toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication,caseStatusList,null); - if(toDoCount==null){ - toDoCount=new ToDoCount(); - } - return toDoCount; - } - caseApplication.setLoginUserName(sysUser.getUserName()); - caseApplication.setLoginUserPhone(sysUser.getPhonenumber()); + return toDoCount; + } else { - if("申请人".equals(role.getRoleName())){ - // 申请人在生成裁决书之前都可以修改案件 - Integer[] array = {0,-1,1,2,3,4,5,6,7,8,9,10,31}; - caseStatusList.addAll(Arrays.asList(array)); + List roles = sysUser.getRoles(); + // 没有角色不能查看案件列表 + if (CollectionUtil.isEmpty(roles)) { + throw new ServiceException("该用户没有角色权限"); } - if("被申请人".equals(role.getRoleName())) { - // 案件质证,开庭审理,书面审理 - caseStatusList.add(4); - caseStatusList.add(8); - caseStatusList.add(9); + + List roleIds = roles.stream().map(SysRole::getRoleId).collect(Collectors.toList()); + + for (SysRole role : roles) { + if (StrUtil.isEmpty(role.getRoleName())) { + continue; + } + if (StrUtil.isEmpty(role.getRoleName())) { + continue; + } + if (StrUtil.contains(role.getRoleName(), "财务") + || StrUtil.contains(role.getRoleName(), "法律顾问") + || StrUtil.contains(role.getRoleName(), "部门长") + ) { + roleIds = null; + } + if ("申请人".equals(role.getRoleName()) || "被申请人".equals(role.getRoleName())) { + caseApplication.setUserId(userId); + } + if (StrUtil.contains(role.getRoleName(), "代理")) { + caseApplication.setCreateBy(String.valueOf(sysUser.getUserName())); + + } + if (StrUtil.equals(role.getRoleName(), "仲裁员")) { + caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId())); + } +// caseApplication.setLoginUserName(sysUser.getUserName()); +// caseApplication.setLoginUserPhone(sysUser.getPhonenumber()); +// +// if ("申请人".equals(role.getRoleName())) { +// // 申请人在生成裁决书之前都可以修改案件 +// Integer[] array = {0, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 31}; +// caseStatusList.addAll(Arrays.asList(array)); +// } +// if ("被申请人".equals(role.getRoleName())) { +// // 案件质证,开庭审理,书面审理 +// caseStatusList.add(4); +// caseStatusList.add(8); +// caseStatusList.add(9); +// } +// if ("仲裁员".equals(role.getRoleName())) { +// caseApplication.setIsOtherRole(1); +// Integer[] array = {7, 8, 9, 13, 18}; +// caseStatusList.addAll(Arrays.asList(array)); +// caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId())); +// } +// if ("仲裁委".equals(role.getRoleName()) +// || "部门长".equals(role.getRoleName())) { +// caseApplication.setIsOtherRole(1); +// // 组庭确定,部门长审核裁决书 +// caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); +// caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); +// } +// if ("财务".equals(role.getRoleName())) { +// caseApplication.setIsOtherRole(1); +// caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); +// } +// if ("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName())) { +// caseApplication.setIsOtherRole(1); +// Integer[] array = {1, 5, 8, 9, 11, 14, 15, 16, 31}; +// caseStatusList.addAll(Arrays.asList(array)); +// } } - if("仲裁员".equals(role.getRoleName())){ - caseApplication.setIsOtherRole(1); - Integer[] array = {7,8,9,13,18}; - caseStatusList.addAll(Arrays.asList(array)); - caseApplication.setArbitratorId(String.valueOf(sysUser.getUserId())); + toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication, caseStatusList, roleIds); + if (toDoCount == null) { + toDoCount = new ToDoCount(); } - if ("仲裁委".equals(role.getRoleName()) - || "部门长".equals(role.getRoleName())) { - caseApplication.setIsOtherRole(1); - // 组庭确定,部门长审核裁决书 - caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); - caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); - } - if ("财务".equals(role.getRoleName())) { - caseApplication.setIsOtherRole(1); - caseStatusList.add(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); - } - if ("法律顾问".equals(role.getRoleName()) || "秘书".equals(role.getRoleName()) ) { - caseApplication.setIsOtherRole(1); - Integer[] array = {1,5,8,9,11,14,15,16,31}; - caseStatusList.addAll(Arrays.asList(array)); - } - } - toDoCount = caseApplicationMapper.selectTodoCountByRole(caseApplication,caseStatusList,roleNames); - if(toDoCount==null){ - toDoCount=new ToDoCount(); } return toDoCount; } @@ -596,13 +444,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); // 当前案件节点 Integer caseStatus = caseApplicationselect.getCaseStatus(); - List allCaseNode= getAllCaseNode(caseApplicationselect.getArbitratMethod()); - if(caseApplicationselect.getArbitratMethod()!=null){ - if(caseApplicationselect.getArbitratMethod().equals(1)) { + List allCaseNode = getAllCaseNode(caseApplicationselect.getArbitratMethod()); + if (caseApplicationselect.getArbitratMethod() != null) { + if (caseApplicationselect.getArbitratMethod().equals(1)) { // 开庭审理 allCaseNode.removeIf(record -> record.getCaseNode().equals(9)); } - if(caseApplicationselect.getArbitratMethod().equals(2)) { + if (caseApplicationselect.getArbitratMethod().equals(2)) { // 书面审理 allCaseNode.removeIf(record -> record.getCaseNode().equals(8) || record.getCaseNode().equals(31)); } @@ -616,50 +464,51 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 获取所有案件节点 * arbitratMethod : 1:开庭诉讼,2:书面诉讼 + * * @return */ private List getAllCaseNode(Integer arbitratMethod) { List allCaseNode = new ArrayList<>(); - allCaseNode.add(getCaseNode("当前节点角色:申请人", "立案申请", 0, "申请人将提交案件","下一节点角色:法律顾问")); - allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "立案审查", 1, "法律顾问将立案审查","下一节点角色:申请人")); - allCaseNode.add(getCaseNode("当前节点角色:申请人", "缴费", 2, "申请人将缴费","下一节点角色:财务")); - allCaseNode.add(getCaseNode("当前节点角色:财务", "缴费确认", 3, "财务将缴费确认","下一节点角色:被申请人")); - allCaseNode.add(getCaseNode("当前节点角色:被申请人", "案件质证", 4, "被申请人将案件质证","下一节点角色:法律顾问")); - allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "组庭审核", 5, "法律顾问将组庭审核","下一节点角色:部门长")); - allCaseNode.add(getCaseNode("当前节点角色:部门长", "组庭确定", 6, "部门长将组庭确定","下一节点角色:仲裁员")); + allCaseNode.add(getCaseNode("当前节点角色:申请人", "立案申请", 0, "申请人将提交案件", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "立案审查", 1, "法律顾问将立案审查", "下一节点角色:申请人")); + allCaseNode.add(getCaseNode("当前节点角色:申请人", "缴费", 2, "申请人将缴费", "下一节点角色:财务")); + allCaseNode.add(getCaseNode("当前节点角色:财务", "缴费确认", 3, "财务将缴费确认", "下一节点角色:被申请人")); + allCaseNode.add(getCaseNode("当前节点角色:被申请人", "案件质证", 4, "被申请人将案件质证", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "组庭审核", 5, "法律顾问将组庭审核", "下一节点角色:部门长")); + allCaseNode.add(getCaseNode("当前节点角色:部门长", "组庭确定", 6, "部门长将组庭确定", "下一节点角色:仲裁员")); // allCaseNode.add(getLastNodeRecord("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式","下一节点角色:法律顾问")); - if(arbitratMethod==null) { - allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式","下一节点角色:法律顾问或仲裁员")); + if (arbitratMethod == null) { + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式", "下一节点角色:法律顾问或仲裁员")); allCaseNode.add(getCaseNode("当前节点角色:法律顾问或仲裁员", "修改开庭时间或书面审理", 31, "法律顾问将修改开庭时间或仲裁员将书面审理", "下一节点角色:法律顾问,仲裁员,申请人,被申请人或仲裁员")); - // allCaseNode.add(getLastNodeRecord("当前节点角色:法律顾问", "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问,仲裁员,申请人,被申请人")); + // allCaseNode.add(getLastNodeRecord("当前节点角色:法律顾问", "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问,仲裁员,申请人,被申请人")); allCaseNode.add(getCaseNode("当前节点角色:法律顾问,仲裁员,申请人,被申请人或仲裁员", "开庭审理或书面审理", 8, "法律顾问,仲裁员,申请人,被申请人将开庭审理或仲裁员将书面审理", "下一节点角色:法律顾问")); - // allCaseNode.add(getLastNodeRecord("当前节点角色:仲裁员", "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); - }else if(arbitratMethod.equals(1)){ - allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式","下一节点角色:法律顾问")); + // allCaseNode.add(getLastNodeRecord("当前节点角色:仲裁员", "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); + } else if (arbitratMethod.equals(1)) { + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式", "下一节点角色:法律顾问")); // 开庭 allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "修改开庭时间", 31, "法律顾问将修改开庭时间", "下一节点角色:法律顾问,仲裁员,申请人,被申请人")); allCaseNode.add(getCaseNode("当前节点角色:法律顾问,仲裁员,申请人,被申请人", "开庭审理", 8, "法律顾问,仲裁员,申请人,被申请人将开庭审理", "下一节点角色:法律顾问")); - }else if(arbitratMethod.equals(2)){ - allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式","下一节点角色:仲裁员")); + } else if (arbitratMethod.equals(2)) { + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "审核仲裁方式", 7, "仲裁员将审核仲裁方式", "下一节点角色:仲裁员")); // 书面 allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "书面审理", 9, "仲裁员将书面审理", "下一节点角色:法律顾问")); } - allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "核验裁决书", 11, "法律顾问将核验裁决书","下一节点角色:仲裁员")); - allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "仲裁员审核裁决书", 18, "仲裁员将审核裁决书","下一节点角色:部门长")); - allCaseNode.add(getCaseNode("当前节点角色:部门长", "部门长审核裁决书", 12, "部门长将审核裁决书","下一节点角色:仲裁员")); - allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "裁决书签名", 13, "仲裁员将进行裁决书签名","下一节点角色:法律顾问")); - allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "裁决书用印", 14, "法律顾问将进行裁决书用印","下一节点角色:法律顾问")); - allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "裁决书送达", 15, "法律顾问将送达裁决书","下一节点角色:法律顾问")); - allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "案件归档", 16, "法律顾问将进行案件归档","")); - allCaseNode.add(getCaseNode(null, "结束", 17, "","")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "核验裁决书", 11, "法律顾问将核验裁决书", "下一节点角色:仲裁员")); + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "仲裁员审核裁决书", 18, "仲裁员将审核裁决书", "下一节点角色:部门长")); + allCaseNode.add(getCaseNode("当前节点角色:部门长", "部门长审核裁决书", 12, "部门长将审核裁决书", "下一节点角色:仲裁员")); + allCaseNode.add(getCaseNode("当前节点角色:仲裁员", "裁决书签名", 13, "仲裁员将进行裁决书签名", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "裁决书用印", 14, "法律顾问将进行裁决书用印", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "裁决书送达", 15, "法律顾问将送达裁决书", "下一节点角色:法律顾问")); + allCaseNode.add(getCaseNode("当前节点角色:法律顾问", "案件归档", 16, "法律顾问将进行案件归档", "")); + allCaseNode.add(getCaseNode(null, "结束", 17, "", "")); return allCaseNode; } @Override @Transactional public int updateHeardate(CaseApplication caseApplication) { - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); // caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); caseApplication.setLockStatus(1); @@ -672,7 +521,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 发送开庭日期通知短信 sendHearDateMessage(caseApplication, request, "1975139"); // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); return rows; } @@ -682,7 +531,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - @Override @Transactional public AjaxResult uploadZipFile(MultipartFile file, Long id, String username, Long userId) { @@ -690,7 +538,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return AjaxResult.error("请选择要上传的文件"); } - String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile"; + String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile"; File zipFile = null; InputStream ins = null; try { @@ -797,7 +645,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String year = Integer.toString(now.getYear()); String month = String.format("%02d", now.getMonthValue()); String day = String.format("%02d", now.getDayOfMonth()); - // todo + // todo String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; // String saveFolderPath = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; String fileName = UUID.randomUUID().toString().replace("-", "") + "_" + substrfile; @@ -833,13 +681,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } else if ("证据材料".equals(substrTwo)) { annexType = 2; } - String savePath = "/home/ruoyi/uploadPath/upload"; String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; //将附件保存到附件表里 CaseAttach caseAttach = CaseAttach.builder() .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) + .annexName(fileName) + .annexPath(saveName) .annexType(annexType) .build(); int i = caseAttachMapper.save(caseAttach); @@ -881,14 +728,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 获取每个节点的流程 + * * @param currentRoleName 当前节点角色 - * @param caseNodeName 节点名称 - * @param caseNode 案件节点 - * @param content 内容 + * @param caseNodeName 节点名称 + * @param caseNode 案件节点 + * @param content 内容 * @return */ - private CaseLogRecord getCaseNode(String currentRoleName, String caseNodeName, int caseNode, String content,String nextRoleName) { - CaseLogRecord lastNodeRecord = new CaseLogRecord(); + private CaseLogRecord getCaseNode(String currentRoleName, String caseNodeName, int caseNode, String content, String nextRoleName) { + CaseLogRecord lastNodeRecord = new CaseLogRecord(); lastNodeRecord.setCaseNodeName(caseNodeName); lastNodeRecord.setCaseNode(caseNode); lastNodeRecord.setContent(content); @@ -897,11 +745,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return lastNodeRecord; } - @Override - public List selectCaseApplicationList(CaseApplication caseApplication) { - return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); - - } /** * 新增案件 @@ -909,144 +752,144 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { * @param caseApplication * @return */ - @Override - @Transactional - public int insertcaseApplication(CaseApplication caseApplication) { - List columnValueList=caseApplication.getColumnValues(); - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - //根据仲裁费用计费规则计算应缴费用 - //暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal(0.01); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); - caseApplication.setFeePayable(feePayable); - // 获取自动编码 - String caseNum = generateCaseNum(); - caseApplication.setCaseNum(caseNum); - // 设置批号 - - caseApplication.setBatchNumber(0); - - caseApplication.setCreateBy(getUsername()); - caseApplication.setVersion(1); - caseApplication.setId(IdWorkerUtil.getId()); - // 新增立案信息 - int rows = caseApplicationMapper.insertCaseApplication(caseApplication); - if (rows == 0) { - return rows; - } - List caseAffiliates = caseApplication.getCaseAffiliates(); - Map deptMap = new HashMap<>(); - // 判断申请机构 - if (caseAffiliates != null && caseAffiliates.size() > 0) { - // 查询所有的组织机构,组装成map - List deptList = sysDeptMapper.selectDeptList(new SysDept()); - if (CollectionUtil.isEmpty(deptList)) { - deptList = new ArrayList<>(); - } - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); - // 查询申请人角色id - Long roleId = roleMapper.selectRoleIdByName("申请人"); - for (CaseAffiliate caseAffiliate : caseAffiliates) { - caseAffiliate.setCaseAppliId(caseApplication.getId()); - // caseAffiliate.setCaseAppliLogId(caseApplication.getId()); - if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { - // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseAffiliate.getName())) { - caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); - caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); - } else { - // 如果不存在则新增 - SysDept dept = new SysDept(); - dept.setParentId(0L); - dept.setDeptName(caseAffiliate.getName()); - dept.setAncestors("0"); - dept.setOrderNum(1); - dept.setStatus("0"); - dept.setDelFlag("0"); - dept.setCreateBy(getUsername()); - dept.setUpdateBy(getUsername()); - sysDeptMapper.insertDept(dept); - deptMap.put(dept.getDeptName(), dept.getDeptId()); - caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); - caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); - - } - // 组装申请代理人信息 - String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); - if (StrUtil.isNotEmpty(agentInfoFlag)) { - throw new ServiceException(agentInfoFlag); - } - } - } - // 新增案件关联人 - caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); - } - - List caseAttachList = caseApplication.getCaseAttachList(); - // 是否是压缩包导入,压缩包导入则不更新附件 - boolean isZipImport = caseApplication.getImportFlag() == null || caseApplication.getImportFlag() != 2; - if (caseAttachList != null && caseAttachList.size() > 0 ) { - if(isZipImport) { - for (CaseAttach caseAttach : caseAttachList) { - caseAttach.setCaseAppliId(caseApplication.getId()); - // 修改案件附件 - caseAttachMapper.updateCaseAttach(caseAttach); - } - }else { - // 压缩包导入 - for (CaseAttach caseAttach : caseAttachList) { - caseAttach.setCaseAppliId(caseApplication.getId()); - } - caseAttachMapper.batchSave(caseAttachList); - } - } - // 新增日志 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); - // 异步新增案件日志 - - ThreadPoolUtil.execute(() -> { - // 批量新增columnValue自定义字段 - if(CollectionUtil.isNotEmpty(columnValueList)) { - columnValueList.forEach(columnValue -> columnValue.setCaseId(caseApplication.getId())); - columnValueMapper.batchSave(columnValueList); - } - // 新增案件日志表 - caseApplication.setCaseAppliId(caseApplication.getId()); - caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); - caseApplication.setCaseLogId(IdWorkerUtil.getId()); - int insertRow = caseApplicationLogMapper.insert(caseApplication); - // 插入案件相关人员表日志 - if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { - caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); - - caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); - } - // 插入附件表日志 - if (CollectionUtil.isNotEmpty(caseAttachList)) { - List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); - // 插入日志附件表 - if (CollectionUtil.isNotEmpty(filterList)) { - for (CaseAttach caseAttach : filterList) { - // 查询附件表 - CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); - attach.setCaseAppliLogId(caseApplication.getCaseLogId()); - caseAttachLogMapper.save(attach); - } - } - - } - // 插入columnValueLog自定义字段日志表 - if (CollectionUtil.isNotEmpty(columnValueList)) { - columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); - columnValueLogMapper.batchSave(columnValueList); - - } - - - }); - - return rows; - } +// @Override +// @Transactional +// public int insertcaseApplication(CaseApplication caseApplication) { +// List columnValueList=caseApplication.getColumnValues(); +// caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); +// //根据仲裁费用计费规则计算应缴费用 +// //暂时设置计费比率为0.01 +// BigDecimal feeRate = new BigDecimal(0.01); +// BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); +// caseApplication.setFeePayable(feePayable); +// // 获取自动编码 +// String caseNum = generateCaseNum(); +// caseApplication.setCaseNum(caseNum); +// // 设置批号 +// +// caseApplication.setBatchNumber(0); +// +// caseApplication.setCreateBy(getUsername()); +// caseApplication.setVersion(1); +// caseApplication.setId(IdWorkerUtil.getId()); +// // 新增立案信息 +// int rows = caseApplicationMapper.insertCaseApplication(caseApplication); +// if (rows == 0) { +// return rows; +// } +// List caseAffiliates = caseApplication.getCaseAffiliates(); +// Map deptMap = new HashMap<>(); +// // 判断申请机构 +// if (caseAffiliates != null && caseAffiliates.size() > 0) { +// // 查询所有的组织机构,组装成map +// List deptList = sysDeptMapper.selectDeptList(new SysDept()); +// if (CollectionUtil.isEmpty(deptList)) { +// deptList = new ArrayList<>(); +// } +// deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); +// // 查询申请人角色id +// Long roleId = roleMapper.selectRoleIdByName("申请人"); +// for (CaseAffiliate caseAffiliate : caseAffiliates) { +// caseAffiliate.setCaseAppliId(caseApplication.getId()); +// // caseAffiliate.setCaseAppliLogId(caseApplication.getId()); +// if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { +// // 将组织机构id设为申请人名称 +// if (deptMap.containsKey(caseAffiliate.getName())) { +// caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); +// caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); +// } else { +// // 如果不存在则新增 +// SysDept dept = new SysDept(); +// dept.setParentId(0L); +// dept.setDeptName(caseAffiliate.getName()); +// dept.setAncestors("0"); +// dept.setOrderNum(1); +// dept.setStatus("0"); +// dept.setDelFlag("0"); +// dept.setCreateBy(getUsername()); +// dept.setUpdateBy(getUsername()); +// sysDeptMapper.insertDept(dept); +// deptMap.put(dept.getDeptName(), dept.getDeptId()); +// caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); +// caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); +// +// } +// // 组装申请代理人信息 +// String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); +// if (StrUtil.isNotEmpty(agentInfoFlag)) { +// throw new ServiceException(agentInfoFlag); +// } +// } +// } +// // 新增案件关联人 +// caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); +// } +// +// List caseAttachList = caseApplication.getCaseAttachList(); +// // 是否是压缩包导入,压缩包导入则不更新附件 +// boolean isZipImport = caseApplication.getImportFlag() == null || caseApplication.getImportFlag() != 2; +// if (caseAttachList != null && caseAttachList.size() > 0 ) { +// if(isZipImport) { +// for (CaseAttach caseAttach : caseAttachList) { +// caseAttach.setCaseAppliId(caseApplication.getId()); +// // 修改案件附件 +// caseAttachMapper.updateCaseAttach(caseAttach); +// } +// }else { +// // 压缩包导入 +// for (CaseAttach caseAttach : caseAttachList) { +// caseAttach.setCaseAppliId(caseApplication.getId()); +// } +// caseAttachMapper.batchSave(caseAttachList); +// } +// } +// // 新增日志 +// insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); +// // 异步新增案件日志 +// +// ThreadPoolUtil.execute(() -> { +// // 批量新增columnValue自定义字段 +// if(CollectionUtil.isNotEmpty(columnValueList)) { +// columnValueList.forEach(columnValue -> columnValue.setCaseId(caseApplication.getId())); +// columnValueMapper.batchSave(columnValueList); +// } +// // 新增案件日志表 +// caseApplication.setCaseAppliId(caseApplication.getId()); +// caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); +// caseApplication.setCaseLogId(IdWorkerUtil.getId()); +// int insertRow = caseApplicationLogMapper.insert(caseApplication); +// // 插入案件相关人员表日志 +// if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { +// caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); +// +// caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); +// } +// // 插入附件表日志 +// if (CollectionUtil.isNotEmpty(caseAttachList)) { +// List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); +// // 插入日志附件表 +// if (CollectionUtil.isNotEmpty(filterList)) { +// for (CaseAttach caseAttach : filterList) { +// // 查询附件表 +// CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); +// attach.setCaseAppliLogId(caseApplication.getCaseLogId()); +// caseAttachLogMapper.save(attach); +// } +// } +// +// } +// // 插入columnValueLog自定义字段日志表 +// if (CollectionUtil.isNotEmpty(columnValueList)) { +// columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); +// columnValueLogMapper.batchSave(columnValueList); +// +// } +// +// +// }); +// +// return rows; +// } /** * 新增案件 @@ -1054,114 +897,114 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { * @param caseApplication * @return */ - @Override - @Transactional - public int insertcaseApplication1(CaseApplication caseApplication) { - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - //根据仲裁费用计费规则计算应缴费用 - //暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal(0.01); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); - caseApplication.setFeePayable(feePayable); - // 获取自动编码 - String caseNum = generateCaseNum(); - caseApplication.setCaseNum(caseNum); - - caseApplication.setCreateBy(getUsername()); - caseApplication.setVersion(1); - caseApplication.setId(IdWorkerUtil.getId()); - // 新增立案信息 - int rows = caseApplicationMapper.insertCaseApplication(caseApplication); - if (rows == 0) { - return rows; - } - List caseAffiliates = caseApplication.getCaseAffiliates(); - Map deptMap = new HashMap<>(); - // 判断申请机构 - if (caseAffiliates != null && caseAffiliates.size() > 0) { - // 查询所有的组织机构,组装成map - List deptList = sysDeptMapper.selectDeptList(new SysDept()); - if (CollectionUtil.isEmpty(deptList)) { - deptList = new ArrayList<>(); - } - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); - // 查询申请人角色id - Long roleId = roleMapper.selectRoleIdByName("申请人"); - for (CaseAffiliate caseAffiliate : caseAffiliates) { - caseAffiliate.setCaseAppliId(caseApplication.getId()); - // caseAffiliate.setCaseAppliLogId(caseApplication.getId()); - if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { - // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseAffiliate.getName())) { - caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); - caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); - } else { - // 如果不存在则新增 - SysDept dept = new SysDept(); - dept.setParentId(0L); - dept.setDeptName(caseAffiliate.getName()); - dept.setAncestors("0"); - dept.setOrderNum(1); - dept.setStatus("0"); - dept.setDelFlag("0"); - dept.setCreateBy(getUsername()); - dept.setUpdateBy(getUsername()); - sysDeptMapper.insertDept(dept); - deptMap.put(dept.getDeptName(), dept.getDeptId()); - caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); - caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); - - } - // 组装申请代理人信息 - String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); - if (StrUtil.isNotEmpty(agentInfoFlag)) { - throw new ServiceException(agentInfoFlag); - } - } - } - // 新增案件关联人 - caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); - } - - List caseAttachList = caseApplication.getCaseAttachList(); - if (caseAttachList != null && caseAttachList.size() > 0 ) { - for (CaseAttach caseAttach : caseAttachList) { - caseAttach.setCaseAppliId(caseApplication.getId()); - } - caseAttachMapper.batchSave(caseAttachList); - } - // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, ""); - - // 新增案件日志表 - caseApplication.setCaseAppliId(caseApplication.getId()); - caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); - caseApplication.setCaseLogId(IdWorkerUtil.getId()); - int insertRow = caseApplicationLogMapper.insert(caseApplication); - // 插入案件相关人员表日志 - if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { - caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); - - caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); - } - // 插入附件表日志 - if (CollectionUtil.isNotEmpty(caseAttachList)) { - List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); - // 插入日志附件表 - if (CollectionUtil.isNotEmpty(filterList)) { - for (CaseAttach caseAttach : filterList) { - // 查询附件表 - CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); - attach.setCaseAppliLogId(caseApplication.getCaseLogId()); - caseAttachLogMapper.save(attach); - } - } - - } - - return rows; - } +// @Override +// @Transactional +// public int insertcaseApplication1(CaseApplication caseApplication) { +// Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); +// caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); +// //根据仲裁费用计费规则计算应缴费用 +// //暂时设置计费比率为0.01 +// BigDecimal feeRate = new BigDecimal(0.01); +// BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); +// caseApplication.setFeePayable(feePayable); +// // 获取自动编码 +// String caseNum = generateCaseNum(); +// caseApplication.setCaseNum(caseNum); +// +// caseApplication.setCreateBy(getUsername()); +// caseApplication.setVersion(1); +// caseApplication.setId(IdWorkerUtil.getId()); +// // 新增立案信息 +// int rows = caseApplicationMapper.insertCaseApplication(caseApplication); +// if (rows == 0) { +// return rows; +// } +// List caseAffiliates = caseApplication.getCaseAffiliates(); +// Map deptMap = new HashMap<>(); +// // 判断申请机构 +// if (caseAffiliates != null && caseAffiliates.size() > 0) { +// // 查询所有的组织机构,组装成map +// List deptList = sysDeptMapper.selectDeptList(new SysDept()); +// if (CollectionUtil.isEmpty(deptList)) { +// deptList = new ArrayList<>(); +// } +// deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); +// // 查询申请人角色id +// Long roleId = roleMapper.selectRoleIdByName("申请人"); +// for (CaseAffiliate caseAffiliate : caseAffiliates) { +// caseAffiliate.setCaseAppliId(caseApplication.getId()); +// // caseAffiliate.setCaseAppliLogId(caseApplication.getId()); +// if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { +// // 将组织机构id设为申请人名称 +// if (deptMap.containsKey(caseAffiliate.getName())) { +// caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); +// caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); +// } else { +// // 如果不存在则新增 +// SysDept dept = new SysDept(); +// dept.setParentId(0L); +// dept.setDeptName(caseAffiliate.getName()); +// dept.setAncestors("0"); +// dept.setOrderNum(1); +// dept.setStatus("0"); +// dept.setDelFlag("0"); +// dept.setCreateBy(getUsername()); +// dept.setUpdateBy(getUsername()); +// sysDeptMapper.insertDept(dept); +// deptMap.put(dept.getDeptName(), dept.getDeptId()); +// caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); +// caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); +// +// } +// // 组装申请代理人信息 +// String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); +// if (StrUtil.isNotEmpty(agentInfoFlag)) { +// throw new ServiceException(agentInfoFlag); +// } +// } +// } +// // 新增案件关联人 +// caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); +// } +// +// List caseAttachList = caseApplication.getCaseAttachList(); +// if (caseAttachList != null && caseAttachList.size() > 0 ) { +// for (CaseAttach caseAttach : caseAttachList) { +// caseAttach.setCaseAppliId(caseApplication.getId()); +// } +// caseAttachMapper.batchSave(caseAttachList); +// } +// // 新增日志 +// insertCaseLog(caseApplication.getId(), currentStatus, ""); +// +// // 新增案件日志表 +// caseApplication.setCaseAppliId(caseApplication.getId()); +// caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); +// caseApplication.setCaseLogId(IdWorkerUtil.getId()); +// int insertRow = caseApplicationLogMapper.insert(caseApplication); +// // 插入案件相关人员表日志 +// if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) { +// caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); +// +// caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); +// } +// // 插入附件表日志 +// if (CollectionUtil.isNotEmpty(caseAttachList)) { +// List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); +// // 插入日志附件表 +// if (CollectionUtil.isNotEmpty(filterList)) { +// for (CaseAttach caseAttach : filterList) { +// // 查询附件表 +// CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); +// attach.setCaseAppliLogId(caseApplication.getCaseLogId()); +// caseAttachLogMapper.save(attach); +// } +// } +// +// } +// +// return rows; +// } /** @@ -1179,7 +1022,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (null == maxCaseNum) { caseNum = caseNum + "001"; } else { - maxCaseNum=maxCaseNum+1; + maxCaseNum = maxCaseNum + 1; caseNum = caseNum + String.format("%03d", maxCaseNum); } return caseNum; @@ -1191,146 +1034,146 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return caseApplicationMapper.selectCaseApplicationCount(caseApplication); } - @Override - @Transactional - public AjaxResult editCaseApplication(CaseApplication caseApplication) { - //根据仲裁费用计费规则计算应缴费用 - //暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal("0.01"); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP); - caseApplication.setFeePayable(feePayable); - caseApplication.setUpdateBy(getUsername()); - // 立案申请状态直接修改主表信息 - if (caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { - // 修改内置字段 - caseApplicationMapper.updataCaseApplication(caseApplication); - if(CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { - // 修改自定义字段 - for (ColumnValue columnValue : caseApplication.getColumnValues()) { - if(StrUtil.isNotEmpty(columnValue.getValue())) { - columnValueMapper.updateColumnValue(columnValue); - } - } - } - // 修改记录表状态为同意提交修改的内容 - caseApplication.setUpdateSubmitStatus(0); - } else { - // 修改记录表状态为已提交修改的内容 - caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.COMMITTED.getCode()); - } - List caseAffiliates = caseApplication.getCaseAffiliates(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - // 查询所有的组织机构,组装成map - List deptList = sysDeptMapper.selectDeptList(new SysDept()); - if (CollectionUtil.isEmpty(deptList)) { - deptList = new ArrayList<>(); - } - Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); - // 查询申请人角色id - Long roleId = roleMapper.selectRoleIdByName("申请人"); - for (CaseAffiliate caseAffiliate : caseAffiliates) { - caseAffiliate.setCaseAppliId(caseApplication.getId()); - if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { - // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseAffiliate.getName())) { - caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); - caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); - } else { - // 如果不存在则新增 - SysDept dept = new SysDept(); - dept.setParentId(0L); - dept.setDeptName(caseAffiliate.getName()); - dept.setAncestors("0"); - dept.setOrderNum(1); - dept.setStatus("0"); - dept.setDelFlag("0"); - dept.setCreateBy(getUsername()); - dept.setUpdateBy(getUsername()); - sysDeptMapper.insertDept(dept); - deptMap.put(dept.getDeptName(), dept.getDeptId()); - - caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); - caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); - - } - String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); - if (StrUtil.isNotEmpty(agentInfoFlag)) { - throw new ServiceException(agentInfoFlag); - } - - } - // 立案申请状态直接修改主表信息 - if (caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { - - caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); - } - } - - } - List caseAttachList = caseApplication.getCaseAttachList(); - // 立案申请状态直接修改主表信息 - if (caseAttachList != null && caseAttachList.size() > 0 - && caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { - List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(filterList)) { - for (CaseAttach caseAttach : caseAttachList) { - caseAttach.setCaseAppliId(caseApplication.getId()); - caseAttachMapper.updateCaseAttach(caseAttach); - } - } - - } - // 根据案件id查询最新版本号 - Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId()); - if (maxVersion == null) { - maxVersion = 1; - } - caseApplication.setVersion(maxVersion + 1); - LoginUser loginUser = getLoginUser(); - // 异步新增案件日志 - ThreadPoolUtil.execute(() -> { - try { - //新增案件日志记录 - insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_EDIT, "修改案件信息",loginUser); - caseApplication.setCaseAppliId(caseApplication.getId()); - caseApplication.setCaseLogId(IdWorkerUtil.getId()); - int insertRow = caseApplicationLogMapper.insert(caseApplication); - if (insertRow != 0) { - if (CollectionUtil.isNotEmpty(caseAffiliates)) { - caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); - // 插入案件日志人员相关表 - caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); - } - if (CollectionUtil.isNotEmpty(caseAttachList)) { - List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); - // 插入日志附件表 - if (CollectionUtil.isNotEmpty(filterList)) { - for (CaseAttach caseAttach : filterList) { - // 查询附件表 - Long annexId = caseAttach.getAnnexId(); - CaseAttach attach = caseAttachMapper.queryAnnexById(annexId); - if(attach!=null){ - attach.setCaseAppliLogId(caseApplication.getCaseLogId()); - caseAttachLogMapper.save(attach); - } - } - } - - } - // 插入案件columnValueLog自定义字段表 - if (CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { - caseApplication.getColumnValues().forEach(columnValue -> columnValue.setCaseAppliLogId(caseApplication.getCaseLogId())); - - columnValueLogMapper.batchSave(caseApplication.getColumnValues()); - } - } - } catch (Exception e) { - throw new RuntimeException(e); - } - }); - - return success(); - } +// @Override +// @Transactional +// public AjaxResult editCaseApplication(CaseApplication caseApplication) { +// //根据仲裁费用计费规则计算应缴费用 +// //暂时设置计费比率为0.01 +// BigDecimal feeRate = new BigDecimal("0.01"); +// BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP); +// caseApplication.setFeePayable(feePayable); +// caseApplication.setUpdateBy(getUsername()); +// // 立案申请状态直接修改主表信息 +// if (caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { +// // 修改内置字段 +// caseApplicationMapper.updataCaseApplication(caseApplication); +// if(CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { +// // 修改自定义字段 +// for (ColumnValue columnValue : caseApplication.getColumnValues()) { +// if(StrUtil.isNotEmpty(columnValue.getValue())) { +// columnValueMapper.updateColumnValue(columnValue); +// } +// } +// } +// // 修改记录表状态为同意提交修改的内容 +// caseApplication.setUpdateSubmitStatus(0); +// } else { +// // 修改记录表状态为已提交修改的内容 +// caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.COMMITTED.getCode()); +// } +// List caseAffiliates = caseApplication.getCaseAffiliates(); +// if (caseAffiliates != null && caseAffiliates.size() > 0) { +// // 查询所有的组织机构,组装成map +// List deptList = sysDeptMapper.selectDeptList(new SysDept()); +// if (CollectionUtil.isEmpty(deptList)) { +// deptList = new ArrayList<>(); +// } +// Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); +// // 查询申请人角色id +// Long roleId = roleMapper.selectRoleIdByName("申请人"); +// for (CaseAffiliate caseAffiliate : caseAffiliates) { +// caseAffiliate.setCaseAppliId(caseApplication.getId()); +// if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { +// // 将组织机构id设为申请人名称 +// if (deptMap.containsKey(caseAffiliate.getName())) { +// caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); +// caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); +// } else { +// // 如果不存在则新增 +// SysDept dept = new SysDept(); +// dept.setParentId(0L); +// dept.setDeptName(caseAffiliate.getName()); +// dept.setAncestors("0"); +// dept.setOrderNum(1); +// dept.setStatus("0"); +// dept.setDelFlag("0"); +// dept.setCreateBy(getUsername()); +// dept.setUpdateBy(getUsername()); +// sysDeptMapper.insertDept(dept); +// deptMap.put(dept.getDeptName(), dept.getDeptId()); +// +// caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); +// caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); +// +// } +// String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); +// if (StrUtil.isNotEmpty(agentInfoFlag)) { +// throw new ServiceException(agentInfoFlag); +// } +// +// } +// // 立案申请状态直接修改主表信息 +// if (caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { +// +// caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); +// } +// } +// +// } +// List caseAttachList = caseApplication.getCaseAttachList(); +// // 立案申请状态直接修改主表信息 +// if (caseAttachList != null && caseAttachList.size() > 0 +// && caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { +// List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); +// if (CollectionUtil.isNotEmpty(filterList)) { +// for (CaseAttach caseAttach : caseAttachList) { +// caseAttach.setCaseAppliId(caseApplication.getId()); +// caseAttachMapper.updateCaseAttach(caseAttach); +// } +// } +// +// } +// // 根据案件id查询最新版本号 +// Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId()); +// if (maxVersion == null) { +// maxVersion = 1; +// } +// caseApplication.setVersion(maxVersion + 1); +// LoginUser loginUser = getLoginUser(); +// // 异步新增案件日志 +// ThreadPoolUtil.execute(() -> { +// try { +// //新增案件日志记录 +// insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_EDIT, "修改案件信息",loginUser); +// caseApplication.setCaseAppliId(caseApplication.getId()); +// caseApplication.setCaseLogId(IdWorkerUtil.getId()); +// int insertRow = caseApplicationLogMapper.insert(caseApplication); +// if (insertRow != 0) { +// if (CollectionUtil.isNotEmpty(caseAffiliates)) { +// caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getCaseLogId())); +// // 插入案件日志人员相关表 +// caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates); +// } +// if (CollectionUtil.isNotEmpty(caseAttachList)) { +// List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); +// // 插入日志附件表 +// if (CollectionUtil.isNotEmpty(filterList)) { +// for (CaseAttach caseAttach : filterList) { +// // 查询附件表 +// Long annexId = caseAttach.getAnnexId(); +// CaseAttach attach = caseAttachMapper.queryAnnexById(annexId); +// if(attach!=null){ +// attach.setCaseAppliLogId(caseApplication.getCaseLogId()); +// caseAttachLogMapper.save(attach); +// } +// } +// } +// +// } +// // 插入案件columnValueLog自定义字段表 +// if (CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { +// caseApplication.getColumnValues().forEach(columnValue -> columnValue.setCaseAppliLogId(caseApplication.getCaseLogId())); +// +// columnValueLogMapper.batchSave(caseApplication.getColumnValues()); +// } +// } +// } catch (Exception e) { +// throw new RuntimeException(e); +// } +// }); +// +// return success(); +// } /** @@ -1403,9 +1246,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber()); caseAffiliate.setNameAgent(agentUser.getNickName()); caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId())); - if(StrUtil.isNotEmpty(agentUser.getIdCard())){ + if (StrUtil.isNotEmpty(agentUser.getIdCard())) { caseAffiliate.setIdentityNumAgent(agentUser.getIdCard()); - }else { + } else { caseAffiliate.setIdentityNumAgent(caseAffiliate.getIdentityNumAgent()); } List longList = new ArrayList<>(); @@ -1451,50 +1294,59 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 查询案件信息,做必填校验,校验不通过,提示,不能提交 StringBuilder errorMsg = new StringBuilder(); List caseApplications = caseApplicationMapper.listCaseApplicationByIds(ids); - if(CollectionUtil.isNotEmpty(caseApplications)) { + if (CollectionUtil.isNotEmpty(caseApplications)) { Map applicationMap = caseApplications.stream().collect(Collectors.toMap(CaseApplication::getId, Function.identity(), (n1, n2) -> n2)); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliateByCaseIds(ids); + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliateByCaseIds(ids); // 转换为Map>形式 - Map> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliate::getCaseAppliId)); + Map> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliateEntity::getCaseAppliId)); for (Long id : ids) { - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); // 必填校验 CaseApplication caseApplication = applicationMap.get(id); // 基本字段校验 - if(caseApplication!=null) { + if (caseApplication != null) { for (String baseColumn : baseColumns) { - if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseApplication, baseColumn))){ - errorMsg.append(baseColumn).append("不能为空,"); - throw new ServiceException("必填字段未填写,请完善案件信息!"); - } + if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseApplication, baseColumn))) { + errorMsg.append(baseColumn).append("不能为空,"); + throw new ServiceException("必填字段未填写,请完善案件信息!"); + } } // 校验人员 - if(CollectionUtil.isNotEmpty(caseAffiliates)){ - List affiliateList = caseAffiliateMap.get(id); - if(CollectionUtil.isNotEmpty(affiliateList)){ - for (CaseAffiliate caseAffiliate : affiliateList) { - if(caseAffiliate.getIdentityType()==1){ + if (CollectionUtil.isNotEmpty(caseAffiliates)) { + List affiliateList = caseAffiliateMap.get(id); + if (CollectionUtil.isNotEmpty(affiliateList)) { + int appCount = 0; + int resCount = 0; + for (CaseAffiliateEntity caseAffiliate : affiliateList) { + if (caseAffiliate.getOperatorFlag() != null && caseAffiliate.getOperatorFlag().equals(1) && caseAffiliate.getRoleType() != null && (caseAffiliate.getRoleType().equals(1) || caseAffiliate.getRoleType().equals(2))) { + appCount++; // 校验申请人 for (String applicAffiliateColumn : applicAffiliateColumns) { - if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){ + if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))) { errorMsg.append(applicAffiliateColumn).append("不能为空,"); throw new ServiceException("必填字段未填写,请完善案件信息!"); } } - }else { + } else if (caseAffiliate.getOperatorFlag() != null && caseAffiliate.getOperatorFlag().equals(1) && caseAffiliate.getRoleType() != null && (caseAffiliate.getRoleType().equals(3) || caseAffiliate.getRoleType().equals(4))) { + resCount++; // 校验被申请人 // 校验申请人 for (String applicAffiliateColumn : dectborAffiliateColumns) { - if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){ + if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))) { errorMsg.append(applicAffiliateColumn).append("不能为空,"); throw new ServiceException("必填字段未填写,请完善案件信息!"); } } } } + if (appCount == 0 || resCount == 0) { + throw new ServiceException("必填字段未填写,请完善案件信息!"); + } } } + } else { + throw new ServiceException("必填字段未填写,请完善案件信息!"); } CaseApplication application = new CaseApplication(); @@ -1503,7 +1355,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { application.setCaseStatus(CaseApplicationConstants.CASE_CHECK); rows += caseApplicationMapper.submitCaseApplication(application); // 新增日志 - insertCaseLog(application.getId(), currentStatus, ""); + insertCaseLog(application.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); } } return rows; @@ -1513,19 +1365,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public int deletecaseApplicationByIds(List ids) { // 查出所有的日志id - List logIds= caseApplicationLogMapper.selectLogsByCaseIds(ids); + List logIds = caseApplicationLogMapper.selectLogsByCaseIds(ids); int rows = caseApplicationMapper.batchDeletecaseApplication(ids); // 删除日志 - if(CollectionUtil.isNotEmpty(logIds)) { + if (CollectionUtil.isNotEmpty(logIds)) { caseApplicationLogMapper.batchDeleteLog(logIds); } return rows; } + /** + * 查询详情 + * + * @param caseApplication + * @return + */ @Override public CaseApplication selectCaseApplication(CaseApplication caseApplication) { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - if(caseApplicationselect==null){ + if (caseApplicationselect == null) { throw new ServiceException("案件不存在"); } CaseAffiliate caseAffiliate = new CaseAffiliate(); @@ -1542,73 +1400,161 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication); if (caseAttachList != null && caseAttachList.size() > 0) { for (CaseAttach caseAttach : caseAttachList) { - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - if(startIndex!=-1) { - startIndex += prefix.length(); + String annexPath = caseAttach.getAnnexPath(); + if(StrUtil.isEmpty(annexPath)){ + continue; + } + // String annexPath =annexName.replace("/profile/","/home/ruoyi/uploadPath/"); - String annexPath = "/uploadPath" + annexName.substring(startIndex); caseAttach.setAnnexPath(annexPath); - } - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } + caseAttach.setAnnexName(caseAttach.getAnnexName()); } } caseApplicationselect.setCaseAttachList(caseAttachList); - List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliatListeselect != null) { - // 查询组织机构 - List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(sysDepts)) { - for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); - } - } - StringBuilder applicantName = new StringBuilder(); - StringBuilder respondentName = new StringBuilder(); - for (int i = 0; i < caseAffiliatListeselect.size(); i++) { - CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); - int identityType = caseAffiliateselect.getIdentityType(); - if (identityType == 1) { - if (StrUtil.isNotEmpty(caseAffiliateselect.getName()) && deptMap.containsKey(caseAffiliateselect.getName())) { - caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); + // 查询案件相关人员 + List msCaseAffiliates = caseApplicationService.selectAfflicatesByCaseId(caseApplication.getId()); + if (CollectionUtil.isNotEmpty(msCaseAffiliates)) { + Map> affliateMap = msCaseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliateEntity::getGroupOrder, Collectors.toList())); + CaseAffiliateVO affiliateVO = new CaseAffiliateVO(); + List applicantList = new ArrayList<>(); + List resList = new ArrayList<>(); + affiliateVO.setApplicant(applicantList); + affiliateVO.setRes(resList); + StringBuffer applicantName=new StringBuffer(); + StringBuffer respondentName=new StringBuffer(); + affliateMap.forEach((k, v) -> { + CaseAffiliateBase affiliateBase = null; + + CaseAffiliateBase resBase = null; + + for (CaseAffiliateEntity affiliate : v) { + + switch (affiliate.getRoleType()) { + case 1: + if (affiliateBase == null) { + affiliateBase = new CaseAffiliateBase(); + } + affiliateBase.setApplicant(affiliate); + if (affiliate.getOrganizeFlag() == null || affiliate.getOrganizeFlag() != 1) { + if (StrUtil.isNotEmpty(affiliate.getName()) + && !applicantName.toString().contains(affiliate.getName() + Constants.CN_SPLIT_COMMA)) { + applicantName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA); + } + } else { + // 组织机构 + if ( StrUtil.isNotEmpty(affiliate.getApplicantOrgName()) + && !applicantName.toString().contains(affiliate.getApplicantOrgName() + Constants.CN_SPLIT_COMMA)) { + applicantName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA); + } + } + break; + case 2: + if (affiliateBase == null) { + affiliateBase = new CaseAffiliateBase(); + } + affiliateBase.setApplicantAgent(affiliate); + break; + case 3: + if (resBase == null) { + resBase = new CaseAffiliateBase(); + } + resBase.setRes(affiliate); + if (affiliate.getOrganizeFlag() == null || affiliate.getOrganizeFlag() != 1) { + if ( StrUtil.isNotEmpty(affiliate.getName()) + && !respondentName.toString().contains(affiliate.getName() + Constants.CN_SPLIT_COMMA)) { + + respondentName.append(affiliate.getName()).append(Constants.CN_SPLIT_COMMA); + } + } else { + // 组织机构 + if ( StrUtil.isNotEmpty(affiliate.getApplicantOrgName()) && !respondentName.toString().contains(affiliate.getApplicantOrgName() + Constants.CN_SPLIT_COMMA)) { + respondentName.append(affiliate.getApplicantOrgName()).append(Constants.CN_SPLIT_COMMA); + } + } + break; + case 4: + if (resBase == null) { + resBase = new CaseAffiliateBase(); + } + resBase.setResAgent(affiliate); + break; + default: + + break; } - applicantName.append(caseAffiliateselect.getName()).append(Constants.CN_SPLIT_COMMA); - ; - } else if (identityType == 2) { - respondentName.append(caseAffiliateselect.getName()).append(Constants.CN_SPLIT_COMMA); + + } + if (affiliateBase != null) { + applicantList.add(affiliateBase); + } + if (resBase != null) { + resList.add(resBase); + } + }); + caseApplicationselect.setAffiliate(affiliateVO); + caseApplicationselect.setApplicantName(removeLastComma(applicantName.toString(),Constants.CN_SPLIT_COMMA)); + caseApplicationselect.setRespondentName(removeLastComma(respondentName.toString(),Constants.CN_SPLIT_COMMA)); + } + caseApplicationselect.setArbitrateRecord(arbitrateRecordselect); + if (arbitrateRecordselect != null) { + caseApplicationselect.setPayRejectReason(arbitrateRecordselect.getPayRejectReason()); + // 仲裁员审核驳回原因 + caseApplicationselect.setArbitrateReject(arbitrateRecordselect.getArbitrateReject()); + caseApplicationselect.setDeptorReject(arbitrateRecordselect.getDeptorReject()); + } + // 设置仲裁方式 + Integer caseStatus = caseApplicationselect.getCaseStatus(); + if (caseStatus != null && caseStatus.equals(CaseApplicationConstants.CHECK_ARBITRATION_METHOD)) { + Integer applicantIsWrittenHear = caseApplicationselect.getApplicantIsWrittenHear(); + Integer respondentIsWrittenHear = caseApplicationselect.getRespondentIsWrittenHear(); + if (applicantIsWrittenHear != null && respondentIsWrittenHear != null) { + if (applicantIsWrittenHear.intValue() == respondentIsWrittenHear.intValue()) { + caseApplicationselect.setArbitraMethodIssame(1); + if (applicantIsWrittenHear.intValue() == 1 && respondentIsWrittenHear.intValue() == 1) { + caseApplicationselect.setArbitratMethod(2); + caseApplicationselect.setArbitratMethodName("书面审理"); + } else { + caseApplicationselect.setArbitratMethod(1); + caseApplicationselect.setArbitratMethodName("开庭审理"); + } + + } else { + caseApplicationselect.setArbitraMethodIssame(2); + String applicantarbitratMethod = ""; + String respondentbitratMethod = ""; + if (applicantIsWrittenHear.intValue() == 1) { + applicantarbitratMethod = "书面审理"; + } else { + applicantarbitratMethod = "开庭审理"; + } + if (respondentIsWrittenHear.intValue() == 1) { + respondentbitratMethod = "书面审理"; + } else { + respondentbitratMethod = "开庭审理"; + } + String arbitratMethodIllustrate = "当前案件开庭方式:申请人选择开庭方式为" + applicantarbitratMethod + + "被申请人选择开庭方式为" + respondentbitratMethod + ",请确定开庭方式。"; + caseApplicationselect.setArbitratMethodIllustrate(arbitratMethodIllustrate); } - } - caseApplicationselect.setApplicantName(removeLastComma(applicantName.toString(), Constants.CN_SPLIT_COMMA)); - caseApplicationselect.setRespondentName(removeLastComma(respondentName.toString(), Constants.CN_SPLIT_COMMA)); - caseApplicationselect.setCaseAffiliates(caseAffiliatListeselect); - caseApplicationselect.setArbitrateRecord(arbitrateRecordselect); - if(arbitrateRecordselect!=null){ - caseApplicationselect.setPayRejectReason(arbitrateRecordselect.getPayRejectReason()); - // 仲裁员审核驳回原因 - caseApplicationselect.setArbitrateReject(arbitrateRecordselect.getArbitrateReject()); - caseApplicationselect.setDeptorReject(arbitrateRecordselect.getDeptorReject()); } } + return caseApplicationselect; } + /** * 去除字符串末尾特殊字符 + * * @param input 字符串 - * @param str 去除字符串末尾的特殊字符 + * @param str 去除字符串末尾的特殊字符 * @return */ - public String removeLastComma(String input,String str) { - if(StrUtil.isEmpty(input)){ + public String removeLastComma(String input, String str) { + if (StrUtil.isEmpty(input)) { return input; } if (input.endsWith(str)) { @@ -1616,131 +1562,132 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } return input; // 如果没有末尾逗号,则直接返回原字符串 } + @Override @Transactional public String importCaseApplication(List caseApplicationList, String operName) { - StringBuilder failureMsg = new StringBuilder(); - StringBuilder successMsg = new StringBuilder(); - int successNum = 0; - List caseAffiliateLogList = new ArrayList<>(); - if (caseApplicationList != null && caseApplicationList.size() > 0) { - // 1,查询所有的组织机构,组装成map - List deptList = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(deptList)) { - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); - } - // 查询申请人角色id - Long roleId = roleMapper.selectRoleIdByName("申请人"); - List caseApplicationListinsert = new ArrayList<>(); - for (int i = 0; i < caseApplicationList.size(); i++) { - CaseApplication caseApplication = caseApplicationList.get(i); - CaseImportValid caseImportValid = new CaseImportValid(caseApplication, deptMap); - // 导入校验 - caseImportValid.importValid(caseApplication, deptMap); - // 校验成功的数据 - if (StrUtil.isEmpty(caseApplication.getErrorMsg())) { - //根据仲裁费用计费规则计算应缴费用 - //暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal("0.01"); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP); - caseApplication.setFeePayable(feePayable); - - //赋值CaseApplication的案件关联人信息 - List caseAffiliatesnew = new ArrayList<>(); - // 组装案件关联人信息 - assignmentCaseAffiliates(caseApplication, caseAffiliatesnew, deptMap, roleId); - caseApplication.setImportFlag(1); - caseApplicationListinsert.add(caseApplication); - } else { - // 拼接错误信息 - failureMsg.append("
").append("第").append(i + 2).append("行:").append(caseApplication.getErrorMsg().toString()); - } - } - if (caseApplicationListinsert.size() > 0) { - //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 - List caseApplicationNewList = null; - for (int i = 0; i < caseApplicationListinsert.size(); i++) { - caseApplicationNewList = new ArrayList<>(); - CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); - // 设置自动编码 - caseApplicationinsertDiffer.setCaseNum(generateCaseNum()); - List caseAffiliatesnew = new ArrayList<>(); - CaseApplication caseApplicationNew = new CaseApplication(); - copyCaseApplication(caseApplicationinsertDiffer, caseApplicationNew); - if (caseApplicationListinsert.size() > 0) { - for (int j = 0; j < caseApplicationListinsert.size(); j++) { - CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); - - if (StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum()) && - caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())) { - - caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); - } - } - caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); - caseApplicationNewList.add(caseApplicationNew); - } - - for (int k = 0; k < caseApplicationNewList.size(); k++) { - CaseApplication caseApplicationItera = caseApplicationNewList.get(k); - // 新增立案信息 - caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - caseApplicationItera.setCreateBy(getUsername()); - caseApplicationItera.setImportFlag(1); - caseApplicationItera.setId(IdWorkerUtil.getId()); - int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); - if (rows == 0) { - continue; - } - // 新增日志 - insertCaseLog(caseApplicationItera.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); - - List caseAffiliates = caseApplicationItera.getCaseAffiliates(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate caseAffiliate : caseAffiliates) { - caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); - - } - caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); - } - // 新增案件记录 - caseApplicationItera.setCaseAppliId(caseApplicationItera.getId()); - caseApplicationItera.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); - caseApplicationItera.setVersion(1); - caseApplicationItera.setCaseLogId(IdWorkerUtil.getId()); - int insertRow = caseApplicationLogMapper.insert(caseApplicationItera); - if (insertRow > 0) { - caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplicationItera.getId())); - caseAffiliateLogList.addAll(caseAffiliates); - } - successNum++; - successMsg.append("
").append(successNum).append("、立案编号 ").append(caseApplicationItera.getCaseNum()).append(" 导入成功"); - } - - - } - - } - // 异步新增案件日志 - ThreadPoolUtil.execute(() -> { - if (CollectionUtil.isNotEmpty(caseAffiliateLogList)) { - // 插入案件日志人员相关表 - caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliateLogList); - } - }); - - - } else { - throw new ServiceException("导入立案申请数据不能为空!"); - } - return successMsg.append(failureMsg).toString(); +// StringBuilder failureMsg = new StringBuilder(); +// StringBuilder successMsg = new StringBuilder(); +// int successNum = 0; +// List caseAffiliateLogList = new ArrayList<>(); +// if (caseApplicationList != null && caseApplicationList.size() > 0) { +// // 1,查询所有的组织机构,组装成map +// List deptList = sysDeptMapper.selectDeptList(new SysDept()); +// Map deptMap = new HashMap<>(); +// if (CollectionUtil.isNotEmpty(deptList)) { +// deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); +// } +// // 查询申请人角色id +// Long roleId = roleMapper.selectRoleIdByName("申请人"); +// List caseApplicationListinsert = new ArrayList<>(); +// for (int i = 0; i < caseApplicationList.size(); i++) { +// CaseApplication caseApplication = caseApplicationList.get(i); +// CaseImportValid caseImportValid = new CaseImportValid(caseApplication, deptMap); +// // 导入校验 +// caseImportValid.importValid(caseApplication, deptMap); +// // 校验成功的数据 +// if (StrUtil.isEmpty(caseApplication.getErrorMsg())) { +// //根据仲裁费用计费规则计算应缴费用 +// //暂时设置计费比率为0.01 +// BigDecimal feeRate = new BigDecimal("0.01"); +// BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP); +// caseApplication.setFeePayable(feePayable); +// +// //赋值CaseApplication的案件关联人信息 +// List caseAffiliatesnew = new ArrayList<>(); +// // 组装案件关联人信息 +// assignmentCaseAffiliates(caseApplication, caseAffiliatesnew, deptMap, roleId); +// caseApplication.setImportFlag(1); +// caseApplicationListinsert.add(caseApplication); +// } else { +// // 拼接错误信息 +// failureMsg.append("
").append("第").append(i + 2).append("行:").append(caseApplication.getErrorMsg().toString()); +// } +// } +// if (caseApplicationListinsert.size() > 0) { +// //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 +// List caseApplicationNewList = null; +// for (int i = 0; i < caseApplicationListinsert.size(); i++) { +// caseApplicationNewList = new ArrayList<>(); +// CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); +// // 设置自动编码 +// caseApplicationinsertDiffer.setCaseNum(generateCaseNum()); +// List caseAffiliatesnew = new ArrayList<>(); +// CaseApplication caseApplicationNew = new CaseApplication(); +// copyCaseApplication(caseApplicationinsertDiffer, caseApplicationNew); +// if (caseApplicationListinsert.size() > 0) { +// for (int j = 0; j < caseApplicationListinsert.size(); j++) { +// CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); +// +// if (StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum()) && +// caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())) { +// +// caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); +// } +// } +// caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); +// caseApplicationNewList.add(caseApplicationNew); +// } +// +// for (int k = 0; k < caseApplicationNewList.size(); k++) { +// CaseApplication caseApplicationItera = caseApplicationNewList.get(k); +// // 新增立案信息 +// caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); +// caseApplicationItera.setCreateBy(getUsername()); +// caseApplicationItera.setImportFlag(1); +// caseApplicationItera.setId(IdWorkerUtil.getId()); +// int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); +// if (rows == 0) { +// continue; +// } +// // 新增日志 +// insertCaseLog(caseApplicationItera.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); +// +// List caseAffiliates = caseApplicationItera.getCaseAffiliates(); +// if (caseAffiliates != null && caseAffiliates.size() > 0) { +// for (CaseAffiliate caseAffiliate : caseAffiliates) { +// caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); +// +// } +// caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); +// } +// // 新增案件记录 +// caseApplicationItera.setCaseAppliId(caseApplicationItera.getId()); +// caseApplicationItera.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); +// caseApplicationItera.setVersion(1); +// caseApplicationItera.setCaseLogId(IdWorkerUtil.getId()); +// int insertRow = caseApplicationLogMapper.insert(caseApplicationItera); +// if (insertRow > 0) { +// caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplicationItera.getId())); +// caseAffiliateLogList.addAll(caseAffiliates); +// } +// successNum++; +// successMsg.append("
").append(successNum).append("、立案编号 ").append(caseApplicationItera.getCaseNum()).append(" 导入成功"); +// } +// +// +// } +// +// } +// // 异步新增案件日志 +// ThreadPoolUtil.execute(() -> { +// if (CollectionUtil.isNotEmpty(caseAffiliateLogList)) { +// // 插入案件日志人员相关表 +// caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliateLogList); +// } +// }); +// +// +// } else { +// throw new ServiceException("导入立案申请数据不能为空!"); +// } +// return successMsg.append(failureMsg).toString(); + // todo + return null; } - - @Override @Transactional public int pendTral(CaseApplication caseApplication) { @@ -1765,15 +1712,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public AjaxResult pendTralCheck(CaseApplication caseApplication) { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - if(caseApplicationselect==null){ + if (caseApplicationselect == null) { throw new ServiceException("案件不存在"); } - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); for (Arbitrator arbitrator : caseApplication.getArbitrators()) { caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); - if(arbitrator.getId()==null || StrUtil.isEmpty(arbitrator.getArbitratorName())){ + if (arbitrator.getId() == null || StrUtil.isEmpty(arbitrator.getArbitratorName())) { return AjaxResult.warn("请选择仲裁员"); } caseApplication.setArbitratorId(String.valueOf(arbitrator.getId())); @@ -1782,27 +1729,28 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationMapper.submitCaseApplication(caseApplication); } // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT, ""); return success(); } @Override @Transactional public int verificationArbitrateRecord(CaseApplication caseApplication) { - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); // 秘书核验裁决书,流转到待仲裁员审核裁决书 - caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); + caseApplication.setCaseStatus(HEAD_CHECK_ARBITRATION); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, ""); return rows; } /** * 部门长审核裁决书 + * * @param caseApplication * @return */ @@ -1810,11 +1758,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public AjaxResult checkArbitrateRecord(CaseApplication caseApplication) { int rows = 0; - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); - if (agreeOrNotCheck!=null&&agreeOrNotCheck.intValue() == 1) {//同意审核 + if (agreeOrNotCheck != null && agreeOrNotCheck.intValue() == 1) {//同意审核 try { //获取当前案件的裁决书 CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); @@ -1823,7 +1771,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (CaseAttach caseAttach : caseAttachList) { if (caseAttach.getAnnexType() == 3) { String annexPath = caseAttach.getAnnexPath(); - String path = "/home/ruoyi" + annexPath; + if(StrUtil.isEmpty(annexPath)){ + throw new ServiceException("文件找不到"); + } + String path = annexPath.replace("/profile/","/home/ruoyi/uploadPath/"); // System.out.println("这是查询到的裁决书路径" + path); // String path = "D:\\home\\新裁决书模板.docx"; //获取文件上传地址 @@ -1952,7 +1903,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (SealManage manage : selectSealList) { Integer sealStatus = manage.getSealStatus(); Integer isUse = manage.getIsUse(); - if (sealStatus == 1 && isUse ==1) { + if (sealStatus == 1 && isUse == 1) { sealIdList.add(manage.getSealId()); } } @@ -1996,17 +1947,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); // 新增日志 - insertCaseLog(caseApplication.getId(),currentStatus , ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 - caseApplication.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); - String notes=""; - if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())){ - notes="驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); + caseApplication.setCaseStatus(HEAD_CHECK_ARBITRATION); + String notes = ""; + if (caseApplication.getArbitrateRecord() != null && StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())) { + notes = "驳回裁决书,驳回原因:" + caseApplication.getArbitrateRecord().getDeptorReject(); } // 新增日志 - insertCaseLog(caseApplication.getId(),currentStatus , notes); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, notes); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } @@ -2016,13 +1967,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 仲裁员审核裁决书 + * * @param caseApplication * @return */ @Override @Transactional public AjaxResult arbitratorCheckArbitrateRecord(CaseApplication caseApplication) { - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); // 同意后状态改为待部门长审核裁决书(CHECK_ARBITRATION = 12),拒绝改为待秘书核验裁决书(VERPRIF_ARBITRATION = 11) int rows = 0; Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); @@ -2031,154 +1983,100 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, ""); + insertCaseLog(caseApplication.getId(), HEAD_CHECK_ARBITRATION, ""); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); - if(arbitrateRecord.getId()!=null){ + if (arbitrateRecord.getId() != null) { arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); - }else { + } else { arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord); } caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); rows = caseApplicationMapper.submitCaseApplication(caseApplication); - String notes=""; - if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())){ - notes="仲裁员驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); + String notes = ""; + if (caseApplication.getArbitrateRecord() != null && StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())) { + notes = "仲裁员驳回裁决书,驳回原因:" + caseApplication.getArbitrateRecord().getArbitrateReject(); } // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, notes); + insertCaseLog(caseApplication.getId(), HEAD_CHECK_ARBITRATION, notes); } return success(); } - @Override @Transactional - public int submitCaseApplicationCheck(List ids, Integer agreeOrNotCheck,String caseCheckReject) { + public int submitCaseApplicationCheck(List ids, Integer agreeOrNotCheck, String caseCheckReject) { //提交立案审查 int rows = 0; for (Long id : ids) { - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); - String notes=""; + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); + String notes = ""; CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); caseApplication.setAgreeOrNotCheck(agreeOrNotCheck); if (agreeOrNotCheck == 1) {//同意审核 caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); rows += caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, notes); + } else if (agreeOrNotCheck == 2) {//拒绝审核 - notes="驳回立案申请,驳回原因:"+caseCheckReject; + notes = "驳回立案申请,驳回原因:" + caseCheckReject; caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); rows += caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, notes); + ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); arbitrateRecordsel.setCaseAppliId(id); ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); - if(arbitrateRecordnew!=null){ + if (arbitrateRecordnew != null) { arbitrateRecordnew.setCaseCheckReject(caseCheckReject); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew); - }else { + } else { arbitrateRecordsel.setCaseCheckReject(caseCheckReject); arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel); } + //查询案件详细信息 + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); //发短信给申请人 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - //查询案件详细信息 - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + List affiliates = selectAfflicatesByCaseId(id); + if (affiliates != null && affiliates.size() > 0) { + // 申请操作人 + Optional applicantAffiliateOpt = affiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + if (applicantAffiliateOpt.isPresent() && StrUtil.isNotEmpty(applicantAffiliateOpt.get().getPhone())) { + + CaseAffiliateEntity affiliate = applicantAffiliateOpt.get(); String caseName = "仲裁"; String caseNum = caseApplication1.getCaseNum(); - - if (identityType == 1) { - request.setPhone(affiliate.getContactTelphone()); - request.setTemplateId("2018697"); - String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseName, caseNum,caseCheckReject}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseNum); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已拒绝,拒接原因:" + caseCheckReject; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - + request.setPhone(affiliate.getPhone()); + request.setTemplateId("2018697"); + String name = affiliate.getName(); + request.setTemplateParamSet(new String[]{name, caseName, caseNum, caseCheckReject}); + Boolean aBoolean = SmsUtils.sendSms(request); + //保存短信发送记录 + SmsSendRecord smsSendRecord = new SmsSendRecord(); + smsSendRecord.setCaseId(caseApplication.getId()); + smsSendRecord.setCaseNum(caseNum); + smsSendRecord.setPhone(request.getPhone()); + smsSendRecord.setSendTime(new Date()); + String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已拒绝,拒接原因:" + caseCheckReject; + smsSendRecord.setSendContent(content); + smsSendRecord.setCreateBy(getUsername()); + if (aBoolean) { + smsSendRecord.setSendStatus(1); + } else { + smsSendRecord.setSendStatus(0); } - + smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } } - + // 新增日志 + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CHECK, notes); } return rows; } - @Override - public CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication) { - CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplicationConfirm(caseApplication); - if (caseApplicationselect == null) { - return caseApplicationselect; - } - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliatListeselect != null) { - // caseAffiliatListeselect=new ArrayList<>(caseAffiliatListeselect.stream().collect(Collectors.toMap(CaseAffiliate::getContactTelphone ,Function.identity(), (k1, k2) -> k1)).values()); - for (int i = 0; i < caseAffiliatListeselect.size(); i++) { - CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); - int identityType = caseAffiliateselect.getIdentityType(); - if (identityType == 1 && StrUtil.isNotEmpty(caseAffiliateselect.getApplicationOrganId())) { - - caseApplicationselect.setApplicantName(caseAffiliateselect.getApplicationOrganName()); - }else { - caseApplicationselect.setApplicantName(caseAffiliateselect.getName()); - } - } - - } - caseApplication.setAnnexType(8); - // 查询缴费凭证 - List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication); - if (caseAttachList != null && caseAttachList.size() > 0) { - for (CaseAttach caseAttach : caseAttachList) { - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseAttach.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } - - - } - } - caseApplicationselect.setPayOrderList(caseAttachList); - - return caseApplicationselect; - } /** * 给被申请人发送房间号短信 @@ -2188,64 +2086,68 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { */ @Override public String sendRoomNoMessage(SendRoomNoMessageVO messageVO) { - CaseAffiliate caseAffiliateSelect = new CaseAffiliate(); - caseAffiliateSelect.setCaseAppliId(messageVO.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliateSelect); - if (CollectionUtil.isEmpty(caseAffiliates)) { - return "申请人、被申请人不存在"; + List afflicates = selectAfflicatesByCaseId(messageVO.getId()); + if (CollectionUtil.isEmpty(afflicates)) { + throw new ServiceException("未找到案件相关人员"); } - caseAffiliates=new ArrayList<>(caseAffiliates.stream().collect(Collectors.toMap(CaseAffiliate::getContactTelphone ,Function.identity(), (k1, k2) -> k1)).values()); CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(messageVO.getId()); CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); + if (caseApplicationselect == null) { + throw new ServiceException("案件不存在"); + } String returnResult = "短信发送成功"; // 需要申请模板,申请人,被申请人发送短信通知 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); String startFormat = ""; String endFormat = ""; // 创建房间短信通知 - String format = "yyyy/MM/dd HH:mm:ss"; // 目标格式 - Date startDate = messageVO.getScheduleStartTime(); - Date endDate = messageVO.getScheduleEndTime(); - SimpleDateFormat sdf = new SimpleDateFormat(format); - if(startDate!=null) { - startFormat = sdf.format(startDate); - } - if(endDate!=null) { - endFormat = sdf.format(endDate); - } - // 预约会议短信模板 - request.setTemplateId("1983711"); + String format = "yyyy/MM/dd HH:mm:ss"; // 目标格式 + Date startDate = messageVO.getScheduleStartTime(); + Date endDate = messageVO.getScheduleEndTime(); + SimpleDateFormat sdf = new SimpleDateFormat(format); + if (startDate != null) { + startFormat = sdf.format(startDate); + } + if (endDate != null) { + endFormat = sdf.format(endDate); + } + // 预约会议短信模板 + request.setTemplateId("1983711"); - for (CaseAffiliate caseAffiliate : caseAffiliates) { - request.setPhone(caseAffiliate.getContactTelphone()); - // 1983711 开庭审理预约会议短信通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},会议时间为{4},请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。 - request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo() , startFormat + "-" + endFormat}); + for (CaseAffiliateEntity affiliate : afflicates) { + if (affiliate.getOperatorFlag() == 1) { + // 操作人发送短信短信 - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(messageVO.getId()); - smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + caseAffiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo() + "会议时间为" + startFormat + "-" + endFormat + ",请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。"; - smsSendRecord.setSendContent(content); + request.setPhone(affiliate.getPhone()); + // 1983711 开庭审理预约会议短信通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},会议时间为{4},请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。 + request.setTemplateParamSet(new String[]{affiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo(), startFormat + "-" + endFormat}); - String userName; - try { - userName = getUsername(); - } catch (Exception e) { - userName = "admin"; + Boolean aBoolean = SmsUtils.sendSms(request); + //保存短信发送记录 + SmsSendRecord smsSendRecord = new SmsSendRecord(); + smsSendRecord.setCaseId(messageVO.getId()); + smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum()); + smsSendRecord.setPhone(request.getPhone()); + smsSendRecord.setSendTime(new Date()); + String content = "尊敬的" + affiliate.getName() + "用户,您的" + caseApplicationselect.getCaseNum() + "仲裁案件,开庭审理房间号为" + messageVO.getRoomNo() + "会议时间为" + startFormat + "-" + endFormat + ",请点击https://txroom.xayunmei.com/#/home, 请知晓,如非本人操作,请忽略本短信。"; + smsSendRecord.setSendContent(content); + + String userName; + try { + userName = getUsername(); + } catch (Exception e) { + userName = "admin"; + } + smsSendRecord.setCreateBy(userName); + if (aBoolean) { + smsSendRecord.setSendStatus(1); + } else { + smsSendRecord.setSendStatus(0); + } + smsRecordMapper.saveSmsSendRecord(smsSendRecord); } - smsSendRecord.setCreateBy(userName); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); } return returnResult; } @@ -2283,11 +2185,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { JsonObject signUrlData = signUrlJsonObject.getAsJsonObject("data"); String url = signUrlData.get("url").getAsString(); sealSignRecordReslt.setSealUrl(url); - if(StrUtil.isEmpty(SecurityUtils.getUsername())){ + if (StrUtil.isEmpty(SecurityUtils.getUsername())) { throw new ServiceException("未获取到当前登录用户"); } SysUser sysUser = sysUserMapper.selectUserByUserName(getUsername()); - if(sysUser==null){ + if (sysUser == null) { throw new ServiceException("未获取到当前登录用户"); } CaseLogRecord operLog = new CaseLogRecord(); @@ -2303,7 +2205,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - @Override @Transactional public AjaxResult creatTrialRecordnew(ArbitrateRecord arbitrateRecordselect) { @@ -2331,7 +2232,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional public AjaxResult editCaseApplicationDefineval(CaseApplication caseApplication) { - if(CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { + if (CollectionUtil.isNotEmpty(caseApplication.getColumnValues())) { for (ColumnValue columnValue : caseApplication.getColumnValues()) { columnValueMapper.updateColumnValue(columnValue); } @@ -2344,14 +2245,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { public CaseAttach downloadCaseZipFile(CaseApplication caseApplication) { caseApplication.setAnnexType(12); CaseAttach caseAttach = new CaseAttach(); - List caseAttachs = caseAttachMapper.queryCaseAttachList( caseApplication); - if(caseAttachs!=null&&caseAttachs.size()>0){ - caseAttach = caseAttachs.get(0); + List caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplication); + if (caseAttachs != null && caseAttachs.size() > 0) { + caseAttach = caseAttachs.get(0); String annexName = caseAttach.getAnnexName(); String prefix = "/profile"; int startIndex = annexName.indexOf(prefix); - if(startIndex!=-1) { + if (startIndex != -1) { startIndex += prefix.length(); String annexPath = "/uploadPath" + annexName.substring(startIndex); @@ -2363,7 +2264,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAttach.setAnnexName(annexNamenew); } - }else { + } else { CaseApplication caseApplicationsel = new CaseApplication(); caseApplicationsel.setId(caseApplication.getId()); List annexTypeList = new ArrayList<>(); @@ -2375,26 +2276,26 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { annexTypeList.add(9); annexTypeList.add(11); caseApplicationsel.setAnnexTypeList(annexTypeList); - List caseAttachList = caseAttachMapper.queryCaseAttachList( caseApplicationsel); - if(caseAttachList!=null&&caseAttachList.size()>0){ + List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplicationsel); + if (caseAttachList != null && caseAttachList.size() > 0) { List pathList = new ArrayList<>(); for (CaseAttach caseAttach1 : caseAttachList) { String annexName = caseAttach1.getAnnexName(); String annexPathsel = caseAttach1.getAnnexPath(); String prefix = "/profile"; int startIndex = annexName.indexOf(prefix); - if(startIndex!=-1) { + if (startIndex != -1) { startIndex += prefix.length(); String annexPath = "/uploadPath" + annexName.substring(startIndex); String path = "/home/ruoyi" + annexPath; pathList.add(path); - }else if(annexPathsel.contains(annexName)){ + } else if (annexPathsel.contains(annexName)) { pathList.add(annexPathsel); } } //将案件相关附件压缩zip文件 - if(pathList!=null&&pathList.size()>0){ + if (pathList != null && pathList.size() > 0) { LocalDate now = LocalDate.now(); String year = Integer.toString(now.getYear()); String month = String.format("%02d", now.getMonthValue()); @@ -2407,37 +2308,37 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { saveFolder.mkdirs(); } String zipFileOutPath = saveFolderPath + "/" + fileName; - try { + try { - FileOutputStream zfous = new FileOutputStream(zipFileOutPath); - ZipOutputStream zipFileOutstream = new ZipOutputStream(zfous); + FileOutputStream zfous = new FileOutputStream(zipFileOutPath); + ZipOutputStream zipFileOutstream = new ZipOutputStream(zfous); - for (String pathstr : pathList) { - FileInputStream fis1 = new FileInputStream(pathstr); - ZipFileUtils.zipFile(pathstr, fis1, zipFileOutstream); - } - zipFileOutstream.close(); - zfous.close(); - } catch (IOException e) { - e.printStackTrace(); + for (String pathstr : pathList) { + FileInputStream fis1 = new FileInputStream(pathstr); + ZipFileUtils.zipFile(pathstr, fis1, zipFileOutstream); } + zipFileOutstream.close(); + zfous.close(); + } catch (IOException e) { + e.printStackTrace(); + } - //保存压缩文件附件 - String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; + //保存压缩文件附件 + String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; // String saveName = "D:/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day + "/" + fileName; - String savePath = "/home/ruoyi/uploadPath/upload"; - caseAttach = CaseAttach.builder() + String savePath = "/home/ruoyi/uploadPath/upload"; + caseAttach = CaseAttach.builder() .caseAppliId(caseApplication.getId()) .annexName(saveName) .annexPath(savePath) .annexType(12) .build(); - int i = caseAttachMapper.save(caseAttach); + int i = caseAttachMapper.save(caseAttach); String annexName = caseAttach.getAnnexName(); String prefix = "/profile"; int startIndex = annexName.indexOf(prefix); - if(startIndex!=-1) { + if (startIndex != -1) { startIndex += prefix.length(); String annexPath = "/uploadPath" + annexName.substring(startIndex); @@ -2449,284 +2350,148 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAttach.setAnnexName(annexNamenew); } - return caseAttach; + return caseAttach; - } - } - } - return caseAttach; - } - - @Override - public List selectCaseApplicationListBatchByRole(CaseApplication caseApplication) { - // 获取登录用户 - LoginUser loginUser = getLoginUser(); - SysUser user = loginUser.getUser(); - Long userId = user.getUserId(); - SysUser sysUser = sysUserMapper.selectUserById(userId); - List roles = sysUser.getRoles(); - // 没有角色不能查看案件列表 - if (CollectionUtil.isEmpty(roles)) { - throw new ServiceException("该用户没有角色权限"); - } - for (SysRole role : roles) { - if (StrUtil.isEmpty(role.getRoleName())) { - continue; - } - if ("超级管理员".equals(role.getRoleName())) { - List caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication); - if(caseApplicationlist!=null&&caseApplicationlist.size()>0){ - for(CaseApplication caseApplicationselect : caseApplicationlist){ - Integer batchNumber = caseApplicationselect.getBatchNumber(); - CaseApplication caseApplicationsel = new CaseApplication(); - caseApplicationsel.setBatchNumber(batchNumber); - List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); - if (caseApplications != null && caseApplications.size() > 0) { - List caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList()); - System.out.println("ceshi:"+caseStatuss.toString()); - List caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList()); - List caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList()); - List caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList()); - String caseStatusName = caseStatusNamesnew.stream().map(Object::toString).collect(Collectors.joining(",")); - String caseStatusstr = caseStatussnew.stream().map(Object::toString).collect(Collectors.joining(",")); - caseApplicationselect.setCaseStatusName(caseStatusName); - caseApplicationselect.setCaseStatusstr(caseStatusstr); - } - } - } - return caseApplicationlist; - - } - - if ("仲裁委".equals(role.getRoleName()) - || "部门长".equals(role.getRoleName())) { - List caseStatusList = new ArrayList<>(); - caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); - caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); - // caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); - caseApplication.setDeptHeadStatus(caseStatusList); - caseApplication.setIsOtherRole(1); - } - if ("仲裁员".equals(role.getRoleName())) { - caseApplication.setUserId(String.valueOf(userId)); - caseApplication.setIsOtherRole(1); - } - if ("财务".equals(role.getRoleName())) { - caseApplication.setIsOtherRole(1); - caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); - } - if ("法律顾问".equals(role.getRoleName())) { - // 秘书查看所有案件 - // 查询角色有关的用户部门 - List deptIds = new ArrayList<>(); - deptIds.add(sysUser.getDeptId()); - caseApplication.setDeptIds(deptIds); - } - if ("申请人".equals(role.getRoleName())) { - // caseApplication.setIsOtherRole(1); - // 查询有关的用户部门 - caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId())); - } - if ("被申请人".equals(role.getRoleName())) { - caseApplication.setIsOtherRole(1); - // - caseApplication.setIdCard(String.valueOf(sysUser.getIdCard())); - } - if ("代理人".equals(role.getRoleName())) { - caseApplication.setIsOtherRole(1); - // 查询角色有关的用户部门 - // List agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); - List agentDeptIds = new ArrayList<>(); - agentDeptIds.add(sysUser.getDeptId()); - caseApplication.setAgentDeptIds(agentDeptIds); - } - - } - List caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch1(caseApplication); - if(caseApplicationlist!=null&&caseApplicationlist.size()>0){ - for(CaseApplication caseApplicationselect : caseApplicationlist){ - Integer batchNumber = caseApplicationselect.getBatchNumber(); - CaseApplication caseApplicationsel = new CaseApplication(); - caseApplicationsel.setBatchNumber(batchNumber); - List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); - if (caseApplications != null && caseApplications.size() > 0) { - List caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList()); - System.out.println("ceshi:"+caseStatuss.toString()); - List caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList()); - List caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList()); - List caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList()); - String caseStatusName = caseStatusNamesnew.stream().map(Object::toString).collect(Collectors.joining(",")); - String caseStatusstr = caseStatussnew.stream().map(Object::toString).collect(Collectors.joining(",")); - caseApplicationselect.setCaseStatusName(caseStatusName); - caseApplicationselect.setCaseStatusstr(caseStatusstr); } } } - - return caseApplicationlist; + return caseAttach; } +// @Override +// public List selectCaseApplicationListBatchByRole(CaseApplication caseApplication) { +// // 获取登录用户 +// LoginUser loginUser = getLoginUser(); +// SysUser user = loginUser.getUser(); +// Long userId = user.getUserId(); +// SysUser sysUser = sysUserMapper.selectUserById(userId); +// List roles = sysUser.getRoles(); +// // 没有角色不能查看案件列表 +// if (CollectionUtil.isEmpty(roles)) { +// throw new ServiceException("该用户没有角色权限"); +// } +// for (SysRole role : roles) { +// if (StrUtil.isEmpty(role.getRoleName())) { +// continue; +// } +// if ("超级管理员".equals(role.getRoleName())) { +// List caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication); +// if (caseApplicationlist != null && caseApplicationlist.size() > 0) { +// for (CaseApplication caseApplicationselect : caseApplicationlist) { +// Integer batchNumber = caseApplicationselect.getBatchNumber(); +// CaseApplication caseApplicationsel = new CaseApplication(); +// caseApplicationsel.setBatchNumber(batchNumber); +// List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); +// if (caseApplications != null && caseApplications.size() > 0) { +// List caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList()); +// System.out.println("ceshi:" + caseStatuss.toString()); +// List caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList()); +// List caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList()); +// List caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList()); +// String caseStatusName = caseStatusNamesnew.stream().map(Object::toString).collect(Collectors.joining(",")); +// String caseStatusstr = caseStatussnew.stream().map(Object::toString).collect(Collectors.joining(",")); +// caseApplicationselect.setCaseStatusName(caseStatusName); +// caseApplicationselect.setCaseStatusstr(caseStatusstr); +// } +// } +// } +// return caseApplicationlist; +// +// } +// +// if ("仲裁委".equals(role.getRoleName()) +// || "部门长".equals(role.getRoleName())) { +// List caseStatusList = new ArrayList<>(); +// caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); +// caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION); +// // caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); +// caseApplication.setDeptHeadStatus(caseStatusList); +// caseApplication.setIsOtherRole(1); +// } +// if ("仲裁员".equals(role.getRoleName())) { +// caseApplication.setUserId(String.valueOf(userId)); +// caseApplication.setIsOtherRole(1); +// } +// if ("财务".equals(role.getRoleName())) { +// caseApplication.setIsOtherRole(1); +// caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); +// } +// if ("法律顾问".equals(role.getRoleName())) { +// // 秘书查看所有案件 +// // 查询角色有关的用户部门 +// List deptIds = new ArrayList<>(); +// deptIds.add(sysUser.getDeptId()); +// caseApplication.setDeptIds(deptIds); +// } +// if ("申请人".equals(role.getRoleName())) { +// // caseApplication.setIsOtherRole(1); +// // 查询有关的用户部门 +// caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId())); +// } +// if ("被申请人".equals(role.getRoleName())) { +// caseApplication.setIsOtherRole(1); +// // +// caseApplication.setIdCard(String.valueOf(sysUser.getIdCard())); +// } +// if ("代理人".equals(role.getRoleName())) { +// caseApplication.setIsOtherRole(1); +// // 查询角色有关的用户部门 +// // List agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); +// List agentDeptIds = new ArrayList<>(); +// agentDeptIds.add(sysUser.getDeptId()); +// caseApplication.setAgentDeptIds(agentDeptIds); +// } +// +// } +// List caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch1(caseApplication); +// if (caseApplicationlist != null && caseApplicationlist.size() > 0) { +// for (CaseApplication caseApplicationselect : caseApplicationlist) { +// Integer batchNumber = caseApplicationselect.getBatchNumber(); +// CaseApplication caseApplicationsel = new CaseApplication(); +// caseApplicationsel.setBatchNumber(batchNumber); +// List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); +// if (caseApplications != null && caseApplications.size() > 0) { +// List caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList()); +// System.out.println("ceshi:" + caseStatuss.toString()); +// List caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList()); +// List caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList()); +// List caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList()); +// String caseStatusName = caseStatusNamesnew.stream().map(Object::toString).collect(Collectors.joining(",")); +// String caseStatusstr = caseStatussnew.stream().map(Object::toString).collect(Collectors.joining(",")); +// caseApplicationselect.setCaseStatusName(caseStatusName); +// caseApplicationselect.setCaseStatusstr(caseStatusstr); +// } +// } +// } +// +// return caseApplicationlist; +// } + @Override @Transactional - public int submitCaseApplicationBatch(String batchNumber) { - - int rows = 0; - CaseApplication caseApplicationsel = new CaseApplication(); - caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber)); - caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); + public AjaxResult submitCaseApplicationBatch(String batchNumber) { + CaseApplication caseApplication = new CaseApplication(); + List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication); + if (CollectionUtil.isEmpty(caseApplications)) { + return error("该批次案件不存在"); + } List ids = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); - if(caseApplications!=null&&caseApplications.size()>0){ - Map applicationMap = caseApplications.stream().collect(Collectors.toMap(CaseApplication::getId, Function.identity(), (n1, n2) -> n2)); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliateByCaseIds(ids); - // 转换为Map>形式 - Map> caseAffiliateMap = caseAffiliates.stream().collect(Collectors.groupingBy(CaseAffiliate::getCaseAppliId)); - for (Long id : ids) { - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); - // 查询案件信息,做必填校验,校验不通过,提示,不能提交 - StringBuilder errorMsg = new StringBuilder(); - // 必填校验 - CaseApplication caseApplication = applicationMap.get(id); - String caseNum = caseApplication.getCaseNum(); - // 基本字段校验 - if(caseApplication!=null) { - for (String baseColumn : baseColumns) { - if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseApplication, baseColumn))){ - errorMsg.append(getColumnstr(baseColumn)).append("不能为空,"); -// throw new ServiceException("必填字段未填写,请完善案件信息!"); - } - } - // 校验人员 - if(CollectionUtil.isNotEmpty(caseAffiliates)){ - List affiliateList = caseAffiliateMap.get(id); - if(CollectionUtil.isNotEmpty(affiliateList)){ - for (CaseAffiliate caseAffiliate : affiliateList) { - if(caseAffiliate.getIdentityType()==1){ - // 校验申请人 - for (String applicAffiliateColumn : applicAffiliateColumns) { - if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){ - errorMsg.append(getColumnstr(applicAffiliateColumn)).append("不能为空,"); -// throw new ServiceException("必填字段未填写,请完善案件信息!"); - } - } - }else { - // 校验被申请人 - for (String applicAffiliateColumn : dectborAffiliateColumns) { - if(StrUtil.isEmpty( ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))){ - errorMsg.append(getColumnstr(applicAffiliateColumn)).append("不能为空,"); -// throw new ServiceException("必填字段未填写,请完善案件信息!"); - } - } - } - } - } - } - } - if(StringUtils.isNotEmpty(errorMsg.toString())){ - throw new ServiceException("案件编号" + caseNum + errorMsg.toString()+"请完善案件信息!"); - } + caseApplicationService.submitCaseApplication(ids); - CaseApplication application = new CaseApplication(); - application.setId(id); - //提交立案申请 - application.setCaseStatus(CaseApplicationConstants.CASE_CHECK); - rows += caseApplicationMapper.submitCaseApplication(application); - // 新增日志 - insertCaseLog(application.getId(),currentStatus , ""); - } - - }else{ - throw new ServiceException("这个批号没有批量提交的案件"); - } - - return rows; + return success(); } @Override @Transactional - public int submitCaseApplicationCheckBatch(String batchNumber, Integer agreeOrNotCheck, String caseCheckReject) { + public AjaxResult submitCaseApplicationCheckBatch(String batchNumber, Integer agreeOrNotCheck, String caseCheckReject) { int rows = 0; CaseApplication caseApplicationsel = new CaseApplication(); caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber)); caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_CHECK); List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); List ids = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); - if(caseApplications!=null&&caseApplications.size()>0){ - for (Long id : ids) { - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(id); - String notes=""; - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - caseApplication.setAgreeOrNotCheck(agreeOrNotCheck); - if (agreeOrNotCheck == 1) { - //同意审核 - caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); - rows += caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, notes); - } else if (agreeOrNotCheck == 2) { - //拒绝审核 - notes="驳回立案申请,驳回原因:"+caseCheckReject; - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - rows += caseApplicationMapper.submitCaseApplication(caseApplication); - // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, notes); - ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); - arbitrateRecordsel.setCaseAppliId(id); - ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); - if(arbitrateRecordnew!=null){ - arbitrateRecordnew.setCaseCheckReject(caseCheckReject); - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew); - }else { - arbitrateRecordsel.setCaseCheckReject(caseCheckReject); - arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel); - } - //发短信给申请人 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - //查询案件详细信息 - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - String caseName = "仲裁"; - String caseNum = caseApplication1.getCaseNum(); - - if (identityType == 1) { - request.setPhone(affiliate.getContactTelphone()); - request.setTemplateId("2018697"); - String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseName, caseNum,caseCheckReject}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseNum); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已拒绝,拒接原因:" + caseCheckReject; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - - } - - } - } - } - } - }else{ - throw new ServiceException("这个批号没有批量审查的案件"); - } - return rows; + caseApplicationService.submitCaseApplicationCheck(ids, agreeOrNotCheck, caseCheckReject); + return success(); } @Override @@ -2742,25 +2507,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseNums = caseApplications.stream().map(CaseApplication::getCaseNum).collect(Collectors.toList()); List caseNumsnew = caseNums.stream().distinct().collect(Collectors.toList()); String caseNumsstr = caseNumsnew.stream().map(Object::toString).collect(Collectors.joining(",")); - throw new ServiceException("案件编号"+caseNumsstr+"在案件质证节点,请先进行案件质证,然后再批量组庭审核"); + throw new ServiceException("案件编号" + caseNumsstr + "在案件质证节点,请先进行案件质证,然后再批量组庭审核"); } - CaseApplication caseApplication1 = new CaseApplication(); caseApplication1.setBatchNumber(caseApplication.getBatchNumber()); caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT); List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); if (caseApplications1 != null && caseApplications1.size() > 0) { - for(CaseApplication caseApplicationse:caseApplications1){ - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); + for (CaseApplication caseApplicationse : caseApplications1) { + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); //同意组庭 if (isAgreePendTral != null && isAgreePendTral == 1) { String arbitratorId = caseApplicationse.getArbitratorId(); String arbitratorName = caseApplicationse.getArbitratorName(); List arbitrators = caseApplication.getArbitrators(); - if(arbitrators != null && arbitrators.size() > 0 && StringUtils.isEmpty(arbitratorId) && StringUtils.isEmpty(arbitratorName)){ + if (arbitrators != null && arbitrators.size() > 0 && StringUtils.isEmpty(arbitratorId) && StringUtils.isEmpty(arbitratorName)) { List ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList()); List arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList()); String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(",")); @@ -2785,10 +2549,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, ""); + insertCaseLog(caseApplication.getId(),CaseApplicationConstants. CONFIRMDED_PENDING_TRIAL_SUBMMIT, ""); } - }else{ + } else { throw new ServiceException("这个批号没有批量组庭审核的案件"); } return rows; @@ -2804,8 +2568,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); if (caseApplications != null && caseApplications.size() > 0) { - for(CaseApplication caseApplicationse:caseApplications){ - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); + for (CaseApplication caseApplicationse : caseApplications) { + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); caseApplicationse.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); caseApplicationse.setIsAgreePendTral(isAgreePendTral); if (isAgreePendTral != null && isAgreePendTral == 1) { @@ -2828,10 +2592,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { request.setTemplateId("2033619"); sendHearDateMessage(caseApplicationse, request, "2033619"); // 新增日志 - insertCaseLog(caseApplication.getId(),currentStatus , ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); } - }else{ + } else { throw new ServiceException("这个批号没有批量组庭审核的案件"); } return rows; @@ -2846,17 +2610,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1); int rows = 0; if (caseApplications != null && caseApplications.size() > 0) { - for(CaseApplication caseApplicationse:caseApplications){ - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); + for (CaseApplication caseApplicationse : caseApplications) { + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); // 秘书核验裁决书,流转到待仲裁员审核裁决书 - caseApplicationse.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); + caseApplicationse.setCaseStatus(HEAD_CHECK_ARBITRATION); rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); // ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); // arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); // 新增日志 - insertCaseLog(caseApplicationse.getId(), currentStatus, ""); + insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, ""); } - }else{ + } else { throw new ServiceException("这个批号没有批量核验裁决书的案件"); } @@ -2871,28 +2635,28 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseApplication caseApplicationsel = new CaseApplication(); caseApplicationsel.setBatchNumber(caseApplication.getBatchNumber()); - caseApplicationsel.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); + caseApplicationsel.setCaseStatus(HEAD_CHECK_ARBITRATION); List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); if (caseApplications1 != null && caseApplications1.size() > 0) { - for(CaseApplication caseApplicationse:caseApplications1){ - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); + for (CaseApplication caseApplicationse : caseApplications1) { + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); if (agreeOrNotCheck.intValue() == 1) { caseApplicationse.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION); rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); // 新增日志 - insertCaseLog(caseApplication.getId(),currentStatus, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, ""); } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord(); arbitrateRecordsel.setCaseAppliId(caseApplicationse.getId()); ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel); - if(arbitrateRecordnew!=null){ + if (arbitrateRecordnew != null) { arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion()); arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject()); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew); - }else { + } else { arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion()); arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject()); arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel); @@ -2900,37 +2664,39 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationse.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); - String notes=""; - if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())){ - notes="仲裁员驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getArbitrateReject(); + String notes = ""; + if (caseApplication.getArbitrateRecord() != null && StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getArbitrateReject())) { + notes = "仲裁员驳回裁决书,驳回原因:" + caseApplication.getArbitrateRecord().getArbitrateReject(); } // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, notes); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.HEAD_CHECK_ARBITRATION, notes); } } - }else{ + } else { throw new ServiceException("这个批号没有批量仲裁员审核裁决书的案件"); } return success(rows); } + /** * 附件上传到onlyoffice服务器 + * * @param annexPath */ @Override @Transactional - public JSONArray uploadOnlyOffice(String annexPath,Long caseId) { - annexPath=annexPath.replace("/profile/","/home/ruoyi/uploadPath/"); + public JSONArray uploadOnlyOffice(String annexPath, Long caseId) { + annexPath = annexPath.replace("/profile/", "/home/ruoyi/uploadPath/"); File file = new File(annexPath); if (file.exists()) { // 调用onlyoffice try { Map params = new HashMap<>(); params.put("file", file); - String postResult = HttpUtil.post(onlyOfficeUrl+ "/"+String.valueOf(caseId), params); - if(StrUtil.isNotEmpty(postResult)){ + String postResult = HttpUtil.post(onlyOfficeUrl + "/" + String.valueOf(caseId), params); + if (StrUtil.isNotEmpty(postResult)) { // 转为jsonArray JSONArray jsonArray = JSONArray.parseArray(postResult); @@ -2939,11 +2705,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } catch (Exception e) { throw new ServiceException("上传OnlyOffice服务器失败"); } - }else { + } else { throw new ServiceException("文件不存在"); } return null; } + @Override @Transactional public AjaxResult checkArbitrateRecordBatch(CaseApplication caseApplication) { @@ -2954,8 +2721,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationsel.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION); List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); if (caseApplications1 != null && caseApplications1.size() > 0) { - for(CaseApplication caseApplicationse:caseApplications1){ - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); + for (CaseApplication caseApplicationse : caseApplications1) { + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); if (agreeOrNotCheck.intValue() == 1) { try { //获取当前案件的裁决书 @@ -3094,7 +2861,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (SealManage manage : selectSealList) { Integer sealStatus = manage.getSealStatus(); Integer isUse = manage.getIsUse(); - if (sealStatus == 1 && isUse ==1) { + if (sealStatus == 1 && isUse == 1) { sealIdList.add(manage.getSealId()); } } @@ -3138,16 +2905,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseApplicationse.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); // 新增日志 - insertCaseLog(caseApplicationse.getId(),currentStatus, ""); + insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); rows += caseApplicationMapper.submitCaseApplication(caseApplicationse); } else if (agreeOrNotCheck.intValue() == 2) { - caseApplicationse.setCaseStatus(CaseApplicationConstants.HEAD_CHECK_ARBITRATION); - String notes=""; - if(caseApplication.getArbitrateRecord()!=null&&StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())){ - notes="部门长驳回裁决书,驳回原因:"+caseApplication.getArbitrateRecord().getDeptorReject(); + caseApplicationse.setCaseStatus(HEAD_CHECK_ARBITRATION); + String notes = ""; + if (caseApplication.getArbitrateRecord() != null && StrUtil.isNotEmpty(caseApplication.getArbitrateRecord().getDeptorReject())) { + notes = "部门长驳回裁决书,驳回原因:" + caseApplication.getArbitrateRecord().getDeptorReject(); } // 新增日志 - insertCaseLog(caseApplicationse.getId(), currentStatus, notes); + insertCaseLog(caseApplicationse.getId(), CaseApplicationConstants.CHECK_ARBITRATION, notes); rows = caseApplicationMapper.submitCaseApplication(caseApplicationse); @@ -3161,7 +2928,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } private String getColumnstr(String columnname) { - String columnstr = ""; + String columnstr = ""; switch (columnname) { case "caseName": columnstr = "案件名称"; @@ -3274,7 +3041,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public int pendTralSure(CaseApplication caseApplication) { // caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); caseApplication.setLockStatus(1); Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); @@ -3302,7 +3069,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 发送开庭日期通知短信 sendHearDateMessage(caseApplication, request, "2033619"); // 新增日志 - insertCaseLog(caseApplication.getId(), currentStatus, ""); + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); return rows; @@ -3316,12 +3083,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { */ private void sendHearDateMessage(CaseApplication caseApplication, SmsUtils.SendSmsRequest request, String templateId) { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - + if (caseApplicationselect == null) { + throw new ServiceException("案件不存在"); + } + List afflicates = selectAfflicatesByCaseId(caseApplicationselect.getId()); + if (CollectionUtil.isEmpty(afflicates)) { + throw new ServiceException("案件相关人员不存在"); + } String caseNum = caseApplicationselect.getCaseNum(); Date hearDate = caseApplicationselect.getHearDate(); String hearDatestr = ""; SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - if(hearDate!=null) { + if (hearDate != null) { hearDatestr = dateFormat.format(hearDate); } String arbitratorId = caseApplicationselect.getArbitratorId(); @@ -3374,19 +3147,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliatListeselect != null) { - for (int j = 0; j < caseAffiliatListeselect.size(); j++) { - CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j); - int identityType = caseAffiliateselect.getIdentityType(); - if (identityType == 1) { - caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName()); - } + for (int j = 0; j < afflicates.size(); j++) { + CaseAffiliateEntity caseAffiliateselect = afflicates.get(j); + if (caseAffiliateselect.getOperatorFlag() != null && caseAffiliateselect.getOperatorFlag().equals(1) && StrUtil.isNotEmpty(caseAffiliateselect.getPhone())) { //给申请人、被申请人发送短信通知 - request.setPhone(caseAffiliateselect.getContactTelphone()); + request.setPhone(caseAffiliateselect.getPhone()); // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 String name = caseAffiliateselect.getName(); if (templateId.equals("2033619")) { @@ -3418,7 +3184,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } smsRecordMapper.saveSmsSendRecord(smsSendRecord); } + } + } @@ -3453,31 +3221,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - private void assignmentCaseAffiliates(CaseApplication caseApplication, List caseAffiliatesnew, - Map deptMap, Long roleId) { - // 申请人信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate = buildApplicaInfo(caseApplication); - // 申请人(机构),需要判断部门中是否存在,不存在则新增,当身份类型为1的时候,查询时需要根据名称查询组织机构 - if (StrUtil.isNotEmpty(caseApplication.getName())) { - setApplicantOrganization(caseAffiliate, caseApplication, deptMap); - } - String s = buildAgentInfo(caseAffiliate, roleId); - if (StrUtil.isNotEmpty(s)) { - StringBuilder errorMsg = caseApplication.getErrorMsg(); - if (StrUtil.isEmpty(errorMsg)) { - errorMsg = new StringBuilder(); - } - errorMsg.append(s); - caseApplication.setErrorMsg(errorMsg); - } - caseAffiliatesnew.add(caseAffiliate); - - // 组装被申请人信息 - caseAffiliatesnew.add(buildDebtorInfo(caseApplication)); - caseApplication.setCaseAffiliates(caseAffiliatesnew); - } - private CaseAffiliate buildApplicaInfo(CaseApplication caseApplication) { // 申请人信息 CaseAffiliate caseAffiliate = new CaseAffiliate(); @@ -3639,7 +3382,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 查询最大房间号 Long maxRoomId = caseApplicationMapper.selectMaxRoomId(); - if (null == maxRoomId || maxRoomId > 4294967294L/2) { + if (null == maxRoomId || maxRoomId > 4294967294L / 2) { return 1L; } else { return maxRoomId + 1; @@ -3700,16 +3443,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return success(reservedConferenceMapper.deleteByRoomId(roomId)); } + @Transactional @Override public AjaxResult uploadCaseZipFile(MultipartFile file, Long templateId) { - return caseZipImportImpl.zipImport( file, templateId); + return caseZipImportImpl.zipImport(file, templateId); } - /** * 根据附件id修改案件id + * * @param caseAttach * @return */ @@ -3718,20 +3462,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAttachMapper.updateCaseAttach(caseAttach); return success(); } + /** * 保存onlyOffice在线编辑的文件 + * * @param * @return */ @Transactional @Override public AjaxResult saveOnlyOfficeFile(CaseAttach caseAttach) { - if(StrUtil.isNotEmpty(caseAttach.getAnnexPath())){ + if (StrUtil.isNotEmpty(caseAttach.getAnnexPath())) { String replace = caseAttach.getAnnexPath().replace("/home/ruoyi/uploadPath/", "/profile/"); - caseAttach.setAnnexName(replace); + caseAttach.setAnnexPath(replace); } - caseAttach.setAnnexPath("/home/ruoyi/uploadPath/onlyoffice/"); + // caseAttach.setAnnexPath("/home/ruoyi/uploadPath/onlyoffice/"); caseAttach.setAnnexType(3); caseAttach.setUserId(SecurityUtils.getUserId()); @@ -3743,6 +3489,538 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return AjaxResult.success(); } + /** + * 新增或编辑案件 + * + * @param caseApplication + * @return + */ + @Transactional + @Override + public AjaxResult insertOrUpdate(CaseApplicationDTO caseApplication) { + CaseAffiliateVO caseAffiliateVO = caseApplication.getAffiliate(); + if (null == caseAffiliateVO) { + throw new ServiceException("案件相关人员未填写"); + } + if (caseApplication.getId() != null) { + // 修改 + caseApplicationService.update(caseApplication); + } else { + // 新增 + caseApplicationService.insert(caseApplication); + } + return success(); + } + + /** + * 新增案件 + * + * @param caseApplication + */ + @Transactional + @Override + public void insert(CaseApplicationDTO caseApplication) { + CaseAffiliateVO caseAffiliateVO = caseApplication.getAffiliate(); + caseApplication.setCreateBy(getUsername()); + caseApplication.setVersion(1); + caseApplication.setId(IdWorkerUtil.getId()); + caseApplication.setCreateTime(new Date()); + caseApplication.setRegisterDate(new Date()); + caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + // 设置编码 + caseApplication.setCaseNum(generateCaseNum()); + // 设置批号 + caseApplication.setBatchNumber(generateBatchNumber()); + // 计算仲裁费用 + caseApplication.setFeePayable(calculateFee(caseApplication.getCaseSubjectAmount())); + caseApplication.setPaidExpenses(caseApplication.getFeePayable()); + // 新增立案申请表 + int rows = caseApplicationMapper.insert(caseApplication); + if (rows == 0) { + throw new ServiceException("新增失败"); + } + List affliates = new ArrayList<>(); + // 新增案件相关人员 + caseApplicationService.insertCaseAfflicate(caseAffiliateVO, affliates, caseApplication); + + + // 保存附件 + // 是否是压缩包导入,压缩包导入则不更新附件 + boolean isZipImport = caseApplication.getImportFlag() == null || caseApplication.getImportFlag() != 2; + List caseAttachList = caseApplication.getCaseAttachList(); + if (caseAttachList != null && caseAttachList.size() > 0) { + if (isZipImport) { + for (CaseAttach caseAttach : caseAttachList) { + caseAttach.setCaseAppliId(caseApplication.getId()); + // 修改案件附件 + caseAttachMapper.updateCaseAttach(caseAttach); + } + } else { + // 压缩包导入 + for (CaseAttach caseAttach : caseAttachList) { + caseAttach.setCaseAppliId(caseApplication.getId()); + } + caseAttachMapper.batchSave(caseAttachList); + } + } + // 新增日志 + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_INSERT, ""); + // 异步新增案件日志 + List columnValueList = caseApplication.getColumnValueList(); + ThreadPoolUtil.execute(() -> { + // 批量新增columnValue自定义字段 + if (CollectionUtil.isNotEmpty(columnValueList)) { + columnValueList.forEach(columnValue -> columnValue.setCaseId(caseApplication.getId())); + columnValueMapper.batchSave(columnValueList); + } + CaseApplication application = new CaseApplication(); + BeanUtil.copyProperties(caseApplication, application); + // 新增案件日志表 + application.setCaseAppliId(caseApplication.getId()); + application.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); + application.setCaseLogId(IdWorkerUtil.getId()); + int insertRow = caseApplicationLogMapper.insert(application); + // 插入案件相关人员表日志 + if (insertRow != 0 && CollectionUtil.isNotEmpty(affliates)) { + affliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(application.getCaseLogId())); + + caseAffiliateLogMapper.batchCaseAffiliate(affliates); + } + // 插入附件表日志 + if (CollectionUtil.isNotEmpty(caseAttachList)) { + List filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList()); + // 插入日志附件表 + if (CollectionUtil.isNotEmpty(filterList)) { + for (CaseAttach caseAttach : filterList) { + // 查询附件表 + CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); + attach.setCaseAppliLogId(application.getCaseLogId()); + caseAttachLogMapper.save(attach); + } + } + + } + // 插入columnValueLog自定义字段日志表 + if (CollectionUtil.isNotEmpty(columnValueList)) { + columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(application.getCaseLogId())); + columnValueLogMapper.batchSave(columnValueList); + + } + + + }); + } + + /** + * 设置案件相关信息 + * + * @param caseApplication + * @param affiliate + * @param groupOrder 组别 + * @param operatorCount 操作人数量 + * @param updateFlag 是否修改案件 + */ + @Transactional + public int setCaseAfflicate(List affliates, CaseApplicationDTO caseApplication, CaseAffiliateEntity affiliate, int groupOrder, int operatorCount, boolean updateFlag) { + if (affiliate == null) { + return operatorCount; + } + affiliate.setCaseAppliId(caseApplication.getId()); + boolean b = affiliate.getOrganizeFlag() != 1 && (affiliate.getRoleType() == 1 || affiliate.getRoleType() == 3) && StrUtil.isEmpty(affiliate.getEmail()); + if (b || StrUtil.isEmpty(affiliate.getName())) { + return operatorCount; + } + affiliate.setGroupOrder(groupOrder); + List sysRoles = roleMapper.selectRoleAll(); + if (CollectionUtil.isEmpty(sysRoles)) { + throw new ServiceException("角色不全,请联系管理员新增角色"); + } + Map roleMap = sysRoles.stream().collect(Collectors.toMap(SysRole::getRoleName, SysRole::getRoleId, (n1, n2) -> n2)); + + affiliate.setCaseAppliId(caseApplication.getId()); + List roleIdList = new ArrayList<>(); + switch (affiliate.getRoleType()) { + case 1: + // 申请人 + roleIdList.add(roleMap.get("申请人")); + if (affiliate.getOperatorFlag() == 1) { + // 是操作人 + roleIdList.add(roleMap.get("申请人操作人")); + } + break; + case 2: + // 申请代理人 + roleIdList.add(roleMap.get("委托代理人")); + if (affiliate.getOperatorFlag() == 1) { + // 是操作人 + roleIdList.add(roleMap.get("申请人操作人")); + } + break; + case 3: + // 被申 + roleIdList.add(roleMap.get("被申请人")); + if (affiliate.getOperatorFlag() == 1) { + // 是操作人 + roleIdList.add(roleMap.get("被申请人操作人")); + } + + break; + case 4: + // 被申代理 + roleIdList.add(roleMap.get("委托代理人")); + if (affiliate.getOperatorFlag() == 1) { + // 是操作人 + roleIdList.add(roleMap.get("被申请人操作人")); + } + break; + default: + break; + } + // 如果是申请人,则和用户表关联 + if (affiliate.getOrganizeFlag() == 0) { + caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag); + } else { + // 申请机构 + if (affiliate.getRoleType() == 1 || affiliate.getRoleType() == 3) { + affiliate.setOperatorFlag(0); + // 申请人,从缓存中判断部门是否存在 + SysDept dept = null; + if (!updateFlag) { + // 新增则根据部门名称查 + dept = sysDeptMapper.selectDeptByName(affiliate.getName()); + } else { + if (affiliate.getApplicantDeptId() != null) { + // 修改根据部门id查 + dept = sysDeptMapper.selectDeptById(affiliate.getApplicantDeptId()); + } else { + dept = sysDeptMapper.selectDeptByName(affiliate.getName()); + } + } + if (dept == null) { + // 不存在该部门,新增 + dept = new SysDept(); + dept.setParentId(0L); + dept.setDeptName(affiliate.getName()); + dept.setAncestors("0"); + dept.setOrderNum(1); + dept.setStatus("0"); + dept.setDelFlag("0"); + dept.setCode(affiliate.getCode()); + dept.setHome(affiliate.getHome()); + dept.setAddress(affiliate.getAddress()); + dept.setCompLegalPerson(affiliate.getCompLegalPerson()); + dept.setCreateBy(getUsername()); + dept.setCreateTime(new Date()); + dept.setNationality(affiliate.getNationality()); + sysDeptMapper.insertDept(dept); + } else { + // 更新部门 + dept.setCode(affiliate.getCode()); + dept.setCompLegalPerson(affiliate.getCompLegalPerson()); + dept.setUpdateBy(getUsername()); + dept.setUpdateTime(new Date()); + dept.setNationality(affiliate.getNationality()); + dept.setHome(affiliate.getHome()); + dept.setAddress(affiliate.getAddress()); + sysDeptMapper.updateDept(dept); + } + affiliate.setApplicantDeptId(dept.getDeptId()); + } else { + caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag); + } + } + affliates.add(affiliate); + // 保存人员 + caseAffiliateMapper.insert(affiliate); + if (affiliate.getOperatorFlag() != null && affiliate.getOperatorFlag() == 1) { + operatorCount++; + } + return operatorCount; + } + + /** + * 新增案件相关人员信息 + * + * @param affiliate 相关人员信息 + * @param roleIdList 角色id + * @param updateFlag 是否修改案件 + */ + @Transactional + public void insertAfficateUser(CaseAffiliateEntity affiliate, List roleIdList, boolean updateFlag) { + + if (StrUtil.isEmpty(affiliate.getEmail())) { + return; + } + SysUser user = null; + if (!updateFlag) { + // 新增案件则根据邮箱查用户 + user = sysUserMapper.selectUserByEmail(affiliate.getEmail()); + } else { + // 修改案件则根据userId查用户 + if (affiliate.getUserId() != null) { + user = sysUserMapper.selectUserById(affiliate.getUserId()); + } else { + user = sysUserMapper.selectUserByEmail(affiliate.getEmail()); + } + } + // 判断该用户是否存在 + if (user == null) { + // 不存在,则新增 + user = new SysUser(); + user.setPosition(affiliate.getPosition()); + user.setPassword(SecurityUtils.encryptPassword("abc123456")); + user.setUserName(affiliate.getEmail()); + user.setNickName(affiliate.getName()); + user.setEmail(affiliate.getEmail()); + user.setHome(affiliate.getHome()); + user.setSex(affiliate.getSex()); + user.setIdCard(affiliate.getIdCard()); + user.setBirth(affiliate.getBirth()); + user.setPhonenumber(affiliate.getPhone()); + user.setAddress(affiliate.getAddress()); + user.setIdType(affiliate.getIdType()); + user.setNationality(affiliate.getNationality()); + sysUserMapper.insertUser(user); + affiliate.setUserId(user.getUserId()); + // redis缓存 + redisCache.setCacheObject(CacheConstants.USER_KEY + user.getUserId(), user); + // 查询该角色是否存在申请人角色 + List roleIds = userRoleMapper.selectRoleIdsByUserId(user.getUserId()); + for (Long roleId : roleIdList) { + if(roleId==null){ + continue; + } + if (CollectionUtil.isEmpty(roleIds) && !roleIds.contains(roleId)) { + userRoleMapper.insertUserRole(user.getUserId(), roleId); + } + } + + } else { + // 存在的话将案件人员信息同步到用户表,更新用户表 + user.setPosition(affiliate.getPosition()); + user.setHome(affiliate.getHome()); + user.setNickName(affiliate.getName()); + user.setSex(affiliate.getSex()); + user.setIdCard(affiliate.getIdCard()); + user.setBirth(affiliate.getBirth()); + user.setPhonenumber(affiliate.getPhone()); + user.setAddress(affiliate.getAddress()); + user.setIdType(affiliate.getIdType()); + user.setNationality(affiliate.getNationality()); + user.setEmail(affiliate.getEmail()); + sysUserMapper.updateUser(user); + affiliate.setUserId(user.getUserId()); + // redis缓存 + redisCache.setCacheObject(CacheConstants.USER_KEY + user.getUserId(), user); + // 查询该角色是否存在申请人角色 + List roleIds = userRoleMapper.selectRoleIdsByUserId(user.getUserId()); + for (Long roleId : roleIdList) { + if(roleId==null){ + continue; + } + if (CollectionUtil.isEmpty(roleIds) || !roleIds.contains(roleId)) { + userRoleMapper.insertUserRole(user.getUserId(), roleId); + } + } + + } + } + + @Transactional + @Override + public void insertCaseAfflicate(CaseAffiliateVO caseAffiliateVO, List affliates, CaseApplicationDTO caseApplication) { + // 组装案件相关人员 + int appOperatorCount = 0; + int resOperatorCount = 0; + // 保存案件相关人员 + List applicant = caseAffiliateVO.getApplicant(); + List res = caseAffiliateVO.getRes(); + + if (CollectionUtil.isNotEmpty(applicant)) { + for (int i = 0; i < applicant.size(); i++) { + // 申请人 + appOperatorCount = setCaseAfflicate(affliates, caseApplication, applicant.get(i).getApplicant(), i, appOperatorCount, false); + // 申请人代理人 + appOperatorCount = setCaseAfflicate(affliates, caseApplication, applicant.get(i).getApplicantAgent(), i, appOperatorCount, false); + } + } + if (CollectionUtil.isNotEmpty(res)) { + for (int i = 0; i < res.size(); i++) { + // 申请人 + resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getRes(), i, resOperatorCount, false); + // 申请人代理人 + resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getResAgent(), i, resOperatorCount, false); + } + } + if (appOperatorCount < 1 && resOperatorCount < 1) { + throw new ServiceException("未设置申请操作人和被申请操作人"); + } else if (appOperatorCount < 1) { + throw new ServiceException("未设置申请操作人"); + } else if (resOperatorCount < 1) { + throw new ServiceException("未设置被申请操作人"); + } + } + + @Override + public List selectAfflicatesByCaseId(Long id) { + CaseAffiliateEntity affiliateEntity = new CaseAffiliateEntity(); + affiliateEntity.setCaseAppliId(id); + return caseAffiliateMapper.selectCaseAffiliate(affiliateEntity); + } + + @Override + public SysUser getUserInfo() { + SysUser sysUser = new SysUser(); + + if (SecurityUtils.getUserId() != null) { + sysUser = sysUserMapper.selectUserById(SecurityUtils.getUserId()); + + } + return sysUser; + } + + /** + * 获取批号 + * + * @return + */ + private Integer generateBatchNumber() { + + Integer batchNumber = caseApplicationMapper.selectMaxBatchNumber(); + AtomicInteger maxBatchNumber = new AtomicInteger(); + if (batchNumber == null) { + maxBatchNumber.set(1); + + } else { + maxBatchNumber.set(batchNumber + 1); + + } + return maxBatchNumber.get(); + } + + /** + * 计算仲裁费用 + * + * @param caseSubjectAmount 案件标的 + * @return + */ + private BigDecimal calculateFee(BigDecimal caseSubjectAmount) { + if (caseSubjectAmount.equals(BigDecimal.ZERO)) { + return BigDecimal.ZERO; + } + BigDecimal feeRate = new BigDecimal(0.01); + return caseSubjectAmount.multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); + + } + + /** + * 修改案件 + * + * @param caseApplication + */ + @Transactional + + @Override + public void update(CaseApplicationDTO caseApplication) { + caseApplication.setFeePayable(calculateFee(caseApplication.getCaseSubjectAmount())); + caseApplication.setPaidExpenses(caseApplication.getFeePayable()); + caseApplication.setUpdateBy(SecurityUtils.getUsername()); + caseApplication.setUpdateTime(new Date()); + Integer updateSubmitStatus = 0; + // 立案申请状态直接修改主表信息 + if (caseApplication.getCaseStatus() != null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) { + // 修改内置字段 + caseApplicationMapper.update(caseApplication); + if (CollectionUtil.isNotEmpty(caseApplication.getColumnValueList())) { + // 修改自定义字段 + for (ColumnValue columnValue : caseApplication.getColumnValueList()) { + if (StrUtil.isNotEmpty(columnValue.getValue())) { + columnValueMapper.updateColumnValue(columnValue); + } + } + } + } else { + // 修改记录表状态为已提交修改的内容 + updateSubmitStatus = UpdateSubmitStatus.COMMITTED.getCode(); + } + CaseApplication application = new CaseApplication(); + BeanUtil.copyProperties(caseApplication, application); + application.setUpdateSubmitStatus(updateSubmitStatus); + CaseAffiliateVO caseAffiliateVO = caseApplication.getAffiliate(); + List affliates = new ArrayList<>(); + // 删除已存在的人员 + caseAffiliateMapper.deleteByCaseId(caseApplication.getId()); + // 新增案件相关人员 + caseApplicationService.insertCaseAfflicate(caseAffiliateVO, affliates, caseApplication); + // 保存附件 + if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) { + for (CaseAttach caseAttach : caseApplication.getCaseAttachList()) { + if(caseAttach==null){ + continue; + } + caseAttach.setCaseAppliId(caseApplication.getId()); + caseAttachMapper.updateCaseAttach(caseAttach); + } + } + // 修改自定义字段 + if (CollectionUtil.isNotEmpty(caseApplication.getColumnValueList())) { + columnValueMapper.batchUpdate(caseApplication.getColumnValueList()); + } + + // 根据案件id查询最新版本号 + Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId()); + if (maxVersion == null) { + maxVersion = 1; + } + caseApplication.setVersion(maxVersion + 1); + LoginUser loginUser = getLoginUser(); + // 异步新增案件日志 + List columnValueList = caseApplication.getColumnValueList(); + ThreadPoolUtil.execute(() -> { + //新增案件日志记录 + insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_EDIT, "", loginUser); + + // 批量新增columnValue自定义字段 + if (CollectionUtil.isNotEmpty(columnValueList)) { + columnValueList.forEach(columnValue -> columnValue.setCaseId(caseApplication.getId())); + columnValueMapper.batchSave(columnValueList); + } + // 新增案件日志表 + application.setCaseAppliId(caseApplication.getId()); + // application.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); + application.setCaseLogId(IdWorkerUtil.getId()); + int insertRow = caseApplicationLogMapper.insert(application); + // 插入案件相关人员表日志 + if (insertRow != 0 && CollectionUtil.isNotEmpty(affliates)) { + affliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(application.getCaseLogId())); + + caseAffiliateLogMapper.batchCaseAffiliate(affliates); + } + // 插入附件表日志 + if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) { + List filterList = caseApplication.getCaseAttachList().stream().filter(c -> c!=null && c.getAnnexType().equals(2)).collect(Collectors.toList()); + // 插入日志附件表 + if (CollectionUtil.isNotEmpty(filterList)) { + for (CaseAttach caseAttach : filterList) { + // 查询附件表 + CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId()); + attach.setCaseAppliLogId(application.getCaseLogId()); + caseAttachLogMapper.save(attach); + } + } + + } + // 插入columnValueLog自定义字段日志表 + if (CollectionUtil.isNotEmpty(columnValueList)) { + columnValueList.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(application.getCaseLogId())); + columnValueLogMapper.batchSave(columnValueList); + + } + + + }); + } + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index fc4b082..1d8cbdc 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.deepoove.poi.data.PictureRenderData; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; @@ -8,6 +9,7 @@ import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.WordUtil; import com.ruoyi.wisdomarbitrate.domain.*; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.service.IAdjudicationService; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; @@ -56,6 +58,8 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { private RedisCache redisCache; @Autowired private ICaseApplicationService caseApplicationService; + @Autowired + private ICaseArbitrateService caseArbitrateService; @Override @Transactional @@ -65,8 +69,11 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { if (caseApplication1 == null) { return AjaxResult.success(); } - Integer currentStatus = caseApplication1.getCaseStatus(); + // Integer currentStatus = caseApplication1.getCaseStatus(); Integer arbitratMethodOriral = caseApplication.getArbitratMethod(); + if (arbitratMethodOriral == null) { + return AjaxResult.error("请选择仲裁方式"); + } String caseNum = caseApplication1.getCaseNum(); if (opinion == 0) { //拒绝 @@ -77,46 +84,41 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { //修改案件状态为待修改开庭时间 // caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); + } else { caseApplication1.setArbitratMethod(2); //修改案件状态为待书面审理 caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); + } - } else if (opinion == 1 ) { + } else if (opinion == 1) { if (arbitratMethodOriral == 2) { //修改案件状态为待书面审理 caseApplication1.setArbitratMethod(2); caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); + } else { //修改案件状态为待修改开庭时间 caseApplication1.setArbitratMethod(1); caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, ""); + } - }else if (opinion == 2) { + } else if (opinion == 2) { if (arbitratMethodNow == 2) { //修改案件状态为待书面审理 caseApplication1.setArbitratMethod(2); caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); + } else { //修改案件状态为待修改开庭时间 caseApplication1.setArbitratMethod(1); caseApplication1.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); + } } @@ -126,14 +128,22 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { String arbitratMethodStr = caseApplication1.getArbitratMethod() == 1 ? "开庭审理" : "书面审理"; //发送短信通知 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication1.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息 + //获取案件关联人信息 + List caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(caseApplication1.getId()); if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { + ArrayList operatorList = new ArrayList<>(); + // 申请操作人 + Optional applicantAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + // 被申请操作人 + Optional resAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); + if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) { + throw new ServiceException("未找到案件操作人员"); + } + operatorList.add(applicantAffiliateOpt.get()); + operatorList.add(resAffiliateOpt.get()); + for (CaseAffiliateEntity affiliate : operatorList) { request.setTemplateId("1931000"); - request.setPhone(affiliate.getContactTelphone()); + request.setPhone(affiliate.getPhone()); // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 // 1931000 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。 String name = affiliate.getName(); @@ -148,17 +158,17 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,仲裁方式已确定为" + arbitratMethodStr + ",请知晓,如非本人操作,请忽略本短信。"; smsSendRecord.setSendContent(content); smsSendRecord.setCreateBy(getUsername()); - if (aBoolean){ + if (aBoolean) { smsSendRecord.setSendStatus(1); - }else { + } else { smsSendRecord.setSendStatus(0); } smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } - - return AjaxResult.success("审核成功"); } + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION_METHOD, ""); return AjaxResult.success(); } @@ -170,68 +180,13 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { caseApplicationsel.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); List caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel); if (caseApplications1 != null && caseApplications1.size() > 0) { - for(CaseApplication caseApplicationse:caseApplications1){ - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplicationse.getId()); - String caseNum = caseApplicationse.getCaseNum(); - Integer arbitratMethod = caseApplication.getArbitratMethod(); - if (arbitratMethod == 1) { - caseApplicationse.setArbitratMethod(1); - caseApplicationse.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); - - }else if (arbitratMethod == 2) { - //修改案件状态为待书面审理 - caseApplicationse.setArbitratMethod(2); - caseApplicationse.setCaseStatus(CaseApplicationConstants.PENDING_WRIITEN_HEAR); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); - - } - int i = caseApplicationMapper.submitCaseApplication(caseApplicationse); - - if (i > 0) { - String arbitratMethodStr = caseApplicationse.getArbitratMethod() == 1 ? "开庭审理" : "书面审理"; - //发送短信通知 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplicationse.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息 - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - request.setTemplateId("1931000"); - request.setPhone(affiliate.getContactTelphone()); - // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 - // 1931000 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplicationse.getId()); - smsSendRecord.setCaseNum(caseApplicationse.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,仲裁方式已确定为" + arbitratMethodStr + ",请知晓,如非本人操作,请忽略本短信。"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean){ - smsSendRecord.setSendStatus(1); - }else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } - } - - - } + for (CaseApplication caseApplicationse : caseApplications1) { + caseArbitrateService.examineArbitrateMethod(caseApplicationse, caseApplication.getOpinion(), caseApplication.getArbitratMethod()); } - }else{ + } else { throw new ServiceException("这个批号没有批量审核仲裁方式的案件"); } @@ -254,7 +209,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); //案件日志表里添加数据 // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), caseApplication1.getCaseStatus(), ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); // 生成裁决书 CaseApplication application = new CaseApplication(); @@ -266,7 +221,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { } - }else{ + } else { throw new ServiceException("这个批号没有批量书面审理的案件"); } return AjaxResult.success(); @@ -276,7 +231,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { @Override @Transactional public AjaxResult writtenHear(CaseIds caseIds) { - if (caseIds!=null){ + if (caseIds != null) { List ids = caseIds.getIds(); for (Long caseId : ids) { //查询案件详情 @@ -289,321 +244,28 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); if (arbitrateRecord1 != null) { int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); - if (i > 0) { - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), caseApplication1.getCaseStatus(), ""); - - } } else { //提交仲裁结果 int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecord); - if (i > 0) { - - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), caseApplication1.getCaseStatus(), ""); - } } // 生成裁决书 CaseApplication application = new CaseApplication(); application.setId(caseId); adjudicationService.createDocument(application); - //修改案件状态 - caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); - int i = caseApplicationMapper.submitCaseApplication(caseApplication1); - + //修改案件状态 + caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); + int i = caseApplicationMapper.submitCaseApplication(caseApplication1); +// 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_WRIITEN_HEAR, ""); } + + return AjaxResult.success("审理成功"); } return AjaxResult.error("请检查参数"); } - //生成裁决书 - private Boolean generateAward(Long id) { - try { - Map datas = new HashMap<>(); - if (id == null) { - return null; - } - //获取案件详细信息 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - //生成编码 - String equipmentNo = getNewEquipmentNo(); - datas.put("num", equipmentNo); - //获取仲裁记录表里的相关信息 - ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); - arbitrateRecord.setCaseAppliId(id); - ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); - //获取案件关联人信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - List nameAgentList = new ArrayList<>(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - if (identityType == 1) { //申请人 - datas.put("appName", affiliate.getName()); - datas.put("appAddress", affiliate.getResidenAffili()); - datas.put("appContactAddress", affiliate.getContactAddress()); - datas.put("appLegalPerson", affiliate.getCompLegalPerson()); - datas.put("appLegalPersonTitle", affiliate.getCompLegalperPost()); - datas.put("appAgentName", affiliate.getNameAgent()); - datas.put("appAgentTitle", affiliate.getAppliAgentTitle()); - nameAgentList.add(affiliate.getNameAgent()); - } else if (identityType == 2) { //被申请人 - datas.put("resName", affiliate.getName()); - datas.put("resAddress", affiliate.getResidenAffili()); - String responSex = affiliate.getResponSex(); - if (responSex.equals("0")) { - datas.put("resSex", "男"); - } else if (responSex.equals("1")){ - datas.put("resSex", "女"); - }else { - datas.put("resSex", "未知"); - } - Date responBirth = affiliate.getResponBirth(); - if (responBirth != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String responBirthStr = sdf.format(responBirth); - datas.put("resDateOfBirth", responBirthStr); - - } - - datas.put("resContactAddress", affiliate.getContactAddress()); - nameAgentList.add(affiliate.getNameAgent()); - } - } - } - Date createTime = caseApplication1.getCreateTime(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - // 将日期格式化为字符串 - String createTimeStr = sdf.format(createTime); - datas.put("submissionDate", createTimeStr); - Date registerDate = caseApplication1.getRegisterDate(); - String registerDateStr = sdf.format(registerDate); - datas.put("acceptDate", registerDateStr); - //反请求 - Integer adjudicaCounter = caseApplication1.getAdjudicaCounter(); - String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + - "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + - "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; - if (adjudicaCounter == null) { - datas.put("counterclaim", null); - } else if (adjudicaCounter == 1) { - datas.put("counterclaim", counterclaim); - } else { - datas.put("counterclaim", null); - } - //财产保全 - Integer properPreser = caseApplication1.getProperPreser(); - String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + - "第二十八条之规定,将该申请提交至法院。"; - if (properPreser == null) { - datas.put("preservation", null); - } else if (properPreser == 1) { - datas.put("preservation", preservation); - } else { - datas.put("preservation", null); - } - //管辖权异议 - Integer objectiJuris = caseApplication1.getObjectiJuris(); - String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《XX管辖异议申请书》,认为XXXXXX" + - ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; - if (objectiJuris == null) { - datas.put("jurisdictionalObjection", null); - } else if (objectiJuris == 1) { - datas.put("jurisdictionalObjection", jurisdictionalObjection); - } else { - datas.put("jurisdictionalObjection", null); - } - String arbitratorName = caseApplication1.getArbitratorName(); - datas.put("arbitratorName", arbitratorName); - Integer arbitratMethod = caseApplication1.getArbitratMethod(); - Date hearDate = caseApplication1.getHearDate(); - if (hearDate != null) { - String hearDateStr = sdf.format(hearDate); - //线上开庭时 - if (arbitratMethod == 1) { - String onLine1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"; - String onLine2 = "通过仲裁委智慧仲裁平台开庭审理了本案。"; - datas.put("onLine1", onLine1); - datas.put("hearDate", hearDateStr); - datas.put("onLine2", onLine2); - } else { - //书面仲裁时 - String written1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"; - String written2 = "在仲裁委所在地开庭审理了本案。"; - datas.put("written1", written1); - datas.put("hearDate1", hearDateStr); - datas.put("written2", written2); - } - } - Integer isAbsence = caseApplication1.getIsAbsence(); - if (isAbsence == null) { - datas.put("absent1", null); - datas.put("absent2", null); - datas.put("absent3", null); - datas.put("absent4", null); - datas.put("absent5", null); - datas.put("attend1", null); - datas.put("attend2", null); - datas.put("attend3", null); - datas.put("attend4", null); - datas.put("attend5", null); - datas.put("attend6", null); - datas.put("attend7", null); - datas.put("appAgentName1", null); - datas.put("appAgentName2", null); - datas.put("resAgentName", null); - } else if (isAbsence == 1) { - //缺席审理 - String absent1 = "申请人的特别授权委托代理人"; - String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + - "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。"; - String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," + - "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。"; - String absent4 = "(二/三)当事人提供的证据材料\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; - String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; - datas.put("absent1", absent1); - datas.put("absent2", absent2); - datas.put("absent3", absent3); - datas.put("absent4", absent4); - datas.put("absent5", absent5); - datas.put("appAgentName1", nameAgentList.get(0)); - } else { - //出席审理 - String attend1 = "申请人的特别授权委托代理人"; - String attend2 = "和被申请人本人/的特别授权委托代理人"; - String attend3 = "出席了庭审。"; - String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" + - "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," + - "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," + - "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。"; - String attend5 = "(二)被申请人的答辩意见"; - String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; - String attend7 = "被申请人对上述材料的质证意见为:"; - datas.put("attend1", attend1); - datas.put("attend2", attend2); - datas.put("attend3", attend3); - datas.put("attend4", attend4); - datas.put("attend5", attend5); - datas.put("attend6", attend6); - datas.put("attend7", attend7); - datas.put("responCrossOpin", caseApplication1.getResponCrossOpin()); - datas.put("appAgentName2", nameAgentList.get(0)); - datas.put("resAgentName", nameAgentList.get(1)); - if (arbitratMethod == 1) { - //被申出席+开庭 - String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第五十一条的规定,裁决如下:"; - datas.put("attend8", attend8); - } else { - //被申出席+书面 - String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第五十一条、第五十八条的规定,裁决如下:"; - datas.put("attend9", attend9); - } - } - datas.put("claims", caseApplication1.getArbitratClaims()); - datas.put("request", caseApplication1.getRequestRule()); - CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); - List caseAttachList1 = caseApplication2.getCaseAttachList(); - if (caseAttachList1 != null && caseAttachList1.size() > 0) { - for (CaseAttach caseAttach : caseAttachList1) { - if (caseAttach.getAnnexType() == 6) { //被申请人证据材料 - String annexName = caseAttach.getAnnexName(); - boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); - if (isImageFile) { - String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); - System.out.println("路径是===========" + annexPath); - PictureRenderData pictureRenderData = WordUtil - .rebuildImageContent(100, 100, null, annexPath); - datas.put("resEvidenceMaterial", pictureRenderData); - } - } else if (caseAttach.getAnnexType() == 2) { //申请人证据材料 - String annexName = caseAttach.getAnnexName(); - boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); - if (isImageFile) { - String annexPath = "/home/ruoyi" + caseAttach.getAnnexPath(); - System.out.println("路径是===========" + annexPath); - PictureRenderData pictureRenderData = WordUtil - .rebuildImageContent(100, 100, null, annexPath); - //申请人证据材料 - datas.put("appEvidenceMaterial", pictureRenderData); - } - } - } - } - datas.put("applicaCrossOpin", "被申请人证据不足,无法说明事实"); - datas.put("factDetermi", "被申请人欠款属实"); - datas.put("arbitrateThink", " 被申请人应按约定还款"); - datas.put("rulingFollows", "被申请人依法偿还申请人欠款"); - LocalDate now = LocalDate.now(); - String year = Integer.toString(now.getYear()); - datas.put("year", year); - String month = String.format("%02d", now.getMonthValue()); - String day = String.format("%02d", now.getDayOfMonth()); - String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx"; - //String modalFilePath = "D:/develop/新裁决书模板.docx"; - String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; - //String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day; - String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx"; - String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName; - String resultFilePath = saveFolderPath + "/" + fileName; - // 创建日期目录 - File saveFolder = new File(saveFolderPath); - if (!saveFolder.exists()) { - saveFolder.mkdirs(); - } - Path sourcePath = new File(modalFilePath).toPath(); - Path destinationPath = new File(resultFilePath).toPath(); - Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING); - String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath); - File file = new File(docFilePath); - if (file.exists()) { - InputStream in = new FileInputStream(file); - XWPFDocument xwpfDocument = new XWPFDocument(in); - WordUtil.changeText(xwpfDocument); - } - String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(3) - .build(); - //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增 - CaseAttach caseAttach1 = new CaseAttach(); - caseAttach1.setAnnexType(3); - caseAttach1.setCaseAppliId(id); - List caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach1); - if (caseAttachList != null && caseAttachList.size() > 0) { - //之前已经生成过了,更新 - caseAttachMapper.updateCaseAttachBycaseid(caseAttach); - } else { - //之前没生成过,新增 - int i = caseAttachMapper.save(caseAttach); - if (i > 0) { - if (arbitrateRecord1 != null) { - Long annexId = caseAttach.getAnnexId(); - //将附件id保存到仲裁记录表里面 - arbitrateRecord1.setAnnexId(annexId); - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1); - } - } - } - return Boolean.TRUE; - } catch (IOException e) { - return Boolean.FALSE; - } - } public String getNewEquipmentNo() { Object awardNum = redisCache.getCacheObject("awardNum"); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index afce097..b787d12 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -59,77 +59,77 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { @Autowired private ICaseApplicationService caseApplicationService; - @Override - @Transactional - public AjaxResult getCaseDetailsById(Long id, String userName) { - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(id); - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplication1 != null) { - CaseDetailVO caseDetailVO = new CaseDetailVO(); - BeanUtils.copyProperties(caseApplication1, caseDetailVO); - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - for (CaseAffiliate affiliate : caseAffiliates) { - if (affiliate.getName() != null) { - String name = affiliate.getName(); - //判断当前登录人和案件关联人姓名是否一致 - if (name.equals(userName)) { //一致,将案件关联人的身份类型赋给当前登录人 - caseDetailVO.setIdentityType(affiliate.getIdentityType()); - } - } - if (affiliate.getIdentityType() == 1) { //申请人 - caseDetailVO.setApplicantName(affiliate.getName()); - } else { - caseDetailVO.setRespondentName(affiliate.getName()); - } - //根据案件id查询案件证据材料 - List evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id); - if (evidenceMaterialList != null && evidenceMaterialList.size() > 0) { -// for (CaseAttach caseAttach : evidenceMaterialList) { -// //根据附件类型决定返回的路径 -// Integer annexType = caseAttach.getAnnexType(); -// if (annexType != 1){ -// String path = caseAttach.getAnnexName(); -// String prefix = "/profile"; -// int startIndex = path.indexOf(prefix); -// startIndex += prefix.length(); -// String extractedPath = "/uploadPath" + path.substring(startIndex); -// caseAttach.setAnnexPath(extractedPath); -// }else { -// String annexPath = caseAttach.getAnnexPath(); -// String result = annexPath.replace("/home/ruoyi", ""); -// caseAttach.setAnnexPath(result); -// } +// @Override +// @Transactional +// public AjaxResult getCaseDetailsById(Long id, String userName) { +// CaseApplication caseApplication = new CaseApplication(); +// caseApplication.setId(id); +// CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); +// if (caseApplication1 != null) { +// CaseDetailVO caseDetailVO = new CaseDetailVO(); +// BeanUtils.copyProperties(caseApplication1, caseDetailVO); +// CaseAffiliate caseAffiliate = new CaseAffiliate(); +// caseAffiliate.setCaseAppliId(id); +// List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); +// for (CaseAffiliate affiliate : caseAffiliates) { +// if (affiliate.getName() != null) { +// String name = affiliate.getName(); +// //判断当前登录人和案件关联人姓名是否一致 +// if (name.equals(userName)) { //一致,将案件关联人的身份类型赋给当前登录人 +// caseDetailVO.setIdentityType(affiliate.getIdentityType()); // } - - for (CaseAttach caseAttach : evidenceMaterialList) { - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - if(startIndex!=-1) { - startIndex += prefix.length(); - - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseAttach.setAnnexPath(annexPath); - } - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } - - - } - - } - caseDetailVO.setEvidenceMaterialList(evidenceMaterialList); - } - return AjaxResult.success(caseDetailVO); - } - return null; - } +// } +// if (affiliate.getIdentityType() == 1) { //申请人 +// caseDetailVO.setApplicantName(affiliate.getName()); +// } else { +// caseDetailVO.setRespondentName(affiliate.getName()); +// } +// //根据案件id查询案件证据材料 +// List evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id); +// if (evidenceMaterialList != null && evidenceMaterialList.size() > 0) { +//// for (CaseAttach caseAttach : evidenceMaterialList) { +//// //根据附件类型决定返回的路径 +//// Integer annexType = caseAttach.getAnnexType(); +//// if (annexType != 1){ +//// String path = caseAttach.getAnnexName(); +//// String prefix = "/profile"; +//// int startIndex = path.indexOf(prefix); +//// startIndex += prefix.length(); +//// String extractedPath = "/uploadPath" + path.substring(startIndex); +//// caseAttach.setAnnexPath(extractedPath); +//// }else { +//// String annexPath = caseAttach.getAnnexPath(); +//// String result = annexPath.replace("/home/ruoyi", ""); +//// caseAttach.setAnnexPath(result); +//// } +//// } +// +// for (CaseAttach caseAttach : evidenceMaterialList) { +// String annexName = caseAttach.getAnnexName(); +// String prefix = "/profile"; +// int startIndex = annexName.indexOf(prefix); +// if(startIndex!=-1) { +// startIndex += prefix.length(); +// +// String annexPath = "/uploadPath" + annexName.substring(startIndex); +// caseAttach.setAnnexPath(annexPath); +// } +// int startIndexnew = annexName.lastIndexOf("/"); +// if (startIndexnew != -1) { +// String annexNamenew = annexName.substring(startIndexnew + 1); +// caseAttach.setAnnexName(annexNamenew); +// } +// +// +// } +// +// } +// caseDetailVO.setEvidenceMaterialList(evidenceMaterialList); +// } +// return AjaxResult.success(caseDetailVO); +// } +// return null; +// } @Override @Transactional @@ -138,10 +138,12 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { if (file.isEmpty()) { return AjaxResult.error("请选择要上传的文件"); } + AjaxResult success = AjaxResult.success(); try { String filePath = RuoYiConfig.getUploadPath(); // 上传 String fileName = FileUploadUtils.upload(filePath, file); + String name = file.getOriginalFilename(); String suffix = getFileExtension(fileName); if(StrUtil.isNotEmpty(suffix)&& suffix.contains("doc")){ // 上传到onlyoffice @@ -149,30 +151,47 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { if(jsonArray!=null && jsonArray.size() > 0) { for (Object obj : jsonArray) { JSONObject jsonObject = (JSONObject) obj; - CaseAttach caseAttach = CaseAttach.builder() + String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):""; + path=path.replace("/home/ruoyi/uploadPath/","/profile/"); + name = jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):""; + CaseAttach caseAttach = CaseAttach.builder() .caseAppliId(id) .annexType(annexType) - .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"") + .annexName(name) .onlyOfficeFileId(jsonObject.getString("fileId")) + .annexPath(path) .build(); - if(jsonObject.get("filePath")!=null){ - String officePath = jsonObject.getString("filePath"); - String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); - caseAttach.setAnnexPath(replace); - +// if(jsonObject.get("filePath")!=null){ +// String officePath = jsonObject.getString("filePath"); +// String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); +// caseAttach.setAnnexPath(replace); +// +// } + if(annexType!=null && annexType.equals(8)){ + // 缴费单,先删除 + caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,annexType); } caseAttachMapper.save(caseAttach); + success.put("annexId", caseAttach.getAnnexId()); + success.put("annexType", caseAttach.getAnnexType()); } } }else { + filePath=fileName.replace("/home/ruoyi/uploadPath/","/profile/"); + if(annexType!=null && annexType.equals(8)){ + // 缴费单,先删除 + caseAttachMapper.deleteCaseAttachByCasedIdAndType(id,annexType); + } CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) - .annexName(fileName) + .annexName(name) .annexPath(filePath) .annexType(annexType) .userId(userId) .userName(userName) .build(); int count = caseAttachMapper.save(caseAttach); + success.put("annexId", caseAttach.getAnnexId()); + success.put("annexType", caseAttach.getAnnexType()); } if ( annexType != null && annexType != 8) { if (id != null) { @@ -183,7 +202,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { caseApplicationMapper.submitCaseApplication(caseApplication); } } - return AjaxResult.success(); + return success; } catch (IOException e) { e.printStackTrace(); } @@ -195,49 +214,49 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { @Autowired IdentityAuthenticationMapper identityAuthenticationMapper; - @Override - public List getCaseListAll(Integer caseStatus) { - // 是否为超级管理员 - int adMinFlag=0; - String identityNum = ""; - IdentityAuthentication authentication = new IdentityAuthentication(); - LoginUser loginUser = SecurityUtils.getLoginUser(); - // 查询该用户的角色 - // 查询登录人手机号 - SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId()); - String username = sysUser.getUserName(); - List roles = sysUser.getRoles(); - if(CollectionUtil.isNotEmpty(roles)){ - for (SysRole role : roles) { - if(role.getRoleName().equals("超级管理员") - ){ - // 超级管理员可查看所有待案件质证的案件 - adMinFlag=1; - break; - } - } - } -// if(adMinFlag!=1) { -// authentication.setUserName(username); -// IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication); -// if (authentication1 != null) { -// identityNum = authentication1.getIdentityNo(); -// } -// } - String phone=sysUser.getPhonenumber(); - List caseStatusList = Arrays.asList(caseStatus); -// return getCaseEvidenceVOList(identityNum, caseStatusList, 2); - return getCaseEvidenceVOListByPhone(phone, caseStatusList, 2); - } +// @Override +// public List getCaseListAll(Integer caseStatus) { +// // 是否为超级管理员 +// int adMinFlag=0; +// String identityNum = ""; +// IdentityAuthentication authentication = new IdentityAuthentication(); +// LoginUser loginUser = SecurityUtils.getLoginUser(); +// // 查询该用户的角色 +// // 查询登录人手机号 +// SysUser sysUser = sysUserMapper.selectUserById(loginUser.getUserId()); +// String username = sysUser.getUserName(); +// List roles = sysUser.getRoles(); +// if(CollectionUtil.isNotEmpty(roles)){ +// for (SysRole role : roles) { +// if(role.getRoleName().equals("超级管理员") +// ){ +// // 超级管理员可查看所有待案件质证的案件 +// adMinFlag=1; +// break; +// } +// } +// } +//// if(adMinFlag!=1) { +//// authentication.setUserName(username); +//// IdentityAuthentication authentication1 = identityAuthenticationMapper.selectIdentityAuthentication(authentication); +//// if (authentication1 != null) { +//// identityNum = authentication1.getIdentityNo(); +//// } +//// } +// String phone=sysUser.getPhonenumber(); +// List caseStatusList = Arrays.asList(caseStatus); +//// return getCaseEvidenceVOList(identityNum, caseStatusList, 2); +// return getCaseEvidenceVOListByPhone(phone, caseStatusList, 2); +// } @Override public AjaxResult evidenceConfirmation(CaseApplication caseApplication) { - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); + // Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseApplication.getId()); caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); int i = caseApplicationMapper.submitCaseApplication(caseApplication); if (i > 0) { // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),currentStatus, ""); +// CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants., ""); return AjaxResult.success("证据确认成功"); } @@ -275,7 +294,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { int i = caseApplicationMapper.submitCaseApplication(caseApplication1); if (i > 0) { // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), caseStatus, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); return AjaxResult.success("提交成功"); } @@ -291,6 +310,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { for (MultipartFile file : files) { // 上传 String fileName = FileUploadUtils.upload(filePath, file); + String name=file.getOriginalFilename(); String suffix = getFileExtension(fileName); if (StrUtil.isNotEmpty(suffix) && suffix.contains("doc")) { // 上传onlyoffice @@ -298,25 +318,24 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { if(jsonArray!=null && jsonArray.size() > 0) { for (Object obj : jsonArray) { JSONObject jsonObject = (JSONObject) obj; + String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):""; + // name = jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):""; + path=path.replace("/home/ruoyi/uploadPath/","/profile/"); + CaseAttach caseAttach = CaseAttach.builder() .caseAppliId(id) .annexType(annexType) - .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"") - + .annexName(name) + .annexPath(path) .onlyOfficeFileId(jsonObject.getString("fileId")) .build(); - if(jsonObject.get("filePath")!=null){ - String officePath = jsonObject.getString("filePath"); - String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); - caseAttach.setAnnexPath(replace); - - } caseAttachMapper.save(caseAttach); } } }else { + filePath=fileName.replace("/home/ruoyi/uploadPath/","/profile/"); CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) - .annexName(fileName) + .annexName(name) .annexPath(filePath) .annexType(annexType) .userId(userId) @@ -334,10 +353,11 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { } // 给秘书发送短信 // 根据caseid查询该案件的法律顾问,根据案件id查申请表,查到申请机构id,然后拿申请机构id查询在哪个人下并且角色要是法律顾问 - CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(id, 1); - if(caseAffiliate!= null && StrUtil.isNotEmpty(caseAffiliate.getApplicationOrganId())){ - List userList= sysUserMapper.selectByDeptIdAndRole(caseAffiliate.getApplicationOrganId(),"法律顾问"); - if(CollectionUtil.isNotEmpty(userList)){ +// CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(id, 1); +// if(caseAffiliate!= null && StrUtil.isNotEmpty(caseAffiliate.getApplicationOrganId())){ +// List userList= sysUserMapper.selectByDeptIdAndRole(caseAffiliate.getApplicationOrganId(),"法律顾问"); + SysUser user= sysUserMapper.selectUserByRole("法律顾问"); + if(user!=null){ // 新增短信记录 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); // 1992106 普通短信 修改证据资料通知 尊敬的{1}用户,您的{2}仲裁案件,有新的证据上传,请知晓,如非本人操作,请忽略本短信。 @@ -345,13 +365,13 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); caseApplication = caseApplicationMapper.selectCaseApplication(caseApplication); - for (SysUser user : userList) { + request.setPhone(user.getPhonenumber()); request.setTemplateParamSet(new String[]{user.getNickName(),caseApplication.getCaseNum()}); Boolean aBoolean = SmsUtils.sendSms(request); //保存短信发送记录 SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); + smsSendRecord.setCaseId(id); smsSendRecord.setCaseNum(caseApplication.getCaseNum()); smsSendRecord.setPhone(request.getPhone()); @@ -365,10 +385,10 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { smsSendRecord.setSendStatus(0); } smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } + } - } + return AjaxResult.success("上传成功"); @@ -383,17 +403,13 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication); if (CollectionUtil.isNotEmpty(caseAttachList)) { for (CaseAttach caseAttach : caseAttachList) { - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseAttach.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); + String annexPath = caseAttach.getAnnexPath(); + if(StrUtil.isEmpty(annexPath)){ + continue; } + caseAttach.setAnnexPath(annexPath); + caseAttach.setAnnexName(caseAttach.getAnnexName()); + } return AjaxResult.success(caseAttachList); } @@ -463,9 +479,10 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { String filePath = RuoYiConfig.getUploadPath(); // 上传 String fileName = FileUploadUtils.upload(filePath, file); + fileName=fileName.replace("/home/ruoyi/uploadPath/","/profile/"); CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) - .annexName(fileName) - .annexPath(filePath) + .annexName(file.getOriginalFilename()) + .annexPath(fileName) .annexType(annexType) .userId(userId) .userName(username) @@ -517,44 +534,44 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { return getChildList(list, t).size() > 0; } - private List getCaseEvidenceVOList(String identityNum, List caseStatusList, Integer identityType) { - List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType,null,SecurityUtils.getUsername()); - if (caseListByRespondent != null && caseListByRespondent.size() > 0) { - for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { - //根据案件id查询姓名 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - for (CaseAffiliate affiliate : caseAffiliates) { - if (affiliate.getIdentityType() == 1) { //申请人 - caseEvidenceVO.setApplicantName(affiliate.getName()); - } else { - caseEvidenceVO.setRespondentName(affiliate.getName()); - } - } - } - return caseListByRespondent; - } - return null; - } - private List getCaseEvidenceVOListByPhone(String phone, List caseStatusList, Integer identityType) { - List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(null, caseStatusList, identityType,phone,SecurityUtils.getUsername()); - if (caseListByRespondent != null && caseListByRespondent.size() > 0) { - for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { - //根据案件id查询姓名 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - for (CaseAffiliate affiliate : caseAffiliates) { - if (affiliate.getIdentityType() == 1) { //申请人 - caseEvidenceVO.setApplicantName(affiliate.getName()); - } else { - caseEvidenceVO.setRespondentName(affiliate.getName()); - } - } - } - return caseListByRespondent; - } - return null; - } +// private List getCaseEvidenceVOList(String identityNum, List caseStatusList, Integer identityType) { +// List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType,null,SecurityUtils.getUsername()); +// if (caseListByRespondent != null && caseListByRespondent.size() > 0) { +// for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { +// //根据案件id查询姓名 +// CaseAffiliate caseAffiliate = new CaseAffiliate(); +// caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); +// List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); +// for (CaseAffiliate affiliate : caseAffiliates) { +// if (affiliate.getIdentityType() == 1) { //申请人 +// caseEvidenceVO.setApplicantName(affiliate.getName()); +// } else { +// caseEvidenceVO.setRespondentName(affiliate.getName()); +// } +// } +// } +// return caseListByRespondent; +// } +// return null; +// } +// private List getCaseEvidenceVOListByPhone(String phone, List caseStatusList, Integer identityType) { +// List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(null, caseStatusList, identityType,phone,SecurityUtils.getUsername()); +// if (caseListByRespondent != null && caseListByRespondent.size() > 0) { +// for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) { +// //根据案件id查询姓名 +// CaseAffiliate caseAffiliate = new CaseAffiliate(); +// caseAffiliate.setCaseAppliId(caseEvidenceVO.getId()); +// List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); +// for (CaseAffiliate affiliate : caseAffiliates) { +// if (affiliate.getIdentityType() == 1) { //申请人 +// caseEvidenceVO.setApplicantName(affiliate.getName()); +// } else { +// caseEvidenceVO.setRespondentName(affiliate.getName()); +// } +// } +// } +// return caseListByRespondent; +// } +// return null; +// } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 71764bf..2b8f7a1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -13,6 +13,7 @@ import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import com.ruoyi.wisdomarbitrate.domain.vo.CasePayListVO; import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; @@ -31,6 +32,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @@ -47,6 +49,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { private SmsRecordMapper smsRecordMapper; @Autowired private ArbitrateRecordMapper arbitrateRecordMapper; + private ICasePaymentService casePaymentService; @Autowired public CasePaymentServiceImpl(ElegentPay elegentPay @@ -118,8 +121,14 @@ public class CasePaymentServiceImpl implements ICasePaymentService { for (Long id : batchCaseApplication.getIds()) { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); + //查询案件详细信息 + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + if (caseApplication1 == null) { + continue; + } + // 查询当前案件节点 - Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(id); + // Integer currentStatus= caseApplicationMapper.selectCaseApplicationCaseStatus(id); if(batchCaseApplication.getAgreeOrNotCheck().equals(1)){ // 同意,更新案件状态为案件质证 caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); @@ -146,23 +155,23 @@ public class CasePaymentServiceImpl implements ICasePaymentService { caseApplicationMapper.submitCaseApplication(caseApplication); //发送短信通知 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息 + List caseAffiliates = caseApplicationService.selectAfflicatesByCaseId(caseApplication.getId()); if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - //查询案件详细信息 - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplication1 == null) { - continue; - } + // 申请操作人 + Optional applicantAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(1) || affiliate.getRoleType().equals(2))).findFirst(); + // 被申请操作人 + Optional resAffiliateOpt = caseAffiliates.stream().filter(affiliate -> affiliate.getOperatorFlag() == 1 && StrUtil.isNotEmpty(affiliate.getPhone()) && (affiliate.getRoleType().equals(3) || affiliate.getRoleType().equals(4))).findFirst(); + if (!applicantAffiliateOpt.isPresent() || !resAffiliateOpt.isPresent()) { + throw new ServiceException("未找到案件操作人员"); + } + String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死 String caseNum = caseApplication1.getCaseNum(); - if (identityType == 1) { //申请人 - String name = affiliate.getName(); - request.setPhone(affiliate.getContactTelphone()); + CaseAffiliateEntity app = applicantAffiliateOpt.get(); + CaseAffiliateEntity res = resAffiliateOpt.get(); + //申请人 + String name = app.getName(); + request.setPhone(app.getPhone()); Boolean aBoolean = SmsUtils.sendSms(request); //保存短信发送记录 SmsSendRecord smsSendRecord = new SmsSendRecord(); @@ -189,17 +198,17 @@ public class CasePaymentServiceImpl implements ICasePaymentService { smsSendRecord.setSendStatus(0); } smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } else { //被申请人 + //被申请人 if(batchCaseApplication.getAgreeOrNotCheck().equals(1)) { - request.setPhone(affiliate.getContactTelphone()); + request.setPhone(res.getPhone()); request.setTemplateId("1952840"); // 1952840 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信 - String name = affiliate.getName(); + name = res.getName(); request.setTemplateParamSet(new String[]{name, caseName, caseNum}); - Boolean aBoolean = SmsUtils.sendSms(request); + aBoolean = SmsUtils.sendSms(request); //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); + smsSendRecord = new SmsSendRecord(); smsSendRecord.setCaseId(caseApplication.getId()); smsSendRecord.setCaseNum(caseNum); smsSendRecord.setPhone(request.getPhone()); @@ -214,8 +223,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { } smsRecordMapper.saveSmsSendRecord(smsSendRecord); } - } - } + + //更改记录表里的支付状态和支付时间 CasePaymentRecord casePaymentRecord = new CasePaymentRecord(); casePaymentRecord.setPaymentStatus(1); @@ -224,9 +233,9 @@ public class CasePaymentServiceImpl implements ICasePaymentService { casePaymentRecordMapper.update(casePaymentRecord); // 新增日志 if(batchCaseApplication.getAgreeOrNotCheck().equals(1)) { - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, ""); }else { - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, "拒绝原因:"+batchCaseApplication.getCaseCheckReject()); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, "拒绝原因:"+batchCaseApplication.getCaseCheckReject()); } } } @@ -271,7 +280,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { paymentRecord.setPaymentStatus(1); casePaymentRecordMapper.saveRecord(paymentRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus ,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT ,""); } } @@ -403,90 +412,10 @@ public class CasePaymentServiceImpl implements ICasePaymentService { if (caseApplications != null && caseApplications.size() > 0) { List caseIds = caseApplications.stream().map(CaseApplication::getId).collect(Collectors.toList()); - for (Long caseId : caseIds) { - Integer currentStatus = caseApplicationMapper.selectCaseApplicationCaseStatus(caseId); - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(caseId); - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI); - caseApplicationMapper.submitCaseApplication(caseApplication); - //发送短信通知 - SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseApplication.getId()); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息 - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - //查询案件详细信息 - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - if (caseApplication1 == null) { - continue; - } - String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死 - String caseNum = caseApplication1.getCaseNum(); - if (identityType == 1) { //申请人 - request.setPhone(affiliate.getContactTelphone()); - request.setTemplateId("1928003"); //传入申请人模板id - // 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置 - // 模板id:1928003 普通短信 案件受理通知 - String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseName, caseNum}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseNum); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理。"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } else { //被申请人 - - request.setPhone(affiliate.getContactTelphone()); - request.setTemplateId("1952840"); - // 1952840 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信 - String name = affiliate.getName(); - request.setTemplateParamSet(new String[]{name, caseName, caseNum}); - Boolean aBoolean = SmsUtils.sendSms(request); - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseNum); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); - if (aBoolean) { - smsSendRecord.setSendStatus(1); - } else { - smsSendRecord.setSendStatus(0); - } - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - } - } - //更改记录表里的支付状态和支付时间 - CasePaymentRecord casePaymentRecord = new CasePaymentRecord(); - casePaymentRecord.setPaymentStatus(1); - casePaymentRecord.setCaseId(caseId); - casePaymentRecord.setPaymentTime(new Date()); - casePaymentRecord.setUpdateTime(new Date()); - casePaymentRecordMapper.update(casePaymentRecord); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), currentStatus, ""); - - - } - - } + BatchCaseApplication batchCaseApplication = new BatchCaseApplication(); + batchCaseApplication.setIds(caseIds); + casePaymentService.confirmPayment(batchCaseApplication); + }else{ throw new ServiceException("这个批号没有批量缴费确认的案件"); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java index c904ec1..b8744ca 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseZipImportImpl.java @@ -50,6 +50,7 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import static com.google.common.io.Files.getFileExtension; +import static com.ruoyi.common.constant.FileTransformation.getFileName; import static com.ruoyi.common.core.domain.AjaxResult.error; import static com.ruoyi.common.core.domain.AjaxResult.success; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @@ -209,7 +210,7 @@ public class CaseZipImportImpl { public CaseApplication buildCaseInfo(File file, Long templateId, List fatchRuleList, Map> fatchRuleMap, Map userMap, List dictDataList, Map deptMap,LoginUser loginUser) { // fileMap> Map fatchMap = new HashMap<>(); - Integer batchNumber = caseApplicationMapper.selectBatchNumberLike(); + Integer batchNumber = caseApplicationMapper.selectMaxBatchNumber(); AtomicInteger maxBatchNumber = new AtomicInteger(); if (batchNumber == null) { maxBatchNumber.set(1); @@ -268,7 +269,7 @@ public class CaseZipImportImpl { // 需要新增的用户 List addUsers = new ArrayList<>(); - caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + // caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); caseApplication.setCaseLogId(IdWorkerUtil.getId()); caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode()); caseApplication.setCaseAppliId(caseApplication.getId()); @@ -290,6 +291,8 @@ public class CaseZipImportImpl { if (StrUtil.isEmpty(fileUrl)) { continue; } + // 根据路径获取文件名 + String name = getFileName(fileUrl); String suffix = getFileExtension(fileUrl); if (StrUtil.isNotEmpty(suffix) && suffix.contains("doc")) { // 上传onlyoffice @@ -297,18 +300,21 @@ public class CaseZipImportImpl { if(jsonArray!=null && jsonArray.size() > 0) { for (Object obj : jsonArray) { JSONObject jsonObject = (JSONObject) obj; - CaseAttach caseAttach = CaseAttach.builder() + String path = jsonObject.get("filePath")!=null?jsonObject.getString("filePath"):""; + path=path.replace("/home/ruoyi/uploadPath/","/profile/"); + // String name = jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):""; + CaseAttach caseAttach = CaseAttach.builder() .caseAppliId(caseApplication.getId()) - .annexName(jsonObject.get("fileName")!=null?jsonObject.getString("fileName"):"") - + .annexName(name) + .annexPath(path) .onlyOfficeFileId(jsonObject.getString("fileId")) .build(); - if(jsonObject.get("filePath")!=null){ - String officePath = jsonObject.getString("filePath"); - String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); - caseAttach.setAnnexPath(replace); - - } +// if(jsonObject.get("filePath")!=null){ +// String officePath = jsonObject.getString("filePath"); +// String replace = officePath.replace("/home/ruoyi/uploadPath/", "/profile/"); +// caseAttach.setAnnexPath(replace); +// +// } if(fileUrl.contains("申请书")){ CaseAttach applyFile = new CaseAttach(); BeanUtil.copyProperties(caseAttach, applyFile); @@ -326,11 +332,11 @@ public class CaseZipImportImpl { CaseAttach caseAttach = new CaseAttach(); caseAttach.setCaseAppliId(caseApplication.getId()); + filePath=filePath.replace("home/ruoyi/uploadPath/","profile/"); caseAttach.setAnnexPath(filePath); - if (StrUtil.isNotEmpty(fileUrl)) { - String fileName = fileUrl.replace(filePath, "/profile/upload"); - caseAttach.setAnnexName(fileName); - } + + caseAttach.setAnnexName(name); + // 申请人提供的证据材料 caseAttach.setAnnexType(2); caseAttachs.add(caseAttach); @@ -359,7 +365,7 @@ public class CaseZipImportImpl { caseApplicationMapper.insertCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, "",loginUser); + // CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_INSERT, "",loginUser); caseApplicationLogMapper.insert(caseApplication); // 多线程执行 if (CollectionUtil.isNotEmpty(addUsers)) { @@ -374,12 +380,13 @@ public class CaseZipImportImpl { sysDeptMapper.batchSave(sysDepts); } - - if (CollectionUtil.isNotEmpty(caseApplication.getCaseAffiliates())) { - - caseAffiliateMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); - caseAffiliateLogMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); - } +// todo +// if (CollectionUtil.isNotEmpty(caseApplication.getCaseAffiliates())) { +// +// caseAffiliateMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); +// //todo +//// caseAffiliateLogMapper.batchCaseAffiliate(caseApplication.getCaseAffiliates()); +// } if (CollectionUtil.isNotEmpty(caseAttachs)) { caseAttachMapper.batchSave(caseAttachs); caseAttachLogMapper.batchSave(caseAttachs); @@ -772,7 +779,8 @@ public class CaseZipImportImpl { if (ObjectUtil.isNotEmpty(debtorAffiliate)) { caseAffiliates.add(debtorAffiliate); } - caseApplication.setCaseAffiliates(caseAffiliates); + // todo +// caseApplication.setCaseAffiliates(caseAffiliates); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java index 8741ab4..043d0e5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java @@ -248,8 +248,8 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { if (downLoadFile) { CaseAttach caseAttach = new CaseAttach(); caseAttach.setAnnexType(10); //10代表印章图片 - caseAttach.setAnnexPath(savePath); - caseAttach.setAnnexName(saveName); + caseAttach.setAnnexPath(saveName); + caseAttach.setAnnexName(fileName); int i1 = caseAttachMapper.save(caseAttach); if (i1 > 0) { //将附件id保存到公章管理表里 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java index a73e243..438499c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/MsSignSealServiceImpl.java @@ -8,6 +8,7 @@ import com.google.gson.JsonObject; import com.ruoyi.common.constant.FileTransformation; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; +import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.utils.EmailOutUtil; import com.ruoyi.common.utils.SecurityUtils; @@ -48,6 +49,8 @@ public class MsSignSealServiceImpl implements MsSignSealService { private SealManageMapper sealManageMapper; @Autowired private CaseLogRecordMapper caseLogRecordMapper; + @Autowired + private SysUserMapper sysUserMapper; /** * 签署流程回调,即签名用印回调 @@ -85,10 +88,11 @@ public class MsSignSealServiceImpl implements MsSignSealService { Long caseAppliId = sealSignRecordsel.getCaseAppliId(); CaseApplication req = new CaseApplication(); req.setId(caseAppliId); - + // 根据电话查询用户名 + SysUser sysUser = sysUserMapper.selectUserByPhone(accountMobile); if ("SIGN_MISSON_COMPLETE".equals(action) && signResult == 2) { if (StringUtils.isNotEmpty(accountMobile) && accountMobile.equals(pensonAccount)) { - //申请人签名 + //调解员签名 sealSignRecordsel.setSignStatusArbitor(1); sealSignRecordMapper.updataSealSignRecord(sealSignRecordsel); CaseLogRecord operLog = new CaseLogRecord(); @@ -96,6 +100,9 @@ public class MsSignSealServiceImpl implements MsSignSealService { operLog.setCaseAppliId(caseAppliId); operLog.setCaseNode(13); operLog.setCreateTime(dateOperate); + if(sysUser!=null){ + operLog.setCreateBy(sysUser.getUserName()); + } caseLogRecordMapper.insertCaseLogRecord(operLog); CaseApplication application = new CaseApplication(); @@ -158,8 +165,8 @@ public class MsSignSealServiceImpl implements MsSignSealService { caseAttach.setAnnexType(3); caseAttach.setAnnexPath(savePath); caseAttach.setAnnexName(saveName); - caseAttach.setUserName(SecurityUtils.getUsername()); - caseAttach.setUserId(SecurityUtils.getUserId()); + //caseAttach.setUserName(SecurityUtils.getUsername()); + //caseAttach.setUserId(SecurityUtils.getUserId()); // 删除已存在的 caseAttachMapper.deleteCaseAttachByCasedIdAndType(caseAppliId, 3); caseAttachMapper.save(caseAttach); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java index 352b0a8..ed9e521 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/VideoServiceImpl.java @@ -27,9 +27,11 @@ import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import com.ruoyi.wisdomarbitrate.domain.IdentityAuthentication; +import com.ruoyi.wisdomarbitrate.domain.entity.CaseAffiliateEntity; import com.ruoyi.wisdomarbitrate.domain.vo.ReservedConferenceVO; import com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO; import com.ruoyi.wisdomarbitrate.mapper.*; +import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; import com.ruoyi.wisdomarbitrate.service.VideoService; import com.ruoyi.wisdomarbitrate.service.WeChatUserService; import com.tencentcloudapi.common.Credential; @@ -96,6 +98,8 @@ public class VideoServiceImpl implements VideoService { private SysRoleMapper roleMapper; @Autowired private SysUserMapper userMapper; + @Autowired + private ICaseApplicationService caseApplicationService; /** * 功能:第三方回调sign校验 * 参数: @@ -179,17 +183,11 @@ public class VideoServiceImpl implements VideoService { return success(); } for (CaseAttach caseAttach : caseAttachList) { - String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseAttach.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } + + caseAttach.setAnnexPath(caseAttach.getAnnexPath()); + + caseAttach.setAnnexName(caseAttach.getAnnexName()); + } return success(caseAttachList); } @@ -374,9 +372,10 @@ public class VideoServiceImpl implements VideoService { // 绑定案件 if(convertFlag){ +// String path=fileName.replace("") CaseAttach caseAttach = CaseAttach.builder().caseAppliId(reservedConferenceVO.getCaseId()) - .annexName(fileName) - .annexPath(RuoYiConfig.getHtml2PDFPath()) + .annexName(currentFileName) + .annexPath(fileName) .annexType(7) .build(); caseAttachMapper.save(caseAttach); @@ -400,16 +399,10 @@ public class VideoServiceImpl implements VideoService { if (caseAttachList != null && caseAttachList.size() > 0) { for (CaseAttach caseAttach : caseAttachList) { String annexName = caseAttach.getAnnexName(); - String prefix = "/profile"; - int startIndex = annexName.indexOf(prefix); - startIndex += prefix.length(); - String annexPath = "/uploadPath" + annexName.substring(startIndex); - caseAttach.setAnnexPath(annexPath); - int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); - caseAttach.setAnnexName(annexNamenew); - } + + caseAttach.setAnnexPath(caseAttach.getAnnexPath()); + caseAttach.setAnnexName(annexName); + } @@ -497,8 +490,8 @@ public class VideoServiceImpl implements VideoService { String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName); // 存入数据库 CaseAttach caseAttach = CaseAttach.builder().caseAppliId(caseId) - .annexName(annexName) - .annexPath(RuoYiConfig.getVideoUploadPath()) + .annexName(fileName) + .annexPath(annexName) .annexType(9) .build(); caseAttachMapper.save(caseAttach); @@ -517,10 +510,7 @@ public class VideoServiceImpl implements VideoService { @Override public AjaxResult selectRoleMenuByCaseId(Long caseId) { AjaxResult result = success(); - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(caseId); - // 根据案件id查询相关人员 - List msCaseAffiliates = affiliateMapper.selectCaseAffiliate(caseAffiliate); + List msCaseAffiliates = caseApplicationService.selectAfflicatesByCaseId(caseId); if (CollectionUtil.isEmpty(msCaseAffiliates)) { return error("未找到案件相关人员"); } @@ -532,27 +522,16 @@ public class VideoServiceImpl implements VideoService { if (sysUser == null) { return error("未找到当前登录用户"); } - for (CaseAffiliate affiliate : msCaseAffiliates) { - if (StrUtil.isEmpty(sysUser.getPhonenumber())) { - continue; - } - // 申请人,根据电话判断用户在该案件是否为申请人 - if (StrUtil.isNotEmpty(affiliate.getContactTelphoneAgent()) && sysUser.getPhonenumber().equals(affiliate.getContactTelphoneAgent())) { - if (affiliate.getIdentityType() == 1) { - result.put("appFlag", "1"); - } else if (affiliate.getIdentityType() == 2) { - // 申请人代理人 - result.put("resFlag", "1"); + for (CaseAffiliateEntity affiliate : msCaseAffiliates) { + if(affiliate.getOperatorFlag()!=null && affiliate.getOperatorFlag()==1 && affiliate.getUserId()!=null&&affiliate.getUserId().equals(userId)&&affiliate.getRoleType()!=null){ + if(affiliate.getRoleType().equals(1)||affiliate.getRoleType().equals(2)){ + // 申请人操作人 + result.put("appFlag","1"); } - } else if (StrUtil.isNotEmpty(affiliate.getContactTelphone()) && sysUser.getPhonenumber().equals(affiliate.getContactTelphone())) { - if (affiliate.getIdentityType() == 1) { - // 在该案件中为申请人或者申请代理人 - result.put("appFlag", "1"); - } else if (affiliate.getIdentityType() == 2) { - // 在该案件中为被申请人或者被申请代理人 - result.put("resFlag", "1"); + if(affiliate.getRoleType().equals(3)||affiliate.getRoleType().equals(4)){ + // 被申请人操作人 + result.put("resFlag","1"); } - } } return result; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java index 913e297..191e879 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -236,8 +236,8 @@ public class FixSelectFlowDetailUtils { if (downLoadFile) { CaseAttach caseAttach = new CaseAttach(); caseAttach.setAnnexType(10); //10代表印章图片 - caseAttach.setAnnexPath(savePath); - caseAttach.setAnnexName(saveName); + caseAttach.setAnnexPath(saveName); + caseAttach.setAnnexName(fileName); int i1 = caseAttachMapper.save(caseAttach); if (i1 > 0) { //将印章信息保存到公章管理表里 diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 588b191..eed8294 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -105,6 +105,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" email, status, create_by, + code, + comp_legal_person, + home, + address, + nationality, create_time )values( #{deptId}, @@ -118,6 +123,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{email}, #{status}, #{createBy}, + #{code}, + #{compLegalPerson}, + #{home}, + #{address}, + #{nationality}, sysdate() ); @@ -168,6 +178,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" email = #{email}, status = #{status}, update_by = #{updateBy}, + code = #{code}, + comp_legal_person = #{compLegalPerson}, + home = #{home}, + address = #{address}, + nationality = #{nationality}, update_time = sysdate() where dept_id = #{deptId} @@ -196,5 +211,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update sys_dept set del_flag = '2' where dept_id = #{deptId} - + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 20cdafe..5dc6817 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -49,9 +49,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, + select u.*, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, - r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card + r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status from sys_user u left join sys_dept d on u.dept_id = d.dept_id left join sys_user_role ur on u.user_id = ur.user_id @@ -217,11 +217,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into sys_user( + position, user_id, dept_id, user_name, nick_name, id_card, + id_type, + nationality, + birth, + home, + address, email, avatar, phonenumber, @@ -232,11 +238,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" remark, create_time )values( + #{position}, #{userId}, #{deptId}, #{userName}, #{nickName}, #{idCard}, + #{idType}, + #{nationality}, + #{birth}, + #{home}, + #{address}, #{email}, #{avatar}, #{phonenumber}, @@ -250,6 +262,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into sys_user( + position, user_id, dept_id, user_name, @@ -267,6 +280,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" )values ( + #{item.position}, #{item.userId}, #{item.deptId}, #{item.userName}, @@ -292,6 +306,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" user_name = #{userName}, nick_name = #{nickName}, id_card = #{idCard}, + position = #{position}, + id_type = #{idType}, + nationality = #{nationality}, + birth = #{birth}, + home = #{home}, + address = #{address}, email = #{email}, phonenumber = #{phonenumber}, sex = #{sex}, @@ -335,5 +355,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" INNER JOIN sys_dept d ON u.dept_id = d.dept_id WHERE ur.role_id = #{roleId} AND d.dept_id = #{deptId}; - + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml index dd72689..1dc018e 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserRoleMapper.xml @@ -16,8 +16,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - + + + delete from sys_user_role where user_id in #{userId} @@ -41,4 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{userId} + + insert into sys_user_role(user_id, role_id) values(#{userId}, #{roleId}) + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml index 190abf9..2a6f912 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/ArbitrateRecordMapper.xml @@ -102,6 +102,7 @@ AND a.case_appli_id = #{caseAppliId}
+ limit 1 diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml index 6c8dab1..8405582 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateLogMapper.xml @@ -63,22 +63,11 @@ - insert into case_affiliate_log(case_appli_log_id, identity_type,application_organ_id,application_organ_name,name,identity_num,contact_telphone, - contact_address,work_address,work_telphone ,name_agent,identity_num_agent,contact_telphone_agent, - comp_legal_person,comp_legalper_post,respon_sex ,respon_birth, - residen_affili,appli_agent_title, - contact_address_agent,email , send_email,track_num,applicant_agent_user_id,agent_email) values + + insert into case_affiliate_log(case_appli_log_id, user_id,applicant_dept_id,role_type,group_order,operator_flag,organize_flag) values - (#{item.caseAppliLogId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone}, - #{item.contactAddress},#{item.workAddress},#{item.workTelphone}, #{item.nameAgent},#{item.identityNumAgent},#{item.contactTelphoneAgent}, - #{item.compLegalPerson},#{item.compLegalperPost},#{item.responSex}, #{item.responBirth}, - #{item.residenAffili},#{item.appliAgentTitle}, - #{item.contactAddressAgent}, - #{item.email}, - #{item.sendEmail}, - #{item.trackNum}, - #{item.applicantAgentUserId}, - #{item.agentEmail} + (#{item.caseAppliLogId},#{item.userId},#{item.applicantDeptId},#{item.roleType},#{item.groupOrder},#{item.operatorFlag},#{item.organizeFlag} + ) ; diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml index 74d3df0..90d791a 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAffiliateMapper.xml @@ -3,188 +3,152 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone, + u.email, + (case when a.user_id is null then d.dept_name else u.nick_name end) name, + (case when a.user_id is null then d.home else u.home end) home, + (case when a.user_id is null then d.address else u.address end) address, + (case when a.user_id is null then d.nationality else u.nationality end) nationality, + u.sex,u.id_type idType,u.birth,r.role_name roleName,d.dept_name applicantOrgName,a.user_id userId,a.applicant_dept_id applicantDeptId,a.organize_flag organizeFlag + FROM + case_application c + JOIN case_affiliate a ON c.id = a.case_appli_id + LEFT JOIN sys_user u ON u.user_id = a.user_id + 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 + LEFT JOIN sys_dept d ON d.dept_id = a.applicant_dept_id - - AND c.case_appli_id = #{caseAppliId} + + c.id=#{ caseAppliId} + GROUP BY a.id,r.role_id order by a.id asc - + + select c.id caseAppliId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone, + u.email, + (case when a.user_id is null then d.dept_name else u.nick_name end) name, + (case when a.user_id is null then d.home else u.home end) home, + (case when a.user_id is null then d.address else u.address end) address, + (case when a.user_id is null then d.nationality else u.nationality end) nationality, + u.sex,u.id_type idType,u.birth,r.role_name roleName,d.dept_name applicantOrgName,a.user_id userId,a.applicant_dept_id applicantDeptId,a.organize_flag organizeFlag + FROM + case_application c + JOIN case_affiliate a ON c.id = a.case_appli_id + LEFT JOIN sys_user u ON u.user_id = a.user_id + 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 + LEFT JOIN sys_dept d ON d.dept_id = a.applicant_dept_id - - case_appli_id in - - #{item} + + and a.case_appli_id in + + #{caseId} - + select a.*,u.email + from case_affiliate a + left join sys_user u on u.user_id=a.user_id - - - - insert into case_affiliate(case_appli_id, identity_type,application_organ_id,application_organ_name,name,identity_num,contact_telphone, - contact_address,work_address,work_telphone ,name_agent,identity_num_agent,contact_telphone_agent, - comp_legal_person,comp_legalper_post,respon_sex ,respon_birth, - residen_affili,appli_agent_title, - contact_address_agent,email, send_email,track_num,applicant_agent_user_id,agent_email) values + insert into case_affiliate(case_appli_id, user_id,applicant_dept_id,role_type,group_order,operator_flag,organize_flag) values - (#{item.caseAppliId},#{item.identityType},#{item.applicationOrganId},#{item.applicationOrganName},#{item.name},#{item.identityNum},#{item.contactTelphone}, - #{item.contactAddress},#{item.workAddress},#{item.workTelphone}, #{item.nameAgent},#{item.identityNumAgent},#{item.contactTelphoneAgent}, - #{item.compLegalPerson},#{item.compLegalperPost},#{item.responSex}, #{item.responBirth}, - #{item.residenAffili},#{item.appliAgentTitle}, - #{item.contactAddressAgent}, - #{item.email}, - #{item.sendEmail}, - #{item.trackNum}, - #{item.applicantAgentUserId}, - #{item.agentEmail} + (#{item.caseAppliId},#{item.userId},#{item.applicantDeptId},#{item.roleType},#{item.groupOrder},#{item.operatorFlag},#{item.organizeFlag} + ) + + INSERT INTO case_affiliate + + + case_appli_id, + + + user_id, + + + applicant_dept_id, + + + role_type, + + + group_order, + + + operator_flag, + + + organize_flag + + + + + #{caseAppliId}, + + + #{userId}, + + + #{applicantDeptId}, + + + #{roleType}, + + + #{groupOrder}, + + + #{operatorFlag}, + + + #{organizeFlag} + + + - - - update case_affiliate - set - case_appli_id=#{caseAppliId}, - identity_type= #{identityType}, - application_organ_id= #{applicationOrganId}, - application_organ_name= #{applicationOrganName}, - name = #{name}, - identity_num = #{identityNum}, - contact_telphone = #{contactTelphone}, - contact_address = #{contactAddress}, - work_address = #{workAddress}, - work_telphone = #{workTelphone}, - name_agent = #{nameAgent}, - identity_num_agent = #{identityNumAgent}, - contact_telphone_agent = #{contactTelphoneAgent}, - contact_address_agent = #{contactAddressAgent}, - send_email = #{sendEmail}, - residen_affili = #{residenAffili}, - email= #{email}, - track_num = #{trackNum}, - comp_legal_person=#{compLegalPerson}, - comp_legalper_post=#{compLegalperPost}, - applicant_agent_user_id=#{applicantAgentUserId}, - respon_sex=#{responSex}, - respon_birth=#{responBirth}, - residen_affili=#{residenAffili}, - appli_agent_title=#{appliAgentTitle} - - - ,agent_email=#{agentEmail} - - where id = #{id} - - - - - - update case_affiliate - - - application_organ_id= #{item.applicationOrganId}, - application_organ_name= #{item.applicationOrganName}, - name = #{item.name}, - identity_num = #{item.identityNum}, - contact_telphone = #{item.contactTelphone}, - contact_address = #{item.contactAddress}, - work_address = #{item.workAddress}, - work_telphone = #{item.workTelphone}, - - name_agent = #{item.nameAgent}, - identity_num_agent = #{item.identityNumAgent}, - contact_telphone_agent = #{item.contactTelphoneAgent}, - contact_address_agent = #{item.contactAddressAgent}, - send_email = #{item.sendEmail}, - residen_affili = #{item.residenAffili}, - email= #{item.email}, - track_num = #{item.trackNum}, - comp_legal_person=#{item.compLegalPerson}, - comp_legalper_post=#{item.compLegalperPost}, - applicant_agent_user_id=#{item.applicantAgentUserId}, - respon_sex=#{item.responSex}, - respon_birth=#{item.responBirth}, - residen_affili=#{item.residenAffili}, - appli_agent_title=#{item.appliAgentTitle} - - - ,agent_email=#{agentEmail} - - - where case_appli_id = #{caseAppliId} and identity_type= #{item.identityType}; - - - delete from case_affiliate where case_appli_id = #{id} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index aa3e30a..8480962 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -19,10 +19,9 @@ + - - @@ -56,509 +55,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + from case_application c + JOIN case_affiliate a ON c.id = a.case_appli_id + LEFT JOIN sys_user u ON u.user_id = a.user_id + LEFT JOIN sys_user u1 ON u1.user_id = c.arbitrator_id + LEFT JOIN sys_user u2 ON u2.user_name = c.create_by + LEFT JOIN sys_user_role ur ON u.user_id = ur.user_id OR u1.user_id = ur.user_id or u2.user_id = ur.user_id + LEFT JOIN sys_role r ON r.role_id = ur.role_id + LEFT JOIN sys_dept d ON d.dept_id = a.applicant_dept_id - - + + + AND (a.user_id=#{caseApplication.userId} ) + + + + or (c.create_by = #{caseApplication.createBy}) + - + + + id, + case_num, + case_subject_amount, + register_date, + arbitrat_method, + case_status, + hear_date, + arbitrat_claims, + loan_start_date, + loan_end_date, + claim_princi_owed, + claim_interest_owed, + claim_liquid_damag, + fee_payable, + contract_number, + create_time, + update_by, + update_time, + create_by, + arbitrator_id, + case_name, + case_result, + is_agree_pend_tral, + objection_add_eviden, + open_court_hear, + paid_expenses, + filearbitra_url, + pay_type, + request_rule, + adjudica_counter, + adjudica_counter_reason, + proper_preser, + objecti_juris, + is_absence, + respon_cross_opin, + applica_cross_opin, + respon_defen_opini, + appli_is_absen, + lock_status, + room_id, + import_flag, + version, + facts, + batch_number, + template_id, + mediation_agreement, + appli_iswrit_hear, + respon_isWrit_hear + + - - - - - - - - select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , + select c.id ,c.room_id,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' - ELSE '无审理方式' + ELSE '' END arbitratMethodName, c.case_name, c.case_status , @@ -1102,21 +888,19 @@ when 31 then '待修改开庭时间' ELSE '无案件状态' END caseStatusName, - c.hear_date ,c.arbitrat_claims , + c.hear_date ,c.arbitrat_claims ,c.create_time, c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , - c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time - ,c.request_rule,c.adjudica_counter,c.proper_preser, + c.contract_number , + c.request_rule,c.adjudica_counter,c.proper_preser, c.is_absence ,c.respon_cross_opin ,c.applica_cross_opin ,c.respon_defen_opini , - c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,ca.application_organ_id applicationOrganId - ,ca.application_organ_name as applicantName, + c.update_by ,c.update_time,c.arbitrator_id,u.nick_name arbitrator_name, c.batch_number, c.facts, c.appli_iswrit_hear,c.respon_isWrit_hear, c.mediation_agreement,c.template_id templateId,c.appli_iswrit_hear,c.respon_isWrit_hear from case_application c - LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 - + left join sys_user u on u.user_id = c.arbitrator_id AND c.id = #{id} @@ -1128,9 +912,9 @@ order by c.create_time desc limit 1 - - + select max(batch_number) as maxBatchNumber from case_application ; - - - - - and c.case_status in - - #{caseStatus} - - - - and ca.identity_type=1 - - - - and ca.identity_type=1 - and ( ca.contact_telphone=#{caseApplication.loginUserPhone} - or ca.contact_telphone_agent=#{caseApplication.loginUserPhone} - ) - - - - and ca.identity_type=2 - and ( ca.contact_telphone=#{caseApplication.loginUserPhone} - or ca.contact_telphone_agent=#{caseApplication.loginUserPhone} - ) - - - - and c.arbitrator_id=#{caseApplication.arbitratorId} - - - and ca.identity_type=1 - - - - - select t.* from( - select c.id id,c.create_time, c.case_num,c.case_status, - CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' - when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' - when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' - when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' - when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核裁决书' - when 31 then '待修改开庭时间' - ELSE '' - END caseStatusName, - rc.room_id,rc.schedule_start_time - from case_application as c join case_affiliate as d on c.id = d.case_appli_id - left join reserved_conference rc on rc.case_id=c.id - where c.id = d.case_appli_id - - and d.identity_num = #{identityNum} - - - and d.identity_type = #{identityType} - - - and (d.contact_telphone = #{phone} or d.contact_telphone_agent=#{phone}) - - - and c.case_status in - - #{caseStatus} - - - union - - select c.id id, c.create_time,c.case_num,c.case_status, - CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' - when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' - when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成裁决书' when 11 then '待核验裁决书' - when 12 then '待部门长审核裁决书' when 13 then '待裁决书签名' when 14 then '待裁决书用印' - when 15 then '待裁决书送达' when 16 then '待案件归档' when 17 then '已归档' - when 18 then '待仲裁员审核裁决书' - when 31 then '待修改开庭时间' - ELSE '' - END caseStatusName, - rc.room_id,rc.schedule_start_time - from case_log_record r - join case_application c on r.case_appli_id=c.id - JOIN case_affiliate ca ON ca.case_appli_id = c.id - left join reserved_conference rc on rc.case_id=c.id - WHERE - r.create_by=#{loginUserName} AND ca.identity_type=2 - and c.id not in( - select c.id - from case_application c - JOIN case_affiliate ca ON ca.case_appli_id = c.id - where c.id = ca.case_appli_id - - and ca.identity_num = #{identityNum} - - - and ca.identity_type = #{identityType} - - - and (ca.contact_telphone = #{phone} or ca.contact_telphone_agent=#{phone}) - - - and c.case_status in - - #{caseStatus} - - - ) - ) t order by t.create_time desc - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml index 4fb0e78..25ebe69 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml @@ -31,26 +31,26 @@ - + update case_attach set case_appli_id= #{caseAppliId} where annex_id = #{annexId} - + update case_attach annex_name = #{annexName}, @@ -127,4 +127,12 @@ where case_appli_id = #{caseId} and annex_type = #{type} and annex_id!=#{annexId} + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SendMailRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SendMailRecordMapper.xml deleted file mode 100644 index b93e36d..0000000 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SendMailRecordMapper.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - insert into send_mail_record( - mail_name, - mail_content, - mail_address, - send_time, - case_id, - send_status, - create_by, - create_time - )values( - #{mailName}, - #{mailContent}, - #{mailAddress}, - #{sendTime}, - #{caseId}, - #{sendStatus}, - #{createBy}, - sysdate() - ) - - - - - - - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SmsRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SmsRecordMapper.xml deleted file mode 100644 index d2035ce..0000000 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/SmsRecordMapper.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - insert into sms_send_record( - case_appli_id, - case_num, - phone, - send_time, - send_content, - create_by, - send_status, - create_time - )values( - #{caseId}, - #{caseNum}, - #{phone}, - #{sendTime}, - #{sendContent}, - #{createBy}, - #{sendStatus}, - sysdate() - ) - - - - insert into sms_send_record( - case_appli_id, - case_num, - phone, - send_time, - send_content, - create_by, - send_status, - create_time - )values - - ( - #{item.caseId}, - #{item.caseNum}, - #{item.phone}, - #{item.sendTime}, - #{item.sendContent}, - #{item.createBy}, - #{item.sendStatus}, - sysdate() - ) - - - - - - diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SendMailRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SendMailRecordMapper.xml new file mode 100644 index 0000000..e0cc93f --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SendMailRecordMapper.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + insert into send_mail_record( + mail_name, + mail_content, + mail_address, + send_time, + case_id, + send_status, + create_by, + file_ids, + mail_subject, + mail_from_address, + case_num, + create_time + )values( + #{mailName}, + #{mailContent}, + #{mailAddress}, + #{sendTime}, + #{caseId}, + #{sendStatus}, + #{createBy}, + #{fileIds}, + #{mailSubject}, + #{mailFromAddress}, + #{caseNum}, + sysdate() + ) + + + update send_mail_record + set + mail_content= #{mailContent} + ,update_time=#{updateTime} + ,send_time=#{sendTime} + ,send_status=#{sendStatus} + ,file_ids=#{fileIds} + where id = #{id} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SmsRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SmsRecordMapper.xml new file mode 100644 index 0000000..fff38dd --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SmsRecordMapper.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + insert into sms_send_record( + case_appli_id, + case_num, + phone, + send_time, + ms_sms_template_id, + create_by, + send_status, + sid, + reason, + create_time + )values( + #{caseId}, + #{caseNum}, + #{phone}, + #{sendTime}, + #{msSmsTemplateId}, + #{createBy}, + #{sendStatus}, + #{sid}, + #{reason}, + sysdate() + ) + + + + insert into sms_send_record( + case_appli_id, + case_num, + phone, + send_time, + sms_template_id, + create_by, + send_status, + create_time, + sid,reason + )values + + ( + #{item.caseId}, + #{item.caseNum}, + #{item.phone}, + #{item.sendTime}, + #{item.msSmsTemplateId}, + #{item.createBy}, + #{item.sendStatus}, + sysdate(),#{sid},#{reason} + ) + + + + + + + + + update sms_send_record + set send_status= #{sendStatus}, + reason=#{reason} + where sid = #{sid} + + + update sms_send_record + + case_appli_id = #{caseId}, + case_num = #{caseNum}, + phone = #{phone}, + + send_time = #{sendTime}, + ms_sms_template_id = #{msSmsTemplateId}, + + send_status = #{sendStatus}, + sid = #{sid}, + reason = #{reason} + + where id = #{id} + + + + + -- 2.54.0 From a54280c3473b98e1aabefa4f897482d31d37f56d Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Fri, 31 May 2024 09:15:37 +0800 Subject: [PATCH 54/55] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/core/controller/BaseController.java | 4 ++++ .../service/shortmessage/impl/ShortMessageServiceImpl.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java index a685e06..4791a0f 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/controller/BaseController.java @@ -1,6 +1,7 @@ package com.ruoyi.common.core.controller; import java.beans.PropertyEditorSupport; +import java.util.ArrayList; import java.util.Date; import java.util.List; import org.slf4j.Logger; @@ -82,6 +83,9 @@ public class BaseController @SuppressWarnings({ "rawtypes", "unchecked" }) protected TableDataInfo getDataTable(List list) { + if(list == null){ + list=new ArrayList<>(); + } TableDataInfo rspData = new TableDataInfo(); rspData.setCode(HttpStatus.SUCCESS); rspData.setMsg("查询成功"); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/impl/ShortMessageServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/impl/ShortMessageServiceImpl.java index e23ed32..01ad44b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/impl/ShortMessageServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/shortmessage/impl/ShortMessageServiceImpl.java @@ -63,7 +63,7 @@ public class ShortMessageServiceImpl implements ShortMessageService { public List smsSendRecordList(SmsSendRecord smsSendRecord) { List records = smsRecordMapper.getSmsSendRecord(smsSendRecord); if (CollectionUtil.isEmpty(records)) { - return null; + return records; } List templateIds = records.stream().map(SmsSendRecord::getMsSmsTemplateId).collect(Collectors.toList()); if (CollectionUtil.isEmpty(templateIds)) { -- 2.54.0 From a78d2bd6c77df3e52476dc6c5a380ad96e1b1b75 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Mon, 3 Jun 2024 10:08:42 +0800 Subject: [PATCH 55/55] =?UTF-8?q?=E4=BB=B2=E8=A3=81=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ICaseApplicationService.java | 4 +- .../service/impl/AdjudicationServiceImpl.java | 2 +- .../impl/CaseApplicationServiceImpl.java | 116 +++++++++--------- 3 files changed, 63 insertions(+), 59 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java index c3b208c..99b8a64 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseApplicationService.java @@ -197,9 +197,9 @@ public interface ICaseApplicationService { * @param updateFlag 是否修改案件 */ - public void insertAfficateUser(CaseAffiliateEntity affiliate, List roleIdList,boolean updateFlag); + public void insertAfficateUser(CaseAffiliateEntity affiliate, List roleIdList,boolean updateFlag,List affiliateEntities); - void insertCaseAfflicate(CaseAffiliateVO caseAffiliateVO, List affliates,CaseApplicationDTO caseApplication); + void insertCaseAfflicate(CaseAffiliateVO caseAffiliateVO, List affliates,CaseApplicationDTO caseApplicationm,boolean updateFlag); /** * 根据案件id查询相关人员 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index accfd28..8eda52c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -873,7 +873,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList,caseNum); // 被申请人发送邮件 - boolean resEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList,caseNum); + boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList,caseNum); if (!appEmailFlag && !resEmailFlag) { throw new ServiceException("裁决书发送失败"); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 086dd26..7510f01 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1200,49 +1200,49 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 必填校验 CaseApplication caseApplication = applicationMap.get(id); // 基本字段校验 - if (caseApplication != null) { - for (String baseColumn : baseColumns) { - if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseApplication, baseColumn))) { - errorMsg.append(baseColumn).append("不能为空,"); - throw new ServiceException("必填字段未填写,请完善案件信息!"); - } - } - // 校验人员 - if (CollectionUtil.isNotEmpty(caseAffiliates)) { - List affiliateList = caseAffiliateMap.get(id); - if (CollectionUtil.isNotEmpty(affiliateList)) { - int appCount = 0; - int resCount = 0; - for (CaseAffiliateEntity caseAffiliate : affiliateList) { - if (caseAffiliate.getOperatorFlag() != null && caseAffiliate.getOperatorFlag().equals(1) && caseAffiliate.getRoleType() != null && (caseAffiliate.getRoleType().equals(1) || caseAffiliate.getRoleType().equals(2))) { - appCount++; - // 校验申请人 - for (String applicAffiliateColumn : applicAffiliateColumns) { - if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))) { - errorMsg.append(applicAffiliateColumn).append("不能为空,"); - throw new ServiceException("必填字段未填写,请完善案件信息!"); - } - } - } else if (caseAffiliate.getOperatorFlag() != null && caseAffiliate.getOperatorFlag().equals(1) && caseAffiliate.getRoleType() != null && (caseAffiliate.getRoleType().equals(3) || caseAffiliate.getRoleType().equals(4))) { - resCount++; - // 校验被申请人 - // 校验申请人 - for (String applicAffiliateColumn : dectborAffiliateColumns) { - if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))) { - errorMsg.append(applicAffiliateColumn).append("不能为空,"); - throw new ServiceException("必填字段未填写,请完善案件信息!"); - } - } - } - } - if (appCount == 0 || resCount == 0) { - throw new ServiceException("必填字段未填写,请完善案件信息!"); - } - } - } - } else { - throw new ServiceException("必填字段未填写,请完善案件信息!"); - } +// if (caseApplication != null) { +// for (String baseColumn : baseColumns) { +// if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseApplication, baseColumn))) { +// errorMsg.append(baseColumn).append("不能为空,"); +// throw new ServiceException("必填字段未填写,请完善案件信息!"); +// } +// } +// // 校验人员 +// if (CollectionUtil.isNotEmpty(caseAffiliates)) { +// List affiliateList = caseAffiliateMap.get(id); +// if (CollectionUtil.isNotEmpty(affiliateList)) { +// int appCount = 0; +// int resCount = 0; +// for (CaseAffiliateEntity caseAffiliate : affiliateList) { +// if (caseAffiliate.getOperatorFlag() != null && caseAffiliate.getOperatorFlag().equals(1) && caseAffiliate.getRoleType() != null && (caseAffiliate.getRoleType().equals(1) || caseAffiliate.getRoleType().equals(2))) { +// appCount++; +// // 校验申请人 +// for (String applicAffiliateColumn : applicAffiliateColumns) { +// if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))) { +// errorMsg.append(applicAffiliateColumn).append("不能为空,"); +// throw new ServiceException("必填字段未填写,请完善案件信息!"); +// } +// } +// } else if (caseAffiliate.getOperatorFlag() != null && caseAffiliate.getOperatorFlag().equals(1) && caseAffiliate.getRoleType() != null && (caseAffiliate.getRoleType().equals(3) || caseAffiliate.getRoleType().equals(4))) { +// resCount++; +// // 校验被申请人 +// // 校验申请人 +// for (String applicAffiliateColumn : dectborAffiliateColumns) { +// if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))) { +// errorMsg.append(applicAffiliateColumn).append("不能为空,"); +// throw new ServiceException("必填字段未填写,请完善案件信息!"); +// } +// } +// } +// } +// if (appCount == 0 || resCount == 0) { +// throw new ServiceException("必填字段未填写,请完善案件信息!"); +// } +// } +// } +// } else { +// throw new ServiceException("必填字段未填写,请完善案件信息!"); +// } CaseApplication application = new CaseApplication(); application.setId(id); @@ -3276,7 +3276,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } List affliates = new ArrayList<>(); // 新增案件相关人员 - caseApplicationService.insertCaseAfflicate(caseAffiliateVO, affliates, caseApplication); + caseApplicationService.insertCaseAfflicate(caseAffiliateVO, affliates, caseApplication,false); // 保存附件 @@ -3414,7 +3414,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } // 如果是申请人,则和用户表关联 if (affiliate.getOrganizeFlag() == 0) { - caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag); + caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag,affliates); } else { // 申请机构 if (affiliate.getRoleType() == 1 || affiliate.getRoleType() == 3) { @@ -3451,6 +3451,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { sysDeptMapper.insertDept(dept); } else { // 更新部门 + dept.setDeptName(affiliate.getName()); dept.setCode(affiliate.getCode()); dept.setCompLegalPerson(affiliate.getCompLegalPerson()); dept.setUpdateBy(getUsername()); @@ -3461,13 +3462,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { sysDeptMapper.updateDept(dept); } affiliate.setApplicantDeptId(dept.getDeptId()); + affliates.add(affiliate); + caseAffiliateMapper.insert(affiliate); } else { - caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag); + caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag,affliates); } } - affliates.add(affiliate); - // 保存人员 - caseAffiliateMapper.insert(affiliate); + if (affiliate.getOperatorFlag() != null && affiliate.getOperatorFlag() == 1) { operatorCount++; } @@ -3482,7 +3483,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { * @param updateFlag 是否修改案件 */ @Transactional - public void insertAfficateUser(CaseAffiliateEntity affiliate, List roleIdList, boolean updateFlag) { + public void insertAfficateUser(CaseAffiliateEntity affiliate, List roleIdList, boolean updateFlag,List affiliateEntities) { if (StrUtil.isEmpty(affiliate.getEmail()) && StrUtil.isEmpty(affiliate.getPhone())) { return; @@ -3566,11 +3567,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } + affiliateEntities.add(affiliate); + // 保存人员 + caseAffiliateMapper.insert(affiliate); } @Transactional @Override - public void insertCaseAfflicate(CaseAffiliateVO caseAffiliateVO, List affliates, CaseApplicationDTO caseApplication) { + public void insertCaseAfflicate(CaseAffiliateVO caseAffiliateVO, List affliates, CaseApplicationDTO caseApplication,boolean updateFlag) { // 组装案件相关人员 int appOperatorCount = 0; int resOperatorCount = 0; @@ -3581,17 +3585,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (CollectionUtil.isNotEmpty(applicant)) { for (int i = 0; i < applicant.size(); i++) { // 申请人 - appOperatorCount = setCaseAfflicate(affliates, caseApplication, applicant.get(i).getApplicant(), i, appOperatorCount, false); + appOperatorCount = setCaseAfflicate(affliates, caseApplication, applicant.get(i).getApplicant(), i, appOperatorCount, updateFlag); // 申请人代理人 - appOperatorCount = setCaseAfflicate(affliates, caseApplication, applicant.get(i).getApplicantAgent(), i, appOperatorCount, false); + appOperatorCount = setCaseAfflicate(affliates, caseApplication, applicant.get(i).getApplicantAgent(), i, appOperatorCount, updateFlag); } } if (CollectionUtil.isNotEmpty(res)) { for (int i = 0; i < res.size(); i++) { // 被申请人 - resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getRes(), i, resOperatorCount, false); + resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getRes(), i, resOperatorCount, updateFlag); // 被申请人代理人 - resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getResAgent(), i, resOperatorCount, false); + resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getResAgent(), i, resOperatorCount, updateFlag); } } if (appOperatorCount < 1 && resOperatorCount < 1) { @@ -3696,7 +3700,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 删除已存在的人员 caseAffiliateMapper.deleteByCaseId(caseApplication.getId()); // 新增案件相关人员 - caseApplicationService.insertCaseAfflicate(caseAffiliateVO, affliates, caseApplication); + caseApplicationService.insertCaseAfflicate(caseAffiliateVO, affliates, caseApplication,true); // 保存附件 if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) { for (CaseAttach caseAttach : caseApplication.getCaseAttachList()) { -- 2.54.0