广州市综治平台后端
zhouxiantao
5 days ago 140170b48b50c33dc68558dc7d97ccd65bffbc7d
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
package cn.huge.module.cases.controller.web;
 
import cn.huge.base.common.utils.ReturnFailUtils;
import cn.huge.base.common.utils.ReturnSucUtils;
import cn.huge.module.cases.domain.po.CaseWindupApply;
import cn.huge.module.cases.service.CaseWindupApplyService;
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.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
 
/**
 * @title: 纠纷结案申请信息表接口api-web端
 * @description: 纠纷结案申请信息表接口api-web端
 * @company: hugeinfo
 * @author: liyj
 * @time: 2024-09-06 23:57:02
 * @version: 1.0.0
 */
@Slf4j
@RestController
@RequestMapping("/api/web/caseWindupApply")
public class CaseWindupApplyWebController {
 
    @Autowired(required = false)
    private HttpServletRequest request;
 
    @Autowired
    private CaseWindupApplyService service;
 
    /**
    * 获取请求URL参数
    * @return Map<String, Object>
    */
    private Map<String, Object> getParameter(){
        Map<String, Object> terms = Maps.newHashMap();
        // 主键编号
        String id = request.getParameter("id");
        if (StringUtils.isNotBlank(id)){
            terms.put("id", id);
        }
        // 纠纷编号
        String caseId = request.getParameter("caseId");
        if (StringUtils.isNotBlank(caseId)){
            terms.put("caseId", caseId);
        }
        // 结案申请组织编号
        String applyUnitId = request.getParameter("applyUnitId");
        if (StringUtils.isNotBlank(applyUnitId)){
            terms.put("applyUnitId", applyUnitId);
        }
        // 结案申请组织名称
        String applyUnitName = request.getParameter("applyUnitName");
        if (StringUtils.isNotBlank(applyUnitName)){
            terms.put("applyUnitName", applyUnitName);
        }
        // 结案申请人编号
        String applyUserId = request.getParameter("applyUserId");
        if (StringUtils.isNotBlank(applyUserId)){
            terms.put("applyUserId", applyUserId);
        }
        // 结案申请人名称
        String applyUserName = request.getParameter("applyUserName");
        if (StringUtils.isNotBlank(applyUserName)){
            terms.put("applyUserName", applyUserName);
        }
        // 结案申请时间
        String applyTime = request.getParameter("applyTime");
        if (StringUtils.isNotBlank(applyTime)){
            terms.put("applyTime", applyTime);
        }
        // 结案申请状态,0:待审核,1:已审核
        String applyStatus = request.getParameter("applyStatus");
        if (StringUtils.isNotBlank(applyStatus)){
            terms.put("applyStatus", applyStatus);
        }
        // 调解结果
        String mediResult = request.getParameter("mediResult");
        if (StringUtils.isNotBlank(mediResult)){
            terms.put("mediResult", mediResult);
        }
        // 调解结果名称
        String mediResultName = request.getParameter("mediResultName");
        if (StringUtils.isNotBlank(mediResultName)){
            terms.put("mediResultName", mediResultName);
        }
        // 达成协议类型
        String agreeType = request.getParameter("agreeType");
        if (StringUtils.isNotBlank(agreeType)){
            terms.put("agreeType", agreeType);
        }
        // 达成协议类型名称
        String agreeTypeName = request.getParameter("agreeTypeName");
        if (StringUtils.isNotBlank(agreeTypeName)){
            terms.put("agreeTypeName", agreeTypeName);
        }
        // 协议要点/已达成协议
        String agreeContent = request.getParameter("agreeContent");
        if (StringUtils.isNotBlank(agreeContent)){
            terms.put("agreeContent", agreeContent);
        }
        // 无法化解理由
        String failReason = request.getParameter("failReason");
        if (StringUtils.isNotBlank(failReason)){
            terms.put("failReason", failReason);
        }
        // 结案意见
        String windupContent = request.getParameter("windupContent");
        if (StringUtils.isNotBlank(windupContent)){
            terms.put("windupContent", windupContent);
        }
        // 结案审核纠纷任务编号
        String caseTaskId = request.getParameter("caseTaskId");
        if (StringUtils.isNotBlank(caseTaskId)){
            terms.put("caseTaskId", caseTaskId);
        }
        // 结案审核组织编号
        String auditUnitId = request.getParameter("auditUnitId");
        if (StringUtils.isNotBlank(auditUnitId)){
            terms.put("auditUnitId", auditUnitId);
        }
        // 结案审核组织名称
        String auditUnitName = request.getParameter("auditUnitName");
        if (StringUtils.isNotBlank(auditUnitName)){
            terms.put("auditUnitName", auditUnitName);
        }
        // 结案审核人编号
        String auditUserId = request.getParameter("auditUserId");
        if (StringUtils.isNotBlank(auditUserId)){
            terms.put("auditUserId", auditUserId);
        }
        // 结案审核人名称
        String auditUserName = request.getParameter("auditUserName");
        if (StringUtils.isNotBlank(auditUserName)){
            terms.put("auditUserName", auditUserName);
        }
        // 结案审核时间
        String auditTime = request.getParameter("auditTime");
        if (StringUtils.isNotBlank(auditTime)){
            terms.put("auditTime", auditTime);
        }
        // 结案审核结果
        String auditResult = request.getParameter("auditResult");
        if (StringUtils.isNotBlank(auditResult)){
            terms.put("auditResult", auditResult);
        }
        // 结案审核结果名称
        String auditResultName = request.getParameter("auditResultName");
        if (StringUtils.isNotBlank(auditResultName)){
            terms.put("auditResultName", auditResultName);
        }
        // 结案审核理由
        String auditContent = request.getParameter("auditContent");
        if (StringUtils.isNotBlank(auditContent)){
            terms.put("auditContent", auditContent);
        }
        // 删除状态,0:未删除,1:已删除
        String deleteStatus = request.getParameter("deleteStatus");
        if (StringUtils.isNotBlank(deleteStatus)){
            terms.put("deleteStatus", deleteStatus);
        }
        // 顾客编号
        String custId = request.getParameter("custId");
        if (StringUtils.isNotBlank(custId)){
            terms.put("custId", custId);
        }
        // 创建时间区间
        String createStart = request.getParameter("createStart");
        String createEnd = request.getParameter("createEnd");
        if(StringUtils.isNotBlank(createStart) && StringUtils.isNotBlank(createEnd)) {
            terms.put("createStart", createStart);
            terms.put("createEnd", createEnd);
        }
        // 更新时间区间
        String updateStart = request.getParameter("updateStart");
        String updateEnd = request.getParameter("updateEnd");
        if(StringUtils.isNotBlank(updateStart) && StringUtils.isNotBlank(updateEnd)) {
            terms.put("updateStart", updateStart);
            terms.put("updateEnd", updateEnd);
        }
        return terms;
    }
 
    /**
    * 条件查询多个
    * @url {ctx}/api/web/caseWindupApply/listQuery
    * @return Object
    */
    @GetMapping("/listQuery")
    public Object listQuery() {
        try {
            Map<String, Object> terms = getParameter();
            return ReturnSucUtils.getRepInfo(service.listTerms(terms));
        } catch (Exception e) {
            return ReturnFailUtils.getRepInfo();
        }
    }
 
    /**
    * 条件分页查询
    * @url {ctx}/api/web/caseWindupApply/pageQuery
    * @param page 页码
    * @param size 每页数量
    * @return Object
    */
    @GetMapping("/pageQuery")
    public Object pageQuery(@RequestParam(value = "page") int page, @RequestParam(value = "size") int size) {
        try {
            Map<String, Object> terms = getParameter();
            Sort sort = Sort.by(Sort.Direction.DESC, "create_time");
            PageRequest pageRequest = PageRequest.of(page-1, size, sort);
            Page<CaseWindupApply> caseWindupApplyPage = service.pageQuery(pageRequest, terms);
            return ReturnSucUtils.getRepInfo( "处理成功", caseWindupApplyPage);
        } catch (Exception e) {
            return ReturnFailUtils.getRepInfo();
        }
    }
 
    /**
    * 根据编号查询单个
    * @url {ctx}/api/web/caseWindupApply/getById
    * @param id 主键编号
    * @return Object
    */
    @GetMapping("/getById")
    public Object getById(@RequestParam(value = "id") String id) {
        try {
            return ReturnSucUtils.getRepInfo(service.getById(id));
        } catch (Exception e) {
            return ReturnFailUtils.getRepInfo();
        }
    }
 
    /**
    * 根据主键单个
    * @url {ctx}/api/web/caseWindupApply/deleteById
    * @param id 主键编号
    * @return Object
    */
    @GetMapping("/deleteById")
    public Object deleteById(@RequestParam(value = "id") String id) {
        try {
            service.removeById(id);
            return ReturnSucUtils.getRepInfo();
        } catch (Exception e) {
            return ReturnFailUtils.getRepInfo();
        }
    }
 
    /**
    * 新增或更新对象
    * @url {ctx}/api/web/caseWindupApply/saveCaseWindupApply
    * @param caseWindupApply 实体对象
    * @return Object
    */
    @PostMapping("/saveCaseWindupApply")
    public Object saveCaseWindupApply(@RequestBody CaseWindupApply caseWindupApply) {
        try {
            service.saveCaseWindupApply(caseWindupApply);
            return ReturnSucUtils.getRepInfo();
        } catch (Exception e) {
            return ReturnFailUtils.getRepInfo();
        }
    }
 
}