From 032c7bfca181726abb314a49058e69ce133dae30 Mon Sep 17 00:00:00 2001 From: gy b Date: Fri, 13 Oct 2023 19:24:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=A5=E9=94=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CaseApplicationServiceImpl.java | 624 +++++++++--------- 1 file changed, 321 insertions(+), 303 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 f71b323..189787e 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 @@ -3,6 +3,9 @@ package com.ruoyi.wisdomarbitrate.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; + + + import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.google.gson.Gson; @@ -10,28 +13,37 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; +import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.entity.EsignHttpResponse; import com.ruoyi.common.core.domain.entity.SysDept; + import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.file.SaaSAPIFileUtils; + + + +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.exception.EsignDemoException; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.system.mapper.SysUserMapper; +import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.bean.BeanUtils; -import com.ruoyi.common.utils.file.SaaSAPIFileUtils; import com.ruoyi.system.mapper.SysDeptMapper; -import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; import com.ruoyi.wisdomarbitrate.mapper.*; import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; -import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.wisdomarbitrate.utils.SignAward; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.io.File; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; @@ -53,20 +65,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private ArbitratorMapper arbitratorMapper; @Autowired private ArbitrateRecordMapper arbitrateRecordMapper; - + @Autowired + private ICaseApplicationService caseApplicationService; @Autowired private CaseAttachMapper caseAttachMapper; @Autowired private SysDeptMapper sysDeptMapper; @Autowired - private ICaseApplicationService caseApplicationService; - @Autowired private SysUserMapper sysUserMapper; @Autowired private SealSignRecordMapper sealSignRecordMapper; - // 手机号正则 - 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 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}$"); + @Override @@ -91,18 +102,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { int rows = caseApplicationMapper.insertCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); - Map deptMap = new HashMap<>(); + 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)); + // 查询所有的组织机构,组装成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)); for (CaseAffiliate caseAffiliate : caseAffiliates) { caseAffiliate.setCaseAppliId(caseApplication.getId()); - if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { + if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseAffiliate.getName())) { caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); @@ -136,25 +147,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_APPLICATION,""); return rows; } /** * 获取自动编码 - * * @return */ private String generateCaseNum() { // 自动编码格式 zc+yyyyMMdd+001 String currentDay = DateUtils.dateTime(); - String caseNum = "zc" + currentDay; + String caseNum = "zc"+ currentDay; //查询出当天的案件编号的最大值 - Integer maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum, caseNum.length()); - if (null == maxCaseNum) { + Integer maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length()); + if(null == maxCaseNum){ caseNum = caseNum + "001"; - } else { + }else { caseNum = caseNum + String.format("%03d", maxCaseNum); } return caseNum; @@ -172,21 +182,21 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 BigDecimal feeRate = new BigDecimal(0.01); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, BigDecimal.ROUND_HALF_UP); + BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP); caseApplication.setFeePayable(feePayable); int rows = caseApplicationMapper.updataCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { + 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)); - for (CaseAffiliate caseAffiliate : caseAffiliates) { + Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); + for (CaseAffiliate caseAffiliate : caseAffiliates){ caseAffiliate.setCaseAppliId(caseApplication.getId()); - if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { + if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseAffiliate.getName())) { caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); @@ -212,8 +222,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } List caseAttachList = caseApplication.getCaseAttachList(); - if (caseAttachList != null && caseAttachList.size() > 0) { - for (CaseAttach caseAttach : caseAttachList) { + if(caseAttachList!=null&&caseAttachList.size()>0){ + for (CaseAttach caseAttach : caseAttachList){ caseAttach.setCaseAppliId(caseApplication.getId()); caseAttachMapper.updateCaseAttach(caseAttach); } @@ -230,7 +240,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.CASE_CHECK); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CHECK, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_CHECK,""); return rows; } @@ -266,8 +276,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String annexPath = "/uploadPath" + annexName.substring(startIndex); caseAttach.setAnnexPath(annexPath); int startIndexnew = annexName.lastIndexOf("/"); - if (startIndexnew != -1) { - String annexNamenew = annexName.substring(startIndexnew + 1); + if(startIndexnew!=-1){ + String annexNamenew = annexName.substring(startIndexnew+1); caseAttach.setAnnexName(annexNamenew); } @@ -277,27 +287,27 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationselect.setCaseAttachList(caseAttachList); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliatListeselect != null) { + if(caseAffiliatListeselect!=null){ // 查询组织机构 List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(sysDepts)) { + Map deptMap=new HashMap<>(); + if(CollectionUtil.isNotEmpty(sysDepts)){ for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); + deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); } } StringBuffer applicantName = new StringBuffer(); StringBuffer respondentName = new StringBuffer(); - for (int i = 0; i < caseAffiliatListeselect.size(); i++) { + 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())) { + if(identityType==1){ + if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } - applicantName.append(caseAffiliateselect.getName()).append(","); - } else if (identityType == 2) { - respondentName.append(caseAffiliateselect.getName()).append(","); + applicantName.append(caseAffiliateselect.getName()).append(",");; + }else if(identityType==2){ + respondentName.append(caseAffiliateselect.getName()).append(",");; } } caseApplicationselect.setApplicantName(applicantName.toString()); @@ -310,26 +320,26 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional - public String importCaseApplication(List caseApplicationList, String operName) { + public String importCaseApplication(List caseApplicationList, String operName) { StringBuilder failureMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder(); int successNum = 0; int failureNum = 0; - if (caseApplicationList != null && caseApplicationList.size() > 0) { + 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)); + Map deptMap =new HashMap<>(); + if(CollectionUtil.isNotEmpty(deptList)) { + deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); } List caseApplicationListinsert = new ArrayList<>(); - for (int i = 0; i < caseApplicationList.size(); i++) { + for (int i = 0; i < caseApplicationList.size(); i++){ CaseApplication caseApplication = caseApplicationList.get(i); // 导入校验 importValid(caseApplication); // 校验成功的数据 - if (StrUtil.isEmpty(caseApplication.getErrorMsg())) { + if(StrUtil.isEmpty(caseApplication.getErrorMsg())) { //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 BigDecimal feeRate = new BigDecimal(0.01); @@ -349,12 +359,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // caseApplicationListinsert.add(caseApplication); // } caseApplicationListinsert.add(caseApplication); - } else { + }else { // 拼接错误信息 - failureMsg.append("
").append("第").append(i + 2).append("行:").append(caseApplication.getErrorMsg().toString()); + failureMsg.append("
").append("第").append(i+2).append("行:").append(caseApplication.getErrorMsg().toString()); } } - if (caseApplicationListinsert != null && caseApplicationListinsert.size() > 0) { + if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ // List caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect( // collectingAndThen( // toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))), @@ -363,45 +373,45 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 // if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.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 != null && caseApplicationListinsert.size() > 0) { - for (int j = 0; j < caseApplicationListinsert.size(); j++) { - CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); + 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!=null&&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())) { + if(StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum())&& + caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())){ - caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); + caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); + } } + caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); + caseApplicationNewList.add(caseApplicationNew); } - caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); - caseApplicationNewList.add(caseApplicationNew); - } - for (int k = 0; k < caseApplicationNewList.size(); k++) { - CaseApplication caseApplicationItera = caseApplicationNewList.get(k); - // 新增立案信息 - caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + for (int k = 0; k < caseApplicationNewList.size(); k++){ + CaseApplication caseApplicationItera = caseApplicationNewList.get(k); + // 新增立案信息 + caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); - List caseAffiliates = caseApplicationItera.getCaseAffiliates(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate caseAffiliate : caseAffiliates) { - caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); + int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); + List caseAffiliates = caseApplicationItera.getCaseAffiliates(); + if(caseAffiliates!=null&&caseAffiliates.size()>0){ + for (CaseAffiliate caseAffiliate : caseAffiliates){ + caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); + } + caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); } - caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); + successNum++; + successMsg.append("
" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功"); } - successNum++; - successMsg.append("
" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功"); - } // } @@ -409,239 +419,233 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - } else { + }else { throw new ServiceException("导入立案申请数据不能为空!"); } - return successMsg.append(failureMsg.toString()).toString(); + return successMsg.append(failureMsg.toString()).toString(); } /** * 导入校验 - * * @param caseApplication * @param */ private void importValid(CaseApplication caseApplication) { - StringBuilder failureMsg = new StringBuilder(); + StringBuilder failureMsg=new StringBuilder(); caseApplication.setErrorMsg(failureMsg); // 校验基本字段 - validBaseColumn(caseApplication, failureMsg); + validBaseColumn(caseApplication,failureMsg); // 校验申请人信息 - validApplicationColumn(caseApplication, failureMsg); + validApplicationColumn(caseApplication,failureMsg); // 校验申请人代理信息 - validApplicationAgentColumn(caseApplication, failureMsg); + validApplicationAgentColumn(caseApplication,failureMsg); // 校验被申请人信息 - validDebtorApplicationColumn(caseApplication, failureMsg); + validDebtorApplicationColumn(caseApplication,failureMsg); // 校验被申请人代理信息 - validDebtorApplicationAgentColumn(caseApplication, failureMsg); + validDebtorApplicationAgentColumn(caseApplication,failureMsg); } /** * 校验被申请人代理信息 - * * @param caseApplication * @param failureMsg */ private void validDebtorApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if (StrUtil.isEmpty(caseApplication.getDebtorNameAgent())) { + if( StrUtil.isEmpty(caseApplication.getDebtorNameAgent())){ failureMsg.append("【被申请人主体信息-代理人姓名】字段不能为空;"); - } else if (caseApplication.getDebtorNameAgent().length() > 50) { + }else if(caseApplication.getDebtorNameAgent().length()>50){ failureMsg.append("【被申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;"); } - if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())) { + if( StrUtil.isEmpty(caseApplication.getDebtorIdentityNumAgent())){ failureMsg.append("【被申请人主体信息-代理人身份证号】字段不能为空;"); - } else if (caseApplication.getDebtorIdentityNumAgent().length() > 50) { + }else if(caseApplication.getDebtorIdentityNumAgent().length()>50){ failureMsg.append("【被申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;"); } String debtorContactTelphoneAgent = caseApplication.getDebtorContactTelphoneAgent(); - if (StrUtil.isEmpty(debtorContactTelphoneAgent)) { + if( StrUtil.isEmpty(debtorContactTelphoneAgent)){ failureMsg.append("【被申请人主体信息-代理人联系电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(debtorContactTelphoneAgent).matches()) { + }else if(!TELEPHONE_REGX.matcher(debtorContactTelphoneAgent).matches()){ failureMsg.append("【被申请人主体信息-代理人联系电话】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getDebtorContactAddressAgent())) { + if( StrUtil.isEmpty(caseApplication.getDebtorContactAddressAgent())){ failureMsg.append("【被申请人主体信息-代理人联系地址】字段不能为空;"); - } else if (caseApplication.getDebtorContactAddressAgent().length() > 50) { + }else if(caseApplication.getDebtorContactAddressAgent().length()>50){ failureMsg.append("【被申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;"); } } /** * 校验被申请人信息 - * * @param caseApplication * @param failureMsg */ private void validDebtorApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if (StrUtil.isEmpty(caseApplication.getDebtorName())) { + if( StrUtil.isEmpty(caseApplication.getDebtorName())){ failureMsg.append("【被申请人主体信息-申请人姓名】字段不能为空;"); - } else if (caseApplication.getDebtorName().length() > 50) { + }else if(caseApplication.getDebtorName().length()>50){ failureMsg.append("【被申请人主体信息-申请人姓名】字段超出指定长度,最大长度为50;"); } - if (StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())) { + if( StrUtil.isEmpty(caseApplication.getDebtorIdentityNum())){ failureMsg.append("【被申请人主体信息-身份证号】字段不能为空;"); - } else if (caseApplication.getDebtorIdentityNum().length() > 50) { + }else if(caseApplication.getDebtorIdentityNum().length()>50){ failureMsg.append("【被申请人主体信息-身份证号】字段超出指定长度,最大长度为50;"); } String debtorContactTelphone = caseApplication.getDebtorContactTelphone(); - if (StrUtil.isEmpty(debtorContactTelphone)) { + if( StrUtil.isEmpty(debtorContactTelphone)){ failureMsg.append("【被申请人主体信息-联系电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(debtorContactTelphone).matches()) { + }else if(!TELEPHONE_REGX.matcher(debtorContactTelphone).matches()){ failureMsg.append("【被申请人主体信息-联系电话】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getDebtorContactAddress())) { + if( StrUtil.isEmpty(caseApplication.getDebtorContactAddress())){ failureMsg.append("【被申请人主体信息-联系地址】字段不能为空;"); - } else if (caseApplication.getDebtorContactAddress().length() > 50) { + }else if(caseApplication.getDebtorContactAddress().length()>50){ failureMsg.append("【被申请人主体信息-联系地址】字段超出指定长度,最大长度为50;"); } String debtorWorkTelphone = caseApplication.getDebtorWorkTelphone(); - if (StrUtil.isEmpty(debtorWorkTelphone)) { + if( StrUtil.isEmpty(debtorWorkTelphone)){ failureMsg.append("【被申请人主体信息-单位电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(debtorWorkTelphone).matches()) { + }else if(!TELEPHONE_REGX.matcher(debtorWorkTelphone).matches()){ failureMsg.append("【被申请人主体信息-单位电话】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getDebtorWorkAddress())) { + if( StrUtil.isEmpty(caseApplication.getDebtorWorkAddress())){ failureMsg.append("【被申请人主体信息-单位地址】字段不能为空;"); - } else if (caseApplication.getDebtorWorkAddress().length() > 50) { + }else if(caseApplication.getDebtorWorkAddress().length()>50){ failureMsg.append("【被申请人主体信息-单位地址】字段超出指定长度,最大长度为50;"); } } /** * 校验申请人代理信息 - * * @param caseApplication * @param failureMsg */ private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if (StrUtil.isEmpty(caseApplication.getNameAgent())) { + if( StrUtil.isEmpty(caseApplication.getNameAgent())){ failureMsg.append("【申请人主体信息-代理人姓名】字段不能为空;"); - } else if (caseApplication.getNameAgent().length() > 50) { + }else if(caseApplication.getNameAgent().length()>50){ failureMsg.append("【申请人主体信息-代理人姓名】字段超出指定长度,最大长度为50;"); } - if (StrUtil.isEmpty(caseApplication.getIdentityNumAgent())) { + if( StrUtil.isEmpty(caseApplication.getIdentityNumAgent())){ failureMsg.append("【申请人主体信息-代理人身份证号】字段不能为空;"); - } else if (caseApplication.getIdentityNumAgent().length() > 50) { + }else if(caseApplication.getIdentityNumAgent().length()>50){ failureMsg.append("【申请人主体信息-代理人身份证号】字段超出指定长度,最大长度为50;"); } String contactTelphoneAgent = caseApplication.getContactTelphoneAgent(); - if (StrUtil.isEmpty(contactTelphoneAgent)) { + if( StrUtil.isEmpty(contactTelphoneAgent)){ failureMsg.append("【申请人主体信息-代理人联系电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(contactTelphoneAgent).matches()) { + }else if(!TELEPHONE_REGX.matcher(contactTelphoneAgent).matches()){ failureMsg.append("【申请人主体信息-代理人联系电话】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getContactAddressAgent())) { + if( StrUtil.isEmpty(caseApplication.getContactAddressAgent())){ failureMsg.append("【申请人主体信息-代理人联系地址】字段不能为空;"); - } else if (caseApplication.getContactAddressAgent().length() > 50) { + }else if(caseApplication.getContactAddressAgent().length()>50){ failureMsg.append("【申请人主体信息-代理人联系地址】字段超出指定长度,最大长度为50;"); } } /** * 校验申请人主题信息 - * * @param caseApplication * @param failureMsg */ private void validApplicationColumn(CaseApplication caseApplication, StringBuilder failureMsg) { - if (StrUtil.isEmpty(caseApplication.getName())) { + if( StrUtil.isEmpty(caseApplication.getName())){ failureMsg.append("【申请人主体信息-申请人(机构)】字段不能为空;"); - } else if (caseApplication.getName().length() > 20) { + }else if(caseApplication.getName().length()>20){ failureMsg.append("【申请人主体信息-申请人(机构)】字段超出指定长度,最大长度为20;"); } - if (StrUtil.isNotEmpty(caseApplication.getIdentityNum()) && caseApplication.getIdentityNum().length() > 50) { + if( StrUtil.isNotEmpty(caseApplication.getIdentityNum())&&caseApplication.getIdentityNum().length()>50){ failureMsg.append("【申请人主体信息-代码】字段超出指定长度,最大长度为50;"); } String contactTelphone = caseApplication.getContactTelphone(); - if (StrUtil.isEmpty(contactTelphone)) { + if( StrUtil.isEmpty(contactTelphone)){ failureMsg.append("【申请人主体信息-联系电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(contactTelphone).matches()) { + }else if(!TELEPHONE_REGX.matcher(contactTelphone).matches()){ failureMsg.append("【申请人主体信息-联系电话】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getContactAddress())) { + if( StrUtil.isEmpty(caseApplication.getContactAddress())){ failureMsg.append("【申请人主体信息-联系地址】字段不能为空;"); - } else if (caseApplication.getName().length() > 50) { + }else if(caseApplication.getName().length()>50){ failureMsg.append("【申请人主体信息-联系地址】字段超出指定长度,最大长度为50;"); } String workTelphone = caseApplication.getWorkTelphone(); - if (StrUtil.isEmpty(workTelphone)) { + if( StrUtil.isEmpty(workTelphone)){ failureMsg.append("【申请人主体信息-单位电话】字段不能为空;"); - } else if (!TELEPHONE_REGX.matcher(workTelphone).matches()) { + }else if(!TELEPHONE_REGX.matcher(workTelphone).matches()){ failureMsg.append("【申请人主体信息-单位电话】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getWorkAddress())) { + if( StrUtil.isEmpty(caseApplication.getWorkAddress())){ failureMsg.append("【申请人主体信息-单位地址】字段不能为空;"); - } else if (caseApplication.getWorkAddress().length() > 50) { + }else if(caseApplication.getWorkAddress().length()>50){ failureMsg.append("【申请人主体信息-单位地址】字段超出指定长度,最大长度为50;"); } } /** * 校验基本字段 - * * @param caseApplication * @param failureMsg */ private void validBaseColumn(CaseApplication caseApplication, StringBuilder failureMsg) { BigDecimal caseSubjectAmount = caseApplication.getCaseSubjectAmount(); - if (null == caseSubjectAmount) { + if(null== caseSubjectAmount){ failureMsg.append("【案件标的】字段不合法;"); - } else { - if (caseSubjectAmount.compareTo(new BigDecimal("0")) < 0 || caseSubjectAmount.compareTo(new BigDecimal("99999999.99")) > 0) { + }else { + if(caseSubjectAmount.compareTo(new BigDecimal("0")) < 0 ||caseSubjectAmount.compareTo(new BigDecimal("99999999.99"))>0){ failureMsg.append("【案件标的】字段超出范围,范围为[0,100000000);"); } - if (caseSubjectAmount.scale() > 2) { + if(caseSubjectAmount.scale()>2){ failureMsg.append("【案件标的】字段超出指定精度(10^-2);"); } } - if (caseApplication.getLoanStartDate() == null) { + if( caseApplication.getLoanStartDate()== null){ failureMsg.append("【借款开始日期】字段不合法;"); } - if (caseApplication.getLoanEndDate() == null) { + if( caseApplication.getLoanEndDate()== null){ failureMsg.append("【借款结束日期】字段不合法;"); } - if (StrUtil.isEmpty(caseApplication.getContractNumber())) { + if( StrUtil.isEmpty(caseApplication.getContractNumber())){ failureMsg.append("【合同编号】字段不能为空;"); - } else if (caseApplication.getContractNumber().length() > 50) { + }else if(caseApplication.getContractNumber().length()>50){ failureMsg.append("【合同编号】字段超出指定长度,最大长度为50;"); } BigDecimal claimPrinciOwed = caseApplication.getClaimPrinciOwed(); - if (null == claimPrinciOwed) { + if(null== claimPrinciOwed){ failureMsg.append("【申请人主张欠本金】字段不合法;"); - } else { - if (claimPrinciOwed.compareTo(new BigDecimal("0")) < 0 || claimPrinciOwed.compareTo(new BigDecimal("99999999.99")) > 0) { + }else { + if(claimPrinciOwed.compareTo(new BigDecimal("0")) < 0 ||claimPrinciOwed.compareTo(new BigDecimal("99999999.99"))>0){ failureMsg.append("【申请人主张欠本金】字段超出范围,范围为[0,100000000);"); } - if (claimPrinciOwed.scale() > 2) { + if(claimPrinciOwed.scale()>2){ failureMsg.append("【申请人主张欠本金】字段超出指定精度(10^-2);"); } } BigDecimal claimInterestOwed = caseApplication.getClaimInterestOwed(); - if (null == claimInterestOwed) { + if(null== claimInterestOwed){ failureMsg.append("【申请人主张欠利息】字段不合法;"); - } else { - if (claimInterestOwed.compareTo(new BigDecimal("0")) < 0 || claimInterestOwed.compareTo(new BigDecimal("99999999.99")) > 0) { + }else { + if(claimInterestOwed.compareTo(new BigDecimal("0")) < 0 ||claimInterestOwed.compareTo(new BigDecimal("99999999.99"))>0){ failureMsg.append("【申请人主张欠利息】字段超出范围,范围为[0,100000000);"); } - if (claimInterestOwed.scale() > 2) { + if(claimInterestOwed.scale()>2){ failureMsg.append("【申请人主张欠利息】字段超出指定精度(10^-2);"); } } BigDecimal claimLiquidDamag = caseApplication.getClaimLiquidDamag(); - if (null == claimLiquidDamag) { + if(null== claimLiquidDamag){ failureMsg.append("【申请人主张违约金】字段不合法;"); - } else { - if (claimLiquidDamag.compareTo(new BigDecimal("0")) < 0 || claimLiquidDamag.compareTo(new BigDecimal("99999999.99")) > 0) { + }else { + if(claimLiquidDamag.compareTo(new BigDecimal("0")) < 0 ||claimLiquidDamag.compareTo(new BigDecimal("99999999.99"))>0){ failureMsg.append("【申请人主张违约金】字段超出范围,范围为[0,100000000);"); } - if (claimLiquidDamag.scale() > 2) { + if(claimLiquidDamag.scale()>2){ failureMsg.append("【申请人主张违约金】字段超出指定精度(10^-2);"); } } - if (StrUtil.isEmpty(caseApplication.getArbitratClaims())) { + if( StrUtil.isEmpty(caseApplication.getArbitratClaims())){ failureMsg.append("【申请人仲裁诉求】字段不能为空;"); - } else if (caseApplication.getArbitratClaims().length() > 10000) { + }else if(caseApplication.getArbitratClaims().length()>10000){ failureMsg.append("【申请人仲裁诉求】字段超出指定长度,最大长度为10000;"); } } @@ -652,7 +656,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { public int pendTral(CaseApplication caseApplication) { List arbitrators = caseApplication.getArbitrators(); int rows = 0; - if (arbitrators != null && arbitrators.size() > 0) { + 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(",")); @@ -674,12 +678,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); int rows = 0; //同意组庭 - if (isAgreePendTral != null && isAgreePendTral == 1) { + if(isAgreePendTral!=null&&isAgreePendTral==1){ rows = caseApplicationMapper.submitCaseApplication(caseApplication); - } else { + }else { List arbitrators = caseApplication.getArbitrators(); // 仲裁员信息 - if (arbitrators != null && arbitrators.size() > 0) { + 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(",")); @@ -690,7 +694,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL,""); return rows; } @@ -702,7 +706,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CHECK_ARBITRATION,""); return rows; } @@ -714,7 +718,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord(); arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord); Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); - if (agreeOrNotCheck.intValue() == 1) {//同意审核 + if(agreeOrNotCheck.intValue()==1){//同意审核 try { //获取当前案件的裁决书 CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); @@ -724,25 +728,26 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (caseAttach.getAnnexType() == 3) { String annexPath = caseAttach.getAnnexPath(); String path = "/home/ruoyi/" + annexPath; -// String path ="D:\\home\\仲裁裁决书模板.docx"; + System.out.println("这是查询到的裁决书路径"+path); + //String path ="D:\\home\\仲裁裁决书模板.docx"; //获取文件上传地址 EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path); String body = response.getBody(); - if (body != null) { + if (body != null){ JSONObject jsonObject = JSONObject.parseObject(body); String fileId = jsonObject.getJSONObject("data").getString("fileId"); String fileUploadUrl = jsonObject.getJSONObject("data").getString("fileUploadUrl"); //上传文件流 EsignHttpResponse response1 = SaaSAPIFileUtils.uploadFile(fileUploadUrl, path); JSONObject jsonObject1 = JSONObject.parseObject(response1.getBody()); - if (jsonObject1.getIntValue("errCode") == 0) { + if (jsonObject1.getIntValue("errCode")==0){ //查看文件上传状态 Thread.sleep(5000); EsignHttpResponse response2 = SaaSAPIFileUtils.getFileStatus(fileId); JSONObject jsonObject2 = JSONObject.parseObject(response2.getBody()); JSONObject data = jsonObject2.getJSONObject("data"); - int fileStatus = data.getIntValue("fileStatus"); - if (fileStatus == 2 || fileStatus == 5) { + int fileStatus =data.getIntValue("fileStatus"); + if (fileStatus == 2 || fileStatus == 5){ String fileName = data.getString("fileName"); //上传成功,获取文件签名印章位置 SealSignRecord sealSignRecord = new SealSignRecord(); @@ -751,21 +756,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Gson gson = new Gson(); JsonObject positionsJsonObject = gson.fromJson(positions.getBody(), JsonObject.class); JsonObject positionsData = positionsJsonObject.getAsJsonObject("data"); - String keywordPositions = positionsData.get("keywordPositions").getAsString(); + String keywordPositions = positionsData.get("keywordPositions").toString(); //发起签署 sealSignRecord.setFilename(fileName); String arbitratorId = caseApplication2.getArbitratorId(); - if (arbitratorId != null) { + if (arbitratorId!=null){ SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(arbitratorId)); - if (sysUser == null) { + if (sysUser == null){ return rows; } sealSignRecord.setPensonAccount(sysUser.getPhonenumber()); sealSignRecord.setPensonName(sysUser.getNickName()); } sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); - sealSignRecord.setOrgnizeNamePsnAccount("秦桃则"); - sealSignRecord.setOrgnizeName("西安云美电子科技有限公司"); sealSignRecord.setOrgnizeNamePsnAccount("17691338406"); sealSignRecord.setOrgnizeNamepsnName("韩超勃"); //解析文件签名印章位置 @@ -773,11 +776,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for (int i = 0; i < jsonArray.size(); i++) { JSONObject jsonObject3 = jsonArray.getJSONObject(i); String keyword = jsonObject3.getString("keyword"); - if (keyword.equals("仲裁员")) { + if (keyword.equals("仲裁员:")){ //签名 JSONArray positionsArray = jsonObject3.getJSONArray("positions"); // 遍历 positionsArray 中的每个元素 - for (int j = 0; j < positionsArray.size(); j++) { + for (int j = 0; j < positionsArray.size(); j++){ JSONObject positionObj = positionsArray.getJSONObject(j); int pageNum = positionObj.getIntValue("pageNum"); sealSignRecord.setPositionPagepsn(String.valueOf(pageNum)); @@ -788,7 +791,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { sealSignRecord.setPositionXpsn(positionX); sealSignRecord.setPositionYpsn(positionY); } - } else { + }else { //用印 JSONArray positionsArray = jsonObject3.getJSONArray("positions"); // 遍历 positionsArray 中的每个元素 @@ -807,7 +810,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord); JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody()); - if (jsonObject1.getIntValue("code") == 0) { + if (jsonObject3.getIntValue("code")==0){ //获取签署流程ID JSONObject data1 = jsonObject3.getJSONObject("data"); String signFlowId = data1.getString("signFlowId"); @@ -816,6 +819,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { sealSignRecord.setSignFlowid(signFlowId); sealSignRecord.setSignFlowStatus(1);//待签名 sealSignRecordMapper.insertSealSignRecord(sealSignRecord); + }else { + throw new ServiceException("发起签署流程失败,请检查参数是否有误"); } } } @@ -831,12 +836,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseApplication.setCaseStatus(CaseApplicationConstants.SIGN_ARBITRATION); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.SIGN_ARBITRATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.SIGN_ARBITRATION,""); + rows = caseApplicationMapper.submitCaseApplication(caseApplication); - } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 + }else if(agreeOrNotCheck.intValue()==2){//拒绝审核 caseApplication.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.VERPRIF_ARBITRATION, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.VERPRIF_ARBITRATION,""); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } @@ -850,15 +856,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //提交立案审查 int rows = 0; Integer agreeOrNotCheck = caseApplication.getAgreeOrNotCheck(); - if (agreeOrNotCheck.intValue() == 1) {//同意审核 + if(agreeOrNotCheck.intValue()==1){//同意审核 caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); rows = caseApplicationMapper.submitCaseApplication(caseApplication); - } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核 + }else if(agreeOrNotCheck.intValue()==2){//拒绝审核 caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); rows = caseApplicationMapper.submitCaseApplication(caseApplication); } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_PAYMENT,""); return rows; } @@ -866,31 +872,30 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override public CaseApplication selectCaseApplicationConfirm(CaseApplication caseApplication) { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplicationConfirm(caseApplication); - if (caseApplicationselect == null) { + if(caseApplicationselect==null){ return caseApplicationselect; } CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliatListeselect != null) { + if(caseAffiliatListeselect!=null){ // 查询组织机构 List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(sysDepts)) { + Map deptMap=new HashMap<>(); + if(CollectionUtil.isNotEmpty(sysDepts)){ for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); + deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); } } StringBuffer applicantName = new StringBuffer(); - for (int i = 0; i < caseAffiliatListeselect.size(); i++) { + 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())) { + if(identityType==1){ + 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(",");; } } caseApplicationselect.setApplicantName(applicantName.toString()); @@ -902,14 +907,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 给被申请人发送房间号短信 - * * @param messageVO * @return */ @Override public String sendRoomNoMessage(SendRoomNoMessageVO messageVO) { CaseAffiliate caseAffiliate = caseAffiliateMapper.selectCaseAffiliateByIdentityType(messageVO.getId(), 2); - if (null == caseAffiliate) { + if(null==caseAffiliate){ return "被申请人不存在"; } CaseApplication caseApplication = new CaseApplication(); @@ -918,7 +922,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //发送短信通知 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1948332"); + request.setTemplateId("1952136"); // 1948332 普通短信 开庭审理房间号通知 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请知晓,如非本人操作,请忽略本短信。 request.setPhone(caseAffiliate.getContactTelphone()); request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()}); @@ -934,7 +938,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Gson gson = new Gson(); List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); SealSignRecord sealSignRecordReslt = new SealSignRecord(); - if (sealSignRecords != null && sealSignRecords.size() > 0) { + if(sealSignRecords!=null&&sealSignRecords.size()>0){ SealSignRecord sealSignRecordselect = sealSignRecords.get(0); EsignHttpResponse signUrl = SignAward.signUrl(sealSignRecordselect); JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class); @@ -953,7 +957,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Gson gson = new Gson(); List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); SealSignRecord sealSignRecordReslt = new SealSignRecord(); - if (sealSignRecords != null && sealSignRecords.size() > 0) { + if(sealSignRecords!=null&&sealSignRecords.size()>0){ SealSignRecord sealSignRecordselect = sealSignRecords.get(0); EsignHttpResponse signUrl = SignAward.usesealUrl(sealSignRecordselect); JsonObject signUrlJsonObject = gson.fromJson(signUrl.getBody(), JsonObject.class); @@ -982,50 +986,45 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String arbitratorId = caseApplicationselect.getArbitratorId(); // List arbitratorList = new ArrayList<>(); - if (StringUtils.isNotEmpty(arbitratorId)) { - String[] idStrList = arbitratorId.split(","); + if(StringUtils.isNotEmpty(arbitratorId)){ + String[] idStrList = arbitratorId.split(","); List idList = new ArrayList<>(); - for (int i = 0; i < idStrList.length; i++) { + for(int i = 0;i < idStrList.length;i ++ ){ idList.add(Long.parseLong(idStrList[i])); } -// - - // 查询仲裁员电话号 - List userList = sysUserMapper.selectUserListByIds(idList); - if (CollectionUtil.isNotEmpty(userList)) { - for (SysUser user : userList) { - - - //给仲裁员发送短信通知 - request.setPhone(user.getPhonenumber()); - // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = user.getNickName(); - request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); - SmsUtils.sendSms(request); - - } - } + // 查询仲裁员电话号 + List userList= sysUserMapper.selectUserListByIds(idList); + if(CollectionUtil.isNotEmpty(userList)) { + for (SysUser user : userList) { + //给仲裁员发送短信通知 + request.setPhone(user.getPhonenumber()); + // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 + String name = user.getNickName(); + request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); + SmsUtils.sendSms(request); + } + } } CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if (caseAffiliatListeselect != null) { + if(caseAffiliatListeselect!=null) { // 查询组织机构 List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap = new HashMap<>(); - if (CollectionUtil.isNotEmpty(sysDepts)) { + Map deptMap=new HashMap<>(); + if(CollectionUtil.isNotEmpty(sysDepts)){ for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()), sysDept.getDeptName()); + deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); } } for (int j = 0; j < caseAffiliatListeselect.size(); j++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j); int identityType = caseAffiliateselect.getIdentityType(); - if (identityType == 1) { - if (StrUtil.isNotEmpty(caseAffiliateselect.getName()) && deptMap.containsKey(caseAffiliateselect.getName())) { + if(identityType==1){ + if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); } @@ -1039,21 +1038,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION_METHOD, ""); + CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CHECK_ARBITRATION_METHOD,""); return rows; } + @Override @Transactional public int pendingAppointArbotrar(CaseApplication caseApplication) { int pendingAppointArbotrar = caseApplication.getPendingAppointArbotrar(); List arbitrators = caseApplication.getArbitrators(); int rows = 0; - if (pendingAppointArbotrar == 1) { - if (arbitrators != null && arbitrators.size() > 0) { + if(pendingAppointArbotrar==1){ + 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(",")); @@ -1065,7 +1065,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); } - } else { + }else { caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); caseApplication.setPendingAppointArbotrar(2); rows = caseApplicationMapper.submitCaseApplication(caseApplication); @@ -1077,59 +1077,59 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } + private void assignmentCaseAffiliates(CaseApplication caseApplication, List caseAffiliatesnew, Map deptMap) { - // 申请人信息 + // 申请人信息 CaseAffiliate caseAffiliate = new CaseAffiliate(); // BeanUtils.copyBeanProp(caseApplication,caseAffiliate); - BeanUtils.copyBeanProp(caseAffiliate, caseApplication); + BeanUtils.copyBeanProp(caseAffiliate,caseApplication); caseAffiliate.setIdentityType(1); // 申请人(机构),需要判断部门中是否存在,不存在则新增,当身份类型为1的时候,查询时需要根据名称查询组织机构 - if (StrUtil.isNotEmpty(caseApplication.getName())) { + if(StrUtil.isNotEmpty(caseApplication.getName())){ setApplicantOrganization(caseAffiliate, caseApplication, deptMap); } caseAffiliatesnew.add(caseAffiliate); // 组装被申请人信息 - caseAffiliatesnew.add(buildDebtorInfo(caseApplication)); + caseAffiliatesnew.add( buildDebtorInfo(caseApplication)); caseApplication.setCaseAffiliates(caseAffiliatesnew); } /** * 设置申请人的组织机构 - * * @param caseAffiliate * @param caseApplication */ @DataScope(deptAlias = "d") - private void setApplicantOrganization(CaseAffiliate caseAffiliate, CaseApplication caseApplication, Map deptMap) { + private void setApplicantOrganization(CaseAffiliate caseAffiliate, CaseApplication caseApplication, Map deptMap ) { - // 将组织机构id设为申请人名称 - if (deptMap.containsKey(caseApplication.getName())) { - caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName()))); - } else { - // 如果不存在则新增 - SysDept dept = new SysDept(); - dept.setParentId(0L); - dept.setDeptName(caseApplication.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.setName(String.valueOf(dept.getDeptId())); - } + // 将组织机构id设为申请人名称 + if(deptMap.containsKey(caseApplication.getName())){ + caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName()))); + }else { + // 如果不存在则新增 + SysDept dept = new SysDept(); + dept.setParentId(0L); + dept.setDeptName(caseApplication.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.setName(String.valueOf(dept.getDeptId())); + + } } /** * 组装被申请人信息 - * * @param caseApplication * @return */ @@ -1165,61 +1165,79 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationNew.setFeePayable(caseApplicationinsertDiffer.getFeePayable()); } - @Transactional - public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException { - - Gson gson = new Gson(); +// @Transactional +// public void fixExecuteSelectFlowDetailUtils() throws EsignDemoException { +// +// Gson gson = new Gson(); +// +// SealSignRecord sealSignRecordselect = new SealSignRecord(); +// sealSignRecordselect.setSignFlowStatus(1); +// +// List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecordselect); +// if(sealSignRecords!=null&&sealSignRecords.size()>0){ +// for (int i = 0; i < sealSignRecords.size(); i++) { +// SealSignRecord sealSignRecord = sealSignRecords.get(i); +// EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); +// JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(),JsonObject.class); +// JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); +// JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); +// for (int j = 0; j < signersArray.size(); j++) { +// JsonObject signerObject = (JsonObject)signersArray.get(j); +// Integer psnsignStatus ; +// Integer orgsignStatus ; +// if(!(signerObject.get("psnSigner").toString()).equals("null")){ +// JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); +// if(psnSignerData!=null){ +// psnsignStatus = signerObject.get("signStatus").getAsInt(); +// sealSignRecord.setPsnsignStatus(psnsignStatus); +// +// if(psnsignStatus.intValue()==2){ +// //更新立案申请状态为待用印 +// CaseApplication caseApplication = new CaseApplication(); +// caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); +// caseApplicationMapper.submitCaseApplication(caseApplication); +// +// //修改"签署用印记录表"的状态为待用印 +// sealSignRecord.setSignFlowStatus(2); +// sealSignRecordMapper.updataSealSignRecord(sealSignRecord); +// +// } +// } +// } +// if(!(signerObject.get("orgSigner").toString()).equals("null")){ +// JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); +// if(orgSignerData!=null){ +// orgsignStatus = signerObject.get("signStatus").getAsInt(); +// sealSignRecord.setOrgsignStatus(orgsignStatus); +// //更新立案申请状态为待送达 +// CaseApplication caseApplication = new CaseApplication(); +// caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); +// caseApplicationMapper.submitCaseApplication(caseApplication); +// +// //修改"签署用印记录表"的状态为签署完成 +// sealSignRecord.setSignFlowStatus(3); +// sealSignRecordMapper.updataSealSignRecord(sealSignRecord); +// +// //下载审核完成的裁决书, +//// SaaSAPIFileUtils.fileDownloadUrl(); +// +// } +// +// } +// +// } +// +// } +// +// } - SealSignRecord sealSignRecord = new SealSignRecord(); - sealSignRecord.setSignFlowid("41e6732b48c54c63a91b2379c352212d"); - EsignHttpResponse signFlowDetail = SignAward.signFlowDetail(sealSignRecord); - JsonObject signFlowDetailJsonObject = gson.fromJson(signFlowDetail.getBody(), JsonObject.class); - JsonObject flowDetailData = signFlowDetailJsonObject.getAsJsonObject("data"); - JsonArray signersArray = flowDetailData.get("signers").getAsJsonArray(); - for (int i = 0; i < signersArray.size(); i++) { - JsonObject signerObject = (JsonObject) signersArray.get(i); - Integer psnsignStatus; - Integer orgsignStatus; - if (!(signerObject.get("psnSigner").toString()).equals("null")) { - JsonObject psnSignerData = signerObject.getAsJsonObject("psnSigner"); - if (psnSignerData != null) { - psnsignStatus = signerObject.get("signStatus").getAsInt(); - sealSignRecord.setPsnsignStatus(psnsignStatus); - if (psnsignStatus.intValue() == 2) { - //更新立案申请状态为待用印 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATED_SEAL); - caseApplicationMapper.submitCaseApplication(caseApplication); +// } - //修改"签署用印记录表"的状态为待用印 - } - } - } - if (!(signerObject.get("orgSigner").toString()).equals("null")) { - JsonObject orgSignerData = signerObject.getAsJsonObject("orgSigner"); - if (orgSignerData != null) { - orgsignStatus = signerObject.get("signStatus").getAsInt(); - sealSignRecord.setOrgsignStatus(orgsignStatus); - //更新立案申请状态为待送达 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setCaseStatus(CaseApplicationConstants.ARBITRATION_DELIVERY); - caseApplicationMapper.submitCaseApplication(caseApplication); - //修改"签署用印记录表"的状态为签署完成 - //下载审核完成的裁决书, -// SaaSAPIFileUtils.fileDownloadUrl(); - - } - - } - - } - - } }