代码更新
This commit is contained in:
@@ -38,26 +38,35 @@ public class KilnServiceImpl implements KilnService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(JSONObject jsonObject) {
|
public void update(JSONObject jsonObject) {
|
||||||
|
// 基础信息
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getNickName();
|
String nickName = SecurityUtils.getNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
|
// 公用信息
|
||||||
String stockrecordId = jsonObject.getString("stockrecord_id");
|
String stockrecordId = jsonObject.getString("stockrecord_id");
|
||||||
String material_id = jsonObject.getString("material_id");
|
String material_id = jsonObject.getString("material_id");
|
||||||
String vehicle_code = jsonObject.getString("vehicle_code");
|
String vehicle_code = jsonObject.getString("vehicle_code");
|
||||||
String point_status = jsonObject.getString("point_status");
|
String point_status = jsonObject.getString("point_status");
|
||||||
String ivt_qty = jsonObject.getString("ivt_qty");
|
String ivt_qty = jsonObject.getString("ivt_qty");
|
||||||
|
String is_full = jsonObject.getString("is_full");
|
||||||
|
// wql表结构
|
||||||
WQLObject structIvtTab = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
WQLObject structIvtTab = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||||
WQLObject vehicleGroupTab = WQLObject.getWQLObject("st_buss_vehiclegroup");
|
WQLObject vehicleGroupTab = WQLObject.getWQLObject("st_buss_vehiclegroup");
|
||||||
WQLObject materialTab = WQLObject.getWQLObject("MD_ME_Material");
|
WQLObject materialTab = WQLObject.getWQLObject("MD_ME_Material");
|
||||||
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
|
WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||||
|
// 共用对象
|
||||||
JSONObject vehicleGroupObj = null;
|
JSONObject vehicleGroupObj = null; // 组盘信息
|
||||||
if (ObjectUtil.isNotEmpty(vehicle_code)) {
|
if (ObjectUtil.isNotEmpty(vehicle_code)) {
|
||||||
vehicleGroupObj = vehicleGroupTab.query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
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")) { // 空位
|
if (point_status.equals("00")) { // 空位
|
||||||
// 删除仓位库存
|
// 删除仓位库存
|
||||||
structIvtTab.delete("struct_id = '" + jsonObject.getString("struct_id") + "'");
|
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("stockrecord_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
structIvt.put("struct_id", jsonObject.getString("struct_id"));
|
structIvt.put("struct_id", jsonObject.getString("struct_id"));
|
||||||
if (ObjectUtil.isNotEmpty(vehicle_code))
|
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"));
|
structIvt.put("workprocedure_id", jsonObject.getString("workprocedure_id"));
|
||||||
if (ObjectUtil.isNotEmpty(material_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"));
|
structIvt.put("producetask_id", jsonObject.getString("producetask_id"));
|
||||||
if (ObjectUtil.isNotEmpty(jsonObject.getString("ivt_qty"))) {
|
if (ObjectUtil.isNotEmpty(jsonObject.getString("ivt_qty"))) {
|
||||||
structIvt.put("canuse_qty", ivt_qty);
|
structIvt.put("canuse_qty", ivt_qty);
|
||||||
@@ -82,19 +91,24 @@ public class KilnServiceImpl implements KilnService {
|
|||||||
}
|
}
|
||||||
structIvt.put("frozen_qty", 0);
|
structIvt.put("frozen_qty", 0);
|
||||||
structIvt.put("warehousing_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);
|
structIvtTab.insert(structIvt);
|
||||||
} else { // 不为空就修改
|
} else { // 不为空就修改
|
||||||
JSONObject structIvt = structIvtTab.query("stockrecord_id = '" + stockrecordId + "'").uniqueResult(0);
|
JSONObject structIvt = structIvtTab.query("stockrecord_id = '" + stockrecordId + "'").uniqueResult(0);
|
||||||
if (ObjectUtil.isNotEmpty(vehicle_code))
|
if (ObjectUtil.isNotEmpty(vehicle_code))
|
||||||
structIvt.put("vehicle_code", jsonObject.getString("vehicle_code"));
|
structIvt.put("vehicle_code", vehicle_code);
|
||||||
if (ObjectUtil.isNotEmpty(material_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"));
|
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("canuse_qty", ivt_qty);
|
||||||
structIvt.put("ivt_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);
|
structIvtTab.update(structIvt);
|
||||||
}
|
}
|
||||||
// 组盘表
|
// 组盘表
|
||||||
@@ -104,14 +118,11 @@ public class KilnServiceImpl implements KilnService {
|
|||||||
vehicleGroup.put("group_id", IdUtil.getSnowflake(1, 1).nextId());
|
vehicleGroup.put("group_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||||
vehicleGroup.put("vehicle_code", vehicle_code);
|
vehicleGroup.put("vehicle_code", vehicle_code);
|
||||||
vehicleGroup.put("is_autopackage", 1);
|
vehicleGroup.put("is_autopackage", 1);
|
||||||
if (ObjectUtil.isNotEmpty(material_id)) {
|
if (ObjectUtil.isNotEmpty(materialObj)) {
|
||||||
vehicleGroup.put("material_id", jsonObject.getString("material_id"));
|
vehicleGroup.put("material_id", materialObj.getString("material_id"));
|
||||||
JSONObject material = materialTab.query("material_id = '" + jsonObject.getString("material_id") + "'").uniqueResult(0);
|
vehicleGroup.put("material_code", materialObj.getString("material_code"));
|
||||||
if (ObjectUtil.isNotEmpty(material)) {
|
vehicleGroup.put("material_name", materialObj.getString("material_name"));
|
||||||
vehicleGroup.put("material_code", material.getString("material_code"));
|
vehicleGroup.put("material_spec", materialObj.getString("material_spec"));
|
||||||
vehicleGroup.put("material_name", material.getString("material_name"));
|
|
||||||
vehicleGroup.put("material_spec", material.getString("material_spec"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
vehicleGroup.put("task_id", IdUtil.simpleUUID());
|
vehicleGroup.put("task_id", IdUtil.simpleUUID());
|
||||||
vehicleGroup.put("create_id", currentUserId);
|
vehicleGroup.put("create_id", currentUserId);
|
||||||
@@ -123,7 +134,7 @@ public class KilnServiceImpl implements KilnService {
|
|||||||
vehicleGroup.put("producetask_id", jsonObject.getString("producetask_id"));
|
vehicleGroup.put("producetask_id", jsonObject.getString("producetask_id"));
|
||||||
vehicleGroup.put("device_id", jsonObject.getString("device_id"));
|
vehicleGroup.put("device_id", jsonObject.getString("device_id"));
|
||||||
vehicleGroup.put("qty", ivt_qty);
|
vehicleGroup.put("qty", ivt_qty);
|
||||||
vehicleGroup.put("is_full", "1");
|
vehicleGroup.put("is_full", is_full);
|
||||||
vehicleGroup.put("material_move_id", IdUtil.simpleUUID());
|
vehicleGroup.put("material_move_id", IdUtil.simpleUUID());
|
||||||
vehicleGroupTab.insert(vehicleGroup);
|
vehicleGroupTab.insert(vehicleGroup);
|
||||||
}
|
}
|
||||||
@@ -131,6 +142,7 @@ public class KilnServiceImpl implements KilnService {
|
|||||||
JSONObject point = pointTab.query("point_id = '" + jsonObject.getString("point_id") + "'").uniqueResult(0);
|
JSONObject point = pointTab.query("point_id = '" + jsonObject.getString("point_id") + "'").uniqueResult(0);
|
||||||
point.put("point_status", point_status);
|
point.put("point_status", point_status);
|
||||||
point.put("lock_type", jsonObject.getString("lock_type"));
|
point.put("lock_type", jsonObject.getString("lock_type"));
|
||||||
|
point.put("vehicle_code", jsonObject.getString("vehicle_code"));
|
||||||
pointTab.update(point);
|
pointTab.update(point);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
structattr.struct_id,
|
structattr.struct_id,
|
||||||
structivt.stockrecord_id,
|
structivt.stockrecord_id,
|
||||||
structivt.material_id,
|
structivt.material_id,
|
||||||
|
structivt.is_full,
|
||||||
material.material_name
|
material.material_name
|
||||||
FROM
|
FROM
|
||||||
sch_base_point point
|
sch_base_point point
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
<el-input v-model="form.ivt_qty" style="width: 370px;" />
|
<el-input v-model="form.ivt_qty" style="width: 370px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="锁定类型" prop="lock_type">
|
<el-form-item label="锁定类型" prop="lock_type">
|
||||||
<el-select v-model="form.lock_type" filterable placeholder="请选择" style="width: 370px">
|
<el-select v-model="form.lock_type" filterable placeholder="请选择" style="width: 370px">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dict.sch_lock_type"
|
v-for="item in dict.sch_lock_type"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@@ -116,6 +116,16 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="是否满拖" prop="is_full">
|
||||||
|
<el-select v-model="form.is_full" filterable placeholder="请选择" style="width: 370px">
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.is_active"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
@@ -191,7 +201,7 @@ export default {
|
|||||||
name: 'InKiln',
|
name: 'InKiln',
|
||||||
components: { WorkDialog, pagination, crudOperation, rrOperation, udOperation },
|
components: { WorkDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
dicts: ['sch_area_type', 'sch_point_type', 'sch_point_status', 'sch_lock_type'],
|
dicts: ['sch_area_type', 'sch_point_type', 'sch_point_status', 'sch_lock_type', 'is_active'],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
title: '入窑缓存库区',
|
title: '入窑缓存库区',
|
||||||
@@ -233,6 +243,9 @@ export default {
|
|||||||
],
|
],
|
||||||
lock_type: [
|
lock_type: [
|
||||||
{ required: true, message: '锁定类型不能为空', trigger: 'blur' }
|
{ required: true, message: '锁定类型不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
is_full: [
|
||||||
|
{ required: true, message: '是否满拖不能为空', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
}}
|
}}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user