Commit f5549c77 authored by KeYong's avatar KeYong

修改bug

parent 4f21d2b6
...@@ -641,9 +641,10 @@ public class ContingencyInstanceImpl implements IContingencyInstance { ...@@ -641,9 +641,10 @@ public class ContingencyInstanceImpl implements IContingencyInstance {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
String img = ""; String img = null;
if (responseModel != null && "SUCCESS".equals(responseModel.getDevMessage())) { if (responseModel != null && "SUCCESS".equals(responseModel.getDevMessage())) {
img = JSON.toJSONString(responseModel.getResult()).replace("\"",""); String resStr = JSON.toJSONString(responseModel.getResult()).replace("\"","");
img = "null".equalsIgnoreCase(resStr) ? null : img;
} }
img = StringUtils.isEmpty(img) ? personImg : img; img = StringUtils.isEmpty(img) ? personImg : img;
contingencyPlanInstance.setPersonImg(img); contingencyPlanInstance.setPersonImg(img);
......
...@@ -251,12 +251,27 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService { ...@@ -251,12 +251,27 @@ public class ContingencyPlanServiceImpl implements IContingencyPlanService {
result.setBatchNo(batchNo); result.setBatchNo(batchNo);
equipmentHandlerService.executeDynamicPlan(batchNo, deviceData, equipment, equipmentSpecific, toke, operationRecord.getId()); equipmentHandlerService.executeDynamicPlan(batchNo, deviceData, equipment, equipmentSpecific, toke, operationRecord.getId());
// app端使用 // app端使用
ContingencyRo contingencyRo = new ContingencyRo();
contingencyRo.setBatchNo(batchNo);
contingencyRo.setEquipmentId(String.valueOf(equipment.getId()));
contingencyRo.setEquipmentName(equipment.getName());
contingencyRo.setFireEquipmentId(String.valueOf(equipmentSpecific.getId()));
contingencyRo.setFireEquipmentName(equipmentSpecific.getName());
contingencyRo.setFireEquipmentCode(equipmentSpecific.getCode());
contingencyRo.setStep("0");
contingencyRo.setConfirm("NONE");
contingencyRo.setFireTruckRoute(equipment.getFireTruckRoute());
contingencyRo.setRunstep(false);
contingencyRo.setEquipmentPosition3d(equipment.getPosition3d());
contingencyRo.setEquipmentCode(equipment.getCode());
contingencyRo.setEquipmentOrgCode(equipment.getOrgCode());
contingencyRo.getParams().put("equipmentId", equipment.getId());
contingencyRo.setPosition(equipmentSpecific.getPosition());
String topic = String.format("/%s/%s/%s", serviceName, stationName, "plan"); String topic = String.format("/%s/%s/%s", serviceName, stationName, "plan");
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
JSONObject msgContext = new JSONObject(); JSONObject msgContext = new JSONObject();
msgContext.put("content", "startPlan"); msgContext.put("content", "startPlan");
map.put("contingency", new ContingencyRo()); map.put("contingency", contingencyRo);
// map.put("msgContext", "{\"content\":\"startPlan\"}");
map.put("msgContext", msgContext); map.put("msgContext", msgContext);
map.put("msgType", "refreshRecord"); map.put("msgType", "refreshRecord");
webMqttComponent.publish(topic, JSON.toJSONString(map)); webMqttComponent.publish(topic, JSON.toJSONString(map));
......
...@@ -496,7 +496,8 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -496,7 +496,8 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
} }
String img = ""; String img = "";
if (responseModel != null && "SUCCESS".equals(responseModel.getDevMessage())) { if (responseModel != null && "SUCCESS".equals(responseModel.getDevMessage())) {
img = JSON.toJSONString(responseModel.getResult()).replace("\"",""); String resStr = JSON.toJSONString(responseModel.getResult()).replace("\"","");
img = "null".equalsIgnoreCase(resStr) ? null : img;
} }
img = StringUtils.isEmpty(img) ? personImg : img; img = StringUtils.isEmpty(img) ? personImg : img;
// Map<String, String> userInfo = contingencyPlanInstanceMapper.getUserByUserId(user.getUserId()); // Map<String, String> userInfo = contingencyPlanInstanceMapper.getUserByUserId(user.getUserId());
...@@ -709,7 +710,8 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService { ...@@ -709,7 +710,8 @@ public class PlanVisual3dServiceImpl implements IPlanVisual3dService {
} }
String img = ""; String img = "";
if (responseModel != null && "SUCCESS".equals(responseModel.getDevMessage())) { if (responseModel != null && "SUCCESS".equals(responseModel.getDevMessage())) {
img = JSON.toJSONString(responseModel.getResult()).replace("\"",""); String resStr = JSON.toJSONString(responseModel.getResult()).replace("\"","");
img = "null".equalsIgnoreCase(resStr) ? null : img;
} }
img = StringUtils.isEmpty(img) ? personImg : img; img = StringUtils.isEmpty(img) ? personImg : img;
if (runStatus) { if (runStatus) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment