From 84621de905f3d8f69c8a2bea38d33378dd715fd0 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Fri, 3 Nov 2023 16:51:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=9F=AD=E4=BF=A1?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=91=E9=80=81=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CaseApplicationServiceImpl.java | 811 +++++++++--------- .../impl/CaseArbitrateServiceImpl.java | 25 +- .../service/impl/CasePaymentServiceImpl.java | 63 +- 3 files changed, 463 insertions(+), 436 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 6fff4d3..7f9f681 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 @@ -5,7 +5,6 @@ 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; @@ -87,13 +86,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Autowired private CaseLogRecordMapper caseLogRecordMapper; @Autowired - private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper; + private CaseEvidenceDirectoryMapper caseEvidenceDirectoryMapper; @Autowired private SmsRecordMapper smsRecordMapper; @Autowired private DeptIdentifyMapper deptIdentifyMapper; // 手机号正则 - 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}$"); /** @@ -104,6 +103,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { * 5.仲裁委(部门长):可以查看所有的案件 * 6.法律顾问秘书:可以属于多个机构,可以查看相关机构的所有案件 * 7.超级管理员:可以查看所有的信息和数据 + * * @param caseApplication * @return */ @@ -117,10 +117,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { SysUser sysUser = sysUserMapper.selectUserById(userId); startPage(); // 已办案件 - if(caseApplication.getSelectCaseStatus().equals("1")){ + if (caseApplication.getSelectCaseStatus().equals("1")) { caseApplication.setLoginUserName(sysUser.getUserName()); return caseApplicationMapper.selectHandledCase(caseApplication); - }else { // 待办案件 + } else { // 待办案件 List roles = sysUser.getRoles(); // 没有角色不能查看案件列表 if (CollectionUtil.isEmpty(roles)) { @@ -148,8 +148,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } if (role.getRoleName().equals("法律顾问")) { // 查询角色有关的用户部门 - // List deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); - List deptIds =new ArrayList<>(); + // List deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); + List deptIds = new ArrayList<>(); deptIds.add(sysUser.getDeptId()); caseApplication.setDeptIds(deptIds); } @@ -169,6 +169,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } + @Override public ToDoCount selectToDoCount() { @@ -181,50 +182,48 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { SysUser sysUser = sysUserMapper.selectUserById(userId); List roles = sysUser.getRoles(); // 没有角色不能查看案件列表 - if(CollectionUtil.isEmpty(roles)){ + if (CollectionUtil.isEmpty(roles)) { throw new ServiceException("该用户没有角色权限"); } CaseApplication caseApplication = new CaseApplication(); - List caseStatusList=new ArrayList<>(); + List caseStatusList = new ArrayList<>(); for (SysRole role : roles) { // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √ - if(role.getRoleName().equals("超级管理员") - ){ + if (role.getRoleName().equals("超级管理员") + ) { return caseApplicationMapper.selectAdminCaseToDoCount(); } - if(role.getRoleName().equals("仲裁委") - ||role.getRoleName().equals("部门长")){ + if (role.getRoleName().equals("仲裁委") + || role.getRoleName().equals("部门长")) { caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); caseApplication.setDeptHeadStatus(caseStatusList); } - if(role.getRoleName().equals("仲裁员")){ + if (role.getRoleName().equals("仲裁员")) { caseApplication.setUserId(String.valueOf(userId)); } - if(role.getRoleName().equals("财务")){ + if (role.getRoleName().equals("财务")) { caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); } - if(role.getRoleName().equals("法律顾问")){ + if (role.getRoleName().equals("法律顾问")) { // 查询角色有关的用户部门 - // List deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); - List deptIds =new ArrayList<>(); + // List deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); + List deptIds = new ArrayList<>(); deptIds.add(sysUser.getDeptId()); caseApplication.setDeptIds(deptIds); } - if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){ + if (StrUtil.isEmpty(caseApplication.getNameId()) && role.getRoleName().equals("申请人")) { // 查询角色有关的用户部门 caseApplication.setNameId(String.valueOf(sysUser.getDeptId())); } - if(role.getRoleName().equals("被申请人")){ + if (role.getRoleName().equals("被申请人")) { // caseApplication.setIdCard(String.valueOf(sysUser.getIdCard())); } } - - // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 return caseApplicationMapper.selectTodoCountByRole(caseApplication); } @@ -238,15 +237,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List records = caseLogRecordMapper.selectCaseLogRecordList(caseLogRecord); CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); Integer caseStatus = caseApplicationselect.getCaseStatus(); - if(caseStatus.intValue()!=0){ + if (caseStatus.intValue() != 0) { CaseLogRecord caseLogRecordin = getInCasenode(caseStatus); records.add(caseLogRecordin); } List recordsnofinish = getNofinishCasenode(caseStatus); records.addAll(recordsnofinish); - datas.put("allCasenode",records); - datas.put("caseStatus",caseStatus); + datas.put("allCasenode", records); + datas.put("caseStatus", caseStatus); return AjaxResult.success(datas); } @@ -257,24 +256,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR); caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD); int rows = caseApplicationMapper.submitCaseApplication(caseApplication); - //1975139 修改开庭时间通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已改为{3},请知晓,如非本人操作,请忽略本短信 + //1975139 修改开庭时间通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已改为{3},请知晓,如非本人操作,请忽略本短信 //发送短信通知 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); request.setTemplateId("1975139"); // 发送开庭日期通知短信 - sendHearDateMessage(caseApplication,request,"1975139"); + sendHearDateMessage(caseApplication, request, "1975139"); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CHECK_ARBITRATION_METHOD,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION_METHOD, ""); return rows; } @Override public int updateCaseLockStatus(CaseApplication caseApplication) { - return caseApplicationMapper.updateCaseLockStatus(caseApplication.getId(),caseApplication.getLockStatus()); + return caseApplicationMapper.updateCaseLockStatus(caseApplication.getId(), caseApplication.getLockStatus()); } - public void inputChangeToFile(InputStream instream, File file) { + public void inputChangeToFile(InputStream instream, File file) { try { OutputStream outStr = new FileOutputStream(file); int bytesRead = 0; @@ -296,7 +295,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (file.isEmpty()) { return AjaxResult.error("请选择要上传的文件"); } - String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile"; + String targetPath = "/home/ruoyi/uploadPath/upload/unzipFile"; // String targetPath = "F:\\testZip\\uploadPath\\upload\\upload1\\unzipFile"; File zipFile = null; InputStream ins = null; @@ -308,19 +307,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { e.printStackTrace(); } //解压缩上传的压缩包 - UnZipFileUtils.unZipFile(zipFile,targetPath); + UnZipFileUtils.unZipFile(zipFile, targetPath); //得到解压缩的所有文件 String zipName = file.getOriginalFilename(); - String subzipName = zipName.substring(0,zipName.indexOf(".zip")); + String subzipName = zipName.substring(0, zipName.indexOf(".zip")); // String zipPath = "F:\\testZip\\uploadPath\\upload\\upload1\\unzipFile\\"+subzipName; - String zipPath = "/home/ruoyi/uploadPath/upload/unzipFile/"+subzipName; + String zipPath = "/home/ruoyi/uploadPath/upload/unzipFile/" + subzipName; File dirUnzipPath = new File(zipPath); List allFiles = new ArrayList<>(); List allFilestr = new ArrayList<>(); - UnZipFileUtils.getFiles(dirUnzipPath,allFiles); - if(allFiles!=null&&allFiles.size()>0){ + UnZipFileUtils.getFiles(dirUnzipPath, allFiles); + if (allFiles != null && allFiles.size() > 0) { for (File fileIter : allFiles) { System.out.println(fileIter.getAbsolutePath()); allFilestr.add(fileIter.getAbsolutePath()); @@ -328,7 +327,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } //保存目录和文件 - if(allFilestr!=null&&allFilestr.size()>0){ + if (allFilestr != null && allFilestr.size() > 0) { for (String filestr : allFilestr) { List allindex = new ArrayList<>(); // int indexKey = filestr.indexOf("\\"); @@ -341,22 +340,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { allindex.add(indexKey); } - if(allindex!=null&&allindex.size()>0){ - String substrOne = filestr.substring(allindex.get(6)+1,allindex.get(7)); + if (allindex != null && allindex.size() > 0) { + String substrOne = filestr.substring(allindex.get(6) + 1, allindex.get(7)); Integer series = null; - for (int i = 0; i < allindex.size()-7; i++) { - String substr = filestr.substring(allindex.get(i+5)+1,allindex.get(i+6)); + for (int i = 0; i < allindex.size() - 7; i++) { + String substr = filestr.substring(allindex.get(i + 5) + 1, allindex.get(i + 6)); series = i + 1; - if(series==1){ + if (series == 1) { //查询这个级数的目录是否存在,若不存在,则新建这个目录 CaseEvidenceDirectory caseEvidenceDirectoryselect = new CaseEvidenceDirectory(); caseEvidenceDirectoryselect.setCaseId(id); - caseEvidenceDirectoryselect.setEvidenceName(filestr.substring(allindex.get(i+5)+1,allindex.get(i+6))); + caseEvidenceDirectoryselect.setEvidenceName(filestr.substring(allindex.get(i + 5) + 1, allindex.get(i + 6))); caseEvidenceDirectoryselect.setSeries(series); - List caseEvidenceDirectorys = caseEvidenceDirectoryMapper.selectList(caseEvidenceDirectoryselect); - if(caseEvidenceDirectorys!=null&&caseEvidenceDirectorys.size()>0){ + List caseEvidenceDirectorys = caseEvidenceDirectoryMapper.selectList(caseEvidenceDirectoryselect); + if (caseEvidenceDirectorys != null && caseEvidenceDirectorys.size() > 0) { continue; - }else { + } else { CaseEvidenceDirectory caseEvidenceDirectory = new CaseEvidenceDirectory(); caseEvidenceDirectory.setEvidenceName(substr); caseEvidenceDirectory.setSeries(series); @@ -365,23 +364,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseEvidenceDirectory.setCreateTime(new Date()); caseEvidenceDirectoryMapper.save(caseEvidenceDirectory); } - }else { + } else { //查询这个级数的目录是否存在,若不存在,则新建这个目录 CaseEvidenceDirectory directoryselect = new CaseEvidenceDirectory(); directoryselect.setCaseId(id); - directoryselect.setEvidenceName(filestr.substring(allindex.get(i+5)+1,allindex.get(i+6))); + directoryselect.setEvidenceName(filestr.substring(allindex.get(i + 5) + 1, allindex.get(i + 6))); directoryselect.setSeries(series); - List evidenceDirectorys = caseEvidenceDirectoryMapper.selectList(directoryselect); - if(evidenceDirectorys!=null&&evidenceDirectorys.size()>0){ + List evidenceDirectorys = caseEvidenceDirectoryMapper.selectList(directoryselect); + if (evidenceDirectorys != null && evidenceDirectorys.size() > 0) { continue; - }else { + } else { Long parentId = null; CaseEvidenceDirectory caseEvidenceDirectoryselect = new CaseEvidenceDirectory(); caseEvidenceDirectoryselect.setCaseId(id); - caseEvidenceDirectoryselect.setEvidenceName(filestr.substring(allindex.get(i+4)+1,allindex.get(i+5))); - caseEvidenceDirectoryselect.setSeries(series-1); - List caseEvidenceDirectorys = caseEvidenceDirectoryMapper.selectList(caseEvidenceDirectoryselect); - if(caseEvidenceDirectorys!=null&&caseEvidenceDirectorys.size()>0){ + caseEvidenceDirectoryselect.setEvidenceName(filestr.substring(allindex.get(i + 4) + 1, allindex.get(i + 5))); + caseEvidenceDirectoryselect.setSeries(series - 1); + List caseEvidenceDirectorys = caseEvidenceDirectoryMapper.selectList(caseEvidenceDirectoryselect); + if (caseEvidenceDirectorys != null && caseEvidenceDirectorys.size() > 0) { parentId = caseEvidenceDirectorys.get(0).getId(); } @@ -400,7 +399,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //得到最后1级的目录,即文件 int lastIndex = allindex.get(7); - String substrfile = filestr.substring(lastIndex+1); + String substrfile = filestr.substring(lastIndex + 1); //保存到附件表 LocalDate now = LocalDate.now(); String year = Integer.toString(now.getYear()); @@ -408,10 +407,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String day = String.format("%02d", now.getDayOfMonth()); String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; // String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day; - String fileName = UUID.randomUUID().toString().replace("-", "")+ "_" + substrfile; + String fileName = UUID.randomUUID().toString().replace("-", "") + "_" + substrfile; String resultFilePath = saveFolderPath + "/" + fileName; try { - File resultFilePathFile = new File(resultFilePath); + File resultFilePathFile = new File(resultFilePath); File parentFilePathFile = resultFilePathFile.getParentFile(); if (!parentFilePathFile.exists()) { parentFilePathFile.mkdirs(); @@ -423,22 +422,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { FileInputStream fis = new FileInputStream(new File(filestr)); FileOutputStream fos = new FileOutputStream(resultFilePathFile); byte[] btyeBuf = new byte[1024]; - int len=0; - while((len=fis.read(btyeBuf))!=-1){ - fos.write(btyeBuf,0,len); + int len = 0; + while ((len = fis.read(btyeBuf)) != -1) { + fos.write(btyeBuf, 0, len); } fis.close(); fos.close(); } catch (IOException e) { - AjaxResult.error("文件解压异常",e); + AjaxResult.error("文件解压异常", e); } - String substrTwo = filestr.substring(allindex.get(6)+1,allindex.get(7)); + String substrTwo = filestr.substring(allindex.get(6) + 1, allindex.get(7)); Integer annexType = null; - if("申请书".equals(substrTwo)){ + if ("申请书".equals(substrTwo)) { annexType = 1; - }else if("证据材料".equals(substrTwo)){ + } else if ("证据材料".equals(substrTwo)) { annexType = 2; } String savePath = "/home/ruoyi/uploadPath/upload"; @@ -457,16 +456,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Long parentId = null; CaseEvidenceDirectory caseEvidenceDirectoryselect = new CaseEvidenceDirectory(); caseEvidenceDirectoryselect.setCaseId(id); - caseEvidenceDirectoryselect.setEvidenceName(filestr.substring(allindex.get(6)+1,allindex.get(7))); + caseEvidenceDirectoryselect.setEvidenceName(filestr.substring(allindex.get(6) + 1, allindex.get(7))); caseEvidenceDirectoryselect.setSeries(series); - List caseEvidenceDirectorys = caseEvidenceDirectoryMapper.selectList(caseEvidenceDirectoryselect); - if(caseEvidenceDirectorys!=null&&caseEvidenceDirectorys.size()>0){ + List caseEvidenceDirectorys = caseEvidenceDirectoryMapper.selectList(caseEvidenceDirectoryselect); + if (caseEvidenceDirectorys != null && caseEvidenceDirectorys.size() > 0) { parentId = caseEvidenceDirectorys.get(0).getId(); } CaseEvidenceDirectory caseEvidenceDirectory = new CaseEvidenceDirectory(); caseEvidenceDirectory.setEvidenceName(substrfile); - caseEvidenceDirectory.setSeries(series+1); + caseEvidenceDirectory.setSeries(series + 1); caseEvidenceDirectory.setCreateBy(username); caseEvidenceDirectory.setCreateTime(new Date()); caseEvidenceDirectory.setAnnexId(annexId); @@ -483,7 +482,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } @Override - public List getSmsSendRecord(SmsSendRecord smsSendRecord) { + public List getSmsSendRecord(SmsSendRecord smsSendRecord) { return smsRecordMapper.getSmsSendRecord(smsSendRecord); } @@ -712,7 +711,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { return caseLogRecords; - } private CaseLogRecord getInCasenode(Integer caseStatus) { @@ -800,11 +798,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } return caseLogRecord; } + @Override public List selectCaseApplicationList(CaseApplication caseApplication) { return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); } + @Override @Transactional public int insertcaseApplication(CaseApplication caseApplication) { @@ -819,10 +819,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String caseNum = generateCaseNum(); caseApplication.setCaseNum(caseNum); caseApplication.setCreateBy(getUsername()); - // 新增立案信息 + // 新增立案信息 int rows = caseApplicationMapper.insertCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); - Map deptMap =new HashMap<>(); + Map deptMap = new HashMap<>(); // 判断申请机构 if (caseAffiliates != null && caseAffiliates.size() > 0) { // 查询所有的组织机构,组装成map @@ -830,12 +830,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (CollectionUtil.isEmpty(deptList)) { deptList = new ArrayList<>(); } - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); + 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())) { + if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseAffiliate.getName())) { caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); @@ -858,8 +858,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } // 组装申请代理人信息 - String agentInfoFlag = buildAgentInfo(caseAffiliate,roleId); - if(StrUtil.isNotEmpty(agentInfoFlag)){ + String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); + if (StrUtil.isNotEmpty(agentInfoFlag)) { throw new ServiceException(agentInfoFlag); } } @@ -877,24 +877,25 @@ 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; @@ -912,24 +913,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 BigDecimal feeRate = new BigDecimal("0.01"); - BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP); + BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2, RoundingMode.HALF_UP); caseApplication.setFeePayable(feePayable); caseApplication.setUpdateBy(getUsername()); 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)); + Map deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId, (oldV, newV) -> newV)); // 查询申请人角色id Long roleId = roleMapper.selectRoleIdByName("申请人"); - for (CaseAffiliate caseAffiliate : caseAffiliates){ + 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.setApplicationOrganName(caseAffiliate.getName()); @@ -952,8 +953,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); } - String agentInfoFlag = buildAgentInfo(caseAffiliate,roleId); - if(StrUtil.isNotEmpty(agentInfoFlag)){ + String agentInfoFlag = buildAgentInfo(caseAffiliate, roleId); + if (StrUtil.isNotEmpty(agentInfoFlag)) { throw new ServiceException(agentInfoFlag); } @@ -964,8 +965,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); } @@ -978,10 +979,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 组装申请代理人信息 + * * @param caseAffiliate */ - private String buildAgentInfo(CaseAffiliate caseAffiliate,Long roleId) { - if (caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getNameAgent())) { + private String buildAgentInfo(CaseAffiliate caseAffiliate, Long roleId) { + if (caseAffiliate.getIdentityType() == 1 && StrUtil.isNotEmpty(caseAffiliate.getNameAgent())) { // 组装申请机构代理人信息,用户表新增并且和部门关联 // 根据代理人身份证去用户表查询,有修改,么有新增 @@ -992,7 +994,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { agentUser.setNickName(caseAffiliate.getNameAgent()); agentUser.setUserName(caseAffiliate.getIdentityNumAgent()); agentUser.setPhonenumber(caseAffiliate.getContactTelphoneAgent()); - // agentUser.setPassword(SecurityUtils.encryptPassword(Constants.DEFAULT_PASSWORD)); + // agentUser.setPassword(SecurityUtils.encryptPassword(Constants.DEFAULT_PASSWORD)); agentUser.setDeptId(Long.valueOf(caseAffiliate.getApplicationOrganId())); int insertUserRow = sysUserMapper.insertUser(agentUser); // 新增角色为申请人 @@ -1001,7 +1003,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { sysUserRole.setUserId(agentUser.getUserId()); sysUserRole.setRoleId(roleId); sysUserRoles.add(sysUserRole); - if(CollectionUtil.isNotEmpty(sysUserRoles)) { + if (CollectionUtil.isNotEmpty(sysUserRoles)) { userRoleMapper.batchUserRole(sysUserRoles); } if (insertUserRow > 0) { @@ -1011,45 +1013,48 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { request.setTemplateId("1956159"); request.setPhone(agentUser.getPhonenumber()); request.setTemplateParamSet(new String[]{agentUser.getNickName()}); - if (SmsUtils.sendSms(request)){ - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(caseAffiliate.getCaseAppliId()); - caseApplication = caseApplicationMapper.selectCaseApplication(caseApplication); - 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()); + Boolean aBoolean = SmsUtils.sendSms(request); + //保存短信发送记录 + SmsSendRecord smsSendRecord = new SmsSendRecord(); + smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId()); + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(caseAffiliate.getCaseAppliId()); + caseApplication = caseApplicationMapper.selectCaseApplication(caseApplication); + 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()); + if (aBoolean) { smsSendRecord.setSendStatus(1); - smsRecordMapper.saveSmsSendRecord(smsSendRecord); + } else { + smsSendRecord.setSendStatus(0); } + smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) { // return "该申请代理人已在"+agentUser.getDeptName()+"申请机构下存在,请检查填写信息是否正确"; - if(null!=agentUser.getDept()&&StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) { - return "该申请代理人已在【" + agentUser.getDept().getDeptName()+"】申请机构下存在,请检查填写信息是否正确"; - }else { + if (null != agentUser.getDept() && StrUtil.isNotEmpty(agentUser.getDept().getDeptName())) { + return "该申请代理人已在【" + agentUser.getDept().getDeptName() + "】申请机构下存在,请检查填写信息是否正确"; + } else { return "该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确"; } - } else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())){ + } else if (null != agentUser.getDeptId() && String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) { // 同步用户表和案件关联人表的手机号和名称 caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber()); caseAffiliate.setNameAgent(agentUser.getNickName()); caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId())); - List longList=new ArrayList<>(); + List longList = new ArrayList<>(); // 新增角色为申请人 - if(CollectionUtil.isNotEmpty(agentUser.getRoles())) { - longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()); - if(!longList.contains(roleId)) { - insertAgentUserRole(agentUser,roleId); + if (CollectionUtil.isNotEmpty(agentUser.getRoles())) { + longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()); + if (!longList.contains(roleId)) { + insertAgentUserRole(agentUser, roleId); } - }else { + } else { - insertAgentUserRole(agentUser,roleId); + insertAgentUserRole(agentUser, roleId); } } @@ -1059,7 +1064,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } /** - * 新增角色为申请人 + * 新增角色为申请人 + * * @param agentUser * @param roleId */ @@ -1076,23 +1082,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Override @Transactional - public int submitCaseApplication( List ids) { - int rows=0; + public int submitCaseApplication(List ids) { + int rows = 0; for (Long id : ids) { CaseApplication application = new CaseApplication(); application.setId(id); //提交立案申请 application.setCaseStatus(CaseApplicationConstants.CASE_CHECK); - rows += caseApplicationMapper.submitCaseApplication(application); + rows += caseApplicationMapper.submitCaseApplication(application); // 新增日志 - CaseLogUtils.insertCaseLog(application.getId(),CaseApplicationConstants.CASE_CHECK,""); + CaseLogUtils.insertCaseLog(application.getId(), CaseApplicationConstants.CASE_CHECK, ""); } return rows; } @Override @Transactional - public int deletecaseApplicationByIds(List ids ) { + public int deletecaseApplicationByIds(List ids) { caseAffiliateMapper.batchDeletecaseAffiliate(ids); return caseApplicationMapper.batchDeletecaseApplication(ids); @@ -1122,8 +1128,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); } @@ -1133,27 +1139,29 @@ 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()); @@ -1166,27 +1174,27 @@ 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; - 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)); } // 查询申请人角色id Long roleId = roleMapper.selectRoleIdByName("申请人"); 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,deptMap); + importValid(caseApplication, deptMap); // 校验成功的数据 - if(StrUtil.isEmpty(caseApplication.getErrorMsg())) { + if (StrUtil.isEmpty(caseApplication.getErrorMsg())) { //根据仲裁费用计费规则计算应缴费用 //暂时设置计费比率为0.01 BigDecimal feeRate = new BigDecimal("0.01"); @@ -1196,15 +1204,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //赋值CaseApplication的案件关联人信息 List caseAffiliatesnew = new ArrayList<>(); // 组装案件关联人信息 - assignmentCaseAffiliates(caseApplication, caseAffiliatesnew, deptMap,roleId); + assignmentCaseAffiliates(caseApplication, caseAffiliatesnew, deptMap, roleId); caseApplication.setImportFlag(1); 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.size()>0){ + if (caseApplicationListinsert.size() > 0) { // List caseApplicationListinsertDiffer = caseApplicationListinsert.stream().collect( // collectingAndThen( // toCollection(() -> new TreeSet<>(Comparator.comparing(CaseApplication::getCaseNum))), @@ -1214,20 +1222,20 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 // if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){ List caseApplicationNewList = null; - for (int i = 0; i < caseApplicationListinsert.size(); i++){ + for (int i = 0; i < caseApplicationListinsert.size(); i++) { caseApplicationNewList = new ArrayList<>(); CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); // 设置自动编码 caseApplicationinsertDiffer.setCaseNum(generateCaseNum()); - List caseAffiliatesnew = new ArrayList<>(); + 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); + 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())){ + if (StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum()) && + caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())) { caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); } @@ -1236,18 +1244,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationNewList.add(caseApplicationNew); } - for (int k = 0; k < caseApplicationNewList.size(); k++){ + for (int k = 0; k < caseApplicationNewList.size(); k++) { CaseApplication caseApplicationItera = caseApplicationNewList.get(k); // 新增立案信息 caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); caseApplicationItera.setCreateBy(getUsername()); int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplicationItera.getId(),CaseApplicationConstants.CASE_APPLICATION,""); + CaseLogUtils.insertCaseLog(caseApplicationItera.getId(), CaseApplicationConstants.CASE_APPLICATION, ""); List caseAffiliates = caseApplicationItera.getCaseAffiliates(); - if(caseAffiliates!=null&&caseAffiliates.size()>0){ - for (CaseAffiliate caseAffiliate : caseAffiliates){ + if (caseAffiliates != null && caseAffiliates.size() > 0) { + for (CaseAffiliate caseAffiliate : caseAffiliates) { caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); } @@ -1265,8 +1273,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - - }else { + } else { throw new ServiceException("导入立案申请数据不能为空!"); } return successMsg.append(failureMsg).toString(); @@ -1275,273 +1282,282 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 导入校验 + * * @param caseApplication * @param */ - private void importValid(CaseApplication caseApplication,Map deptMap) { - StringBuilder failureMsg=new StringBuilder(); + private void importValid(CaseApplication caseApplication, Map deptMap) { + StringBuilder failureMsg = new StringBuilder(); caseApplication.setErrorMsg(failureMsg); // 校验基本字段 - validBaseColumn(caseApplication,failureMsg); + validBaseColumn(caseApplication, failureMsg); // 校验申请人信息 - validApplicationColumn(caseApplication,failureMsg); + validApplicationColumn(caseApplication, failureMsg); // 校验申请人代理信息 - validApplicationAgentColumn(caseApplication,failureMsg,deptMap); + validApplicationAgentColumn(caseApplication, failureMsg, deptMap); // 校验被申请人信息 - 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;"); } - if( StrUtil.isEmpty(caseApplication.getResponSex())){ + if (StrUtil.isEmpty(caseApplication.getResponSex())) { failureMsg.append("【被申请人主体信息-性别】字段不能为空;"); - }else if(caseApplication.getResponSex().length()>1){ + } else if (caseApplication.getResponSex().length() > 1) { failureMsg.append("【被申请人主体信息-性别】字段超出指定长度,最大长度为1;"); } - if( caseApplication.getResponBirth()== null){ + if (caseApplication.getResponBirth() == null) { failureMsg.append("【被申请人主体信息-出生年月日】字段不合法;"); - }else if(caseApplication.getResponBirth().after(new Date())){ + } else if (caseApplication.getResponBirth().after(new Date())) { failureMsg.append("【被申请人主体信息-出生年月日】字段不合法,不能超过当前日期;"); } } /** * 校验申请人代理信息 + * * @param caseApplication * @param failureMsg */ - private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg,Map deptMap) { - if( StrUtil.isEmpty(caseApplication.getNameAgent())){ + private void validApplicationAgentColumn(CaseApplication caseApplication, StringBuilder failureMsg, Map deptMap) { + 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;"); } - validAgentInfo(caseApplication,failureMsg,deptMap); + validAgentInfo(caseApplication, failureMsg, deptMap); 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 * @return */ - private void validAgentInfo(CaseApplication caseApplication, StringBuilder failureMsg,Map deptMap) { + private void validAgentInfo(CaseApplication caseApplication, StringBuilder failureMsg, Map deptMap) { // 申请机构与代理人都不为空,校验代理人与组织机构关系(代理人必须在该部门下) - if (StrUtil.isNotEmpty(caseApplication.getName())&&StrUtil.isNotEmpty(caseApplication.getNameAgent())) { - String applicationOrganId=""; + if (StrUtil.isNotEmpty(caseApplication.getName()) && StrUtil.isNotEmpty(caseApplication.getNameAgent())) { + String applicationOrganId = ""; // 申请机构已经存在 - if(deptMap.containsKey(caseApplication.getName())){ - applicationOrganId=String.valueOf(deptMap.get(caseApplication.getName())); + if (deptMap.containsKey(caseApplication.getName())) { + applicationOrganId = String.valueOf(deptMap.get(caseApplication.getName())); } // 根据代理人身份证去用户表查询 SysUser agentUser = sysUserMapper.selectUserByIdCard(caseApplication.getIdentityNumAgent()); // 代理人的部门和申请机构不匹配 - if (null!=agentUser && null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(applicationOrganId)) { + if (null != agentUser && 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( "该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确"); + failureMsg.append("该申请代理人已存在,与申请机构不匹配,请检查填写信息是否正确"); } } } } + /** * 校验申请人主题信息 + * * @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) { - if( StrUtil.isEmpty(caseApplication.getCaseName())){ + if (StrUtil.isEmpty(caseApplication.getCaseName())) { failureMsg.append("【案件名称】字段不能为空;"); - }else if(caseApplication.getCaseName().length()>50){ + } else if (caseApplication.getCaseName().length() > 50) { failureMsg.append("【案件名称】字段超出指定长度,最大长度为50;"); } 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( caseApplication.getLoanStartDate()!= null && caseApplication.getLoanEndDate()!= null && caseApplication.getLoanStartDate().after(caseApplication.getLoanEndDate()) ){ + if (caseApplication.getLoanStartDate() != null && caseApplication.getLoanEndDate() != null && caseApplication.getLoanStartDate().after(caseApplication.getLoanEndDate())) { 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;"); } - if(StrUtil.isNotEmpty(caseApplication.getArbitratClaims())&&caseApplication.getArbitratClaims().length()>10000){ + if (StrUtil.isNotEmpty(caseApplication.getArbitratClaims()) && caseApplication.getArbitratClaims().length() > 10000) { failureMsg.append("【申请人请求仲裁庭裁决】字段超出指定长度,最大长度为10000;"); } } @@ -1552,7 +1568,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(",")); @@ -1574,12 +1590,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(",")); @@ -1590,7 +1606,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, ""); return rows; } @@ -1602,7 +1618,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; } @@ -1614,7 +1630,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); @@ -1624,26 +1640,26 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if (caseAttach.getAnnexType() == 3) { String annexPath = caseAttach.getAnnexPath(); String path = "/home/ruoyi/" + annexPath; - System.out.println("这是查询到的裁决书路径"+path); + 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(); @@ -1656,9 +1672,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //发起签署 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 AjaxResult.error(); } sealSignRecord.setPensonAccount(sysUser.getPhonenumber()); @@ -1667,14 +1683,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { DeptIdentify deptIdentify = new DeptIdentify(); deptIdentify.setIsUse(1); - DeptIdentify deptIdentifyselect = new DeptIdentify(); + DeptIdentify deptIdentifyselect = new DeptIdentify(); List deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify); - if(deptIdentifysnew!=null&&deptIdentifysnew.size()>0){ + if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) { deptIdentifyselect = deptIdentifysnew.get(0); sealSignRecord.setOrgnizeName(deptIdentifyselect.getDeptName()); sealSignRecord.setOrgnizeNamePsnAccount(deptIdentifyselect.getPhonenumber()); sealSignRecord.setOrgnizeNamepsnName(deptIdentifyselect.getNickName()); - }else { + } else { return AjaxResult.error("没有用印时的机构名称及经办人信息"); } @@ -1683,11 +1699,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)); @@ -1695,10 +1711,10 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { JSONObject coordinateObj = coordinatesArray.getJSONObject(0); double positionX = coordinateObj.getDoubleValue("positionX"); double positionY = coordinateObj.getDoubleValue("positionY"); - sealSignRecord.setPositionXpsn(positionX+90); + sealSignRecord.setPositionXpsn(positionX + 90); sealSignRecord.setPositionYpsn(positionY); } - }else { + } else { //用印 JSONArray positionsArray = jsonObject3.getJSONArray("positions"); // 遍历 positionsArray 中的每个元素 @@ -1710,14 +1726,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { JSONObject coordinateObj = coordinatesArray.getJSONObject(0); double positionX = coordinateObj.getDoubleValue("positionX"); double positionY = coordinateObj.getDoubleValue("positionY"); - sealSignRecord.setPositionXorg(positionX+90); + sealSignRecord.setPositionXorg(positionX + 90); sealSignRecord.setPositionYorg(positionY); } } } EsignHttpResponse response3 = SignAward.createByFile(sealSignRecord); JSONObject jsonObject3 = JSONObject.parseObject(response3.getBody()); - if (jsonObject3.getIntValue("code")==0){ + if (jsonObject3.getIntValue("code") == 0) { //获取签署流程ID JSONObject data1 = jsonObject3.getJSONObject("data"); String signFlowId = data1.getString("signFlowId"); @@ -1726,7 +1742,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { sealSignRecord.setSignFlowid(signFlowId); sealSignRecord.setSignFlowStatus(1);//待签名 sealSignRecordMapper.insertSealSignRecord(sealSignRecord); - }else { + } else { throw new ServiceException("发起签署流程失败,请检查参数是否有误"); } } @@ -1743,13 +1759,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); } @@ -1766,15 +1782,15 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(id); caseApplication.setAgreeOrNotCheck(agreeOrNotCheck); - if(agreeOrNotCheck ==1){//同意审核 + if (agreeOrNotCheck == 1) {//同意审核 caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT); - rows+= caseApplicationMapper.submitCaseApplication(caseApplication); - }else if(agreeOrNotCheck ==2){//拒绝审核 + rows += caseApplicationMapper.submitCaseApplication(caseApplication); + } else if (agreeOrNotCheck == 2) {//拒绝审核 caseApplication.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - rows+= caseApplicationMapper.submitCaseApplication(caseApplication); + rows += caseApplicationMapper.submitCaseApplication(caseApplication); } // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_PAYMENT,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT, ""); } @@ -1784,18 +1800,18 @@ 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) { - 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 (identityType == 1) { caseApplicationselect.setApplicantName(caseAffiliateselect.getApplicationOrganName()); } @@ -1814,8 +1830,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); } @@ -1829,22 +1845,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 给被申请人发送房间号短信 + * * @param messageVO * @return */ @Override public String sendRoomNoMessage(SendRoomNoMessageVO messageVO) { - CaseAffiliate caseAffiliateSelect=new CaseAffiliate(); + CaseAffiliate caseAffiliateSelect = new CaseAffiliate(); caseAffiliateSelect.setCaseAppliId(messageVO.getId()); - List caseAffiliates= caseAffiliateMapper.selectCaseAffiliate(caseAffiliateSelect); - if(CollectionUtil.isEmpty(caseAffiliates)){ + List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliateSelect); + if (CollectionUtil.isEmpty(caseAffiliates)) { return "申请人、被申请人不存在"; } CaseApplication caseApplication = new CaseApplication(); caseApplication.setId(messageVO.getId()); CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); - String returnResult="短信发送成功"; - + String returnResult = "短信发送成功"; //发送短信通知 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); request.setTemplateId("1952136"); @@ -1852,30 +1868,31 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { request.setPhone(caseAffiliate.getContactTelphone()); request.setTemplateParamSet(new String[]{caseAffiliate.getName(), caseApplicationselect.getCaseNum(), messageVO.getRoomNo()}); // 1948332 普通短信 尊敬的{1}用户,您的{2}仲裁案件,开庭审理房间号为{3},请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。 - if (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()+",请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。"; - smsSendRecord.setSendContent(content); - smsSendRecord.setSendStatus(1); - String userName; - try { - userName= getUsername(); - } catch (Exception e) { - userName="admin"; - } - smsSendRecord.setCreateBy(userName); - smsRecordMapper.saveSmsSendRecord(smsSendRecord); - }else { - returnResult= "短信发送失败"; + 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() + ",请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。"; + 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); } return returnResult; - } @Override @@ -1885,7 +1902,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); @@ -1904,7 +1921,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); @@ -1923,7 +1940,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplicationselect.setId(arbitrateRecordselect.getCaseAppliId()); CaseApplication caseApplication = caseApplicationMapper.selectCaseApplication(caseApplicationselect); String createBy = caseApplication.getCreateBy(); - if (createBy!=null){ + if (createBy != null) { arbitrateRecordselect.setCreateBy(createBy); } @@ -1938,39 +1955,39 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //先判断案件是否已经提交过仲裁结果 ArbitrateRecord arbitrateRecordsele = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordselect); - if (arbitrateRecordsele!=null){ + if (arbitrateRecordsele != null) { int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordselect); - if (i>0){ + if (i > 0) { //案件日志表里添加数据 CaseLogRecord caseLogRecord = new CaseLogRecord(); caseLogRecord.setCaseAppliId(caseApplication.getId()); caseLogRecord.setCaseNode(caseApplication.getCaseStatus()); - if (createBy!=null){ + if (createBy != null) { caseLogRecord.setCreateBy(createBy); } caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.GENERATED_ARBITRATION,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); } - }else { + } else { //提交仲裁结果 - int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordselect); + int i = arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordselect); - if (i>0){ + if (i > 0) { //案件日志表里添加数据 CaseLogRecord caseLogRecord = new CaseLogRecord(); caseLogRecord.setCaseAppliId(caseApplication.getId()); caseLogRecord.setCaseNode(caseApplication.getCaseStatus()); - if (createBy!=null){ + if (createBy != null) { caseLogRecord.setCreateBy(createBy); } caseLogRecordMapper.insertCaseLogRecord(caseLogRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.GENERATED_ARBITRATION,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, ""); } } @@ -2067,7 +2084,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseApplication.setAnnexType(7); List caseAttachs = caseAttachMapper.queryCaseAttachList(caseApplication); - if(caseAttachs!=null&&caseAttachs.size()>0){ + if (caseAttachs != null && caseAttachs.size() > 0) { CaseAttach caseAttach = CaseAttach.builder() .caseAppliId(id) .annexName(saveName) @@ -2076,7 +2093,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { .build(); int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach); - }else { + } else { //将庭审笔录保存到附件表里 CaseAttach caseAttach = CaseAttach.builder() .caseAppliId(id) @@ -2104,16 +2121,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { SealSignRecord sealSignRecord = new SealSignRecord(); sealSignRecord.setCaseAppliId(caseApplication.getId()); List sealSignRecords = sealSignRecordMapper.selectSealSignRecord(sealSignRecord); - if(sealSignRecords!=null&&sealSignRecords.size()>0){ + 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 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); + 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); + String filearbitraUrl = fileDownloadUrl.substring(1, fileDownloadUrl.length() - 1); caseApplication.setFilearbitraUrl(filearbitraUrl); } } @@ -2122,7 +2139,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - @Override @Transactional public int pendTralSure(CaseApplication caseApplication) { @@ -2132,12 +2148,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { Integer isAgreePendTral = caseApplication.getIsAgreePendTral(); 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(",")); @@ -2152,9 +2168,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); request.setTemplateId("1947342"); // 发送开庭日期通知短信 - sendHearDateMessage(caseApplication,request,"1947342"); + sendHearDateMessage(caseApplication, request, "1947342"); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.MODIFY_HEARDATE,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.MODIFY_HEARDATE, ""); return rows; @@ -2162,10 +2178,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 发送开庭日期通知短信 + * * @param caseApplication * @param request */ - private void sendHearDateMessage(CaseApplication caseApplication, SmsUtils.SendSmsRequest request,String templateId) { + private void sendHearDateMessage(CaseApplication caseApplication, SmsUtils.SendSmsRequest request, String templateId) { CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication); String caseNum = caseApplicationselect.getCaseNum(); @@ -2174,41 +2191,43 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String hearDatestr = dateFormat.format(hearDate); 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)) { + 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}); - if (SmsUtils.sendSms(request)){ - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplicationselect.getId()); - smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content=""; - if(templateId.equals("1947342")) { - content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已确定为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; - } - if(templateId.equals("1975139")) { - content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; - } - smsSendRecord.setSendContent(content); - smsSendRecord.setSendStatus(1); - smsSendRecord.setCreateBy(getUsername()); - smsRecordMapper.saveSmsSendRecord(smsSendRecord); + Boolean aBoolean = SmsUtils.sendSms(request); + //保存短信发送记录 + SmsSendRecord smsSendRecord = new SmsSendRecord(); + smsSendRecord.setCaseId(caseApplicationselect.getId()); + smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum()); + smsSendRecord.setPhone(request.getPhone()); + smsSendRecord.setSendTime(new Date()); + String content = ""; + if (templateId.equals("1947342")) { + content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已确定为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; } - + if (templateId.equals("1975139")) { + content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; + } + smsSendRecord.setSendContent(content); + smsSendRecord.setCreateBy(getUsername()); + if (aBoolean) { + smsSendRecord.setSendStatus(1); + } else { + smsSendRecord.setSendStatus(0); + } + smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } @@ -2217,12 +2236,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseAffiliate caseAffiliate = new CaseAffiliate(); caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - if(caseAffiliatListeselect!=null) { + if (caseAffiliatListeselect != null) { for (int j = 0; j < caseAffiliatListeselect.size(); j++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j); int identityType = caseAffiliateselect.getIdentityType(); - if(identityType==1){ + if (identityType == 1) { caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName()); } @@ -2231,19 +2250,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 String name = caseAffiliateselect.getName(); request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); - if (SmsUtils.sendSms(request)){ - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content="尊敬的"+name+"用户,您的"+caseNum+"仲裁案件,开庭日期已确定为"+hearDatestr+",请知晓,如非本人操作,请忽略本短信。"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); + Boolean aBoolean = SmsUtils.sendSms(request); + //保存短信发送记录 + SmsSendRecord smsSendRecord = new SmsSendRecord(); + smsSendRecord.setCaseId(caseApplication.getId()); + smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum()); + smsSendRecord.setPhone(request.getPhone()); + smsSendRecord.setSendTime(new Date()); + String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已确定为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; + smsSendRecord.setSendContent(content); + smsSendRecord.setCreateBy(getUsername()); + if (aBoolean) { smsSendRecord.setSendStatus(1); - smsRecordMapper.saveSmsSendRecord(smsSendRecord); + } else { + smsSendRecord.setSendStatus(0); } + smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } } @@ -2255,8 +2277,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { 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(",")); @@ -2268,7 +2290,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { rows = caseApplicationMapper.submitCaseApplication(caseApplication); } - }else { + } else { caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_TRIAL); caseApplication.setPendingAppointArbotrar(2); rows = caseApplicationMapper.submitCaseApplication(caseApplication); @@ -2280,9 +2302,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - private void assignmentCaseAffiliates(CaseApplication caseApplication, List caseAffiliatesnew, - Map deptMap,Long roleId) { + Map deptMap, Long roleId) { // 申请人信息 CaseAffiliate caseAffiliate = new CaseAffiliate(); @@ -2291,14 +2312,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // caseAffiliate.setIdentityType(1); caseAffiliate = buildApplicaInfo(caseApplication); // 申请人(机构),需要判断部门中是否存在,不存在则新增,当身份类型为1的时候,查询时需要根据名称查询组织机构 - if(StrUtil.isNotEmpty(caseApplication.getName())){ + if (StrUtil.isNotEmpty(caseApplication.getName())) { setApplicantOrganization(caseAffiliate, caseApplication, deptMap); } - String s = buildAgentInfo(caseAffiliate,roleId); - if(StrUtil.isNotEmpty(s)){ + String s = buildAgentInfo(caseAffiliate, roleId); + if (StrUtil.isNotEmpty(s)) { StringBuilder errorMsg = caseApplication.getErrorMsg(); - if(StrUtil.isEmpty(errorMsg)){ - errorMsg=new StringBuilder(); + if (StrUtil.isEmpty(errorMsg)) { + errorMsg = new StringBuilder(); } errorMsg.append(s); caseApplication.setErrorMsg(errorMsg); @@ -2306,7 +2327,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliatesnew.add(caseAffiliate); // 组装被申请人信息 - caseAffiliatesnew.add( buildDebtorInfo(caseApplication)); + caseAffiliatesnew.add(buildDebtorInfo(caseApplication)); caseApplication.setCaseAffiliates(caseAffiliatesnew); } @@ -2337,19 +2358,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 设置申请人的组织机构 + * * @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())){ + if (deptMap.containsKey(caseApplication.getName())) { caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName()))); caseAffiliate.setApplicationOrganName(caseApplication.getName()); - }else { + } else { // 如果不存在则新增 SysDept dept = new SysDept(); dept.setParentId(0L); @@ -2361,7 +2382,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { dept.setCreateBy(getUsername()); dept.setUpdateBy(getUsername()); sysDeptMapper.insertDept(dept); - deptMap.put(dept.getDeptName(),dept.getDeptId()); + deptMap.put(dept.getDeptName(), dept.getDeptId()); caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); caseAffiliate.setApplicationOrganName(caseApplication.getName()); @@ -2371,6 +2392,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { /** * 组装被申请人信息 + * * @param caseApplication * @return */ @@ -2481,12 +2503,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // } - // } - - - - } 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 28b9aec..65bb975 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 @@ -116,19 +116,22 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { // 1931000 尊敬的{1}用户,您的{2}仲裁案件,仲裁方式已确定为{3},请知晓,如非本人操作,请忽略本短信。 String name = affiliate.getName(); request.setTemplateParamSet(new String[]{name, caseNum, arbitratMethodStr}); - if (SmsUtils.sendSms(request)) { - //保存短信发送记录 - SmsSendRecord smsSendRecord = new SmsSendRecord(); - smsSendRecord.setCaseId(caseApplication.getId()); - smsSendRecord.setCaseNum(caseApplication1.getCaseNum()); - smsSendRecord.setPhone(request.getPhone()); - smsSendRecord.setSendTime(new Date()); - String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,仲裁方式已确定为" + arbitratMethodStr + ",请知晓,如非本人操作,请忽略本短信。"; - smsSendRecord.setSendContent(content); - smsSendRecord.setCreateBy(getUsername()); + Boolean aBoolean = SmsUtils.sendSms(request); + //保存短信发送记录 + SmsSendRecord smsSendRecord = new SmsSendRecord(); + smsSendRecord.setCaseId(caseApplication.getId()); + smsSendRecord.setCaseNum(caseApplication1.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); - smsRecordMapper.saveSmsSendRecord(smsSendRecord); + }else { + smsSendRecord.setSendStatus(0); } + smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } 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 afab07a..fd2f4b2 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 @@ -24,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Date; import java.util.List; + import static com.ruoyi.common.utils.SecurityUtils.getUsername; @Service @@ -33,7 +34,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { private final CasePaymentRecordMapper casePaymentRecordMapper; private final CaseAffiliateMapper caseAffiliateMapper; @Autowired - private CaseAttachMapper caseAttachMapper; + private CaseAttachMapper caseAttachMapper; @Autowired private SmsRecordMapper smsRecordMapper; @@ -118,38 +119,44 @@ public class CasePaymentServiceImpl implements ICasePaymentService { // 模板id:1928003 普通短信 案件受理通知 String name = affiliate.getName(); request.setTemplateParamSet(new String[]{name, caseName, caseNum}); - if (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()); + 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); - smsRecordMapper.saveSmsSendRecord(smsSendRecord); + } else { + smsSendRecord.setSendStatus(0); } + 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}); - if (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()); + //保存短信发送记录 + 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); - smsRecordMapper.saveSmsSendRecord(smsSendRecord); + }else { + smsSendRecord.setSendStatus(0); } + smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } //更改记录表里的支付状态和支付时间 @@ -159,22 +166,23 @@ public class CasePaymentServiceImpl implements ICasePaymentService { casePaymentRecord.setUpdateTime(new Date()); casePaymentRecordMapper.update(casePaymentRecord); // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CASE_CROSSEXAMI,""); + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CASE_CROSSEXAMI, ""); return AjaxResult.success(); } } return AjaxResult.error("暂无需要确认的缴费清单"); } + @Transactional @Override public AjaxResult confirmPay(CaseConfirmPayDTO payDTO) { - if(payDTO.getCaseId()!=null&&payDTO.getPayType()!=null){ + if (payDTO.getCaseId() != null && payDTO.getPayType() != null) { // 修改支付方式 caseApplicationMapper.updatePayType(payDTO); } - if(CollectionUtil.isNotEmpty(payDTO.getPayOrderList())){ + if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) { for (CaseAttach caseAttach : payDTO.getPayOrderList()) { caseAttach.setCaseAppliId(payDTO.getCaseId()); caseAttachMapper.updateCaseAttach(caseAttach); @@ -188,7 +196,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); //修改案件状态 int i = caseApplicationMapper.submitCaseApplication(caseApplication1); - if(i>0) { + if (i > 0) { // 修改支付状态 CasePaymentRecord paymentRecord = new CasePaymentRecord(); paymentRecord.setPayType(payDTO.getPayType()); @@ -204,5 +212,4 @@ public class CasePaymentServiceImpl implements ICasePaymentService { } - } From e85fb44ef2ec63fbf9bf3396a3d9ce7ff9c1a673 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Fri, 3 Nov 2023 20:05:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?11.3=E5=8F=91=E7=89=88,=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E7=A7=A6=E5=B7=A5=E4=B8=8B=E8=BD=BD=E6=96=87=E4=BB=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AdjudicationServiceImpl.java | 2 +- .../utils/FixSelectFlowDetailUtils.java | 14 +++----------- 2 files changed, 4 insertions(+), 12 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 6d09066..3e371b6 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 @@ -582,7 +582,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService { for (CaseAttach caseAttach : caseAttachList) { if (caseAttach.getAnnexType() == 3) { String annexName = caseAttach.getAnnexName(); - String prefix = "/profile/upload"; + String prefix = "/profile/upload/"; int startIndex = prefix.length(); String path = caseAttach.getAnnexPath() + annexName.substring(startIndex); file = new File(path); 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 0e11b5e..618b6a3 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 { Gson gson = new Gson(); SealSignRecord sealSignRecordselect = new SealSignRecord(); -// sealSignRecordselect.setSignFlowStatus(1); + // sealSignRecordselect.setSignFlowStatus(1); List sealSignRecords = sealSignRecordMapper.selectSealSignRecordbyStat(sealSignRecordselect); try { @@ -118,7 +118,7 @@ public class FixSelectFlowDetailUtils { caseApplication.setFilearbitraUrl(filearbitraUrl); caseApplicationMapper.submitCaseApplication(caseApplication); - LocalDate now = LocalDate.now(); + /* LocalDate now = LocalDate.now(); String year = Integer.toString(now.getYear()); String month = String.format("%02d", now.getMonthValue()); String day = String.format("%02d", now.getDayOfMonth()); @@ -137,7 +137,7 @@ public class FixSelectFlowDetailUtils { caseAttach.setAnnexPath(savePath); caseAttach.setAnnexName(saveName); caseAttachMapper.updateCaseAttachBycaseid(caseAttach); - } + }*/ } } @@ -147,9 +147,6 @@ public class FixSelectFlowDetailUtils { } } - - - } catch (EsignDemoException e) { e.printStackTrace(); } @@ -198,9 +195,4 @@ public class FixSelectFlowDetailUtils { } - - - - - }