18792927508 2 лет назад
Родитель
Сommit
80cabfbf5e

+ 22
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Просмотреть файл

@@ -188,6 +188,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
188 188
                     caseApplication.setDeptIds(deptIds);
189 189
                 }
190 190
                 if ("申请人".equals(role.getRoleName())) {
191
+                    caseApplication.setIsOtherRole(1);
191 192
                     // 查询有关的用户部门
192 193
                     caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
193 194
                 }
@@ -263,6 +264,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
263 264
                 caseApplication.setDeptIds(deptIds);
264 265
             }
265 266
             if ("申请人".equals(role.getRoleName())) {
267
+                caseApplication.setIsOtherRole(1);
266 268
                 // 查询角色有关的用户部门
267 269
                 caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
268 270
             }
@@ -1233,7 +1235,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1233 1235
 
1234 1236
     @Override
1235 1237
     public CaseApplication selectCaseApplication(CaseApplication caseApplication) {
1236
-        CaseApplication caseApplicationselect=caseApplicationLogMapper.selectByCaseIdAndVersion(caseApplication.getId(),caseApplication.getVersion());
1238
+        CaseApplication caseApplicationselect=new CaseApplication();
1239
+        if(caseApplication.getVersion()!=null) {
1240
+             caseApplicationselect=caseApplicationLogMapper.selectByCaseIdAndVersion(caseApplication.getId(),caseApplication.getVersion());
1241
+
1242
+        }
1243
+        else {
1244
+             caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
1245
+
1246
+
1247
+        }
1237 1248
         caseApplicationselect.setId(caseApplication.getId());
1238 1249
 
1239 1250
 
@@ -1264,7 +1275,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1264 1275
             }
1265 1276
         }
1266 1277
         caseApplicationselect.setCaseAttachList(caseAttachList);
1267
-        List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationselect.getCaseLogId());
1278
+        List<CaseAffiliate> caseAffiliatListeselect;
1279
+        if(caseApplication.getVersion()!=null) {
1280
+            caseAffiliatListeselect = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationselect.getCaseLogId());
1281
+
1282
+        }else {
1283
+            CaseAffiliate caseAffiliate = new CaseAffiliate();
1284
+            caseAffiliate.setCaseAppliId(caseApplication.getId());
1285
+            caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
1286
+        }
1287
+
1268 1288
         if (caseAffiliatListeselect != null) {
1269 1289
             // 查询组织机构
1270 1290
             List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
@@ -1287,7 +1307,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
1287 1307
                     ;
1288 1308
                 } else if (identityType == 2) {
1289 1309
                     respondentName.append(caseAffiliateselect.getName()).append(",");
1290
-                    ;
1291 1310
                 }
1292 1311
             }
1293 1312
             caseApplicationselect.setApplicantName(applicantName.toString());

+ 98
- 92
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Просмотреть файл

@@ -58,7 +58,7 @@
58 58
         t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus
59 59
         from(
60 60
         <trim suffixOverrides="union">
61
-                <!--被申请人,仲裁员,部门长,财务,代理人案件-->
61
+                <!--申请人,被申请人,仲裁员,部门长,财务,代理人案件-->
62 62
             <if test="isOtherRole!=null and isOtherRole==1">
63 63
 
64 64
                 select t.id,t.caseLogId,t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
@@ -125,7 +125,13 @@
125 125
                         and
126 126
                         instr (t.arbitrator_id,#{userId})>0)
127 127
                     </if>
128
+                    <!--申请人-->
129
+                    <if test="applicationOrganId != null and applicationOrganId != ''">
130
+                        or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
131
+                        <!--暂时改为可以查询到生成裁决书之前所有的案件状态-->
132
+                        and (t.case_status &lt;= 10 or t.case_status=31))
128 133
 
134
+                    </if>
129 135
                     <!--部门长-->
130 136
                     <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
131 137
                         or (t.identity_type=1 and t.case_status in
@@ -152,61 +158,61 @@
152 158
                 </where>
153 159
                 union
154 160
             </if>
155
-            <if test="applicationOrganId != null and applicationOrganId != ''">
161
+<!--            <if test="applicationOrganId != null and applicationOrganId != ''">-->
156 162
 
157 163
 
158
-                <!--申请人案件-->
159
-                select c.id ,l.id AS caseLogId,c.case_num ,l.case_subject_amount ,c.register_date ,c.arbitrat_method ,
160
-                CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
161
-                ELSE '无审理方式'
162
-                END arbitratMethodName,
163
-                c.case_status ,
164
-                CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
165
-                when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'
166
-                when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'
167
-                when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'
168
-                when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
169
-                when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
170
-                when 31 then '待修改开庭时间'
171
-                ELSE '无案件状态'
172
-                END caseStatusName,
173
-                c.hear_date ,l.arbitrat_claims ,
174
-                l.loan_start_date ,l.loan_end_date ,l.claim_princi_owed ,l.claim_interest_owed ,l.claim_liquid_damag
175
-                ,l.fee_payable ,
176
-                c.begin_video_date ,c.online_video_person ,l.contract_number ,c.create_by ,c.create_time ,
177
-                c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
178
-                as
179
-                applicantName,
180
-                c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus
181
-                from case_application c
182
-                JOIN case_application_log l ON c.id = l.case_appli_id
183
-                JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1
184
-
185
-                <where>
186
-                    (c.case_status &lt;= 10 or c.case_status=31) AND ca.identity_type=1
187
-                    and l.version=(SELECT
188
-                    max( version ) version
189
-                    FROM
190
-                    case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))
191
-                    <if test="applicationOrganId != null and applicationOrganId != ''">
192
-                        AND ca.application_organ_id = #{applicationOrganId}
193
-                    </if>
194
-                    <if test="caseStatus != null">
195
-                        AND c.case_status = #{caseStatus}
196
-                    </if>
197
-                    <if test="caseNum != null and caseNum != ''">
198
-                        AND c.case_num = #{caseNum}
199
-                    </if>
200
-                    <if test="nameId != null and nameId != ''">
201
-                        AND ca.application_organ_id=#{nameId}
202
-                    </if>
164
+<!--                &lt;!&ndash;申请人案件&ndash;&gt;-->
165
+<!--                select c.id ,l.id AS caseLogId,c.case_num ,l.case_subject_amount ,c.register_date ,c.arbitrat_method ,-->
166
+<!--                CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'-->
167
+<!--                ELSE '无审理方式'-->
168
+<!--                END arbitratMethodName,-->
169
+<!--                c.case_status ,-->
170
+<!--                CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'-->
171
+<!--                when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核'-->
172
+<!--                when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理'-->
173
+<!--                when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书'-->
174
+<!--                when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'-->
175
+<!--                when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'-->
176
+<!--                when 31 then '待修改开庭时间'-->
177
+<!--                ELSE '无案件状态'-->
178
+<!--                END caseStatusName,-->
179
+<!--                c.hear_date ,l.arbitrat_claims ,-->
180
+<!--                l.loan_start_date ,l.loan_end_date ,l.claim_princi_owed ,l.claim_interest_owed ,l.claim_liquid_damag-->
181
+<!--                ,l.fee_payable ,-->
182
+<!--                c.begin_video_date ,c.online_video_person ,l.contract_number ,c.create_by ,c.create_time ,-->
183
+<!--                c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name-->
184
+<!--                as-->
185
+<!--                applicantName,-->
186
+<!--                c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus-->
187
+<!--                from case_application c-->
188
+<!--                JOIN case_application_log l ON c.id = l.case_appli_id-->
189
+<!--                JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1-->
190
+
191
+<!--                <where>-->
192
+<!--                    (c.case_status &lt;= 10 or c.case_status=31) AND ca.identity_type=1-->
193
+<!--                    and l.version=(SELECT-->
194
+<!--                    max( version ) version-->
195
+<!--                    FROM-->
196
+<!--                    case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))-->
197
+<!--                    <if test="applicationOrganId != null and applicationOrganId != ''">-->
198
+<!--                        AND ca.application_organ_id = #{applicationOrganId}-->
199
+<!--                    </if>-->
200
+<!--                    <if test="caseStatus != null">-->
201
+<!--                        AND c.case_status = #{caseStatus}-->
202
+<!--                    </if>-->
203
+<!--                    <if test="caseNum != null and caseNum != ''">-->
204
+<!--                        AND c.case_num = #{caseNum}-->
205
+<!--                    </if>-->
206
+<!--                    <if test="nameId != null and nameId != ''">-->
207
+<!--                        AND ca.application_organ_id=#{nameId}-->
208
+<!--                    </if>-->
203 209
 
204
-                    <if test="lockStatus != null">
205
-                        AND c.lock_status = #{lockStatus}
206
-                    </if>
207
-                </where>
208
-                union
209
-            </if>
210
+<!--                    <if test="lockStatus != null">-->
211
+<!--                        AND c.lock_status = #{lockStatus}-->
212
+<!--                    </if>-->
213
+<!--                </where>-->
214
+<!--                union-->
215
+<!--            </if>-->
210 216
             <!--秘书案件-->
211 217
             <if test="deptIds != null and deptIds.size() > 0">
212 218
 
@@ -673,13 +679,13 @@
673 679
 <!--                </foreach> )-->
674 680
 <!--            </if>-->
675 681
             <!--申请人-->
676
-<!--            <if test="applicationOrganId != null and applicationOrganId != ''">-->
677
-<!--                or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1-->
678
-<!--                &lt;!&ndash;暂时改为可以查询到生成裁决书之前所有的案件状态&ndash;&gt;-->
679
-<!--                and (t.case_status &lt;= 10 or t.case_status=31))-->
680
-<!--            &lt;!&ndash; and t.case_status in (0,2,17))&ndash;&gt;-->
682
+            <if test="applicationOrganId != null and applicationOrganId != ''">
683
+                or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
684
+                <!--暂时改为可以查询到生成裁决书之前所有的案件状态-->
685
+                and (t.case_status &lt;= 10 or t.case_status=31))
686
+            <!-- and t.case_status in (0,2,17))-->
681 687
 
682
-<!--         </if>-->
688
+         </if>
683 689
          <!--部门长-->
684 690
             <if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
685 691
                 or (t.identity_type=1 and t.case_status in
@@ -705,40 +711,40 @@
705 711
         </where>
706 712
             union
707 713
         </if>
708
-            <if test="applicationOrganId != null and applicationOrganId != ''">
709
-                <!--申请人案件-->
710
-
711
-                select l.case_appli_id id ,
712
-                c.case_status,ca.application_organ_id,
713
-                c.arbitrator_id,ca.identity_num , ca.identity_type
714
-                from case_application c
715
-                JOIN case_application_log l ON c.id = l.case_appli_id
716
-                JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1
717
-                <where>
718
-                    (c.case_status &lt;= 10 or c.case_status=31) AND ca.identity_type=1
719
-                    and l.version=(SELECT
720
-                    max( version ) version
721
-                    FROM
722
-                    case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))
723
-                    <if test="applicationOrganId != null and applicationOrganId != ''">
724
-                        AND ca.application_organ_id = #{applicationOrganId}
725
-                    </if>
726
-                    <if test="caseStatus != null">
727
-                        AND c.case_status = #{caseStatus}
728
-                    </if>
729
-                    <if test="caseNum != null and caseNum != ''">
730
-                        AND c.case_num = #{caseNum}
731
-                    </if>
732
-                    <if test="nameId != null and nameId != ''">
733
-                        AND ca.application_organ_id=#{nameId}
734
-                    </if>
714
+<!--            <if test="applicationOrganId != null and applicationOrganId != ''">-->
715
+<!--                &lt;!&ndash;申请人案件&ndash;&gt;-->
716
+
717
+<!--                select l.case_appli_id id ,-->
718
+<!--                c.case_status,ca.application_organ_id,-->
719
+<!--                c.arbitrator_id,ca.identity_num , ca.identity_type-->
720
+<!--                from case_application c-->
721
+<!--                JOIN case_application_log l ON c.id = l.case_appli_id-->
722
+<!--                JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1-->
723
+<!--                <where>-->
724
+<!--                    (c.case_status &lt;= 10 or c.case_status=31) AND ca.identity_type=1-->
725
+<!--                    and l.version=(SELECT-->
726
+<!--                    max( version ) version-->
727
+<!--                    FROM-->
728
+<!--                    case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))-->
729
+<!--                    <if test="applicationOrganId != null and applicationOrganId != ''">-->
730
+<!--                        AND ca.application_organ_id = #{applicationOrganId}-->
731
+<!--                    </if>-->
732
+<!--                    <if test="caseStatus != null">-->
733
+<!--                        AND c.case_status = #{caseStatus}-->
734
+<!--                    </if>-->
735
+<!--                    <if test="caseNum != null and caseNum != ''">-->
736
+<!--                        AND c.case_num = #{caseNum}-->
737
+<!--                    </if>-->
738
+<!--                    <if test="nameId != null and nameId != ''">-->
739
+<!--                        AND ca.application_organ_id=#{nameId}-->
740
+<!--                    </if>-->
735 741
 
736
-                    <if test="lockStatus != null">
737
-                        AND c.lock_status = #{lockStatus}
738
-                    </if>
739
-                </where>
740
-                union
741
-            </if>
742
+<!--                    <if test="lockStatus != null">-->
743
+<!--                        AND c.lock_status = #{lockStatus}-->
744
+<!--                    </if>-->
745
+<!--                </where>-->
746
+<!--                union-->
747
+<!--            </if>-->
742 748
             <!--秘书案件-->
743 749
             <if test="deptIds != null and deptIds.size() > 0">
744 750