|
@@ -1,14 +1,22 @@
|
|
package com.sooka.sponest.mobile.comprehensive.eventController;
|
|
package com.sooka.sponest.mobile.comprehensive.eventController;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.ruoyi.common.core.constant.HttpStatus;
|
|
import com.ruoyi.common.core.constant.HttpStatus;
|
|
|
|
+import com.ruoyi.common.core.utils.SpringUtils;
|
|
|
|
+import com.ruoyi.common.core.utils.StringUtils;
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
|
import com.ruoyi.common.core.web.page.TableDataInfo;
|
|
|
|
+import com.ruoyi.common.redis.service.RedisService;
|
|
|
|
+import com.ruoyi.common.security.utils.DictUtils;
|
|
|
|
+import com.ruoyi.system.api.domain.SysDictData;
|
|
import com.sooka.sponest.comprehensive.api.comprehensiveEvent.domain.ZhsqEvent;
|
|
import com.sooka.sponest.comprehensive.api.comprehensiveEvent.domain.ZhsqEvent;
|
|
import com.sooka.sponest.comprehensive.api.comprehensiveEvent.service.*;
|
|
import com.sooka.sponest.comprehensive.api.comprehensiveEvent.service.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping("/AppComprehensiveEvent")
|
|
@RequestMapping("/AppComprehensiveEvent")
|
|
@@ -40,32 +48,40 @@ public class EventController {
|
|
@GetMapping("/event/getList")
|
|
@GetMapping("/event/getList")
|
|
public AjaxResult getEventList(@RequestParam("pageNum") String pageNum, @RequestParam("pageSize") String pageSize, @RequestParam("eventType") String eventType) {
|
|
public AjaxResult getEventList(@RequestParam("pageNum") String pageNum, @RequestParam("pageSize") String pageSize, @RequestParam("eventType") String eventType) {
|
|
TableDataInfo data = new TableDataInfo();
|
|
TableDataInfo data = new TableDataInfo();
|
|
|
|
+
|
|
switch (eventType){
|
|
switch (eventType){
|
|
case "1":
|
|
case "1":
|
|
data = eventService.getList(pageNum,pageSize);
|
|
data = eventService.getList(pageNum,pageSize);
|
|
- break;
|
|
|
|
|
|
+ return setLabel(data, "eventState");
|
|
case "2":
|
|
case "2":
|
|
data = eventTodoService.getList(pageNum,pageSize);
|
|
data = eventTodoService.getList(pageNum,pageSize);
|
|
- break;
|
|
|
|
|
|
+ return setLabel(data, "sjczCzzt");
|
|
case "3":
|
|
case "3":
|
|
data = eventCompletedService.getList(pageNum,pageSize);
|
|
data = eventCompletedService.getList(pageNum,pageSize);
|
|
- break;
|
|
|
|
|
|
+ return setLabel(data, "eventState");
|
|
case "4":
|
|
case "4":
|
|
data = eventVerfiedService.getList(pageNum,pageSize);
|
|
data = eventVerfiedService.getList(pageNum,pageSize);
|
|
- break;
|
|
|
|
|
|
+ return setLabel(data, "eventState");
|
|
case "5":
|
|
case "5":
|
|
data = eventDistributeService.getList(pageNum,pageSize);
|
|
data = eventDistributeService.getList(pageNum,pageSize);
|
|
- break;
|
|
|
|
|
|
+ return setLabel(data, "sjczCzzt");
|
|
case "6":
|
|
case "6":
|
|
data = eventFileService.getList(pageNum,pageSize);
|
|
data = eventFileService.getList(pageNum,pageSize);
|
|
- break;
|
|
|
|
|
|
+ return setLabel(data, "eventState");
|
|
default:
|
|
default:
|
|
- data.setCode(500);
|
|
|
|
- data.setMsg("参数错误");
|
|
|
|
- break;
|
|
|
|
|
|
+ return AjaxResult.error(500, "参数错误");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private AjaxResult setLabel(TableDataInfo data, String keys){
|
|
if (HttpStatus.SUCCESS == data.getCode()) {
|
|
if (HttpStatus.SUCCESS == data.getCode()) {
|
|
- return AjaxResult.success(data.getRows());
|
|
|
|
|
|
+ Map<String, Object> eventType1 = DictUtils.getDictCacheToMap("eventType");
|
|
|
|
+ List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) data.getRows();
|
|
|
|
+ for (HashMap<String, Object> row : rows) {
|
|
|
|
+ row.put("eventStateLabel", eventType1.get(row.get(keys).toString()));
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success(rows);
|
|
} else {
|
|
} else {
|
|
return AjaxResult.error(data.getCode(), data.getMsg());
|
|
return AjaxResult.error(data.getCode(), data.getMsg());
|
|
}
|
|
}
|
|
@@ -78,7 +94,21 @@ public class EventController {
|
|
*/
|
|
*/
|
|
@GetMapping("/event/edit")
|
|
@GetMapping("/event/edit")
|
|
public AjaxResult getEdit(@RequestParam("eventId") String eventId){
|
|
public AjaxResult getEdit(@RequestParam("eventId") String eventId){
|
|
- return eventService.getEdit(eventId);
|
|
|
|
|
|
+ AjaxResult result = eventService.getEdit(eventId);
|
|
|
|
+ if("200".equals(String.valueOf(result.get("code")))){
|
|
|
|
+ HashMap<String, Object> data = (HashMap<String, Object>) result.get("data");
|
|
|
|
+ String keys = "zhsqEventType";
|
|
|
|
+ List<JSONObject> list = SpringUtils.getBean(RedisService.class).getCacheList(keys);
|
|
|
|
+ for (JSONObject map : list) {
|
|
|
|
+ if(map.getString("eventTypeId").equals(String.valueOf(data.get("eventTypeId")))){
|
|
|
|
+ data.put("eventTypeLabel", map.get("eventTypeName"));
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return AjaxResult.success(data);
|
|
|
|
+ }else{
|
|
|
|
+ return AjaxResult.error(String.valueOf(result.get("code")), result.get("msg"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -115,7 +145,7 @@ public class EventController {
|
|
* @param eventId
|
|
* @param eventId
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @PostMapping("/event/report/eventId")
|
|
|
|
|
|
+ @GetMapping("/event/report/eventId")
|
|
public AjaxResult reportEventId(@RequestParam("eventId") String eventId){
|
|
public AjaxResult reportEventId(@RequestParam("eventId") String eventId){
|
|
return eventService.reportEventId(eventId);
|
|
return eventService.reportEventId(eventId);
|
|
}
|
|
}
|