代码更新

This commit is contained in:
lyd
2022-11-02 16:25:50 +08:00
parent d1661c9fe2
commit 0b07a1e985
3 changed files with 47 additions and 21 deletions

View File

@@ -38,26 +38,35 @@ public class KilnServiceImpl implements KilnService {
@Override
public void update(JSONObject jsonObject) {
// 基础信息
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getNickName();
String now = DateUtil.now();
// 公用信息
String stockrecordId = jsonObject.getString("stockrecord_id");
String material_id = jsonObject.getString("material_id");
String vehicle_code = jsonObject.getString("vehicle_code");
String point_status = jsonObject.getString("point_status");
String ivt_qty = jsonObject.getString("ivt_qty");
String is_full = jsonObject.getString("is_full");
// wql表结构
WQLObject structIvtTab = WQLObject.getWQLObject("ST_IVT_StructIvt");
WQLObject vehicleGroupTab = WQLObject.getWQLObject("st_buss_vehiclegroup");
WQLObject materialTab = WQLObject.getWQLObject("MD_ME_Material");
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
JSONObject vehicleGroupObj = null;
// 共用对象
JSONObject vehicleGroupObj = null; // 组盘信息
if (ObjectUtil.isNotEmpty(vehicle_code)) {
vehicleGroupObj = vehicleGroupTab.query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
}
JSONObject materialObj = null; // 物料信息
if (ObjectUtil.isNotEmpty(material_id)) { // 获取物料对象
materialObj = materialTab.query("material_id = '" + jsonObject.getString("material_id") + "'").uniqueResult(0);
}
// 判断状态
if (point_status.equals("00")) { // 空位
// 删除仓位库存
structIvtTab.delete("struct_id = '" + jsonObject.getString("struct_id") + "'");
@@ -71,10 +80,10 @@ public class KilnServiceImpl implements KilnService {
structIvt.put("stockrecord_id", IdUtil.getSnowflake(1, 1).nextId());
structIvt.put("struct_id", jsonObject.getString("struct_id"));
if (ObjectUtil.isNotEmpty(vehicle_code))
structIvt.put("vehicle_code", jsonObject.getString("vehicle_code"));
structIvt.put("vehicle_code", vehicle_code);
structIvt.put("workprocedure_id", jsonObject.getString("workprocedure_id"));
if (ObjectUtil.isNotEmpty(material_id))
structIvt.put("material_id", jsonObject.getString("material_id"));
structIvt.put("material_id", material_id);
structIvt.put("producetask_id", jsonObject.getString("producetask_id"));
if (ObjectUtil.isNotEmpty(jsonObject.getString("ivt_qty"))) {
structIvt.put("canuse_qty", ivt_qty);
@@ -82,19 +91,24 @@ public class KilnServiceImpl implements KilnService {
}
structIvt.put("frozen_qty", 0);
structIvt.put("warehousing_qty", 0);
structIvt.put("is_full", 0);
structIvt.put("is_full", is_full);
if (ObjectUtil.isNotEmpty(materialObj))
structIvt.put("stewing_time", materialObj.getString("stewing_time"));
structIvtTab.insert(structIvt);
} else { // 不为空就修改
JSONObject structIvt = structIvtTab.query("stockrecord_id = '" + stockrecordId + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(vehicle_code))
structIvt.put("vehicle_code", jsonObject.getString("vehicle_code"));
structIvt.put("vehicle_code", vehicle_code);
if (ObjectUtil.isNotEmpty(material_id))
structIvt.put("material_id", jsonObject.getString("material_id"));
structIvt.put("material_id", material_id);
structIvt.put("producetask_id", jsonObject.getString("producetask_id"));
if (ObjectUtil.isNotEmpty(jsonObject.getString("ivt_qty"))) {
if (ObjectUtil.isNotEmpty(ivt_qty)) {
structIvt.put("canuse_qty", ivt_qty);
structIvt.put("ivt_qty", ivt_qty);
}
if (ObjectUtil.isNotEmpty(materialObj))
structIvt.put("stewing_time", materialObj.getString("stewing_time"));
structIvt.put("is_full", is_full);
structIvtTab.update(structIvt);
}
// 组盘表
@@ -104,14 +118,11 @@ public class KilnServiceImpl implements KilnService {
vehicleGroup.put("group_id", IdUtil.getSnowflake(1, 1).nextId());
vehicleGroup.put("vehicle_code", vehicle_code);
vehicleGroup.put("is_autopackage", 1);
if (ObjectUtil.isNotEmpty(material_id)) {
vehicleGroup.put("material_id", jsonObject.getString("material_id"));
JSONObject material = materialTab.query("material_id = '" + jsonObject.getString("material_id") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(material)) {
vehicleGroup.put("material_code", material.getString("material_code"));
vehicleGroup.put("material_name", material.getString("material_name"));
vehicleGroup.put("material_spec", material.getString("material_spec"));
}
if (ObjectUtil.isNotEmpty(materialObj)) {
vehicleGroup.put("material_id", materialObj.getString("material_id"));
vehicleGroup.put("material_code", materialObj.getString("material_code"));
vehicleGroup.put("material_name", materialObj.getString("material_name"));
vehicleGroup.put("material_spec", materialObj.getString("material_spec"));
}
vehicleGroup.put("task_id", IdUtil.simpleUUID());
vehicleGroup.put("create_id", currentUserId);
@@ -123,7 +134,7 @@ public class KilnServiceImpl implements KilnService {
vehicleGroup.put("producetask_id", jsonObject.getString("producetask_id"));
vehicleGroup.put("device_id", jsonObject.getString("device_id"));
vehicleGroup.put("qty", ivt_qty);
vehicleGroup.put("is_full", "1");
vehicleGroup.put("is_full", is_full);
vehicleGroup.put("material_move_id", IdUtil.simpleUUID());
vehicleGroupTab.insert(vehicleGroup);
}
@@ -131,6 +142,7 @@ public class KilnServiceImpl implements KilnService {
JSONObject point = pointTab.query("point_id = '" + jsonObject.getString("point_id") + "'").uniqueResult(0);
point.put("point_status", point_status);
point.put("lock_type", jsonObject.getString("lock_type"));
point.put("vehicle_code", jsonObject.getString("vehicle_code"));
pointTab.update(point);
}
}

View File

@@ -48,6 +48,7 @@
structattr.struct_id,
structivt.stockrecord_id,
structivt.material_id,
structivt.is_full,
material.material_name
FROM
sch_base_point point