This commit is contained in:
qitz
2023-10-19 15:19:13 +08:00
12 changed files with 333 additions and 293 deletions
@@ -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<Integer> annexTypeList){
if(caseAppliId==null){
return error("案件id不能为空");
}
return caseEvidenceService.fileList(caseAppliId, annexTypeList);
}
/**
* 删除附件
* @param fileIds
* @return
*/
@PostMapping("/deleteFile")
public AjaxResult deleteFile( @RequestParam("fileIds") List<Integer> fileIds){
if(CollectionUtil.isEmpty(fileIds)){
return error("附件id不能为空");
}
return toAjax(caseEvidenceService.deleteFile( fileIds));
}
/**
* 查询当前用户案件列表
@@ -55,16 +55,9 @@ public interface CaseApplicationMapper {
*/
void updatePayType(CaseConfirmPayDTO payDTO);
/**
* 查询部门长案件
* @param caseApplication
* @return
*/
List<CaseApplication> selectDeptHeadCaseApplicationList(@Param("caseApplication") CaseApplication caseApplication, @Param("statusList")List<Integer> caseStatusList);
ToDoCount selectAdminCaseToDoCount();
ToDoCount selectDeptHeadCaseToDoCount( @Param("statusList")List<Integer> caseStatusList);
ToDoCount selectTodoCountByRole(CaseApplication caseApplication);
}
@@ -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<Integer> fileIds);
}
@@ -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<Integer> annexTypeList);
int deleteFile( List<Integer> fileIds);
}
@@ -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<Integer> 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<Integer> 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<Long> deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
// caseApplication.setDeptIds(deptIds);
// }
if(role.getRoleName().equals("法律顾问")){
// 查询角色有关的用户部门
List<Long> 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<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
Map<String, Long> deptMap =new HashMap<>();
if (caseAffiliates != null && caseAffiliates.size() > 0) {
// 查询所有的组织机构,组装成map
List<SysDept> 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<SysDept> 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<Long> longList = Arrays.asList(agentUser.getRoleIds());
if(CollectionUtil.isNotEmpty(agentUser.getRoles())) {
List<Long> longList = agentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
if(!longList.contains(roleId)) {
ArrayList<SysUserRole> sysUserRoles = new ArrayList<>();
SysUserRole sysUserRole = new SysUserRole();
@@ -918,47 +914,47 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
//对不重复的立案对象集合的立案对象重新组装对应的案件关联人信息
// if(caseApplicationListinsertDiffer!=null&&caseApplicationListinsertDiffer.size()>0){
List<CaseApplication> caseApplicationNewList = null;
for (int i = 0; i < caseApplicationListinsert.size(); i++){
caseApplicationNewList = new ArrayList<>();
CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i);
// 设置自动编码
caseApplicationinsertDiffer.setCaseNum(generateCaseNum());
List<CaseAffiliate> 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<CaseApplication> caseApplicationNewList = null;
for (int i = 0; i < caseApplicationListinsert.size(); i++){
caseApplicationNewList = new ArrayList<>();
CaseApplication caseApplicationinsertDiffer = caseApplicationListinsert.get(i);
// 设置自动编码
caseApplicationinsertDiffer.setCaseNum(generateCaseNum());
List<CaseAffiliate> 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<CaseAffiliate> 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<CaseAffiliate> caseAffiliates = caseApplicationItera.getCaseAffiliates();
if(caseAffiliates!=null&&caseAffiliates.size()>0){
for (CaseAffiliate caseAffiliate : caseAffiliates){
caseAffiliate.setCaseAppliId(caseApplicationItera.getId());
}
caseAffiliateMapper.batchCaseAffiliate(caseAffiliates);
}
successNum++;
successMsg.append("<br/>" + successNum + "、立案编号 " + caseApplicationItera.getCaseNum() + " 导入成功");
}
successNum++;
successMsg.append("<br/>" + 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<CaseAttach> payOrderList = caseAttachMapper.queryCaseAttachList(caseApplication);
caseApplicationselect.setPayOrderList(payOrderList);
List<CaseAttach> 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<SysUser> 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<SysUser> 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<CaseAffiliate> caseAffiliatesnew, Map<String, Long> 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());
}
}
}
@@ -104,8 +104,6 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
}
}
}
// 新增日志
CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_OPENCOURT_HEAR,"");
return AjaxResult.success("审核成功");
}
@@ -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<CaseAttach> 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<Integer> annexTypeList) {
CaseApplication caseApplication = new CaseApplication();
caseApplication.setId(caseAppliId);
caseApplication.setAnnexTypeList(annexTypeList);
List<CaseAttach> 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<Integer> fileIds) {
return caseAttachMapper.deleteByFileIds(fileIds);
}
private List<CaseEvidenceVO> getCaseEvidenceVOList(String identityNum, List<Integer> caseStatusList, Integer identityType) {
List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType);
@@ -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);
@@ -178,7 +178,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectUserByIdCard" parameterType="String" resultMap="SysUserResult">
select u.* from sys_user u
select u.*,d.dept_name,ur.role_id
from sys_user u
left join sys_dept d on u.dept_id = d.dept_id
left join sys_user_role ur on u.user_id = ur.user_id
left join sys_role r on r.role_id = ur.role_id
where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
</select>
@@ -49,7 +49,7 @@
<select id="selectCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
select t1.* from(
select DISTINCT(t.id),t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
t.arbitratMethodName,t.case_status,t.caseStatusName,t.hear_date ,t.arbitrat_claims ,
t.loan_start_date ,t.loan_end_date ,t.claim_princi_owed ,t.claim_interest_owed ,t.claim_liquid_damag,t.fee_payable ,
t.begin_video_date ,t.online_video_person ,t.contract_number ,t.create_by ,t.create_time ,
t.update_by ,t.update_time , t.arbitrator_name,t.name,t.application_organ_id,t.applicantName,
@@ -96,51 +96,46 @@
<!--被申请人-->
<if test="idCard != null and idCard != ''">
or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
or (t.identity_num=#{idCard} AND t.identity_type=2 and (t.case_status=4 or t.case_status=17))
</if>
<!--仲裁员-->
<if test="userId != null and userId != ''">
or ( t.identity_type=1 and
t.case_status in (7,8,9,12,13,14)
t.case_status in (7,8,9,12,13,14,17)
and
instr (t.arbitrator_id,#{userId})>0)
</if>
<!--法律顾问-->
<if test="deptIds != null and deptIds.size() > 0">
or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
or (t.identity_type=1 and t.case_status in (1,5,11,15,16,17)
and t.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach> )
</if>
<!--申请人-->
<if test="nameId != null and nameId != ''">
or ( t.application_organ_id = #{nameId} AND t.identity_type=1
and t.case_status in (0,2))
<!--申请人-->
<if test="nameId != null and nameId != ''">
or ( t.application_organ_id = #{nameId} AND t.identity_type=1
and t.case_status in (0,2,17))
</if>
<!--部门长-->
</if>
<!--部门长-->
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
or (t.identity_type=1 and t.case_status in
<foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">#{caseStatus}
</foreach>)
or (t.identity_type=1 and t.case_status in
<foreach item="caseStatus" collection="deptHeadStatus" open="(" separator="," close=")">#{caseStatus}
</foreach>)
</if>
<!--财务-->
<if test="financeStatus != null and financeStatus != ''">
(t.identity_type=1 and t.case_status =#{financeStatus})
or (t.identity_type=1 and t.case_status =#{financeStatus})
</if>
</where>
) t1
<!-- <where>-->
<!-- &lt;!&ndash;申请人&ndash;&gt;-->
<!-- <if test="nameId != null and nameId != ''">-->
<!-- and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
<!-- and t1.case_status in (0,2)-->
<!-- )-->
<!-- </if>-->
<!-- </where>-->
order by t1.create_time desc,t1.case_num desc
</select>
<select id="selectTodoCountByRole" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
@@ -165,7 +160,7 @@
from(
select DISTINCT(t.id),t.case_status,t.application_organ_id, t.arbitrator_id,t.identity_num , t.identity_type from(
select c.id ,
c.case_status,ca.application_organ_id,
c.case_status,ca.application_organ_id,
c.arbitrator_id,ca.identity_num , ca.identity_type
from case_application c
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id
@@ -188,18 +183,18 @@
<!--被申请人-->
<if test="idCard != null and idCard != ''">
or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
or (t.identity_num=#{idCard} AND t.identity_type=2 and (t.case_status=4 or t.case_status=17))
</if>
<!--仲裁员-->
<if test="userId != null and userId != ''">
or ( t.identity_type=1 and
t.case_status in (7,8,9,12,13,14)
t.case_status in (7,8,9,12,13,14,17)
and
instr (t.arbitrator_id,#{userId})>0)
</if>
<!--法律顾问-->
<if test="deptIds != null and deptIds.size() > 0">
or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
or (t.identity_type=1 and t.case_status in (1,5,11,15,16,17)
and t.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
@@ -208,7 +203,7 @@
<!--申请人-->
<if test="nameId != null and nameId != ''">
or ( t.application_organ_id = #{nameId} AND t.identity_type=1
and t.case_status in (0,2))
and t.case_status in (0,2,17))
</if>
<!--部门长-->
@@ -220,19 +215,11 @@
</if>
<!--财务-->
<if test="financeStatus != null and financeStatus != ''">
( t.identity_type=1 and t.case_status =#{financeStatus})
or ( t.identity_type=1 and t.case_status =#{financeStatus})
</if>
</where>
) t1
<!-- <where>
&lt;!&ndash;申请人&ndash;&gt;-->
<!-- <if test="nameId != null and nameId != ''">-->
<!-- and ( t1.application_organ_id = #{nameId} AND t1.identity_type=1-->
<!-- and t1.case_status in (0,2)-->
<!-- )-->
<!-- </if>
</where> -->
</select>
<select id="selectAdminCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
@@ -296,7 +283,7 @@
sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived
FROM
case_application c
JOIN case_affiliate ca ON ca.case_appli_id = c.id
JOIN case_affiliate ca ON ca.case_appli_id = c.id
AND ca.identity_type = 1
WHERE
c.case_status IN (
@@ -321,106 +308,6 @@
)
</select>
<select id="selectDeptHeadCaseApplicationList" parameterType="CaseApplication" resultMap="CaseApplicationResult">
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,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
ELSE '无案件状态'
END caseStatusName,
c.hear_date ,c.arbitrat_claims ,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
c.update_by ,c.update_time , c.arbitrator_name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.filearbitra_url
from case_application c
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
<where>
c.case_status in
<foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
<if test="caseApplication.caseStatus != null">
AND c.case_status = #{caseApplication.caseStatus}
</if>
<if test="caseApplication.caseNum != null and caseApplication.caseNum != ''">
AND c.case_num = #{caseApplication.caseNum}
</if>
<if test="caseApplication.nameId != null and caseApplication.nameId != ''">
AND ca.application_organ_id=#{caseApplication.nameId} AND ca.identity_type=1
</if>
<if test="caseApplication.caseStatusList != null and caseApplication.caseStatusList.size() > 0">
and c.case_status in
<foreach item="caseStatus" collection="caseApplication.caseStatusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
</if>
</where>
order by c.create_time desc,c.case_num desc
</select>
<select id="selectDeptHeadCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
select sum( case when c.case_status=0 then 1 else 0 end) caseApply,
sum( case when c.case_status=1 then 1 else 0 end) caseApplyCheck,
sum( case when c.case_status=2 then 1 else 0 end) caseApplyPay,
sum( case when c.case_status=3 then 1 else 0 end) caseApplyPayCheck,
sum( case when c.case_status=4 then 1 else 0 end) caseApplyEvidence,
sum( case when c.case_status=5 then 1 else 0 end) caseApplyGroupCheck,
sum( case when c.case_status=6 then 1 else 0 end) caseApplyGroupConfirm,
sum( case when c.case_status=7 then 1 else 0 end) caseApplyArbitrateWay,
sum( case when c.case_status=8 then 1 else 0 end) caseApplyGroupOnline,
sum( case when c.case_status=9 then 1 else 0 end) caseApplyGroupOffline,
sum( case when c.case_status=10 then 1 else 0 end) caseApplyAward,
sum( case when c.case_status=11 then 1 else 0 end) caseApplyAwardCheck,
sum( case when c.case_status=12 then 1 else 0 end) caseApplyAwardConfirm,
sum( case when c.case_status=13 then 1 else 0 end) caseApplyAwardSign,
sum( case when c.case_status=14 then 1 else 0 end) caseApplyAwardSeal,
sum( case when c.case_status=15 then 1 else 0 end) caseApplyAwardSend,
sum( case when c.case_status=16 then 1 else 0 end) caseApplyStored,
sum( case when c.case_status=17 then 1 else 0 end) caseApplyArchived
from case_application c
LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type=1
<where>
<!--部门长-->
<if test="statusList != null and statusList.size() > 0">
or c.case_status in
<foreach item="caseStatus" collection="statusList" open="(" separator="," close=")">
#{caseStatus}
</foreach>
<!--被申请人-->
<if test="idCard != null and idCard != ''">
or (t.identity_num=#{idCard} AND t.identity_type=2 and t.case_status=4)
</if>
<!--仲裁员-->
<if test="userId != null and userId != ''">
or ( t.identity_type=1 and
t.case_status in (7,8,9,12,13,14)
and
instr (t.arbitrator_id,#{userId})>0)
</if>
<!--法律顾问-->
<if test="deptIds != null and deptIds.size() > 0">
or (t.identity_type=1 and t.case_status in (1,5,11,15,16)
and t.application_organ_id in
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
#{item}
</foreach> )
</if>
<!--申请人-->
<if test="nameId != null and nameId != ''">
or( ( t.application_organ_id = #{nameId} AND t.identity_type=1
and t.case_status in (0,2))
)
</if>
</if>
</where>
</select>
<select id="selectCaseApplicationCount" parameterType="CaseApplication" resultType="int">
@@ -463,7 +350,7 @@
)values(
<if test="caseNum != null and caseNum != ''">#{caseNum},</if>
<if test="caseSubjectAmount != null">#{caseSubjectAmount},</if>
sysdate(),
sysdate(),
<if test="arbitratMethod != null and arbitratMethod != ''">#{arbitratMethod},</if>
<if test="caseStatus != null ">#{caseStatus},</if>
<if test="hearDate != null ">#{hearDate},</if>
@@ -559,8 +446,8 @@
<select id="selectCaseApplication" parameterType="CaseApplication" resultMap="CaseApplicationResult">
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 @@
<select id="selectCaseApplicationConfirm" parameterType="CaseApplication" resultMap="CaseApplicationResult">
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,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档'
ELSE '无案件状态'
END caseStatusName,
c.hear_date ,c.arbitrat_claims ,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,
p.payment_status ,
CASE p.payment_status when 1 then '已支付' when 0 then '未支付'
ELSE '无支付状态'
END paymentStatusName,c.pay_type,
CASE c.pay_type when 0 then '线上支付' when 0 then '线下支付' else '' end payTypeName
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName,
c.case_status ,
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
when 15 then '待仲裁文书送达' when 16 then '待案件归档'
ELSE '无案件状态'
END caseStatusName,
c.hear_date ,c.arbitrat_claims ,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,
p.payment_status ,
CASE p.payment_status when 1 then '已支付' when 0 then '未支付'
ELSE '无支付状态'
END paymentStatusName,c.pay_type,
CASE c.pay_type when 0 then '线上支付' when 0 then '线下支付' else '' end payTypeName
from case_application c left join case_payment_record p on c.id = p.case_id
where c.case_status = 3
AND c.id = #{id}
AND c.id = #{id}
</select>
<select id="selectCaseNumLike" resultType="java.lang.Integer">
@@ -622,4 +509,4 @@
</select>
</mapper>
</mapper>
@@ -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})
</insert>
<delete id="deleteByFileIds">
delete from case_attach
where annex_id in
<foreach collection="ids" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
@@ -25,8 +25,8 @@
cl.create_by createBy,cl.create_nick_name createNickName,cl.create_time createTime,cl.update_by updateBy,cl.update_time updateTime,
CASE cl.case_node when 0 then '立案申请' when 1 then '提交立案申请' when 2 then '立案审查'
when 3 then '支付成功' when 4 then '缴费确认' when 5 then '案件质证'
when 6 then '组庭审核' when 7 then '组庭确认' when 8 then '待开庭审理'
when 9 then '待书面审理' when 10 then '书面审理' when 11 then '拒绝裁决书'
when 6 then '组庭审核' when 7 then '组庭确认' when 8 then '当前仲裁方式为开庭审理'
when 9 then '当前仲裁方式为书面审理' when 10 then '书面审理' when 11 then '生成裁決书'
when 12 then '核验裁决书' when 13 then '同意裁决书' when 14 then '签名成功'
when 15 then '用印成功' when 16 then '送达仲裁文书' when 17 then '案件归档'
when 26 then '证据确认成功'