Commit b4298805 authored by Carit Zhu's avatar Carit Zhu 🎱

Modify to return "endCircuit" when checking the circuitState is 2 in updateEndTime interface.

parent fe7adea4
...@@ -16,7 +16,7 @@ public class CircuitResultVo { ...@@ -16,7 +16,7 @@ public class CircuitResultVo {
private Long endTime; private Long endTime;
private Integer circuitState; private Integer circuitState; // 0: 未开始, 1: 运输中, 2: 完成
private String alarmType; private String alarmType;
......
...@@ -1223,20 +1223,27 @@ public class CircuitController { ...@@ -1223,20 +1223,27 @@ public class CircuitController {
fb.setMessage(i18n.getMessage(request,"transportationNo")); fb.setMessage(i18n.getMessage(request,"transportationNo"));
return gson.toJson(fb); return gson.toJson(fb);
} }
if (circuitService.getByTransportationNo(updateCircuitVo.getTransportationNo(),user.getCompanyNo())==null){ ResultCircuitVo resultCircuitVo = circuitService.getByTransportationNo(
updateCircuitVo.getTransportationNo(),user.getCompanyNo());
if (resultCircuitVo == null) { // 线路不存在
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"noCircuit")); fb.setMessage(i18n.getMessage(request,"noCircuit"));
return gson.toJson(fb); return gson.toJson(fb);
} }
if (updateCircuitVo.getEndTime()==null){ if (resultCircuitVo.getCircuitState() == 0) { // 线路还未开始
updateCircuitVo.setEndTime(System.currentTimeMillis());
}
if (circuitService.getByTransportationNo(updateCircuitVo.getTransportationNo(),user.getCompanyNo()).getCircuitState() ==0){
fb.setCode(0); fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"notStarted")); fb.setMessage(i18n.getMessage(request,"notStarted"));
return gson.toJson(fb); return gson.toJson(fb);
} }
ResultCircuitVo resultCircuitVo = circuitService.getByTransportationNo(updateCircuitVo.getTransportationNo(),user.getCompanyNo()); if (resultCircuitVo.getCircuitState() == 2) { // 线路已经结束
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"endCircuit"));
return gson.toJson(fb);
}
// 结束时间没有传则使用后台当前时间戳
if (updateCircuitVo.getEndTime()==null){
updateCircuitVo.setEndTime(System.currentTimeMillis());
}
//获取当前线路的gateway 和tdl信息 //获取当前线路的gateway 和tdl信息
TDLLogVo tdlLogVo = tdlLogService.getByTransportationNo(updateCircuitVo.getTransportationNo()); TDLLogVo tdlLogVo = tdlLogService.getByTransportationNo(updateCircuitVo.getTransportationNo());
if(tdlLogVo == null){ if(tdlLogVo == null){
......
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