实现批量组庭功能

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
@@ -292,6 +292,16 @@ public class CaseApplicationController extends BaseController {
return toAjax(caseApplicationService.pendTralSure(caseApplication));
}
/**
* 批量组庭审核
*/
// @PreAuthorize("@ss.hasPermi('caseManagement:list:checkgroup')")
@Log(title = "批量组庭审核", businessType = BusinessType.UPDATE)
@PostMapping("/pendTralCheckBatch")
public AjaxResult pendTralCheckBatch(@Validated @RequestBody CaseApplication caseApplication) {
return toAjax(caseApplicationService.pendTralCheckBatch(caseApplication));
}
/**
* 修改开庭时间
*/
@@ -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);
@@ -856,17 +856,7 @@
<select id="selectAdminCaseApplicationListBatch" parameterType="CaseApplication" resultMap="CaseApplicationResult">
SELECT DISTINCT c.batch_number ,c.arbitrat_method ,c.arbitrator_name ,
c.arbitrator_id ,c.case_status ,a.identity_type ,a.name ,
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 '已归档'
when 18 then '待仲裁员审核仲裁文书'
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
c.arbitrator_id ,a.identity_type ,a.name ,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName