Преглед на файлове

修改镜屏推送信息

konghl преди 4 години
родител
ревизия
53804e97f6

+ 8 - 4
location-rescue-service/src/main/java/com/ai/bss/location/rescue/controller/AlarmManagementController.java

@ -19,6 +19,7 @@ import com.ai.abc.api.model.CommonResponse;
19 19
import com.ai.bss.components.common.model.PageBean;
20 20
import com.ai.bss.location.rescue.service.interfaces.AlarmManagementService;
21 21
import com.ai.bss.location.rescue.util.EbcConstant;
22
import com.ai.bss.position.model.EntityPosition;
22 23
import com.ai.bss.work.rescue.model.WorkTaskRescue;
23 24
import com.ai.bss.work.task.model.common.WorkTask;
24 25
@ -74,7 +75,7 @@ public class AlarmManagementController {
74 75
	 */
75 76
	@ResponseBody
76 77
	@RequestMapping("/assignRescuer")
77
	public CommonResponse<WorkTaskRescue> assignRescuer(@RequestBody Map<String, String> params,
78
	public CommonResponse<EntityPosition> assignRescuer(@RequestBody Map<String, String> params,
78 79
			HttpServletRequest request) throws Exception {
79 80
		if (params == null || StringUtils.isEmpty(params.get("workTaskId"))
80 81
				|| StringUtils.isEmpty(params.get("rescuersId"))) {
@ -112,7 +113,7 @@ public class AlarmManagementController {
112 113
		workTaskRescue.setWorkTaskId(params.get("workTaskId"));
113 114
		workTaskRescue.setCloseTime(new Date());
114 115
115
		return alarmManagementService.closeRescue(workTaskRescue, params.get("isFalseAlarm"));
116
		return alarmManagementService.closeRescue(workTaskRescue, params.get("isAssignAlarm"));
116 117
	}
117 118
118 119
	/**
@ -163,11 +164,14 @@ public class AlarmManagementController {
163 164
	*/
164 165
	@ResponseBody
165 166
	@RequestMapping("/deleteCloseAlarm")
166
	public CommonResponse<Void> deleteCloseAlarm(@RequestBody Map<String, String> params) throws Exception {
167
	public  CommonResponse<WorkTaskRescue> deleteCloseAlarm(@RequestBody Map<String, String> params) throws Exception {
167 168
		if (params == null || StringUtils.isEmpty(params.get("workTaskId"))) {
168 169
			return CommonResponse.fail("500", "删除失败");
169 170
		}
170 171
171
		return alarmManagementService.deleteCloseAlarm(params);
172
		WorkTaskRescue workTaskRescue = new WorkTaskRescue();
173
        workTaskRescue.setWorkTaskId(params.get("workTaskId"));
174
		
175
		return alarmManagementService.deleteCloseAlarm(workTaskRescue);
172 176
	}
173 177
}

+ 18 - 6
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/impl/AlarmManagementServiceImpl.java

@ -20,7 +20,9 @@ import com.ai.bss.components.common.model.PageBean;
20 20
import com.ai.bss.location.rescue.service.interfaces.AlarmManagementService;
21 21
import com.ai.bss.location.rescue.util.DateUtil;
22 22
import com.ai.bss.location.rescue.util.EbcConstant;
23
import com.ai.bss.position.model.EntityPosition;
23 24
import com.ai.bss.position.model.MapAreaBusinessType;
25
import com.ai.bss.position.repository.EntityPositionRepository;
24 26
import com.ai.bss.position.service.api.MapAreaQuery;
25 27
import com.ai.bss.work.rescue.model.WorkTaskRescue;
26 28
import com.ai.bss.work.rescue.service.api.RescueCommand;
@ -40,6 +42,9 @@ public class AlarmManagementServiceImpl implements AlarmManagementService {
40 42
41 43
	@Autowired
42 44
	private RescueQueryService rescueQueryService;
45
	
46
	@Autowired
47
	private EntityPositionRepository entityPositionRepository;
43 48
44 49
	@Autowired
45 50
	private MapAreaTagQuery mapAreaTagQuery;
@ -145,9 +150,16 @@ public class AlarmManagementServiceImpl implements AlarmManagementService {
145 150
	 * @throws Exception
146 151
	 */
147 152
	@Override
148
	public CommonResponse<WorkTaskRescue> assignRescuer(WorkTaskRescue workTaskRescue) throws Exception {
153
	public CommonResponse<EntityPosition> assignRescuer(WorkTaskRescue workTaskRescue) throws Exception {
149 154
		CommonRequest<WorkTaskRescue> commonRequest = new CommonRequest<WorkTaskRescue>(workTaskRescue);
150
		return rescueCommand.assignRescueEmployee(commonRequest);
155
		
156
		List<EntityPosition> list = entityPositionRepository.findByEntityId(workTaskRescue.getWorkTaskId());
157
		if (!CollectionUtils.isEmpty(list)) {
158
			return CommonResponse.ok(list.get(0));
159
		}else {
160
			return CommonResponse.ok(null);
161
		}
162
		
151 163
	}
152 164
153 165
	/**
@ -260,14 +272,14 @@ public class AlarmManagementServiceImpl implements AlarmManagementService {
260 272
	/**
261 273
	 * 删除历史报警
262 274
	 * 
263
	* @param params
275
	* @param workTaskRescue
264 276
	* @return
265 277
	* @throws Exception
266 278
	*/
267 279
	@Override
268
	public CommonResponse<Void> deleteCloseAlarm(Map<String, String> params) throws Exception {
269
270
		return null;
280
	public CommonResponse<WorkTaskRescue> deleteCloseAlarm(WorkTaskRescue workTaskRescue) throws Exception {
281
		CommonRequest<WorkTaskRescue> commonRequest=new CommonRequest(workTaskRescue);
282
		return rescueCommand.deleteTask(commonRequest);
271 283
	}
272 284
273 285
}

+ 4 - 3
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/interfaces/AlarmManagementService.java

@ -6,6 +6,7 @@ import java.util.Map;
6 6
7 7
import com.ai.abc.api.model.CommonResponse;
8 8
import com.ai.bss.components.common.model.PageBean;
9
import com.ai.bss.position.model.EntityPosition;
9 10
import com.ai.bss.work.rescue.model.WorkTaskRescue;
10 11
11 12
/**
@ -36,7 +37,7 @@ public interface AlarmManagementService {
36 37
	 * @return
37 38
	 * @throws Exception
38 39
	 */
39
	CommonResponse<WorkTaskRescue> assignRescuer(WorkTaskRescue workTaskRescue) throws Exception;
40
	CommonResponse<EntityPosition> assignRescuer(WorkTaskRescue workTaskRescue) throws Exception;
40 41
41 42
	/**
42 43
	 * 关闭救援
@ -70,10 +71,10 @@ public interface AlarmManagementService {
70 71
	/**
71 72
	 * 删除历史报警
72 73
	 * 
73
	* @param params
74
	* @param workTaskRescue
74 75
	* @return
75 76
	* @throws Exception
76 77
	*/
77
	CommonResponse<Void> deleteCloseAlarm(Map<String, String> params) throws Exception;
78
	 CommonResponse<WorkTaskRescue> deleteCloseAlarm(WorkTaskRescue workTaskRescue) throws Exception;
78 79
79 80
}

+ 1 - 0
location-rescue-service/src/main/java/com/ai/bss/location/rescue/service/task/LocationMirrorTask.java

@ -47,6 +47,7 @@ public class LocationMirrorTask implements EntityPositionChangeHandle {
47 47
				resultMap.put("unaggregatedEntityPositionList", new ArrayList<EntityPosition>());
48 48
			}
49 49
50
			resultMap.put("currentEntityPosition", commonRequest.getData().getCurrentEntityPosition());
50 51
			resultMap.put("countMap", locationManagementService.loadEmployeeStatusCount());
51 52
52 53
			String msg = JSON.toJSONString(CommonResponse.ok(resultMap));