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

Merge branch 'tdl_bosch_carit' into 'tdl_bosch'

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

See merge request !5
parents 6fd17789 b4298805
Pipeline #631 passed with stage
in 0 seconds
......@@ -16,7 +16,7 @@ public class CircuitResultVo {
private Long endTime;
private Integer circuitState;
private Integer circuitState; // 0: 未开始, 1: 运输中, 2: 完成
private String alarmType;
......
......@@ -1223,20 +1223,27 @@ public class CircuitController {
fb.setMessage(i18n.getMessage(request,"transportationNo"));
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.setMessage(i18n.getMessage(request,"noCircuit"));
return gson.toJson(fb);
}
if (updateCircuitVo.getEndTime()==null){
updateCircuitVo.setEndTime(System.currentTimeMillis());
}
if (circuitService.getByTransportationNo(updateCircuitVo.getTransportationNo(),user.getCompanyNo()).getCircuitState() ==0){
if (resultCircuitVo.getCircuitState() == 0) { // 线路还未开始
fb.setCode(0);
fb.setMessage(i18n.getMessage(request,"notStarted"));
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信息
TDLLogVo tdlLogVo = tdlLogService.getByTransportationNo(updateCircuitVo.getTransportationNo());
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