优化批量送达裁决书功能

This commit is contained in:
qitz
2024-01-09 11:41:16 +08:00
parent da105d20e4
commit 088bd41d0b
5 changed files with 204 additions and 10 deletions
@@ -137,4 +137,6 @@ public interface CaseApplicationMapper {
List<CaseApplication> selectAdminCaseApplicationListBatch(CaseApplication caseApplication);
List<CaseApplication> listCaseApplicationByBatchNumber(CaseApplication caseApplication);
List<CaseApplication> selectAdminCaseApplicationListBatch1(CaseApplication caseApplication);
}
@@ -610,7 +610,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
}
//修改案件状态
caseApplicationById.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
caseApplicationById.setLockStatus(1);
Integer arbitratMethod = caseApplicationById.getArbitratMethod();
if(arbitratMethod==1){
caseApplicationById.setLockStatus(1);
}
caseApplicationMapper.submitCaseApplication(caseApplicationById);
}
@@ -2561,7 +2561,89 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
@Override
public List<CaseApplication> selectCaseApplicationListBatchByRole(CaseApplication caseApplication) {
List<CaseApplication> caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication);
// 获取登录用户
LoginUser loginUser = getLoginUser();
SysUser user = loginUser.getUser();
Long userId = user.getUserId();
SysUser sysUser = sysUserMapper.selectUserById(userId);
List<SysRole> roles = sysUser.getRoles();
// 没有角色不能查看案件列表
if (CollectionUtil.isEmpty(roles)) {
throw new ServiceException("该用户没有角色权限");
}
for (SysRole role : roles) {
if (StrUtil.isEmpty(role.getRoleName())) {
continue;
}
if ("超级管理员".equals(role.getRoleName())) {
List<CaseApplication> caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication);
if(caseApplicationlist!=null&&caseApplicationlist.size()>0){
for(CaseApplication caseApplicationselect : caseApplicationlist){
Integer batchNumber = caseApplicationselect.getBatchNumber();
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setBatchNumber(batchNumber);
List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
if (caseApplications != null && caseApplications.size() > 0) {
List<Integer> caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList());
List<String> caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList());
List<Integer> caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList());
List<String> caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList());
String caseStatusName = caseStatusNamesnew.stream().map(Object::toString).collect(Collectors.joining(","));
String caseStatusstr = caseStatussnew.stream().map(Object::toString).collect(Collectors.joining(","));
caseApplicationselect.setCaseStatusName(caseStatusName);
caseApplicationselect.setCaseStatusstr(caseStatusstr);
}
}
}
return caseApplicationlist;
}
if ("仲裁委".equals(role.getRoleName())
|| "部门长".equals(role.getRoleName())) {
List<Integer> caseStatusList = new ArrayList<>();
caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION);
// caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
caseApplication.setDeptHeadStatus(caseStatusList);
caseApplication.setIsOtherRole(1);
}
if ("仲裁员".equals(role.getRoleName())) {
caseApplication.setUserId(String.valueOf(userId));
caseApplication.setIsOtherRole(1);
}
if ("财务".equals(role.getRoleName())) {
caseApplication.setIsOtherRole(1);
caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
}
if ("法律顾问".equals(role.getRoleName())) {
// 秘书查看所有案件
// 查询角色有关的用户部门
List<Long> deptIds = new ArrayList<>();
deptIds.add(sysUser.getDeptId());
caseApplication.setDeptIds(deptIds);
}
if ("申请人".equals(role.getRoleName())) {
// caseApplication.setIsOtherRole(1);
// 查询有关的用户部门
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
}
if ("被申请人".equals(role.getRoleName())) {
caseApplication.setIsOtherRole(1);
//
caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
}
if ("代理人".equals(role.getRoleName())) {
caseApplication.setIsOtherRole(1);
// 查询角色有关的用户部门
// List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
List<Long> agentDeptIds = new ArrayList<>();
agentDeptIds.add(sysUser.getDeptId());
caseApplication.setAgentDeptIds(agentDeptIds);
}
}
List<CaseApplication> caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch1(caseApplication);
if(caseApplicationlist!=null&&caseApplicationlist.size()>0){
for(CaseApplication caseApplicationselect : caseApplicationlist){
Integer batchNumber = caseApplicationselect.getBatchNumber();
@@ -2895,18 +2977,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, "");
} else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
ArbitrateRecord arbitrateRecordnew = caseApplicationse.getArbitrateRecord();
ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord();
arbitrateRecordsel.setCaseAppliId(caseApplicationse.getId());
ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel);
if(arbitrateRecordnew!=null){
arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion());
arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject());
arbitrateRecordnew.setCaseAppliId(caseApplicationse.getId());
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew);
}else {
ArbitrateRecord arbitrateRecordnew1 = new ArbitrateRecord();
arbitrateRecordnew1.setCheckOpinion(arbitrateRecord.getCheckOpinion());
arbitrateRecordnew1.setArbitrateReject(arbitrateRecord.getArbitrateReject());
arbitrateRecordnew1.setCaseAppliId(caseApplicationse.getId());
arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordnew1);
arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion());
arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject());
arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel);
}
caseApplicationse.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);