广州市综治平台后端
xusd
2025-06-07 36306491396230522fa20585c2621a7fc899849a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
package cn.huge.module.judic.controller.web;
 
import cn.huge.base.common.utils.ObjectUtils;
import cn.huge.base.common.utils.ReturnFailUtils;
import cn.huge.base.common.utils.ReturnSucUtils;
import cn.huge.base.config.CurrentUser;
import cn.huge.module.client.api.impl.CustClientImpl;
import cn.huge.module.client.api.impl.SysClientImpl;
import cn.huge.module.cust.constant.RoleBaseEnum;
import cn.huge.module.cust.dto.CtUserDTO;
import cn.huge.module.judic.domain.dto.*;
import cn.huge.module.judic.service.JudicInfoService;
import cn.huge.module.mediate.constant.*;
import cn.huge.module.meet.domain.dto.WindowInMeetInfo;
import cn.huge.module.notice.domain.po.NoticeMode;
import cn.huge.module.sys.constant.FlowNodeBaseEnum;
import cn.huge.module.sys.dto.FileTypeInfoBaseDTO;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
 
/**
 * @title: 司法确认信息表接口api
 * @description: 司法确认信息表接口api
 * @company: hugeinfo
 * @author: liyj
 * @time: 2022-04-18 10:40:03
 * @version: 1.0.0
 */
@Slf4j
@RestController
@RequestMapping("/api/web/judicInfo")
public class JudicInfoWebController {
 
    @Autowired(required = false)
    private HttpServletRequest request;
 
    @Autowired
    private JudicInfoService service;
    @Autowired
    private CustClientImpl custClient;
    @Autowired
    private SysClientImpl sysClient;
 
 
    /**
     * 获取请求URL参数
     * @return Map<String, Object>
     */
    private Map<String, Object> getCaseParameter(){
        Map<String, Object> terms = Maps.newHashMap();
        // 案号
        String caseNo = request.getParameter("caseNo");
        if (StringUtils.isNotBlank(caseNo)){
            terms.put("caseNo", caseNo);
        }
 
        String judicNo = request.getParameter("judicNo");
        if (StringUtils.isNotBlank(judicNo)){
            terms.put("judicNo", judicNo);
        }
 
        String caseRef = request.getParameter("caseRef");
        if (StringUtils.isNotBlank(caseRef)){
            terms.put("caseRef", caseRef);
        }
 
        String caseType = request.getParameter("caseType");
        if (StringUtils.isNotBlank(caseType)){
            terms.put("caseType", caseType);
        }
        // 案号
        String judicApply = request.getParameter("judicApply");
        if (StringUtils.isNotBlank(judicApply)){
            terms.put("judicApply", judicApply);
        }
 
        String judicAudit = request.getParameter("judicAudit");
        if (StringUtils.isNotBlank(judicAudit)){
            terms.put("judicAudit", judicAudit);
        }
        // 纠纷发生地详细地址
        String addr = request.getParameter("addr");
        if (StringUtils.isNotBlank(addr)){
            terms.put("addr", addr);
        }
        // 实际调解组织编号
        String mediateUnitId = request.getParameter("mediateUnitId");
        if (StringUtils.isNotBlank(mediateUnitId)){
            terms.put("mediateUnitId", mediateUnitId);
        }
        // 当事人申请人名称,多个用,隔开
        String plaintiffs = request.getParameter("plaintiffs");
        if (StringUtils.isNotBlank(plaintiffs)){
            terms.put("plaintiffs", plaintiffs);
        }
        // 当事人被申请人名称,多个用,隔开
        String defendants = request.getParameter("defendants");
        if (StringUtils.isNotBlank(defendants)){
            terms.put("defendants", defendants);
        }
        // 调解员
        String mediateUserName = request.getParameter("mediateUserName");
        if (StringUtils.isNotBlank(mediateUserName)){
            terms.put("mediateUserName", mediateUserName);
        }
        // 调解员
        String status = request.getParameter("status");
        if (StringUtils.isNotBlank(status)){
            terms.put("status", status);
        }
 
        String judicResult = request.getParameter("judicResult");
        if (StringUtils.isNotBlank(judicResult)){
            terms.put("judicResult", judicResult);
        }
        // 调解结束时间区间
        String mediEndStart = request.getParameter("mediEndStart");
        String mediEndEnd = request.getParameter("mediEndEnd");
        if(StringUtils.isNotBlank(mediEndStart) && StringUtils.isNotBlank(mediEndEnd)) {
            terms.put("mediEndStart", mediEndStart);
            terms.put("mediEndEnd", mediEndEnd);
        }
 
        String closeStart = request.getParameter("closeStart");
        String closeEnd = request.getParameter("closeEnd");
        if (StringUtils.isNotBlank(closeStart) && StringUtils.isNotBlank(closeEnd)) {
            terms.put("closeStart", closeStart);
            terms.put("closeEnd", closeEnd);
        }
 
        String fileStart = request.getParameter("fileStart");
        String fileEnd = request.getParameter("fileEnd");
        if (StringUtils.isNotBlank(fileStart) && StringUtils.isNotBlank(fileEnd)) {
            terms.put("createStart", fileStart);
            terms.put("createEnd", fileEnd);
        }
 
        // 申请时间
        String applyStart = request.getParameter("applyStart");
        String applyEnd = request.getParameter("applyEnd");
        if(StringUtils.isNotBlank(applyStart) && StringUtils.isNotBlank(applyEnd)) {
            terms.put("applyStart", applyStart);
            terms.put("applyEnd", applyEnd);
        }
 
        // 审核时间
        String auditStart = request.getParameter("auditStart");
        String auditEnd = request.getParameter("auditEnd");
        if(StringUtils.isNotBlank(auditStart) && StringUtils.isNotBlank(auditEnd)) {
            terms.put("auditStart", auditStart);
            terms.put("auditEnd", auditEnd);
        }
 
        String judicEndStart = request.getParameter("judicEndStart");
        String judicEndEnd = request.getParameter("judicEndEnd");
        if (StringUtils.isNotBlank(judicEndStart) && StringUtils.isNotBlank(judicEndEnd)) {
            terms.put("judicEndStart", judicEndStart);
            terms.put("judicEndEnd", judicEndEnd);
        }
        return terms;
    }
 
    /**
     * pc端司法确认-调解组织申请-查询平台内调解成功案件
     * @url {ctx}/api/web/judicInfo/pageSuccessCase
     * @param page 页码
     * @param size 每页数量
     * @return Object
     */
    @GetMapping("/pageSuccessCase")
    public Object pageSuccessCase(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size,
                                  @CurrentUser String userId) {
        try {
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            Map<String, Object> terms = getCaseParameter();
            terms.put("belongUnitId", loginUser.getUnitId());
            terms.put("mediResult", MediResultBaseConstsEnum.MEDI_RESULT_1.getIndex());
            Sort sort = null;
            String sortName = null;
            String sortColmnStr = request.getParameter("sortColmn");
            String sortTypeStr = request.getParameter("sortType");
            int sortColmn = 1;
            int sortType = 1;
            if (StringUtils.isNotBlank(sortColmnStr)) {
                sortColmn = Integer.valueOf(sortColmnStr);
            }
            if (StringUtils.isNotBlank(sortTypeStr)) {
                sortType = Integer.valueOf(sortTypeStr);
            }
            switch (sortColmn) {
                case 1:
                    sortName = "j.apply_time";
                    break;
                case 2:
                    sortName = "b.close_time";
                    break;
            }
            switch (sortType) {
                case 1:
                    sort = Sort.by(Sort.Direction.ASC, sortName);
                    break;
                case 2:
                    sort = Sort.by(Sort.Direction.DESC, sortName);
                    break;
            }
            PageRequest pageRequest = PageRequest.of(page-1, size, sort);
            return ReturnSucUtils.getRepInfo(service.pageSuccessCase(pageRequest, terms));
        } catch (Exception e) {
            log.error("Controller接口[JudicInfoController.pageUnitApply]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo(e.getMessage(), null);
        }
    }
 
    /**
     * pc端司法确认-调解组织申请-平台内调解成功案件申请材料
     * @url {ctx}/api/web/judicInfo/getCaseApplyFile
     * @param caseId 纠纷编号
     * @return Object
     */
    @GetMapping("/getCaseApplyFile")
    public Object getCaseApplyFile(@RequestParam(value = "caseId") String caseId) {
        try {
            List<FileTypeInfoBaseDTO> fileTypeInfoBaseDTOList = service.listApplyFIle(caseId);
            return ReturnSucUtils.getRepInfo(fileTypeInfoBaseDTOList);
        } catch (Exception e) {
            log.error("Controller接口[JudicInfoController.getCaseApplyFile]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo(e.getMessage(), null);
        }
    }
 
    /**
     * pc端司法确认-调解组织申请-提交/退回修改司法确认申请
     * @url {ctx}/api/web/judicInfo/unitApplyJudic
     * @param unitApplySaveDTO 司法确认申请对象
     * @return Object
     */
    @PostMapping("/unitApplyJudic")
    public Object unitApplyJudic(@CurrentUser String userId, @RequestBody UnitApplySaveDTO unitApplySaveDTO) {
        try {
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            service.unitApplyJudic(loginUser, unitApplySaveDTO);
            return ReturnSucUtils.getRepInfo();
        } catch (Exception e) {
            log.error("Controller接口[JudicInfoController.getCaseApplyFile]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo(e.getMessage(), null);
        }
    }
 
    /**
     * pc端司法确认-法院审查-司法确认申请审查列表
     * @url {ctx}/api/web/judicInfo/pageCourtAudit
     * @param page 页码
     * @param size 每页数量
     * @return Object
     *
     */
    @GetMapping("/pageCourtAudit")
    public Object pageCourtAudit(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size,
                 @CurrentUser String userId) {
        try {
            Map<String, Object> terms = getCaseParameter();
 
            Sort sort = null;
            String sortName = null;
            String sortColmnStr = request.getParameter("sortColmn");
            String sortTypeStr = request.getParameter("sortType");
            int sortColmn = 1;
            int sortType = 1;
            if (StringUtils.isNotBlank(sortColmnStr)) {
                sortColmn = Integer.valueOf(sortColmnStr);
            }
            if (StringUtils.isNotBlank(sortTypeStr)) {
                sortType = Integer.valueOf(sortTypeStr);
            }
            switch (sortColmn) {
                case 1:
                    sortName = "t1.apply_time";
                    break;
                case 2:
                    sortName = "t1.audit_time";
                    break;
            }
            switch (sortType) {
                case 1:
                    sort = Sort.by(Sort.Direction.ASC, sortName);
                    break;
                case 2:
                    sort = Sort.by(Sort.Direction.DESC, sortName);
                    break;
            }
            if (ObjectUtils.isEmpty(sort)) {
                sort = Sort.by(Sort.Direction.DESC, "t1.create_time");
            }
 
            PageRequest pageRequest = PageRequest.of(page-1, size, sort);
            return ReturnSucUtils.getRepInfo(service.pageCourtAudit(pageRequest, terms, userId));
        } catch (Exception e) {
            log.error("Controller接口[JudicInfoController.pageCourtAudit]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo(e.getMessage(), null);
        }
    }
 
    /**
     * pc端司法确认-查询申请信息详情
     * @url {ctx}/api/web/judicInfo/getJudicInfo
     * @param judicId 司法确认编号
     * @return Object
     */
    @GetMapping("/getJudicInfo")
    public Object getJudicInfo(@RequestParam(value = "judicId") String judicId) {
        try {
            JudicInfoDTO judicInfoDTO = service.getJudicInfo(judicId);
            return ReturnSucUtils.getRepInfo(judicInfoDTO);
        } catch (Exception e) {
            log.error("Controller接口[JudicInfoController.getJudicInfo]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo(e.getMessage(), null);
        }
    }
 
    /**
     * pc端司法确认-查询申请信息详情
     * @url {ctx}/api/web/judicInfo/getJudicCaseInfo
     * @param caseId 司法确认编号
     * @return Object
     */
    @GetMapping("/getJudicCaseInfo")
    public Object getJudicCaseInfo(@RequestParam(value = "caseId") String caseId) {
        try {
            JudicInfoDTO judicInfoDTO = service.getJudicCaseInfo(caseId);
            return ReturnSucUtils.getRepInfo(judicInfoDTO);
        } catch (Exception e) {
            log.error("Controller接口[JudicInfoController.getJudicCaseInfo]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo(e.getMessage(), null);
        }
    }
 
 
    /**
     * pc端司法确认-法院审核
     * @url {ctx}/api/web/judicInfo/courtAudit
     * @param courtAuditDTO 司法确认审核对象
     * @return Object
     */
    @PostMapping("/courtAudit")
    public Object courtAudit(@CurrentUser String userId, @RequestBody CourtAuditDTO courtAuditDTO) {
        try {
            CtUserDTO loginUser = custClient.clientGetUserAll(userId);
            service.courtAudit(loginUser, courtAuditDTO);
            return ReturnSucUtils.getRepInfo();
        } catch (Exception e) {
            log.error("Controller接口[JudicInfoController.courtAudit]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo(e.getMessage(), null);
        }
    }
 
 
    /**
     * pc端司法确认-法院确认列表
     * @url {ctx}/api/web/judicInfo/pageCourtConfirm
     * @param page 页码
     * @param size 每页数量
     * @return Object
     */
    @GetMapping("/pageCourtConfirm")
    public Object pageCourtConfirm(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size,
                                 @CurrentUser String userId) {
        try {
            Map<String, Object> terms = getCaseParameter();
            String status = request.getParameter("status");
            if("0".equals(status)){
                List<String> processList = new ArrayList<>();
                processList.add(JudicBaseConstsEnum.JUDIC_PROCESS_1.getIndex());
                processList.add(JudicBaseConstsEnum.JUDIC_PROCESS_2.getIndex());
                processList.add(JudicBaseConstsEnum.JUDIC_PROCESS_3.getIndex());
                terms.put("processList", processList);
                terms.remove("status");
            }else if("1".equals(status)){
                List<String> processList = new ArrayList<>();
                processList.add(JudicBaseConstsEnum.JUDIC_PROCESS_4.getIndex());
                processList.add(JudicBaseConstsEnum.JUDIC_PROCESS_5.getIndex());
                processList.add(JudicBaseConstsEnum.JUDIC_PROCESS_6.getIndex());
                terms.put("processList", processList);
                terms.remove("status");
            }
            Sort sort = null;
            String sortName = null;
            String sortColmnStr = request.getParameter("sortColmn");
            String sortTypeStr = request.getParameter("sortType");
            int sortColmn = 1;
            int sortType = 1;
            if (StringUtils.isNotBlank(sortColmnStr)) {
                sortColmn = Integer.valueOf(sortColmnStr);
            }
            if (StringUtils.isNotBlank(sortTypeStr)) {
                sortType = Integer.valueOf(sortTypeStr);
            }
            switch (sortColmn) {
                case 1:
                    sortName = "t1.apply_time";
                    break;
                case 2:
                    sortName = "t1.judic_end_time";
                    break;
                case 3:
                    sortName = "wait_hours";
                    break;
            }
            switch (sortType) {
                case 1:
                    sort = Sort.by(Sort.Direction.ASC, sortName);
                    break;
                case 2:
                    sort = Sort.by(Sort.Direction.DESC, sortName);
                    break;
            }
            if (ObjectUtils.isEmpty(sort)) {
                sort = Sort.by(Sort.Direction.DESC, "t1.create_time");
            }
            PageRequest pageRequest = PageRequest.of(page-1, size, sort);
            return ReturnSucUtils.getRepInfo(service.pageCourtConfirm(pageRequest, terms, userId));
        } catch (Exception e) {
            log.error("Controller接口[JudicInfoController.pageCourtConfirm]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo(e.getMessage(), null);
        }
    }
 
    /**
     * pc端司法确认-办结提交
     * @url {ctx}/api/web/judicInfo/judicConfirm
     * @param courtAuditDTO 司法确认审核对象
     * @return Object
     */
    @PostMapping("/judicConfirm")
    public Object judicConfirm(@CurrentUser String userId, @RequestBody CourtAuditDTO courtAuditDTO) {
        try {
            service.judicConfirm(courtAuditDTO);
            return ReturnSucUtils.getRepInfo();
        } catch (Exception e) {
            log.error("Controller接口[JudicInfoController.courtAudit]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo(e.getMessage(), null);
        }
    }
 
    /**
     * pc端司法确认-重新申请复制原来的申请单
     * @url {ctx}/api/web/judicInfo/copyJudic
     * @param caseId 司法确认编号
     * @return Object
     */
    @GetMapping("/copyJudic")
    public Object copyJudic(@RequestParam(value = "caseId") String caseId) {
        try {
            JudicInfoDTO judicInfoDTO = service.copyJudic(caseId);
            return ReturnSucUtils.getRepInfo(judicInfoDTO);
        } catch (Exception e) {
            log.error("Controller接口[JudicInfoController.copyJudic]请求异常:"+e, e);
            return ReturnFailUtils.getRepInfo(e.getMessage(), null);
        }
    }
 
}