From a3a7d39da32220cf4ed1469a345a1efb88f1de78 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Wed, 1 Nov 2023 11:06:44 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/CaseApplication.java | 12 ++++ .../impl/CaseApplicationServiceImpl.java | 64 ++++++++++++------- .../wisdomarbitrate/utils/CaseLogUtils.java | 4 ++ .../wisdomarbitrate/CaseApplicationMapper.xml | 2 + 4 files changed, 59 insertions(+), 23 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 9a0d4ed..59d2d13 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 @@ -29,6 +29,18 @@ public class CaseApplication extends BaseEntity { private Date registerDate; /** 仲裁方式 */ private Integer arbitratMethod; + /** + * 是否导入,0手动录入,1导入,默认0 + */ + private Integer importFlag; + + public Integer getImportFlag() { + return importFlag; + } + + public void setImportFlag(Integer importFlag) { + this.importFlag = importFlag; + } public String getSelectCaseStatus() { return selectCaseStatus; 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 a2991ea..b298d09 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 @@ -44,6 +44,7 @@ import org.springframework.web.multipart.MultipartFile; import java.io.*; import java.math.BigDecimal; +import java.math.RoundingMode; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; @@ -905,8 +906,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { public int editCaseApplication(CaseApplication caseApplication) { //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal(0.01); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP); + BigDecimal feeRate = new BigDecimal("0.01"); + BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP); caseApplication.setFeePayable(feePayable); caseApplication.setUpdateBy(getUsername()); @@ -969,6 +970,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return rows; } + /** * 组装申请代理人信息 * @param caseAffiliate @@ -1176,34 +1178,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseApplication caseApplication = caseApplicationList.get(i); // 导入校验 - importValid(caseApplication); + importValid(caseApplication,deptMap); // 校验成功的数据 if(StrUtil.isEmpty(caseApplication.getErrorMsg())) { //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 - BigDecimal feeRate = new BigDecimal(0.01); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); + 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); - -// int caseApplicationCount = selectCaseApplicationCount(caseApplication); -// if(caseApplicationCount>0){ -// failureNum++; -// failureMsg.append("
" + failureNum + "、立案编号 " + caseApplication.getCaseNum() + " 已存在"); -// }else { -// caseApplicationListinsert.add(caseApplication); -// } - if(StrUtil.isEmpty(caseApplication.getErrorMsg())) { - caseApplicationListinsert.add(caseApplication); - }else { - // 拼接错误信息 - failureMsg.append("
").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString()); - - } + caseApplication.setImportFlag(1); + caseApplicationListinsert.add(caseApplication); }else { // 拼接错误信息 failureMsg.append("
").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString()); @@ -1283,7 +1272,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { * @param caseApplication * @param */ - private void importValid(CaseApplication caseApplication) { + private void importValid(CaseApplication caseApplication,Map deptMap) { StringBuilder failureMsg=new StringBuilder(); caseApplication.setErrorMsg(failureMsg); // 校验基本字段 @@ -1291,7 +1280,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 校验申请人信息 validApplicationColumn(caseApplication,failureMsg); // 校验申请人代理信息 - validApplicationAgentColumn(caseApplication,failureMsg); + validApplicationAgentColumn(caseApplication,failureMsg,deptMap); // 校验被申请人信息 validDebtorApplicationColumn(caseApplication,failureMsg); // 校验被申请人代理信息 @@ -1382,7 +1371,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { * @param caseApplication * @param failureMsg */ - private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) { + private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg,Map deptMap) { if( StrUtil.isEmpty(caseApplication.getNameAgent())){ failureMsg.append("【申请人主体信息-代理人姓名】字段不能为空;"); }else if(caseApplication.getNameAgent().length()>50){ @@ -1393,6 +1382,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { }else if(caseApplication.getIdentityNumAgent().length()>50){ failureMsg.append("【申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;"); } + validAgentInfo(caseApplication,failureMsg,deptMap); String contactTelphoneAgent = caseApplication.getContactTelphoneAgent(); if( StrUtil.isEmpty(contactTelphoneAgent)){ failureMsg.append("【申请人主体信息-代理人联系电话】字段不能为空;"); @@ -1405,7 +1395,34 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { failureMsg.append("【申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;"); } } + /** + * 校验代理人与组织机构关系 + * @param caseApplication + * @param failureMsg + * @return + */ + private void validAgentInfo(CaseApplication caseApplication, StringBuilder failureMsg,Map deptMap) { + // 申请机构与代理人都不为空,校验代理人与组织机构关系(代理人必须在该部门下) + if (StrUtil.isNotEmpty(caseApplication.getName())&&StrUtil.isNotEmpty(caseApplication.getNameAgent())) { + String applicationOrganId=""; + // 申请机构已经存在 + if(deptMap.containsKey(caseApplication.getName())){ + applicationOrganId=String.valueOf(deptMap.get(caseApplication.getName())); + } + // 根据代理人身份证去用户表查询 + SysUser agentUser = sysUserMapper.selectUserByIdCard(caseApplication.getIdentityNumAgent()); + // 代理人的部门和申请机构不匹配 + if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(applicationOrganId)) { +// return "该申请代理人已在"+agentUser.getDeptName()+"申请机构下存在,请检查填写信息是否正确"; + if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) { + failureMsg.append("该申请代理人已在【").append(agentUser.getDept().getDeptName()).append("】申请机构下存在,请检查填写信息是否正确"); + } else { + failureMsg.append( "该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确"); + } + } + } + } /** * 校验申请人主题信息 * @param caseApplication @@ -2073,6 +2090,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setFilearbitraUrl(filearbitraUrl); } } + return caseApplication; } 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 d99c420..97dcac4 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 @@ -36,6 +36,10 @@ public class CaseLogUtils 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); diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 73536b0..4da9470 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -402,6 +402,7 @@ proper_preser, create_by, + import_flag, create_time )values( #{caseNum}, @@ -428,6 +429,7 @@ #{properPreser}, #{createBy}, + #{importFlag}, sysdate() ) From 6a49e0199fb6408c6ea5077ba4d17a6f829f4d05 Mon Sep 17 00:00:00 2001 From: qitz <18810291185@163.com> Date: Wed, 1 Nov 2023 13:59:47 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SysDeptServiceImpl.java | 15 ++++++++------ .../domain/CaseApplication.java | 1 + .../impl/CaseApplicationServiceImpl.java | 20 ++++++++++++++++++- .../utils/FixSelectFlowDetailUtils.java | 7 +++---- .../resources/mapper/system/SysDeptMapper.xml | 5 +++-- .../wisdomarbitrate/CaseAffiliateMapper.xml | 1 + 6 files changed, 36 insertions(+), 13 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index f7fb088..e5c8307 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -211,13 +211,16 @@ public class SysDeptServiceImpl implements ISysDeptService @Override public int insertDept(SysDept dept) { - SysDept info = deptMapper.selectDeptById(dept.getParentId()); - // 如果父节点不为正常状态,则不允许新增子节点 - if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) - { - throw new ServiceException("部门停用,不允许新增"); + Long parentId = dept.getParentId(); + if(parentId!=null){ + SysDept info = deptMapper.selectDeptById(dept.getParentId()); + // 如果父节点不为正常状态,则不允许新增子节点 + if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) + { + throw new ServiceException("部门停用,不允许新增"); + } + dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); } - dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); return deptMapper.insertDept(dept); } 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 9a0d4ed..f32973f 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 @@ -597,6 +597,7 @@ public class CaseApplication extends BaseEntity { /** 联系地址 */ @Excel(name = "申请人主体信息-联系地址",width = 26) private String contactAddress; + /** 单位电话 */ @Excel(name = "申请人主体信息-单位电话",width = 26) private String workTelphone; 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 535f948..3219e04 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 @@ -2073,8 +2073,26 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Transactional public int pendTralSure(CaseApplication caseApplication) { // caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); + caseApplication.setCaseStatus(CaseApplicationConstants.MODIFY_HEARDATE); - int rows = caseApplicationMapper.submitCaseApplication(caseApplication); + Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); + int rows = 0; + //同意组庭 + if(isAgreePendTral!=null&&isAgreePendTral==1){ + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + }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(",")); + caseApplication.setArbitratorId(idstr); + caseApplication.setArbitratorName(arbitratorNamestr); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); + } + } //发送短信通知 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); 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 6e6abc5..0cf4ed4 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 @@ -77,7 +77,7 @@ public class FixSelectFlowDetailUtils { caseApplication.setId(sealSignRecord.getCaseAppliId()); CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - if(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.SIGN_ARBITRATION){ + if((caseApplicationselect.getCaseStatus()!=null)&&(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.SIGN_ARBITRATION)){ caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); caseApplicationMapper.submitCaseApplication(caseApplication); @@ -85,8 +85,6 @@ public class FixSelectFlowDetailUtils { sealSignRecord.setSignFlowStatus(2); sealSignRecordMapper.updataSealSignRecord(sealSignRecord); } - - } if((psnsignStatus.intValue()==2)&&(orgsignStatus.intValue()==2)){ //更新立案申请状态为待送达 @@ -94,7 +92,7 @@ public class FixSelectFlowDetailUtils { caseApplication.setId(sealSignRecord.getCaseAppliId()); CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - if(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.ARBITRATED_SEAL){ + if((caseApplicationselect.getCaseStatus()!=null)&&(caseApplicationselect.getCaseStatus().intValue()==CaseApplicationConstants.ARBITRATED_SEAL)){ caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); //下载审核完成的裁决书, String signFlowId = sealSignRecord.getSignFlowid(); @@ -115,6 +113,7 @@ public class FixSelectFlowDetailUtils { } } + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 48a45b7..1444c0f 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -23,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time + select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_type,d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time from sys_dept d @@ -59,7 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"