diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java index 3a408ca..f3bc7b2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseEvidenceController.java @@ -1,5 +1,7 @@ package com.ruoyi.web.controller.wisdomarbitrate; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; @@ -55,6 +57,45 @@ public class CaseEvidenceController extends BaseController { Long userId = this.getUserId(); return caseEvidenceService.uploadEvidence(file, annexType, id, username, userId); } + @PostMapping("/batchUpload") + public AjaxResult batchUpload(@RequestParam("file") MultipartFile[] file, Integer annexType, Long id) { + if(file==null){ + return error("请选择要上传的文件"); + } + String username = this.getUsername(); + Long userId = this.getUserId(); + return caseEvidenceService.batchUpload(file, annexType, id, username, userId); + } + + /** + * 获取附件 + * @param caseAppliId + * @param annexTypeList + * @param + * @return + */ + @GetMapping("/fileList") + public AjaxResult fileList(Long caseAppliId, @RequestParam("annexTypeList") List annexTypeList){ + if(caseAppliId==null){ + return error("案件id不能为空"); + } + return caseEvidenceService.fileList(caseAppliId, annexTypeList); + } + + /** + * 删除附件 + * @param fileIds + * @return + */ + @PostMapping("/deleteFile") + public AjaxResult deleteFile( @RequestParam("fileIds") List fileIds){ + + if(CollectionUtil.isEmpty(fileIds)){ + return error("附件id不能为空"); + } + return toAjax(caseEvidenceService.deleteFile( fileIds)); + } + /** * 查询当前用户案件列表 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index 3a3cf75..b2a5ff9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -55,16 +55,9 @@ public interface CaseApplicationMapper { */ void updatePayType(CaseConfirmPayDTO payDTO); - /** - * 查询部门长案件 - * @param caseApplication - * @return - */ - List selectDeptHeadCaseApplicationList(@Param("caseApplication") CaseApplication caseApplication, @Param("statusList")List caseStatusList); ToDoCount selectAdminCaseToDoCount(); - ToDoCount selectDeptHeadCaseToDoCount( @Param("statusList")List caseStatusList); ToDoCount selectTodoCountByRole(CaseApplication caseApplication); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index 95498cd..c455c8a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import com.ruoyi.wisdomarbitrate.domain.SealSignRecord; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -18,4 +19,5 @@ public interface CaseAttachMapper { int updateCaseAttachBycaseid(CaseAttach caseAttach); + int deleteByFileIds(@Param("ids") List fileIds); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java index e601832..969e13f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICaseEvidenceService.java @@ -20,4 +20,19 @@ public interface ICaseEvidenceService { AjaxResult evidenceConfirmation(CaseApplication caseApplication); AjaxResult caseCrossexamination(CaseEvidenceDTO caseEvidenceDTO); + + /** + * 批量上传文件 + * @param file + * @param annexType + * @param id + * @param username + * @param userId + * @return + */ + AjaxResult batchUpload(MultipartFile[] file, Integer annexType, Long id, String username, Long userId); + + AjaxResult fileList(Long caseAppliId, List annexTypeList); + + int deleteFile( List fileIds); } 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 b02c5f2..6018ee4 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 @@ -22,19 +22,13 @@ import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.*; import com.ruoyi.common.utils.file.SaaSAPIFileUtils; - - - import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.exception.EsignDemoException; -import com.ruoyi.common.exception.ServiceException; import com.ruoyi.system.domain.SysUserRole; import com.ruoyi.system.mapper.SysRoleMapper; import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.system.mapper.SysUserRoleMapper; import com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; -import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.system.mapper.SysDeptMapper; import com.ruoyi.wisdomarbitrate.domain.*; import com.ruoyi.wisdomarbitrate.domain.vo.SendRoomNoMessageVO; @@ -44,7 +38,6 @@ import com.ruoyi.wisdomarbitrate.utils.SignAward; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; - import java.io.File; import java.io.IOException; import java.math.BigDecimal; @@ -71,8 +64,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { @Autowired private CaseAffiliateMapper caseAffiliateMapper; - @Autowired - private CasePaymentRecordMapper casePaymentRecordMapper; @Autowired private ArbitrateRecordMapper arbitrateRecordMapper; @Autowired @@ -127,25 +118,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { ){ return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); } -// if(role.getRoleName().equals("仲裁委") -// ||role.getRoleName().equals("部门长")){ -// List caseStatusList=new ArrayList<>(); -// caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); -// caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION); -// caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); -// caseApplication.setDeptHeadStatus(caseStatusList); -// } -// if(role.getRoleName().equals("仲裁员")){ -// caseApplication.setUserId(String.valueOf(userId)); -// } + if(role.getRoleName().equals("仲裁委") + ||role.getRoleName().equals("部门长")){ + List caseStatusList=new ArrayList<>(); + caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL); + caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION); + caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL); + caseApplication.setDeptHeadStatus(caseStatusList); + } + if(role.getRoleName().equals("仲裁员")){ + caseApplication.setUserId(String.valueOf(userId)); + } if(role.getRoleName().equals("财务")){ caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); } -// if(role.getRoleName().equals("法律顾问")){ -// // 查询角色有关的用户部门 -// List deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); -// caseApplication.setDeptIds(deptIds); -// } + if(role.getRoleName().equals("法律顾问")){ + // 查询角色有关的用户部门 + List deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); + caseApplication.setDeptIds(deptIds); + } if(StrUtil.isEmpty(caseApplication.getNameId())&&role.getRoleName().equals("申请人")){ // 查询角色有关的用户部门 caseApplication.setNameId(String.valueOf(sysUser.getDeptId())); @@ -559,12 +550,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { List caseAffiliates = caseApplication.getCaseAffiliates(); Map deptMap =new HashMap<>(); if (caseAffiliates != null && caseAffiliates.size() > 0) { - // 查询所有的组织机构,组装成map - List deptList = sysDeptMapper.selectDeptList(new SysDept()); - if (CollectionUtil.isEmpty(deptList)) { - deptList = new ArrayList<>(); - } - deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); + // 查询所有的组织机构,组装成map + List deptList = sysDeptMapper.selectDeptList(new SysDept()); + if (CollectionUtil.isEmpty(deptList)) { + deptList = new ArrayList<>(); + } + deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV)); for (CaseAffiliate caseAffiliate : caseAffiliates) { caseAffiliate.setCaseAppliId(caseApplication.getId()); @@ -623,7 +614,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String currentDay = DateUtils.dateTime(); String caseNum = "zc"+ currentDay; //查询出当天的案件编号的最大值 - Integer maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length()); + Integer maxCaseNum = caseApplicationMapper.selectCaseNumLike(caseNum,caseNum.length()); if(null == maxCaseNum){ caseNum = caseNum + "001"; }else { @@ -689,7 +680,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } - caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); + caseAffiliateMapper.updataCaseAffiliate(caseAffiliate); } } @@ -722,7 +713,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); // 新增角色为申请人 @@ -736,23 +727,28 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } if (insertUserRow > 0) { caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId())); - // 发送短信 1955400 普通短信 导入后通知申请人认证注册 尊敬的{1},您的申请的仲裁案件已导入,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信 已生效 + // 明天改下模板id:1956159 普通短信 通知用户认证注册 尊敬的{1},您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信 SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest(); - request.setTemplateId("1955400"); + request.setTemplateId("1956159"); request.setPhone(agentUser.getPhonenumber()); request.setTemplateParamSet(new String[]{agentUser.getNickName()}); SmsUtils.sendSms(request); } } else if (null != agentUser.getDeptId() && !String.valueOf(agentUser.getDeptId()).equals(caseAffiliate.getApplicationOrganId())) { - return "申请机构与申请代理人不匹配"; +// return "该申请代理人已在"+agentUser.getDeptName()+"申请机构下存在,请检查填写信息是否正确"; + 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())){ // 同步用户表和案件关联人表的手机号和名称 caseAffiliate.setContactTelphoneAgent(agentUser.getPhonenumber()); caseAffiliate.setNameAgent(agentUser.getNickName()); caseAffiliate.setApplicantAgentUserId(String.valueOf(agentUser.getUserId())); // 新增角色为申请人 - if(agentUser.getRoleIds()!=null) { - List longList = Arrays.asList(agentUser.getRoleIds()); + if(CollectionUtil.isNotEmpty(agentUser.getRoles())) { + List longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()); if(!longList.contains(roleId)) { ArrayList sysUserRoles = new ArrayList<>(); SysUserRole sysUserRole = new SysUserRole(); @@ -918,47 +914,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { //对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息 // if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){ - List caseApplicationNewList = null; - for (int i = 0; i < caseApplicationListinsert.size(); i++){ - caseApplicationNewList = new ArrayList<>(); - CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); - // 设置自动编码 - caseApplicationinsertDiffer.setCaseNum(generateCaseNum()); - List caseAffiliatesnew = new ArrayList<>(); - CaseApplication caseApplicationNew = new CaseApplication(); - copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew); - if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ - for (int j = 0; j < caseApplicationListinsert.size(); j++){ - CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); + List caseApplicationNewList = null; + for (int i = 0; i < caseApplicationListinsert.size(); i++){ + caseApplicationNewList = new ArrayList<>(); + CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i); + // 设置自动编码 + caseApplicationinsertDiffer.setCaseNum(generateCaseNum()); + List caseAffiliatesnew = new ArrayList<>(); + CaseApplication caseApplicationNew = new CaseApplication(); + copyCaseApplication(caseApplicationinsertDiffer,caseApplicationNew); + if(caseApplicationListinsert!=null&&caseApplicationListinsert.size()>0){ + for (int j = 0; j < caseApplicationListinsert.size(); j++){ + CaseApplication caseApplicationinsert = caseApplicationListinsert.get(j); - if(StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum())&& - caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())){ + if(StringUtils.isNotEmpty(caseApplicationinsert.getCaseNum())&& + caseApplicationinsert.getCaseNum().equals(caseApplicationinsertDiffer.getCaseNum())){ - caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); - } + caseAffiliatesnew.addAll(caseApplicationinsert.getCaseAffiliates()); } - caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); - caseApplicationNewList.add(caseApplicationNew); + } + caseApplicationNew.setCaseAffiliates(caseAffiliatesnew); + caseApplicationNewList.add(caseApplicationNew); + } + + for (int k = 0; k < caseApplicationNewList.size(); k++){ + CaseApplication caseApplicationItera = caseApplicationNewList.get(k); + // 新增立案信息 + caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); + caseApplicationItera.setCreateBy(getUsername()); + int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); + List caseAffiliates = caseApplicationItera.getCaseAffiliates(); + if(caseAffiliates!=null&&caseAffiliates.size()>0){ + for (CaseAffiliate caseAffiliate : caseAffiliates){ + caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); + + } + caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); } - 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); - List caseAffiliates = caseApplicationItera.getCaseAffiliates(); - if(caseAffiliates!=null&&caseAffiliates.size()>0){ - for (CaseAffiliate caseAffiliate : caseAffiliates){ - caseAffiliate.setCaseAppliId(caseApplicationItera.getId()); - - } - caseAffiliateMapper.batchCaseAffiliate(caseAffiliates); - } - - successNum++; - successMsg.append("
" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功"); - } + successNum++; + successMsg.append("
" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功"); + } // } @@ -969,7 +965,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { }else { throw new ServiceException("导入立案申请数据不能为空!"); } - return successMsg.append(failureMsg.toString()).toString(); + return successMsg.append(failureMsg.toString()).toString(); } @@ -1439,8 +1435,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { } caseApplication.setAnnexType(8); // 查询缴费凭证 - List payOrderList = caseAttachMapper.queryCaseAttachList(caseApplication); - caseApplicationselect.setPayOrderList(payOrderList); + List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication); + if (caseAttachList != null && caseAttachList.size() > 0) { + for (CaseAttach caseAttach : caseAttachList) { + String annexName = caseAttach.getAnnexName(); + String prefix = "/profile"; + int startIndex = annexName.indexOf(prefix); + startIndex += prefix.length(); + String annexPath = "/uploadPath" + annexName.substring(startIndex); + caseAttach.setAnnexPath(annexPath); + int startIndexnew = annexName.lastIndexOf("/"); + if(startIndexnew!=-1){ + String annexNamenew = annexName.substring(startIndexnew+1); + caseAttach.setAnnexName(annexNamenew); + } + + + } + } + caseApplicationselect.setPayOrderList(caseAttachList); return caseApplicationselect; } @@ -1739,19 +1752,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { for(int i = 0;i < idStrList.length;i ++ ){ idList.add(Long.parseLong(idStrList[i])); } - // 查询仲裁员电话号 - List userList= sysUserMapper.selectUserListByIds(idList); - if(CollectionUtil.isNotEmpty(userList)) { - for (SysUser user : userList) { - //给仲裁员发送短信通知 - request.setPhone(user.getPhonenumber()); - // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 - String name = user.getNickName(); - request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); - SmsUtils.sendSms(request); + // 查询仲裁员电话号 + List userList= sysUserMapper.selectUserListByIds(idList); + if(CollectionUtil.isNotEmpty(userList)) { + for (SysUser user : userList) { + //给仲裁员发送短信通知 + request.setPhone(user.getPhonenumber()); + // 1947342 普通短信 开庭日期通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。 + String name = user.getNickName(); + request.setTemplateParamSet(new String[]{name, caseNum, hearDatestr}); + SmsUtils.sendSms(request); - } - } + } + } } @@ -1764,7 +1777,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j); int identityType = caseAffiliateselect.getIdentityType(); if(identityType==1){ - caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName()); + caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName()); } //给申请人、被申请人发送短信通知 @@ -1817,7 +1830,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private void assignmentCaseAffiliates(CaseApplication caseApplication, List caseAffiliatesnew, Map deptMap) { - // 申请人信息 + // 申请人信息 CaseAffiliate caseAffiliate = new CaseAffiliate(); // BeanUtils.copyBeanProp(caseApplication,caseAffiliate); @@ -1832,7 +1845,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if(StrUtil.isNotEmpty(s)){ StringBuilder errorMsg = caseApplication.getErrorMsg(); if(StrUtil.isEmpty(errorMsg)){ - errorMsg=new StringBuilder(); + errorMsg=new StringBuilder(); } errorMsg.append(s); caseApplication.setErrorMsg(errorMsg); @@ -1879,27 +1892,27 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { - // 将组织机构id设为申请人名称 - if(deptMap.containsKey(caseApplication.getName())){ - caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName()))); - caseAffiliate.setApplicationOrganName(caseApplication.getName()); - }else { - // 如果不存在则新增 - SysDept dept = new SysDept(); - dept.setParentId(0L); - dept.setDeptName(caseApplication.getName()); - dept.setAncestors("0"); - dept.setOrderNum(1); - dept.setStatus("0"); - dept.setDelFlag("0"); - dept.setCreateBy(getUsername()); - dept.setUpdateBy(getUsername()); - sysDeptMapper.insertDept(dept); - deptMap.put(dept.getDeptName(),dept.getDeptId()); - caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); - caseAffiliate.setApplicationOrganName(caseApplication.getName()); + // 将组织机构id设为申请人名称 + if(deptMap.containsKey(caseApplication.getName())){ + caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName()))); + caseAffiliate.setApplicationOrganName(caseApplication.getName()); + }else { + // 如果不存在则新增 + SysDept dept = new SysDept(); + dept.setParentId(0L); + dept.setDeptName(caseApplication.getName()); + dept.setAncestors("0"); + dept.setOrderNum(1); + dept.setStatus("0"); + dept.setDelFlag("0"); + dept.setCreateBy(getUsername()); + dept.setUpdateBy(getUsername()); + sysDeptMapper.insertDept(dept); + deptMap.put(dept.getDeptName(),dept.getDeptId()); + caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); + caseAffiliate.setApplicationOrganName(caseApplication.getName()); - } + } } 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 b6d5d36..5e59301 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 @@ -104,8 +104,6 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { } } } - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_OPENCOURT_HEAR,""); return AjaxResult.success("审核成功"); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index c83db9f..b742dda 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.wisdomarbitrate.service.impl; +import cn.hutool.core.collection.CollectionUtil; import com.ruoyi.common.config.RuoYiConfig; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; @@ -21,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -195,6 +197,79 @@ IdentityAuthenticationMapper identityAuthenticationMapper; } return null; } + @Transactional + @Override + public AjaxResult batchUpload(MultipartFile[] files, Integer annexType, Long id, String userName, Long userId) { + List successList= new ArrayList<>(); + try { + String filePath = RuoYiConfig.getUploadPath(); + for (MultipartFile file : files) { + // 上传 + String fileName = FileUploadUtils.upload(filePath, file); + CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id) + .annexName(fileName) + .annexPath(filePath) + .annexType(annexType) + .userId(userId) + .userName(userName) + .build(); + int count = caseAttachMapper.save(caseAttach); + if (count > 0 && annexType!=null && annexType!=8) { + if(id!=null){ + //修改案件状态 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(id); + caseApplication.setCaseStatus(4); + caseApplicationMapper.submitCaseApplication(caseApplication); + } + CaseAttach caseAttachselect = new CaseAttach(); + caseAttachselect.setAnnexId(caseAttach.getAnnexId()); + caseAttachselect.setAnnexName(caseAttach.getAnnexName()); + caseAttachselect.setAnnexType(caseAttach.getAnnexType()); + successList.add(caseAttachselect); + } + } + + + } catch (IOException e) { + e.printStackTrace(); + return AjaxResult.error("上传失败"); + } + + return AjaxResult.success("上传成功",successList); + + } + + @Override + public AjaxResult fileList(Long caseAppliId, List annexTypeList) { + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(caseAppliId); + caseApplication.setAnnexTypeList(annexTypeList); + List caseAttachList = caseAttachMapper.queryCaseAttachList(caseApplication); + if(CollectionUtil.isNotEmpty(caseAttachList)){ + for (CaseAttach caseAttach : caseAttachList) { + String annexName = caseAttach.getAnnexName(); + String prefix = "/profile"; + int startIndex = annexName.indexOf(prefix); + startIndex += prefix.length(); + String annexPath = "/uploadPath" + annexName.substring(startIndex); + caseAttach.setAnnexPath(annexPath); + int startIndexnew = annexName.lastIndexOf("/"); + if(startIndexnew!=-1){ + String annexNamenew = annexName.substring(startIndexnew+1); + caseAttach.setAnnexName(annexNamenew); + } + } + return AjaxResult.success(caseAttachList); + } + return null; + } + + @Override + public int deleteFile( List fileIds) { + + return caseAttachMapper.deleteByFileIds(fileIds); + } private List getCaseEvidenceVOList(String identityNum, List caseStatusList, Integer identityType) { List caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java index 7781461..d99c420 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/CaseLogUtils.java @@ -1,8 +1,10 @@ package com.ruoyi.wisdomarbitrate.utils; import cn.hutool.extra.spring.SpringUtil; +import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.system.mapper.SysUserMapper; import com.ruoyi.wisdomarbitrate.domain.CaseLogRecord; import com.ruoyi.wisdomarbitrate.mapper.CaseLogRecordMapper; @@ -17,6 +19,7 @@ import javax.validation.constraints.NotNull; public class CaseLogUtils { private static CaseLogRecordMapper caseLogRecordMapper= SpringUtil.getBean(CaseLogRecordMapper.class); + private static SysUserMapper userMapper= SpringUtil.getBean(SysUserMapper.class); /** * 新增案件日志 @@ -25,13 +28,15 @@ public class CaseLogUtils * @param notes 备注 */ public static void insertCaseLog(@NotNull Long caseAppliId, @NotEmpty Integer caseNode, String notes ){ + CaseLogRecord operLog = new CaseLogRecord(); // 获取当前的用户 LoginUser loginUser = SecurityUtils.getLoginUser(); - String nickName = loginUser.getUser().getNickName(); - CaseLogRecord operLog = new CaseLogRecord(); - operLog.setCreateBy(loginUser.getUsername()); - operLog.setCreateNickName(nickName); - operLog.setUpdateBy(loginUser.getUsername()); + if(loginUser!=null) { + SysUser sysUser = userMapper.selectUserById(loginUser.getUserId()); + operLog.setCreateBy(sysUser.getUserName()); + operLog.setCreateNickName(sysUser.getNickName()); + operLog.setUpdateBy(sysUser.getUserName()); + } operLog.setCaseAppliId(caseAppliId); operLog.setCaseNode(caseNode); operLog.setNotes(notes); diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 795bb69..53865cf 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -178,7 +178,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index baae6c8..105cacf 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -49,7 +49,7 @@ - - select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' - ELSE '无审理方式' - END arbitratMethodName, + ELSE '无审理方式' + END arbitratMethodName, c.case_status , CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' @@ -587,30 +474,30 @@ - \ No newline at end of file + diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml index 2eabbbd..d68b234 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseAttachMapper.xml @@ -17,6 +17,13 @@ INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account) VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName}) + + delete from case_attach + where annex_id in + + #{id} + +