实现批量组庭功能

This commit is contained in:
qitz
2024-01-03 17:55:35 +08:00
parent 061bdc6312
commit 82b6431be9
5 changed files with 109 additions and 14 deletions
@@ -141,4 +141,6 @@ public interface ICaseApplicationService {
int submitCaseApplicationBatch(String batchNumber);
int submitCaseApplicationCheckBatch(String batchNumber, Integer agreeOrNotCheck, String caseCheckReject);
int pendTralCheckBatch(CaseApplication caseApplication);
}
@@ -1692,7 +1692,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
int rows = 0;
//同意组庭
if (isAgreePendTral != null && isAgreePendTral == 1) {
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
if(caseApplicationselect==null){
throw new ServiceException("案件不存在");
}
String arbitratorId = caseApplicationselect.getArbitratorId();
String arbitratorName = caseApplicationselect.getArbitratorName();
List<Arbitrator> arbitrators = caseApplication.getArbitrators();
if(arbitrators != null && arbitrators.size() > 0 && StringUtils.isEmpty(arbitratorId) && StringUtils.isEmpty(arbitratorName)){
List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(","));
String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(","));
caseApplication.setArbitratorId(idstr);
caseApplication.setArbitratorName(arbitratorNamestr);
rows = caseApplicationMapper.submitCaseApplication(caseApplication);
}
} else {
List<Arbitrator> arbitrators = caseApplication.getArbitrators();
// 仲裁员信息
@@ -2543,7 +2558,25 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
@Override
public List<CaseApplication> selectCaseApplicationListBatchByRole(CaseApplication caseApplication) {
return caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication);
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(","));
caseApplicationselect.setCaseStatusName(caseStatusName);
}
}
}
return caseApplicationlist;
}
@Override
@@ -2704,6 +2737,66 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
return rows;
}
@Override
@Transactional
public int pendTralCheckBatch(CaseApplication caseApplication) {
Integer isAgreePendTral = caseApplication.getIsAgreePendTral();
int rows = 0;
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setBatchNumber(caseApplication.getBatchNumber());
caseApplicationsel.setCaseStatus(CaseApplicationConstants.CASE_CROSSEXAMI);
List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
if (caseApplications != null && caseApplications.size() > 0) {
List<String> caseNums = caseApplications.stream().map(CaseApplication::getCaseNum).collect(Collectors.toList());
List<String> caseNumsnew = caseNums.stream().distinct().collect(Collectors.toList());
String caseNumsstr = caseNumsnew.stream().map(Object::toString).collect(Collectors.joining(","));
throw new ServiceException("案件编号"+caseNumsstr+"在案件质证节点,请先进行案件质证,然后再批量组庭审核");
}
CaseApplication caseApplication1 = new CaseApplication();
caseApplication1.setBatchNumber(caseApplication.getBatchNumber());
caseApplication1.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL_SUBMMIT);
List<CaseApplication> caseApplications1 = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplication1);
if (caseApplications1 != null && caseApplications1.size() > 0) {
for(CaseApplication caseApplicationse:caseApplications1){
//同意组庭
if (isAgreePendTral != null && isAgreePendTral == 1) {
String arbitratorId = caseApplicationse.getArbitratorId();
String arbitratorName = caseApplicationse.getArbitratorName();
List<Arbitrator> arbitrators = caseApplication.getArbitrators();
if(arbitrators != null && arbitrators.size() > 0 && StringUtils.isEmpty(arbitratorId) && StringUtils.isEmpty(arbitratorName)){
List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(","));
String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(","));
caseApplicationse.setArbitratorId(idstr);
caseApplicationse.setArbitratorName(arbitratorNamestr);
caseApplicationse.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
rows += caseApplicationMapper.submitCaseApplication(caseApplicationse);
}
} else {
List<Arbitrator> arbitrators = caseApplication.getArbitrators();
// 仲裁员信息
if (arbitrators != null && arbitrators.size() > 0) {
List<Long> ids = arbitrators.stream().map(Arbitrator::getId).collect(Collectors.toList());
List<String> arbitratorNames = arbitrators.stream().map(Arbitrator::getArbitratorName).collect(Collectors.toList());
String idstr = ids.stream().map(Object::toString).collect(Collectors.joining(","));
String arbitratorNamestr = arbitratorNames.stream().map(Object::toString).collect(Collectors.joining(","));
caseApplicationse.setArbitratorId(idstr);
caseApplicationse.setArbitratorName(arbitratorNamestr);
caseApplicationse.setCaseStatus(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
rows += caseApplicationMapper.submitCaseApplication(caseApplicationse);
}
}
// 新增日志
insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL, "");
}
}
return rows;
}
private String getColumnstr(String columnname) {
String columnstr = "";
switch (columnname) {
@@ -330,7 +330,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
String batchNumber = casePayDTO.getBatchNumber();
CaseApplication caseApplicationsel = new CaseApplication();
caseApplicationsel.setBatchNumber(Integer.parseInt(batchNumber));
caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT);
// caseApplicationsel.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT);
List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
CasePayListVO listVO = new CasePayListVO();
BigDecimal sum = new BigDecimal(0);