嘉耐项目更新
This commit is contained in:
@@ -13,45 +13,52 @@ import org.springframework.http.HttpStatus;
|
||||
|
||||
public class PointUpdateUtil {
|
||||
public static void updatePoint(JSONArray arr) {
|
||||
WmsToAcsServiceImpl wmsToAcsServiceImpl = new WmsToAcsServiceImpl();
|
||||
String isConnect = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("IS_CONNECT_ACS").getValue();
|
||||
if (StrUtil.equals("0", isConnect)) {
|
||||
return;
|
||||
}
|
||||
JSONObject joo = wmsToAcsServiceImpl.queryPointStatus(arr);
|
||||
JSONArray pointarr = joo.getJSONArray("data");
|
||||
//JSONArray pointarr =new JSONArray();
|
||||
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
|
||||
for (int i = 0; i < pointarr.size(); i++) {
|
||||
JSONObject pointjo = pointarr.getJSONObject(i);
|
||||
//String point_status = "00";
|
||||
String mode = pointjo.getString("mode");
|
||||
String point_status = "0" + pointjo.getString("move");
|
||||
//String vehicle_code = pointjo.getString("vehicle_code");
|
||||
String vehicle_code = pointjo.getString("barcode");
|
||||
String device_code = pointjo.getString("device_code");
|
||||
//物料类型
|
||||
String weight = pointjo.getString("weight");
|
||||
//物料
|
||||
String material_code = pointjo.getString("material");
|
||||
//将托盘类型123,改为 03,04,05,默认给01
|
||||
String pallet_type = "01";
|
||||
if (!StrUtil.equals("0", pointjo.getString("pallet_type"))) {
|
||||
pallet_type = "0" + (pointjo.getIntValue("pallet_type") + 2);
|
||||
new Thread(() -> {
|
||||
try {
|
||||
WmsToAcsServiceImpl wmsToAcsServiceImpl = new WmsToAcsServiceImpl();
|
||||
JSONObject joo = wmsToAcsServiceImpl.queryPointStatus(arr);
|
||||
JSONArray pointarr = joo.getJSONArray("data");
|
||||
//JSONArray pointarr =new JSONArray();
|
||||
WQLObject pointTable = WQLObject.getWQLObject("sch_base_point");
|
||||
for (int i = 0; i < pointarr.size(); i++) {
|
||||
JSONObject pointjo = pointarr.getJSONObject(i);
|
||||
//String point_status = "00";
|
||||
String mode = pointjo.getString("mode");
|
||||
String point_status = "0" + pointjo.getString("move");
|
||||
//String vehicle_code = pointjo.getString("vehicle_code");
|
||||
String vehicle_code = pointjo.getString("barcode");
|
||||
String device_code = pointjo.getString("device_code");
|
||||
//物料类型
|
||||
String weight = pointjo.getString("weight");
|
||||
//物料
|
||||
String material_code = pointjo.getString("material");
|
||||
//将托盘类型123,改为 03,04,05,默认给01
|
||||
String pallet_type = "01";
|
||||
if (!StrUtil.equals("0", pointjo.getString("pallet_type"))) {
|
||||
pallet_type = "0" + (pointjo.getIntValue("pallet_type") + 2);
|
||||
}
|
||||
pointjo.put("point_status", point_status);
|
||||
if (StrUtil.equals(vehicle_code, "0")) {
|
||||
vehicle_code = "";
|
||||
}
|
||||
JSONObject pointObj = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0);
|
||||
pointObj.put("vehicle_code", vehicle_code);
|
||||
pointObj.put("point_status", point_status);
|
||||
pointObj.put("vehicle_type", pallet_type);
|
||||
pointObj.put("material_type", weight);
|
||||
pointObj.put("material_code", material_code);
|
||||
pointObj.put("mode", mode);
|
||||
pointTable.update(pointObj);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
pointjo.put("point_status", point_status);
|
||||
if (StrUtil.equals(vehicle_code, "0")) {
|
||||
vehicle_code = "";
|
||||
}
|
||||
JSONObject pointObj = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0);
|
||||
pointObj.put("vehicle_code", vehicle_code);
|
||||
pointObj.put("point_status", point_status);
|
||||
pointObj.put("vehicle_type", pallet_type);
|
||||
pointObj.put("material_type", weight);
|
||||
pointObj.put("material_code", material_code);
|
||||
pointObj.put("mode", mode);
|
||||
pointTable.update(pointObj);
|
||||
}
|
||||
}).start();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user