Merge branch 'qtz5' of SH-Arbitrate/Arbitrate-Backend into dev

This commit was merged in pull request #332.
This commit is contained in:
qtz
2024-01-09 11:45:16 +08:00
committed by Gitea
5 changed files with 204 additions and 10 deletions
@@ -200,7 +200,7 @@ public class AdjudicationController extends BaseController {
* @return
*/
@PostMapping("/serviceBatch")
public AjaxResult serviceBatch( CaseApplication caseApplication){
public AjaxResult serviceBatch(@Validated @RequestBody CaseApplication caseApplication){
if(StrUtil.isEmpty(caseApplication.getBatchNumber().toString())){
return error("参数校验失败");
}
@@ -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);
@@ -879,6 +879,113 @@
order by c.batch_number desc
</select>
<select id="selectAdminCaseApplicationListBatch1" parameterType="CaseApplication" resultMap="CaseApplicationResult">
SELECT DISTINCT t1.batch_number ,t1.arbitrat_method ,t1.arbitrator_name ,
t1.arbitrator_id ,t1.identity_type ,t1.name ,t1.applicationOrganId ,
t1.applicantName,t1.arbitratMethodName
FROM(
<trim suffixOverrides="union">
<!--被申请人,仲裁员,部门长,财务,代理人案件-->
<if test="isOtherRole!=null and isOtherRole==1">
SELECT c.batch_number ,c.arbitrat_method ,c.arbitrator_name ,
c.arbitrator_id ,ca.identity_type ,ca.name ,ca.application_organ_id as applicationOrganId,
ca.application_organ_name as applicantName, c.lock_status,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName
FROM case_application c left join case_affiliate ca on c.id = ca.case_appli_id
<where>
<!--根据角色和状态过滤-->
<!--被申请人-->
<if test="idCard != null and idCard != ''">
or (ca.identity_num=#{idCard} AND ca.identity_type=2
and (c.case_status=4 or c.case_status=17)
)
</if>
<!--仲裁员-->
<if test="userId != null and userId != ''">
or ( ca.identity_type=1 and
c.case_status in (7,13,17,18)
and
instr (c.arbitrator_id,#{userId})>0 )
</if>
<!--部门长-->
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
or (ca.identity_type=1)
</if>
<!--财务-->
<if test="financeStatus != null and financeStatus != ''">
or (ca.identity_type=1
and c.case_status =#{financeStatus}
)
</if>
<!--代理人-->
<if test="agentDeptIds != null and agentDeptIds.size()>0">
or (
ca.application_organ_id in
<foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
</foreach>
AND ca.identity_type=1
and c.case_status in (0,9)
)
</if>
</where>
union
</if>
<!--申请人案件-->
<if test="applicationOrganId != null and applicationOrganId != ''">
SELECT c.batch_number ,c.arbitrat_method ,c.arbitrator_name ,
c.arbitrator_id ,ca.identity_type ,ca.name ,ca.application_organ_id as applicationOrganId,
ca.application_organ_name as applicantName, c.lock_status,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName
FROM case_application c left join case_affiliate ca on c.id = ca.case_appli_id
<where>
(c.case_status &lt;= 10 or c.case_status=31) AND
ca.identity_type=1
<if test="applicationOrganId != null and applicationOrganId != ''">
AND ca.application_organ_id = #{applicationOrganId}
</if>
</where>
union
</if>
<!--秘书案件-->
<if test="deptIds != null and deptIds.size() > 0">
SELECT c.batch_number ,c.arbitrat_method ,c.arbitrator_name ,
c.arbitrator_id ,ca.identity_type ,ca.name ,ca.application_organ_id as applicationOrganId,
ca.application_organ_name as applicantName, c.lock_status,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName
FROM case_application c left join case_affiliate ca on c.id = ca.case_appli_id
WHERE ca.identity_type=1
and c.case_status in (1,5,8,9,11,14,15,16,17,31)
union
</if>
</trim>
) t1
WHERE t1.lock_status = 0 and t1.batch_number is not null
and t1.identity_type = 1
<if test="batchNumber != null and batchNumber != ''">
AND t1.batch_number = #{batchNumber}
</if>
<if test="nameId != null and nameId != ''">
AND t1.application_organ_id=#{nameId}
</if>
order by t1.batch_number desc
</select>
<select id="selectAdminCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
SELECT
sum( case when c.case_status=0 then 1 else 0 end) caseApply,