|
@ -873,21 +873,11 @@ public class AMHandServiceImpl implements AMHandService { |
|
|
jo.put("desc", "呼叫失败,起点或终点不能为空!"); |
|
|
jo.put("desc", "呼叫失败,起点或终点不能为空!"); |
|
|
return jo; |
|
|
return jo; |
|
|
} |
|
|
} |
|
|
for (int i = 0; i < start_device_codes.size(); i++) { |
|
|
if (start_device_codes.size() > 2) { |
|
|
String device_code = start_device_codes.getString(i); |
|
|
throw new BadRequestException("起点个数不能大于2!"); |
|
|
Device device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
|
|
JSONObject jsonObject = wo_runPoint.query("device_code = '" + device_code + "'").uniqueResult(0); |
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject)){ |
|
|
|
|
|
String hasgoods = jsonObject.getString("hasgoods"); |
|
|
|
|
|
if (StrUtil.equals(hasgoods,"0")){ |
|
|
|
|
|
throw new BadRequestException("设备:" + device_code + "库存为无货状态,请手动绑定货物!"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
if (start_device_codes.size() == 2) { |
|
|
} |
|
|
|
|
|
//将数组转换为集合判断是否为同一排的库位,并按照库位顺序号排序
|
|
|
//将数组转换为集合判断是否为同一排的库位,并按照库位顺序号排序
|
|
|
List<String> start_device_code_list = JSONArray.parseArray(start_device_codes.toJSONString(), String.class); |
|
|
List<String> start_device_code_list = JSONArray.parseArray(start_device_codes.toJSONString(), String.class); |
|
|
Collections.sort(start_device_code_list, new Comparator<String>() { |
|
|
Collections.sort(start_device_code_list, new Comparator<String>() { |
|
@ -908,7 +898,40 @@ public class AMHandServiceImpl implements AMHandService { |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
start_device_codes = JSONArray.parseArray(JSON.toJSONString(start_device_code_list)); |
|
|
String s = start_device_code_list.get(0); |
|
|
|
|
|
String e = start_device_code_list.get(1); |
|
|
|
|
|
String row_num = s.split("_")[0]; |
|
|
|
|
|
int s_col_num = Integer.parseInt(s.split("_")[s.split("_").length - 1]); |
|
|
|
|
|
int e_col_num = Integer.parseInt(e.split("_")[e.split("_").length - 1]); |
|
|
|
|
|
start_device_codes = new JSONArray(); |
|
|
|
|
|
// start_device_codes = JSONArray.parseArray(JSON.toJSONString(start_device_code_list));
|
|
|
|
|
|
for (int i = s_col_num; i <= e_col_num; i++) { |
|
|
|
|
|
String col_num = ""; |
|
|
|
|
|
if (i < 10){ |
|
|
|
|
|
col_num = "0" + i; |
|
|
|
|
|
} else { |
|
|
|
|
|
col_num = String.valueOf(i); |
|
|
|
|
|
} |
|
|
|
|
|
String point_code = row_num + "_" + col_num; |
|
|
|
|
|
start_device_codes.add(point_code); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < start_device_codes.size(); i++) { |
|
|
|
|
|
String device_code = start_device_codes.getString(i); |
|
|
|
|
|
Device device = deviceAppService.findDeviceByCode(device_code); |
|
|
|
|
|
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { |
|
|
|
|
|
JSONObject jsonObject = wo_runPoint.query("device_code = '" + device_code + "'").uniqueResult(0); |
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonObject)) { |
|
|
|
|
|
String hasgoods = jsonObject.getString("hasgoods"); |
|
|
|
|
|
if (StrUtil.equals(hasgoods, "0")) { |
|
|
|
|
|
throw new BadRequestException("设备:" + device_code + "库存为无货状态,请手动绑定货物!"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int start_size = start_device_codes.size(); |
|
|
int start_size = start_device_codes.size(); |
|
|
if (start_size > 0) { |
|
|
if (start_size > 0) { |
|
|
//获取起点点位数组的第一个点位
|
|
|
//获取起点点位数组的第一个点位
|
|
|