Parcourir la source

手机端事件接口修改返回数据格式,增加分页信息

Wang-Xiao-Ran il y a 1 an
Parent
commit
2e44ab7254

+ 45 - 19
src/main/java/com/sooka/sponest/mobile/event/controller/AppEventController.java

@@ -1,5 +1,7 @@
 package com.sooka.sponest.mobile.event.controller;
 
+import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.core.constant.HttpStatus;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -16,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 
 @RequestMapping("AppEventController")
@@ -42,8 +45,9 @@ public class AppEventController extends AppBaseController {
 
     /**
      * 手机查询大类小类(上报时使用)
-     * @Version 1.0
+     *
      * @return
+     * @Version 1.0
      * @author wang_xy
      * @since 2023/2/23 9:09
      */
@@ -56,8 +60,9 @@ public class AppEventController extends AppBaseController {
 
     /**
      * 手机查询行管局
-     * @Version 1.0
+     *
      * @return
+     * @Version 1.0
      * @author wang_xy
      * @since 2023/2/23 9:09
      */
@@ -69,8 +74,9 @@ public class AppEventController extends AppBaseController {
 
     /**
      * 手机上报事件
-     * @Version 1.0
+     *
      * @return
+     * @Version 1.0
      * @author wang_xy
      * @since 2023/2/23 9:09
      */
@@ -135,8 +141,22 @@ public class AppEventController extends AppBaseController {
      */
     @ApiOperation(value = "反馈列表", notes = "反馈列表")
     @GetMapping("eventLogList")
-    public AjaxResult eventLogList(String eventCode) {
-        return remoteCenterBaseService.eventLogList(eventCode);
+    public AjaxResult eventLogList(String pageNum, String pageSize,String eventCode) {
+        return remoteCenterBaseService.eventLogList(pageNum, pageSize, eventCode);
+    }
+
+    @ApiOperation(value = "反馈列表", notes = "反馈列表")
+    @GetMapping("eventLogListAllAndDetails")
+    public AjaxResult eventLogListAllAndDetails(String eventCode) {
+        AjaxResult ajaxResult = remoteCenterBaseService.eventLogListAll(eventCode);
+        ArrayList<HashMap<String, Object>> result = (ArrayList<HashMap<String, Object>>) ajaxResult.get("data");
+        for (HashMap<String, Object> map : result) {
+            AjaxResult ajaxResult1 = appEventService.selectCentereventTFireLogById(map.get("id").toString());
+            CentereventTFireLog data = (CentereventTFireLog) ajaxResult1.get("data");
+            map.put("attachs", data.getAttachs());
+            map.put("attachsMp", data.getAttachsMp());
+        }
+        return ajaxResult;
     }
 
 
@@ -170,11 +190,12 @@ public class AppEventController extends AppBaseController {
         return remoteCenterBaseService.EventFeignedit(centereventtDeptEventBO);
     }
 
-    @ApiOperation(value = "查询事件部门信息",notes ="查询事件部门信息" )
+    @ApiOperation(value = "查询事件部门信息", notes = "查询事件部门信息")
     @PostMapping("/centereventtdepteventList")
     public AjaxResult centereventtdepteventList(@RequestBody CentereventDeptEvent centereventTDeptEvent) {
         return AjaxResult.success(remoteCenterBaseService.remotecentereventtdepteventList(centereventTDeptEvent.getEventCode()).getData());
     }
+
     /**
      * 获取用户部门列表
      */
@@ -184,15 +205,16 @@ public class AppEventController extends AppBaseController {
         List<SysUserSystem> list = remoteSystemBaseService.selectUserWithPostByDeptId(sysUserSystem.getDeptId()).getData();
         return AjaxResult.success(list);
     }
-    @ApiOperation(value = "发送会议短信",notes ="发送会议短信" )
+
+    @ApiOperation(value = "发送会议短信", notes = "发送会议短信")
     @PostMapping("/sendMeetingMsg")
     public AjaxResult sendMeetingMsg(@RequestBody CentereventMeetingSystemBO centereventMeetingSystemBO) {
         AjaxResult result = remoteSystemBaseService.joinConferences(centereventMeetingSystemBO.getEventId(), centereventMeetingSystemBO.getMeetingSubject(), centereventMeetingSystemBO.getUserName());
-        if(!result.get("code").equals(200)){
+        if (!result.get("code").equals(200)) {
             return AjaxResult.error("查询失败");
-        }else{
+        } else {
             List<CentereventTDutySystemBO> meetingSystemList = centereventMeetingSystemBO.getCentereventTDutySystemList();
-            meetingSystemList.forEach(e ->{
+            meetingSystemList.forEach(e -> {
                 e.setPost(e.getPostName());
                 e.setTelphone(e.getPhonenumber());
             });
@@ -201,7 +223,6 @@ public class AppEventController extends AppBaseController {
     }
 
 
-
     /**
      * 反馈详情
      *
@@ -219,8 +240,9 @@ public class AppEventController extends AppBaseController {
 
     /**
      * 任务列表
+     *
+     * @return 待领取
      * @Version 1.0
-     * @return  待领取
      * @author wang_xy
      * @since 2023/2/22 14:52111
      */
@@ -252,10 +274,11 @@ public class AppEventController extends AppBaseController {
 
     /**
      * 手机端领取任务
-     * @author pengyu
-     * @date 2023/2/22 15:03
+     *
      * @param receiveTaskVO
      * @return com.ruoyi.common.core.web.domain.AjaxResult
+     * @author pengyu
+     * @date 2023/2/22 15:03
      **/
     @ApiOperation(value = "领取任务", notes = "领取任务")
     @PostMapping("receiveTask")
@@ -293,16 +316,17 @@ public class AppEventController extends AppBaseController {
                 remoteEventBaseService.remoteAdd(centereventDeptEvent);
             }
         }
-        return AjaxResult.success(msg,"");
+        return AjaxResult.success(msg, "");
     }
 
 
     /**
      * 手机端拒绝任务
-     * @author pengyu
-     * @date 2023/2/22 15:03
+     *
      * @param refusedTaskVO
      * @return com.ruoyi.common.core.web.domain.AjaxResult
+     * @author pengyu
+     * @date 2023/2/22 15:03
      **/
     @ApiOperation(value = "拒绝任务", notes = "拒绝任务")
     @PostMapping("refusedTask")
@@ -318,14 +342,15 @@ public class AppEventController extends AppBaseController {
         centereventTFireLog.setLogContent(SecurityUtils.getLoginUser().getSysUser().getNickName() + "拒绝领取任务");
         remoteCenterBaseService.add(centereventTFireLog);
         String msg = (String) remoteTaskBaseService.refusedTask(refusedTaskVO).get("msg");
-        return AjaxResult.success(msg,"");
+        return AjaxResult.success(msg, "");
     }
 
     /**
      * 根据事件编码查询事件部门信息
+     *
+     * @return com.ruoyi.common.core.web.domain.AjaxResult
      * @author pengyu
      * @date 2023/2/22 15:03
-     * @return com.ruoyi.common.core.web.domain.AjaxResult
      **/
     @GetMapping("selectByeventCodeFeign")
     public AjaxResult selectByeventCodeFeign(String eventCode) {
@@ -335,6 +360,7 @@ public class AppEventController extends AppBaseController {
     /**
      * 手机端任务列表查找全部
      * 已领取
+     *
      * @return com.ruoyi.common.core.web.domain.AjaxResult
      * @author pengyu
      * @date 2023/2/22 13:35

+ 4 - 1
src/main/java/com/sooka/sponest/mobile/remoteapi/RemoteCenterBaseService.java

@@ -64,7 +64,7 @@ public interface RemoteCenterBaseService {
      * @since 2023/2/22 13:57
      */
     @GetMapping("/centereventtfirelog/getAllCentereventTFireLog")
-    public AjaxResult eventLogList(@RequestParam("eventCode") String eventCode);
+    public AjaxResult eventLogList(@RequestParam("pageNum") String pageNum, @RequestParam("pageSize") String pageSize, @RequestParam("eventCode") String eventCode);
 
 
     /**
@@ -112,4 +112,7 @@ public interface RemoteCenterBaseService {
      **/
     @GetMapping("/centereventtdeptevent/getAllCentereventDeptEvent")
     public R remotecentereventtdepteventList(@RequestParam("eventCode") String eventCode);
+
+    @GetMapping("/centereventtfirelog/getAllCentereventTFireLog")
+    AjaxResult eventLogListAll(@RequestParam("eventCode") String eventCode);
 }

+ 7 - 1
src/main/java/com/sooka/sponest/mobile/remoteapi/factory/RemoteBaseServiceCenterFactory.java

@@ -39,6 +39,7 @@ public class RemoteBaseServiceCenterFactory implements FallbackFactory<RemoteCen
                 return null;
             }
 
+            @Override
             public R<CentereventTEmergencyDanger> selectDangerById(@PathVariable("id") String id) {
                 return null;
             }
@@ -74,7 +75,7 @@ public class RemoteBaseServiceCenterFactory implements FallbackFactory<RemoteCen
             }
 
             @Override
-            public AjaxResult eventLogList(@RequestParam("eventCode") String eventCode) {
+            public AjaxResult eventLogList(@RequestParam("pageNum") String pageNum, @RequestParam("pageSize") String pageSize, @RequestParam("eventCode") String eventCode) {
                 return null;
             }
 
@@ -102,6 +103,11 @@ public class RemoteBaseServiceCenterFactory implements FallbackFactory<RemoteCen
             public R remotecentereventtdepteventList(String eventCode) {
                 return null;
             }
+
+            @Override
+            public AjaxResult eventLogListAll(@RequestParam("eventCode") String eventCode) {
+                return null;
+            }
         };
     }
 }