|
@@ -9,9 +9,7 @@ import com.example.civilizedcity.common.*;
|
9
|
9
|
|
10
|
10
|
import java.net.URL;
|
11
|
11
|
import java.time.LocalDateTime;
|
12
|
|
-import java.util.ArrayList;
|
13
|
|
-import java.util.List;
|
14
|
|
-import java.util.Optional;
|
|
12
|
+import java.util.*;
|
15
|
13
|
import java.util.stream.Collectors;
|
16
|
14
|
|
17
|
15
|
import com.example.civilizedcity.entity.*;
|
|
@@ -78,16 +76,48 @@ public class TaIssueController extends BaseController {
|
78
|
76
|
/**
|
79
|
77
|
* 构造 查询构造器
|
80
|
78
|
* @param sysUser
|
81
|
|
- * @param bizStatus
|
82
|
|
- * @param sourceType
|
83
|
|
- * @param locId
|
84
|
|
- * @param mine
|
85
|
|
- * @param orgId
|
|
79
|
+ * @param params
|
86
|
80
|
* @return
|
87
|
81
|
*/
|
88
|
|
- private QueryWrapper<TaIssue> buildQuery(SysUser sysUser, String issueId, String bizStatus, String sourceType, String locId, Boolean mine, String orgId, Boolean all) {
|
|
82
|
+ private QueryWrapper<TaIssue> buildQuery(SysUser sysUser, Map<String, Object> params) {
|
|
83
|
+
|
|
84
|
+ String issueId = (String) params.get("issueId");
|
|
85
|
+ String typeId = (String) params.get("typeId");
|
|
86
|
+ String bizStatus = (String) params.get("bizStatus");
|
|
87
|
+ String sourceType = (String) params.get("sourceType");
|
|
88
|
+ String locId = (String) params.get("locId");
|
|
89
|
+ Boolean mine = (Boolean) params.get("mine");
|
|
90
|
+ String orgId = (String) params.get("orgId");
|
|
91
|
+ String userName = (String) params.get("userName");
|
|
92
|
+ Boolean all = (Boolean) params.get("all");
|
|
93
|
+
|
|
94
|
+ LocalDateTime createDateStart = null;
|
|
95
|
+ LocalDateTime createDateEnd = null;
|
|
96
|
+ if (null != params.get("createDateStart")) {
|
|
97
|
+ String dt1 = (String) params.get("createDateStart");
|
|
98
|
+ String dt2 = (String) params.get("createDateEnd");
|
|
99
|
+
|
|
100
|
+ if (StringUtils.isNotEmpty(dt1)) {
|
|
101
|
+ createDateStart = DateUtils.day2LocalDateime(dt1);
|
|
102
|
+ createDateEnd = DateUtils.day2LocalDateime2(dt2);
|
|
103
|
+ }
|
|
104
|
+ }
|
|
105
|
+
|
|
106
|
+ LocalDateTime endDateStart = null;
|
|
107
|
+ LocalDateTime endDateEnd = null;
|
|
108
|
+ if (null != params.get("endDateStart")) {
|
|
109
|
+ String dt1 = (String) params.get("endDateStart");
|
|
110
|
+ String dt2 = (String) params.get("endDateEnd");
|
|
111
|
+
|
|
112
|
+ if (StringUtils.isNotEmpty(dt1)) {
|
|
113
|
+ endDateStart = DateUtils.day2LocalDateime(dt1);
|
|
114
|
+ endDateEnd = DateUtils.day2LocalDateime2(dt2);
|
|
115
|
+ }
|
|
116
|
+ }
|
|
117
|
+
|
89
|
118
|
QueryWrapper<TaIssue> queryWrapper = new QueryWrapper<>();
|
90
|
119
|
queryWrapper.eq(StringUtils.isNotEmpty(issueId), "issue_id", issueId);
|
|
120
|
+ queryWrapper.eq(StringUtils.isNotEmpty(typeId), "type_id", typeId);
|
91
|
121
|
|
92
|
122
|
if (Constants.PROCESS_START.equals(bizStatus)) {
|
93
|
123
|
// 待交办
|
|
@@ -101,7 +131,11 @@ public class TaIssueController extends BaseController {
|
101
|
131
|
} else if ("expired".equals(bizStatus)) {
|
102
|
132
|
// 已逾期
|
103
|
133
|
queryWrapper.ne("process_node", Constants.PROCESS_END);
|
104
|
|
- queryWrapper.le("expire_date", DateUtils.yestoday());
|
|
134
|
+ queryWrapper.lt("expire_date", DateUtils.today());
|
|
135
|
+ } else if ("expiredEnd".equals(bizStatus)) {
|
|
136
|
+ // 逾期办结
|
|
137
|
+ queryWrapper.eq("process_node", Constants.PROCESS_END);
|
|
138
|
+ queryWrapper.lt("expire_date", DateUtils.today());
|
105
|
139
|
} else if ("reject".equals(bizStatus)) {
|
106
|
140
|
// 已打回
|
107
|
141
|
queryWrapper.eq("process_node", Constants.PROCESS_APPLY_REJECT);
|
|
@@ -117,6 +151,9 @@ public class TaIssueController extends BaseController {
|
117
|
151
|
|
118
|
152
|
queryWrapper.eq(StringUtils.isNotEmpty(locId), "loc_id", locId);
|
119
|
153
|
queryWrapper.eq(StringUtils.isNotEmpty(orgId), "org_id", orgId);
|
|
154
|
+ queryWrapper.like(StringUtils.isNotEmpty(userName), "user_name", userName);
|
|
155
|
+ queryWrapper.between(null != createDateStart, "create_date", createDateStart, createDateEnd);
|
|
156
|
+ queryWrapper.between(null != endDateStart, "end_date", endDateStart, endDateEnd);
|
120
|
157
|
queryWrapper.eq(Constants.SOURCE_FEEDBACK.equals(sourceType) && !all, "source_type", Constants.SOURCE_FEEDBACK);
|
121
|
158
|
queryWrapper.ne(!Constants.SOURCE_FEEDBACK.equals(sourceType) && !all, "source_type", Constants.SOURCE_FEEDBACK);
|
122
|
159
|
queryWrapper.gt("status", Constants.STATUS_DELETE);
|
|
@@ -137,11 +174,17 @@ public class TaIssueController extends BaseController {
|
137
|
174
|
public ResponseBean list(@ApiParam("页码") @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
138
|
175
|
@ApiParam("单页数据量") @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
|
139
|
176
|
@ApiParam("问题单ID") @RequestParam(value = "issueId", required = false) String issueId,
|
|
177
|
+ @ApiParam("类型ID") @RequestParam(value = "typeId", required = false) String typeId,
|
140
|
178
|
@ApiParam("问题单状态") @RequestParam(value = "bizStatus", required = false) String bizStatus,
|
141
|
179
|
@ApiParam("来源") @RequestParam(value = "sourceType", required = false) String sourceType,
|
142
|
180
|
@ApiParam("点位") @RequestParam(value = "locId", required = false) String locId,
|
143
|
181
|
@ApiParam("我的") @RequestParam(value = "mine", defaultValue = "false") Boolean mine,
|
144
|
182
|
@ApiParam("责任单位") @RequestParam(value = "orgId", required = false) String orgId,
|
|
183
|
+ @ApiParam("上报人") @RequestParam(value = "userName", required = false) String userName,
|
|
184
|
+ @ApiParam(value = "创建时间-开始", example = "2023-03-01") @RequestParam(value = "createDateStart", required = false) String createDateStart,
|
|
185
|
+ @ApiParam(value = "创建时间-结束", example = "2023-03-31") @RequestParam(value = "createDateEnd", required = false) String createDateEnd,
|
|
186
|
+ @ApiParam(value = "结单时间-开始", example = "2023-03-01") @RequestParam(value = "endDateStart", required = false) String endDateStart,
|
|
187
|
+ @ApiParam(value = "结单时间-结束", example = "2023-03-31") @RequestParam(value = "endDateEnd", required = false) String endDateEnd,
|
145
|
188
|
@ApiParam("是否全部") @RequestParam(value = "all", defaultValue = "false") Boolean all) throws Exception {
|
146
|
189
|
|
147
|
190
|
SysUser sysUser = currentUser();
|
|
@@ -152,8 +195,23 @@ public class TaIssueController extends BaseController {
|
152
|
195
|
return ResponseBean.error("暂无权限查询数据");
|
153
|
196
|
}
|
154
|
197
|
|
|
198
|
+ Map<String, Object> params = new HashMap<>();
|
|
199
|
+ params.put("issueId", issueId);
|
|
200
|
+ params.put("typeId", typeId);
|
|
201
|
+ params.put("bizStatus", bizStatus);
|
|
202
|
+ params.put("sourceType", sourceType);
|
|
203
|
+ params.put("locId", locId);
|
|
204
|
+ params.put("mine", mine);
|
|
205
|
+ params.put("orgId", orgId);
|
|
206
|
+ params.put("userName", userName);
|
|
207
|
+ params.put("all", all);
|
|
208
|
+ params.put("createDateStart", createDateStart);
|
|
209
|
+ params.put("createDateEnd", createDateEnd);
|
|
210
|
+ params.put("endDateStart", endDateStart);
|
|
211
|
+ params.put("endDateEnd", endDateEnd);
|
|
212
|
+
|
155
|
213
|
IPage<TaIssue> pg = new Page<>(pageNum, pageSize);
|
156
|
|
- QueryWrapper<TaIssue> queryWrapper = buildQuery(sysUser, issueId, bizStatus, sourceType, locId, mine, orgId, all);
|
|
214
|
+ QueryWrapper<TaIssue> queryWrapper = buildQuery(sysUser, params);
|
157
|
215
|
IPage<TaIssue> result = taIssueService.page(pg, queryWrapper);
|
158
|
216
|
|
159
|
217
|
return ResponseBean.success(result);
|
|
@@ -171,11 +229,18 @@ public class TaIssueController extends BaseController {
|
171
|
229
|
@PostMapping("/taIssue/export")
|
172
|
230
|
public ResponseBean export(@ApiParam("问题单ID") @RequestParam(value = "issueId", required = false) String issueId,
|
173
|
231
|
@ApiParam("问题单状态") @RequestParam(value = "bizStatus", required = false) String bizStatus,
|
|
232
|
+ @ApiParam("类型ID") @RequestParam(value = "typeId", required = false) String typeId,
|
174
|
233
|
@ApiParam("来源") @RequestParam(value = "sourceType", required = false) String sourceType,
|
175
|
234
|
@ApiParam("点位") @RequestParam(value = "locId", required = false) String locId,
|
176
|
235
|
@ApiParam("我的") @RequestParam(value = "mine", defaultValue = "false") Boolean mine,
|
177
|
236
|
@ApiParam("责任单位") @RequestParam(value = "orgId", required = false) String orgId,
|
|
237
|
+ @ApiParam("上报人") @RequestParam(value = "userName", required = false) String userName,
|
|
238
|
+ @ApiParam(value = "创建时间-开始", example = "2023-03-01") @RequestParam(value = "createDateStart", required = false) String createDateStart,
|
|
239
|
+ @ApiParam(value = "创建时间-结束", example = "2023-03-31") @RequestParam(value = "createDateEnd", required = false) String createDateEnd,
|
|
240
|
+ @ApiParam(value = "结单时间-开始", example = "2023-03-01") @RequestParam(value = "endDateStart", required = false) String endDateStart,
|
|
241
|
+ @ApiParam(value = "结单时间-结束", example = "2023-03-31") @RequestParam(value = "endDateEnd", required = false) String endDateEnd,
|
178
|
242
|
@ApiParam("是否全部") @RequestParam(value = "all", defaultValue = "false") Boolean all,
|
|
243
|
+ @ApiParam("是否带图") @RequestParam(value = "withImage", defaultValue = "true") Boolean withImage,
|
179
|
244
|
HttpServletResponse response) throws Exception {
|
180
|
245
|
|
181
|
246
|
SysUser sysUser = currentUser();
|
|
@@ -186,10 +251,26 @@ public class TaIssueController extends BaseController {
|
186
|
251
|
return ResponseBean.error("暂无权限查询数据");
|
187
|
252
|
}
|
188
|
253
|
|
189
|
|
- QueryWrapper<TaIssue> queryWrapper = buildQuery(sysUser, issueId, bizStatus, sourceType, locId, mine, orgId, all);
|
|
254
|
+
|
|
255
|
+ Map<String, Object> params = new HashMap<>();
|
|
256
|
+ params.put("issueId", issueId);
|
|
257
|
+ params.put("typeId", typeId);
|
|
258
|
+ params.put("bizStatus", bizStatus);
|
|
259
|
+ params.put("sourceType", sourceType);
|
|
260
|
+ params.put("locId", locId);
|
|
261
|
+ params.put("mine", mine);
|
|
262
|
+ params.put("orgId", orgId);
|
|
263
|
+ params.put("userName", userName);
|
|
264
|
+ params.put("all", all);
|
|
265
|
+ params.put("createDateStart", createDateStart);
|
|
266
|
+ params.put("createDateEnd", createDateEnd);
|
|
267
|
+ params.put("endDateStart", endDateStart);
|
|
268
|
+ params.put("endDateEnd", endDateEnd);
|
|
269
|
+
|
|
270
|
+ QueryWrapper<TaIssue> queryWrapper = buildQuery(sysUser, params);
|
190
|
271
|
List<TaIssue> list = taIssueService.list(queryWrapper);
|
191
|
272
|
|
192
|
|
- List<IssueExport> exportList = exportIssueUtil.getExportList(list);
|
|
273
|
+ List<IssueExport> exportList = exportIssueUtil.getExportList(list, withImage);
|
193
|
274
|
ExcelUtils.flush(response, IssueExport.class, exportList, "问题单列表");
|
194
|
275
|
|
195
|
276
|
return null;
|