|
|
|
@ -56,6 +56,7 @@ import java.util.stream.Collectors; |
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
import com.sun.prism.paint.Color; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import springfox.documentation.annotations.ApiIgnore; |
|
|
|
@ -423,7 +424,8 @@ public class PatrolPresetPosController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping |
|
|
|
public AjaxResult getInfoByPatrolPointId(String patrolPointId) { |
|
|
|
public AjaxResult getInfoByPatrolPointId(@RequestParam("patrolpointId") String patrolPointId) { |
|
|
|
logger.info("[PRESET] getInfoByPatrolPointId patrolPointId: {}", patrolPointId); |
|
|
|
List<PatrolPresetPos> patrolPresetPos = this.patrolPresetPosService.selectPatrolPresetPosByPatrolPointId(patrolPointId); |
|
|
|
return AjaxResult.success(patrolPresetPos); |
|
|
|
} |
|
|
|
@ -455,6 +457,7 @@ public class PatrolPresetPosController extends BaseController { |
|
|
|
String stdPatrolPointId = patrolPresetPos.getStdParolPointId(); |
|
|
|
JSONObject paramJson = (new JSONObject()) |
|
|
|
.fluentPut("deviceId", patrolPresetPos.getDeviceId()) |
|
|
|
.fluentPut("patrolPointId", patrolPresetPos.getPatrolPointId()) |
|
|
|
.fluentPut("patrolContent", basePresetId.getString("patrolContent")) |
|
|
|
.fluentPut("purpose", INSERT_PATROL_POINT_PURPOSE) |
|
|
|
.fluentPut("areaId", snap) |
|
|
|
@ -489,10 +492,12 @@ public class PatrolPresetPosController extends BaseController { |
|
|
|
logger.info("[PRESET] 预置位编码不能为空!: {}", patrolPresetPos.getPresetPosCode()); |
|
|
|
throw new ServiceException("预置位编码不能为空!"); |
|
|
|
} else { |
|
|
|
patrolPresetPosService.insertPatrolPresetPos(patrolPresetPos); |
|
|
|
int insertResId = patrolPresetPosService.insertPatrolPresetPos(patrolPresetPos); |
|
|
|
logger.info("[PRESET] insert insertResId: {}", insertResId); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
logger.warn("[PRESET] patrolPresetPos: {} already added!", patrolPresetPos1.getPatrolPointId()); |
|
|
|
logger.info("[PRESET] patrolPresetPos: {} already added!", patrolPresetPos1.getPatrolPointId()); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
this.basedataPatrolPointService.remove(new Long[]{patrolPresetPos.getPatrolPointId()}); |
|
|
|
@ -568,6 +573,8 @@ public class PatrolPresetPosController extends BaseController { |
|
|
|
|
|
|
|
private int insertBasePreset(PatrolPresetPos patrolPresetPos) { |
|
|
|
JSONObject params = JSONObject.parseObject(JSONObject.toJSONString(patrolPresetPos)).fluentPut("presetCode", patrolPresetPos.getPresetPosCode()).fluentPut("presetName", patrolPresetPos.getPresetPosName()); |
|
|
|
|
|
|
|
logger.info("[METADATA] !!!!!!!!!!!!!!!!!!!!!insertBasePreset params: {}", params.toString()); |
|
|
|
return (Integer) this.basedataPatrolpointPresetService.add(params).get("data"); |
|
|
|
} |
|
|
|
|
|
|
|
|