fix: 修复缓存线盘点功能
This commit is contained in:
@@ -345,9 +345,10 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
if(ObjectUtil.isEmpty(meObj)) {
|
if(ObjectUtil.isEmpty(meObj)) {
|
||||||
throw new BadRequestException("物料查询错误,请检查物料");
|
throw new BadRequestException("物料查询错误,请检查物料");
|
||||||
}
|
}
|
||||||
|
String materialId = meObj.getString("material_id");
|
||||||
vehiobj.put("vehicle_code", vehicle_code);
|
vehiobj.put("vehicle_code", vehicle_code);
|
||||||
//2.缓存线位置通过扫码绑定料箱条码
|
//2.缓存线位置通过扫码绑定料箱条码
|
||||||
positionTab.update(vehiobj);
|
positionTab.update(vehiobj, "position_code = '" + position_code + "'");
|
||||||
// 缓存线载具物料表
|
// 缓存线载具物料表
|
||||||
WQLObject ivtTab = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
WQLObject ivtTab = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||||
//3.先删除料箱的所有关联信息,包括物料,工序,生产区域
|
//3.先删除料箱的所有关联信息,包括物料,工序,生产区域
|
||||||
@@ -357,12 +358,9 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
json.put("vehmaterial_id", IdUtil.getStringId());
|
json.put("vehmaterial_id", IdUtil.getStringId());
|
||||||
json.put("vehicle_code", vehicle_code);
|
json.put("vehicle_code", vehicle_code);
|
||||||
json.put("cacheLine_code", cacheLine_code);
|
json.put("cacheLine_code", cacheLine_code);
|
||||||
json.put("material_id", meObj.getString("material_id"));
|
json.put("material_id", materialId);
|
||||||
json.put("material_code", meObj.getString("material_code"));
|
|
||||||
json.put("material_spec", meObj.getString("material_spec"));
|
|
||||||
json.put("material_name", meObj.getString("material_name"));
|
|
||||||
json.put("weight", weight);
|
|
||||||
json.put("quantity", quantity);
|
json.put("quantity", quantity);
|
||||||
|
json.put("weight", weight);
|
||||||
// json.put("workprocedure_code", wpObj.getString("workprocedure_code"));
|
// json.put("workprocedure_code", wpObj.getString("workprocedure_code"));
|
||||||
// json.put("workprocedure_name", wpObj.getString("workprocedure_name"));
|
// json.put("workprocedure_name", wpObj.getString("workprocedure_name"));
|
||||||
//有箱有料
|
//有箱有料
|
||||||
@@ -382,6 +380,8 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
String position_code = param.getString("position_code");
|
String position_code = param.getString("position_code");
|
||||||
// 载具条码
|
// 载具条码
|
||||||
String vehicle_code = param.getString("vehicle_code");
|
String vehicle_code = param.getString("vehicle_code");
|
||||||
|
// 缓存线
|
||||||
|
String wcsdevice_code = param.getString("wcsdevice_code");
|
||||||
// 缓存线载具物料表
|
// 缓存线载具物料表
|
||||||
WQLObject ivtTab = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
WQLObject ivtTab = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||||
// 缓存线位置表
|
// 缓存线位置表
|
||||||
@@ -392,9 +392,13 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
}
|
}
|
||||||
//1.缓存线位置通过扫码绑定料箱条码
|
//1.缓存线位置通过扫码绑定料箱条码
|
||||||
vehiobj.put("vehicle_code", vehicle_code);
|
vehiobj.put("vehicle_code", vehicle_code);
|
||||||
positionTab.update(vehiobj);
|
positionTab.update(vehiobj, "position_code = '" + position_code + "'");
|
||||||
//2.清空
|
//2.先删除料箱的所有关联信息,包括物料,工序,生产区域
|
||||||
JSONObject json = ivtTab.query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
ivtTab.delete("vehicle_code = '" + vehicle_code + "'");
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("vehmaterial_id", IdUtil.getStringId());
|
||||||
|
json.put("vehicle_code", vehicle_code);
|
||||||
|
json.put("cacheLine_code", wcsdevice_code);
|
||||||
json.put("vehicle_status", StatusEnum.CACHE_VEL_EMT.getCode());
|
json.put("vehicle_status", StatusEnum.CACHE_VEL_EMT.getCode());
|
||||||
json.put("material_id", "");
|
json.put("material_id", "");
|
||||||
json.put("material_code", "");
|
json.put("material_code", "");
|
||||||
@@ -404,8 +408,9 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
json.put("quantity", "0");
|
json.put("quantity", "0");
|
||||||
json.put("workprocedure_code", "");
|
json.put("workprocedure_code", "");
|
||||||
json.put("workprocedure_name", "");
|
json.put("workprocedure_name", "");
|
||||||
json.put("update_time", DateUtil.now());
|
json.put("create_time", DateUtil.now());
|
||||||
ivtTab.update(json);
|
// 3.重新新建该缓存线位置上的料箱为空箱子,是空料箱没有放物料等其他信息
|
||||||
|
ivtTab.insert(json);
|
||||||
JSONObject res = new JSONObject();
|
JSONObject res = new JSONObject();
|
||||||
res.put("message", "设置成功");
|
res.put("message", "设置成功");
|
||||||
return res;
|
return res;
|
||||||
@@ -830,7 +835,9 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
// 指令标识
|
// 指令标识
|
||||||
String instruct_uuid = param.getString("instruct_uuid");
|
String instruct_uuid = param.getString("instruct_uuid");
|
||||||
// 指令点位表【sch_base_task】
|
// 指令点位表【sch_base_task】
|
||||||
JSONObject instObj = WQLObject.getWQLObject("sch_base_task").query("task_id = '" + instruct_uuid + "'").uniqueResult(0);
|
JSONObject instObj = WQLObject.getWQLObject("sch_base_task")
|
||||||
|
.query("task_id = '" + instruct_uuid + "'")
|
||||||
|
.uniqueResult(0);
|
||||||
int putquantity = instObj.getInteger("material_qty");
|
int putquantity = instObj.getInteger("material_qty");
|
||||||
String producer = instObj.getString("point_code2");
|
String producer = instObj.getString("point_code2");
|
||||||
JSONArray jsonArray = new JSONArray();
|
JSONArray jsonArray = new JSONArray();
|
||||||
@@ -856,7 +863,10 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
|||||||
public JSONArray getCacheLine(JSONObject param) {
|
public JSONArray getCacheLine(JSONObject param) {
|
||||||
// 生产区域
|
// 生产区域
|
||||||
String product_area = param.getString("product_area");
|
String product_area = param.getString("product_area");
|
||||||
JSONArray resultJSONArray = WQL.getWO("PDA_QUERY").addParamMap(MapOf.of("flag", "7", "product_area", product_area)).process().getResultJSONArray(0);
|
JSONArray resultJSONArray = WQL.getWO("PDA_QUERY")
|
||||||
|
.addParamMap(MapOf.of("flag", "7", "product_area", product_area))
|
||||||
|
.process()
|
||||||
|
.getResultJSONArray(0);
|
||||||
return resultJSONArray;
|
return resultJSONArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,15 +189,16 @@
|
|||||||
sch_cacheline_vehilematerial.workprocedure_code,
|
sch_cacheline_vehilematerial.workprocedure_code,
|
||||||
sch_cacheline_vehilematerial.workprocedure_name,
|
sch_cacheline_vehilematerial.workprocedure_name,
|
||||||
sch_cacheline_vehilematerial.material_id as material_uuid,
|
sch_cacheline_vehilematerial.material_id as material_uuid,
|
||||||
sch_cacheline_vehilematerial.material_code,
|
md_me_materialbase.material_code,
|
||||||
sch_cacheline_vehilematerial.material_name,
|
md_me_materialbase.material_name,
|
||||||
sch_cacheline_vehilematerial.material_spec,
|
md_me_materialbase.material_spec,
|
||||||
sch_cacheline_vehilematerial.quantity,
|
sch_cacheline_vehilematerial.quantity,
|
||||||
sch_cacheline_vehilematerial.weight,
|
sch_cacheline_vehilematerial.weight,
|
||||||
IF(length(sch_cacheline_position.vehicle_code) > 0, IFNULL(sch_cacheline_vehilematerial.vehicle_status, 4), 5) AS vehicle_status
|
IF(length(sch_cacheline_position.vehicle_code) > 0, IFNULL(sch_cacheline_vehilematerial.vehicle_status, 4), 5) AS vehicle_status
|
||||||
FROM
|
FROM
|
||||||
sch_cacheline_position
|
sch_cacheline_position
|
||||||
LEFT JOIN sch_cacheline_vehilematerial ON sch_cacheline_position.vehicle_code = sch_cacheline_vehilematerial.vehicle_code
|
LEFT JOIN sch_cacheline_vehilematerial ON sch_cacheline_position.vehicle_code = sch_cacheline_vehilematerial.vehicle_code
|
||||||
|
LEFT JOIN md_me_materialbase ON md_me_materialbase.material_id = sch_cacheline_vehilematerial.material_id
|
||||||
WHERE
|
WHERE
|
||||||
1 = 1
|
1 = 1
|
||||||
OPTION 输入.product_area <> ""
|
OPTION 输入.product_area <> ""
|
||||||
|
|||||||
Reference in New Issue
Block a user