| | |
| | | |
| | | import com.whyc.config.WebSocketConfig; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.factory.ThreadPoolExecutorFactory; |
| | | import com.whyc.pojo.FaultUpload; |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.service.FaultUploadService; |
| | |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.concurrent.CountDownLatch; |
| | | import java.util.concurrent.ThreadPoolExecutor; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Component |
| | | @ServerEndpoint(value = "/taskMAdmin", encoders = WebSocketEncoder.class, configurator = WebSocketConfig.class) |
| | |
| | | //获取管理员的数据 |
| | | public Map getTaskMAdmin(int userId, FaultUpload upload) { |
| | | Map<String, Object> res = new HashMap<>(); |
| | | //本月 |
| | | Response monRes = faultUploadService.groupNameCount(1, userId); |
| | | res.put("monRes", monRes); |
| | | //本季度 |
| | | Response quarterRes = faultUploadService.groupNameCount(2, userId); |
| | | res.put("quarterRes", quarterRes); |
| | | //本年 |
| | | Response yearRes = faultUploadService.groupNameCount(3, userId); |
| | | res.put("yearRes", yearRes); |
| | | |
| | | //隐患故障上报进度-最近一周及最近一月-管理 |
| | | Response lastPeriodRes = faultUploadService.getListOfLastPeriod(1, userId); |
| | | res.put("lastPeriodRes", lastPeriodRes); |
| | | |
| | | //列表分页-管理 |
| | | Response listRes = faultUploadService.listPage2(upload.getPageNum(), upload.getPageSize(), upload, userId); |
| | | res.put("listRes", listRes); |
| | | |
| | | return res; |
| | | } |
| | | /* //获取管理员的数据 |
| | | public Map getTaskMAdmin(int userId, FaultUpload upload) { |
| | | Map<String, Object> res = new HashMap<>(); |
| | | try { |
| | | ThreadPoolExecutor poolExecutor = ThreadPoolExecutorFactory.getPoolExecutor(); |
| | | CountDownLatch latch = new CountDownLatch(3); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | return res; |
| | | } |
| | | }*/ |
| | | |
| | | @OnClose |
| | | public void onClose(CloseReason closeReason) { |