Преглед изворни кода

优化批量送达裁决书功能

qitz пре 2 година
родитељ
комит
088bd41d0b

+ 1
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/AdjudicationController.java Прегледај датотеку

@@ -200,7 +200,7 @@ public class AdjudicationController extends BaseController {
200 200
      * @return
201 201
      */
202 202
     @PostMapping("/serviceBatch")
203
-    public AjaxResult serviceBatch( CaseApplication caseApplication){
203
+    public AjaxResult serviceBatch(@Validated @RequestBody  CaseApplication caseApplication){
204 204
         if(StrUtil.isEmpty(caseApplication.getBatchNumber().toString())){
205 205
             return error("参数校验失败");
206 206
         }

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java Прегледај датотеку

@@ -137,4 +137,6 @@ public interface CaseApplicationMapper {
137 137
     List<CaseApplication> selectAdminCaseApplicationListBatch(CaseApplication caseApplication);
138 138
 
139 139
     List<CaseApplication> listCaseApplicationByBatchNumber(CaseApplication caseApplication);
140
+
141
+    List<CaseApplication> selectAdminCaseApplicationListBatch1(CaseApplication caseApplication);
140 142
 }

+ 4
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Прегледај датотеку

@@ -610,7 +610,10 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
610 610
         }
611 611
         //修改案件状态
612 612
         caseApplicationById.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
613
-        caseApplicationById.setLockStatus(1);
613
+        Integer arbitratMethod = caseApplicationById.getArbitratMethod();
614
+        if(arbitratMethod==1){
615
+            caseApplicationById.setLockStatus(1);
616
+        }
614 617
         caseApplicationMapper.submitCaseApplication(caseApplicationById);
615 618
     }
616 619
 

+ 90
- 8
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Прегледај датотеку

@@ -2561,7 +2561,89 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2561 2561
 
2562 2562
     @Override
2563 2563
     public List<CaseApplication> selectCaseApplicationListBatchByRole(CaseApplication caseApplication) {
2564
-        List<CaseApplication> caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication);
2564
+        // 获取登录用户
2565
+        LoginUser loginUser = getLoginUser();
2566
+        SysUser user = loginUser.getUser();
2567
+        Long userId = user.getUserId();
2568
+        SysUser sysUser = sysUserMapper.selectUserById(userId);
2569
+        List<SysRole> roles = sysUser.getRoles();
2570
+        // 没有角色不能查看案件列表
2571
+        if (CollectionUtil.isEmpty(roles)) {
2572
+            throw new ServiceException("该用户没有角色权限");
2573
+        }
2574
+        for (SysRole role : roles) {
2575
+            if (StrUtil.isEmpty(role.getRoleName())) {
2576
+                continue;
2577
+            }
2578
+            if ("超级管理员".equals(role.getRoleName())) {
2579
+                List<CaseApplication> caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch(caseApplication);
2580
+                if(caseApplicationlist!=null&&caseApplicationlist.size()>0){
2581
+                    for(CaseApplication caseApplicationselect : caseApplicationlist){
2582
+                        Integer batchNumber = caseApplicationselect.getBatchNumber();
2583
+                        CaseApplication caseApplicationsel = new CaseApplication();
2584
+                        caseApplicationsel.setBatchNumber(batchNumber);
2585
+                        List<CaseApplication> caseApplications = caseApplicationMapper.listCaseApplicationByBatchNumber(caseApplicationsel);
2586
+                        if (caseApplications != null && caseApplications.size() > 0) {
2587
+                            List<Integer> caseStatuss = caseApplications.stream().map(CaseApplication::getCaseStatus).collect(Collectors.toList());
2588
+                            List<String> caseStatusNames = caseApplications.stream().map(CaseApplication::getCaseStatusName).collect(Collectors.toList());
2589
+                            List<Integer> caseStatussnew = caseStatuss.stream().distinct().collect(Collectors.toList());
2590
+                            List<String> caseStatusNamesnew = caseStatusNames.stream().distinct().collect(Collectors.toList());
2591
+                            String caseStatusName = caseStatusNamesnew.stream().map(Object::toString).collect(Collectors.joining(","));
2592
+                            String caseStatusstr = caseStatussnew.stream().map(Object::toString).collect(Collectors.joining(","));
2593
+                            caseApplicationselect.setCaseStatusName(caseStatusName);
2594
+                            caseApplicationselect.setCaseStatusstr(caseStatusstr);
2595
+                        }
2596
+                    }
2597
+                }
2598
+                return caseApplicationlist;
2599
+
2600
+            }
2601
+
2602
+            if ("仲裁委".equals(role.getRoleName())
2603
+                    || "部门长".equals(role.getRoleName())) {
2604
+                List<Integer> caseStatusList = new ArrayList<>();
2605
+                caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
2606
+                caseStatusList.add(CaseApplicationConstants.CHECK_ARBITRATION);
2607
+                //  caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
2608
+                caseApplication.setDeptHeadStatus(caseStatusList);
2609
+                caseApplication.setIsOtherRole(1);
2610
+            }
2611
+            if ("仲裁员".equals(role.getRoleName())) {
2612
+                caseApplication.setUserId(String.valueOf(userId));
2613
+                caseApplication.setIsOtherRole(1);
2614
+            }
2615
+            if ("财务".equals(role.getRoleName())) {
2616
+                caseApplication.setIsOtherRole(1);
2617
+                caseApplication.setFinanceStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
2618
+            }
2619
+            if ("法律顾问".equals(role.getRoleName())) {
2620
+                // 秘书查看所有案件
2621
+                // 查询角色有关的用户部门
2622
+                List<Long> deptIds = new ArrayList<>();
2623
+                deptIds.add(sysUser.getDeptId());
2624
+                caseApplication.setDeptIds(deptIds);
2625
+            }
2626
+            if ("申请人".equals(role.getRoleName())) {
2627
+                //    caseApplication.setIsOtherRole(1);
2628
+                // 查询有关的用户部门
2629
+                caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
2630
+            }
2631
+            if ("被申请人".equals(role.getRoleName())) {
2632
+                caseApplication.setIsOtherRole(1);
2633
+                //
2634
+                caseApplication.setIdCard(String.valueOf(sysUser.getIdCard()));
2635
+            }
2636
+            if ("代理人".equals(role.getRoleName())) {
2637
+                caseApplication.setIsOtherRole(1);
2638
+                // 查询角色有关的用户部门
2639
+                // List<Long> agentDeptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId());
2640
+                List<Long> agentDeptIds = new ArrayList<>();
2641
+                agentDeptIds.add(sysUser.getDeptId());
2642
+                caseApplication.setAgentDeptIds(agentDeptIds);
2643
+            }
2644
+
2645
+        }
2646
+        List<CaseApplication> caseApplicationlist = caseApplicationMapper.selectAdminCaseApplicationListBatch1(caseApplication);
2565 2647
         if(caseApplicationlist!=null&&caseApplicationlist.size()>0){
2566 2648
             for(CaseApplication caseApplicationselect : caseApplicationlist){
2567 2649
                 Integer batchNumber = caseApplicationselect.getBatchNumber();
@@ -2895,18 +2977,18 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
2895 2977
                     insertCaseLog(caseApplication.getId(), CaseApplicationConstants.CHECK_ARBITRATION, "");
2896 2978
                 } else if (agreeOrNotCheck.intValue() == 2) {//拒绝审核
2897 2979
                     ArbitrateRecord arbitrateRecord = caseApplication.getArbitrateRecord();
2898
-                    ArbitrateRecord arbitrateRecordnew = caseApplicationse.getArbitrateRecord();
2980
+
2981
+                    ArbitrateRecord arbitrateRecordsel = new ArbitrateRecord();
2982
+                    arbitrateRecordsel.setCaseAppliId(caseApplicationse.getId());
2983
+                    ArbitrateRecord arbitrateRecordnew = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecordsel);
2899 2984
                     if(arbitrateRecordnew!=null){
2900 2985
                         arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion());
2901 2986
                         arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject());
2902
-                        arbitrateRecordnew.setCaseAppliId(caseApplicationse.getId());
2903 2987
                         arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecordnew);
2904 2988
                     }else {
2905
-                        ArbitrateRecord arbitrateRecordnew1 = new ArbitrateRecord();
2906
-                        arbitrateRecordnew1.setCheckOpinion(arbitrateRecord.getCheckOpinion());
2907
-                        arbitrateRecordnew1.setArbitrateReject(arbitrateRecord.getArbitrateReject());
2908
-                        arbitrateRecordnew1.setCaseAppliId(caseApplicationse.getId());
2909
-                        arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordnew1);
2989
+                        arbitrateRecordnew.setCheckOpinion(arbitrateRecord.getCheckOpinion());
2990
+                        arbitrateRecordnew.setArbitrateReject(arbitrateRecord.getArbitrateReject());
2991
+                        arbitrateRecordMapper.insertArbitrateRecord(arbitrateRecordsel);
2910 2992
                     }
2911 2993
                     caseApplicationse.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
2912 2994
 

+ 107
- 0
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Прегледај датотеку

@@ -879,6 +879,113 @@
879 879
         order by  c.batch_number desc
880 880
     </select>
881 881
 
882
+    <select id="selectAdminCaseApplicationListBatch1" parameterType="CaseApplication" resultMap="CaseApplicationResult">
883
+        SELECT DISTINCT t1.batch_number ,t1.arbitrat_method ,t1.arbitrator_name ,
884
+        t1.arbitrator_id  ,t1.identity_type ,t1.name ,t1.applicationOrganId ,
885
+        t1.applicantName,t1.arbitratMethodName
886
+        FROM(
887
+            <trim suffixOverrides="union">
888
+                <!--被申请人,仲裁员,部门长,财务,代理人案件-->
889
+                <if test="isOtherRole!=null and isOtherRole==1">
890
+                    SELECT c.batch_number ,c.arbitrat_method ,c.arbitrator_name ,
891
+                    c.arbitrator_id  ,ca.identity_type ,ca.name ,ca.application_organ_id as applicationOrganId,
892
+                    ca.application_organ_name  as applicantName,  c.lock_status,
893
+                    CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
894
+                    ELSE '无审理方式'
895
+                    END arbitratMethodName
896
+                    FROM  case_application c left join case_affiliate ca on c.id  = ca.case_appli_id
897
+                    <where>
898
+                        <!--根据角色和状态过滤-->
899
+                        <!--被申请人-->
900
+                        <if test="idCard != null and idCard != ''">
901
+                            or (ca.identity_num=#{idCard} AND ca.identity_type=2
902
+                            and (c.case_status=4 or c.case_status=17)
903
+                            )
904
+                        </if>
905
+                        <!--仲裁员-->
906
+                        <if test="userId != null and userId != ''">
907
+                            or ( ca.identity_type=1 and
908
+                            c.case_status in (7,13,17,18)
909
+                            and
910
+                            instr (c.arbitrator_id,#{userId})>0 )
911
+                        </if>
912
+                        <!--部门长-->
913
+                        <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
914
+                            or (ca.identity_type=1)
915
+                        </if>
916
+                        <!--财务-->
917
+                        <if test="financeStatus != null and financeStatus != ''">
918
+                            or (ca.identity_type=1
919
+                            and c.case_status =#{financeStatus}
920
+                            )
921
+                        </if>
922
+                        <!--代理人-->
923
+                        <if test="agentDeptIds != null and agentDeptIds.size()>0">
924
+                            or (
925
+                            ca.application_organ_id in
926
+                            <foreach item="deptId" collection="agentDeptIds" open="(" separator="," close=")">#{deptId}
927
+                            </foreach>
928
+                            AND ca.identity_type=1
929
+                            and c.case_status in (0,9)
930
+                            )
931
+
932
+                        </if>
933
+                    </where>
934
+
935
+                    union
936
+                </if>
937
+
938
+                <!--申请人案件-->
939
+                <if test="applicationOrganId != null and applicationOrganId != ''">
940
+                    SELECT c.batch_number ,c.arbitrat_method ,c.arbitrator_name ,
941
+                    c.arbitrator_id  ,ca.identity_type ,ca.name ,ca.application_organ_id as applicationOrganId,
942
+                    ca.application_organ_name  as applicantName, c.lock_status,
943
+                    CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
944
+                    ELSE '无审理方式'
945
+                    END arbitratMethodName
946
+                    FROM  case_application c left join case_affiliate ca on c.id  = ca.case_appli_id
947
+
948
+                    <where>
949
+                        (c.case_status &lt;= 10 or c.case_status=31) AND
950
+                        ca.identity_type=1
951
+
952
+                        <if test="applicationOrganId != null and applicationOrganId != ''">
953
+                            AND ca.application_organ_id = #{applicationOrganId}
954
+                        </if>
955
+                    </where>
956
+                    union
957
+                </if>
958
+
959
+                <!--秘书案件-->
960
+                <if test="deptIds != null and deptIds.size() > 0">
961
+
962
+                    SELECT c.batch_number ,c.arbitrat_method ,c.arbitrator_name ,
963
+                    c.arbitrator_id  ,ca.identity_type ,ca.name ,ca.application_organ_id as applicationOrganId,
964
+                    ca.application_organ_name  as applicantName, c.lock_status,
965
+                    CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
966
+                    ELSE '无审理方式'
967
+                    END arbitratMethodName
968
+                    FROM  case_application c left join case_affiliate ca on c.id  = ca.case_appli_id
969
+
970
+                    WHERE ca.identity_type=1
971
+                         and c.case_status in (1,5,8,9,11,14,15,16,17,31)
972
+                    union
973
+                </if>
974
+            </trim>
975
+
976
+        ) t1
977
+        WHERE t1.lock_status = 0 and t1.batch_number is not null
978
+        and t1.identity_type  = 1
979
+        <if test="batchNumber != null and batchNumber != ''">
980
+            AND t1.batch_number = #{batchNumber}
981
+        </if>
982
+        <if test="nameId != null and nameId != ''">
983
+            AND t1.application_organ_id=#{nameId}
984
+        </if>
985
+        order by  t1.batch_number desc
986
+
987
+    </select>
988
+
882 989
     <select id="selectAdminCaseToDoCount" resultType="com.ruoyi.wisdomarbitrate.domain.vo.ToDoCount">
883 990
         SELECT
884 991
             sum( case when c.case_status=0 then 1 else 0 end) caseApply,