| | |
| | | |
| | | /** |
| | | * 查询可参与任务 |
| | | * |
| | | * @param serid |
| | | * @param jurisdiction |
| | | * @return |
| | | */ |
| | | @GetMapping("/selectNum") |
| | | public R selectNum(String serid,String jurisdiction,String workjurisdiction) { |
| | | return R.data(taskqdService.selectNum(serid, jurisdiction,workjurisdiction)); |
| | | public R selectNum(String serid, String jurisdiction, String workjurisdiction) { |
| | | List<Map<String, Object>> maps = taskqdService.selectNum(serid, jurisdiction, workjurisdiction); |
| | | //0:治安巡查 |
| | | Map map = new HashMap(); |
| | | int a = 0; |
| | | int b = 0; |
| | | int c = 0; |
| | | for (int i = 0; i < maps.size(); i++) { |
| | | String tasktype = maps.get(i).get("tasktype").toString(); |
| | | if (tasktype.equals("0")) { |
| | | map.put("xcha", maps.get(i).get("num")); |
| | | a = 1; |
| | | } else if (tasktype.equals("1")) { |
| | | map.put("xchuan", maps.get(i).get("num")); |
| | | b = 1; |
| | | } else if (tasktype.equals("2")) { |
| | | map.put("px", maps.get(i).get("num")); |
| | | c = 1; |
| | | } |
| | | } |
| | | if (a == 0) { |
| | | map.put("xcha", 0); |
| | | } |
| | | if (b == 0) { |
| | | map.put("xchuan", 0); |
| | | } |
| | | if (c == 0) { |
| | | map.put("px", 0); |
| | | } |
| | | return R.data(map); |
| | | } |
| | | |
| | | @GetMapping("/startTask") |
| | | public R<Map> startTask(String rid, String serid,String type,String data) { |
| | | public R<Map> startTask(String rid, String serid, String type, String data) { |
| | | //获取组员id并进行通知 |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | serid = taskqdService.querySerid(rid); |
| | | |
| | | int msg = pushMsgService.startTask(serid, rid,type,data); |
| | | int msg = pushMsgService.startTask(serid, rid, type, data); |
| | | map.put("res", msg); |
| | | map.put("type", type); |
| | | map.put("data",data); |
| | | if (!type.equals("stop")){ |
| | | taskqdService.updateRtype("0",rid); |
| | | map.put("data", data); |
| | | if (!type.equals("stop")) { |
| | | taskqdService.updateRtype("0", rid); |
| | | } |
| | | return R.data(map); |
| | | } |