|
|
@ -46,6 +46,8 @@ import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.Optional; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
@ -233,6 +235,23 @@ public class HFHandServiceImpl implements HFHandService { |
|
|
|
return resultJson; |
|
|
|
} |
|
|
|
|
|
|
|
String only_next_device_code = Optional.ofNullable(startDevice.getExtraValue().get("next_device_code")) |
|
|
|
.map(Objects::toString).orElse(null); |
|
|
|
if (only_next_device_code == null || only_next_device_code.length() <= 2) { |
|
|
|
resultJson.put("code", "0"); |
|
|
|
resultJson.put("desc", "起点'" + start_devicecode + "',驱动未配置定点任务中的下一点位!"); |
|
|
|
resultJson.put("result", ""); |
|
|
|
return resultJson; |
|
|
|
} |
|
|
|
|
|
|
|
JSONArray array = JSONArray.parseArray(only_next_device_code); |
|
|
|
if (!array.contains(next_devicecode)) { |
|
|
|
resultJson.put("code", "0"); |
|
|
|
resultJson.put("desc", "起点'" + start_devicecode + "',驱动配置的定点任务中的下一点位中的点位信息不包含该终点!"); |
|
|
|
resultJson.put("result", ""); |
|
|
|
return resultJson; |
|
|
|
} |
|
|
|
|
|
|
|
//判断起点有货,终点为空
|
|
|
|
if (0 == startDevice.getHas_goods() || "1".equals(startDevice.getIslock())) { |
|
|
|
resultJson.put("code", "0"); |
|
|
|