缓存线pad接口更新
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
package org.nl.wms.pda.rest;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -20,7 +19,6 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -122,8 +120,6 @@ public class CacheLineHandController{
|
||||
return RestBusinessTemplate.execute(() -> cacheLineHandService.cacheLineMaterInfoQuery(param));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/inOutEmptyBox")
|
||||
@Log("空箱初始化--出入空箱")
|
||||
@ApiOperation("空箱初始化--出入空箱")
|
||||
@@ -134,7 +130,6 @@ public class CacheLineHandController{
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/inOutExceptionInstQuery")
|
||||
@Log("缓存线出入箱异常指令查询")
|
||||
@ApiOperation("缓存线出入箱异常指令查询")
|
||||
@@ -143,10 +138,6 @@ public class CacheLineHandController{
|
||||
return RestBusinessTemplate.execute(() -> cacheLineHandService.inOutExceptionInstQuery(param));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/inOutExceptionInstConfirm")
|
||||
@Log("缓存线出入箱异常指令确认")
|
||||
@ApiOperation("缓存线出入箱异常指令确认")
|
||||
@@ -167,8 +158,6 @@ public class CacheLineHandController{
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/setEmptyBox")
|
||||
@Log("设置空框")
|
||||
@ApiOperation("设置空框")
|
||||
@@ -179,9 +168,6 @@ public class CacheLineHandController{
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/agvInBoxExceptionQuery")
|
||||
@Log("AGV入箱异常-查询")
|
||||
@ApiOperation("AGV入箱异常-查询")
|
||||
@@ -190,8 +176,6 @@ public class CacheLineHandController{
|
||||
return RestBusinessTemplate.execute(() -> cacheLineHandService.agvInBoxExceptionQuery(param));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/agvInBoxExceptionConfirm")
|
||||
@Log("AGV入箱异常-确认")
|
||||
@ApiOperation("AGV入箱异常-确认")
|
||||
@@ -202,12 +186,6 @@ public class CacheLineHandController{
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/agvOutBoxExceptionQuery")
|
||||
@Log("AGV出箱异常-查询")
|
||||
@ApiOperation("AGV出箱异常-查询")
|
||||
@@ -216,7 +194,6 @@ public class CacheLineHandController{
|
||||
return RestBusinessTemplate.execute(() -> cacheLineHandService.agvOutBoxExceptionQuery(param));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/agvOutBoxExceptionConfirm")
|
||||
@Log("AGV出箱异常-确认")
|
||||
@ApiOperation("AGV出箱异常-确认")
|
||||
@@ -237,7 +214,6 @@ public class CacheLineHandController{
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/setBlankPos")
|
||||
@Log("设置缓存线货位为空位置")
|
||||
@ApiOperation("设置缓存线货位为空位置")
|
||||
@@ -248,7 +224,6 @@ public class CacheLineHandController{
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/cacheLineOutBoxExceptionQuery")
|
||||
@Log("缓存线出箱异常-查询")
|
||||
@ApiOperation("缓存线出箱异常-查询")
|
||||
@@ -257,7 +232,6 @@ public class CacheLineHandController{
|
||||
return RestBusinessTemplate.execute(() -> cacheLineHandService.cacheLineOutBoxExceptionQuery(param));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/cacheLineExcepOpt")
|
||||
@Log("缓存线异常处理")
|
||||
@ApiOperation("缓存线异常处理")
|
||||
@@ -268,8 +242,6 @@ public class CacheLineHandController{
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/pourMaterial")
|
||||
@Log("倒料操作")
|
||||
@ApiOperation("倒料操作")
|
||||
@@ -279,6 +251,4 @@ public class CacheLineHandController{
|
||||
cacheLineHandService.pourMaterial(param);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package org.nl.wms.pda.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.pda.dto.MaterialDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -15,7 +14,6 @@ import org.nl.common.utils.LocalCache;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.exception.BizCoreException;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
@@ -194,70 +192,43 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
*/
|
||||
@Override
|
||||
public JSONArray cacheLineMaterInfoQuery(JSONObject param) {
|
||||
|
||||
WQLObject positionTab = WQLObject.getWQLObject("sch_cacheline_position");
|
||||
|
||||
|
||||
//获取缓存线位置信息
|
||||
JSONArray arr = positionTab
|
||||
.query("cacheLine_code like '%" + param.getString("cacheLine_code") + "%'", "layer_num desc,order_no")
|
||||
.getResultJSONArray(0);
|
||||
|
||||
|
||||
JSONArray arr = positionTab.query("cacheLine_code like '%" + param.getString("cacheLine_code") + "%'", "layer_num desc,order_no").getResultJSONArray(0);
|
||||
// 获取缓存线物料库存信息
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < arr.size(); i++)
|
||||
{
|
||||
|
||||
for(int i = 0; i < arr.size(); i++) {
|
||||
// 0 空位 status = 1: 绿色空箱 || status = 2:黄色满箱 || status = 3:红色异常 || status = 4 :不展示
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
|
||||
//料箱展示顺序号
|
||||
json.put("seat_order_num", json.getString("order_no"));
|
||||
|
||||
|
||||
//初始化料箱重量和数量
|
||||
json.put("weight", "0");
|
||||
json.put("quantity", "0");
|
||||
|
||||
//不展示
|
||||
if ("0".equals(json.getString("is_show")))
|
||||
{
|
||||
if("0".equals(json.getString("is_show"))) {
|
||||
json.put("vehicle_status", "04");
|
||||
}
|
||||
//展示
|
||||
else
|
||||
{
|
||||
else{
|
||||
//是否空位
|
||||
if ("1".equals(json.getString("is_empty")))
|
||||
{
|
||||
if("1".equals(json.getString("is_empty"))) {
|
||||
json.put("vehicle_status", "00");
|
||||
}
|
||||
else
|
||||
{
|
||||
else{
|
||||
// 载具不是空位
|
||||
String vehicle_code = json.getString("vehicle_code");
|
||||
//从缓存线物料库存中 根据缓存线编码和载具编码获取绑定信息
|
||||
JSONObject ivtObj =
|
||||
ivtTab.query("vehicle_code = '" + vehicle_code + "' and cacheLine_code like '%"
|
||||
+ param.getString("wcsdevice_code") + "%'").uniqueResult(0);
|
||||
|
||||
|
||||
if (ivtObj == null)
|
||||
{
|
||||
JSONObject ivtObj = ivtTab.query("vehicle_code = '" + vehicle_code + "' and cacheLine_code like '%" + param.getString("wcsdevice_code") + "%'").uniqueResult(0);
|
||||
if(ivtObj == null) {
|
||||
//标记为红色异常
|
||||
json.put("vehicle_status", "03");
|
||||
}
|
||||
else
|
||||
{
|
||||
else{
|
||||
json.put("vehicle_status", ivtObj.getString("vehicle_status"));
|
||||
json.put("weight", ivtObj.getString("weight"));
|
||||
json.put("quantity", ivtObj.getString("quantity"));
|
||||
json.putAll(ivtObj);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,22 +237,12 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
json.put("cacheLine_code", json.getString("cacheLine_code"));
|
||||
json.put("weight", NumberUtil.mul(json.getString("weight"), "1"));
|
||||
json.put("status", json.getString("vehicle_status").substring(1, 2));
|
||||
|
||||
//异常类型
|
||||
if(!"00".equals(json.getString("err_type"))) {
|
||||
json.put("is_err", "1");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return arr;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,7 +251,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
*/
|
||||
@Override
|
||||
public void setfullBox(JSONObject param) {
|
||||
|
||||
String semimanufactures_uuid = param.getString("material_uuid");
|
||||
// 料箱码
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
@@ -303,11 +263,8 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
String weight = param.getString("weight");
|
||||
String quantity = param.getString("quantity");
|
||||
if(StringUtils.isEmpty(quantity) || param.getInteger("quantity") <= 0) {
|
||||
|
||||
|
||||
throw new RuntimeException("数量必须大于0!");
|
||||
}
|
||||
|
||||
String workprocedure_code = param.getString("workprocedure_uuid");
|
||||
// 判断载具编码是否存在
|
||||
// 缓存线载具条码表【IF_CacheLine_Vehicle】
|
||||
@@ -321,9 +278,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
WQLObject positionTab = WQLObject.getWQLObject("IF_CacheLine_Position");
|
||||
JSONObject vehiobj = positionTab.query("order_no = " + seat_order_num + " and layer_num = " + layer_num + " and cacheLine_code like '%" + wcsdevice_code + "%'").uniqueResult(0);
|
||||
if(vehiobj == null) {
|
||||
|
||||
throw new RuntimeException("位置不存在,设置有误!");
|
||||
|
||||
}
|
||||
// 判断物料去的缓存线是否正确
|
||||
// PDM_BI_WorkshopMaterialCorr
|
||||
@@ -333,17 +288,13 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
JSONObject wpObj = wpTab.query("workprocedure_code = '" + workprocedure_code + "'").uniqueResult(0);
|
||||
// 物料系列
|
||||
String materialprocess_series = corrTab.query("semimanufactures_uuid = '" + semimanufactures_uuid + "'").uniqueResult(0).getString("materialprocess_series");
|
||||
|
||||
//TOASK 这个是调用什么?
|
||||
// AgvTwoInst inst = new AgvTwoInst();
|
||||
// String cachelineCode2 = inst.getCachelineCode(materialprocess_series, wpObj.getString("workprocedure_code"));
|
||||
|
||||
String cachelineCode2 = "";
|
||||
if(!wcsdevice_code.equals(cachelineCode2)) {
|
||||
String materialprocess_seriesname = WQLObject.getWQLObject("PF_PB_SysDicInfo").query("sysdic_type = 'IF_WCS_DEVICESERIES' and sysdic_code = '" + materialprocess_series + "'").uniqueResult(0).getString("sysdic_name");
|
||||
|
||||
throw new RuntimeException("该缓存线【" + wcsdevice_code + "】不能存放【" + materialprocess_seriesname + "】物料,操作失败!");
|
||||
|
||||
}
|
||||
vehiobj.put("vehicle_code", vehicle_code);
|
||||
vehiobj.put("vehicle_uuid", vehicle_code);
|
||||
@@ -374,12 +325,10 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
json.put("vehicle_status", "02");
|
||||
json.put("create_time", DateUtil.now());
|
||||
ivtTab.insert(json);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEmptyBox(JSONObject param) {
|
||||
|
||||
// 层数
|
||||
String layer_num = param.getString("layer_num");
|
||||
// 顺序号
|
||||
@@ -401,9 +350,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
WQLObject positionTab = WQLObject.getWQLObject("IF_CacheLine_Position");
|
||||
JSONObject vehiobj = positionTab.query("order_no = " + seat_order_num + " and layer_num = " + layer_num + " and cacheLine_code like '%" + wcsdevice_code + "%'").uniqueResult(0);
|
||||
if(vehiobj == null) {
|
||||
|
||||
throw new RuntimeException("位置不存在,设置有误!");
|
||||
|
||||
}
|
||||
vehiobj.put("vehicle_code", vehicle_code);
|
||||
vehiobj.put("vehicle_uuid", vehicle_code);
|
||||
@@ -434,14 +381,10 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
json.put("workprocedure_name", "");
|
||||
json.put("create_time", DateUtil.now());
|
||||
ivtTab.insert(json);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void setBlankPos(JSONObject param) {
|
||||
|
||||
// 层数
|
||||
String layer_num = param.getString("layer_num");
|
||||
// 顺序号
|
||||
@@ -456,20 +399,13 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
json.put("vehicle_uuid", "");
|
||||
json.put("vehicle_code", "");
|
||||
ivtTab.update(json);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 出入空箱,出入类型 inOut_type 1 入空箱 2 出空箱 缓存线编码 wcsdevice_code 料箱码 vehicle_code
|
||||
*/
|
||||
@Override
|
||||
public void inOutEmptyBox(JSONObject param) {
|
||||
|
||||
String inOut_type = param.getString("inOut_type");
|
||||
String cacheLine_code = param.getString("wcsdevice_code");
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
@@ -510,12 +446,10 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
// 删除掉出库的箱子
|
||||
vehMaterTab.delete("cacheLine_code = '" + cacheLine_code + "' and vehicle_code = '" + vehicle_code + "'");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray inOutExceptionInstQuery(JSONObject param) {
|
||||
|
||||
// 1 扫码异常-入箱扫码 2 扫码异常-出箱扫码
|
||||
// 出入类型 inOut_type
|
||||
// 缓存线编码 wcsdevice_code
|
||||
@@ -566,10 +500,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
result.add(json);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -578,7 +509,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
*/
|
||||
@Override
|
||||
public void inOutExceptionInstConfirm(JSONObject param) {
|
||||
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
// 1 扫码异常-入箱扫码 2 扫码异常-出箱扫码
|
||||
String inOut_type = param.getString("inOut_type");
|
||||
@@ -595,18 +525,10 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
data[0] = inOut_type;
|
||||
data[1] = wcsdevice_code;
|
||||
data[2] = vehicle_code;
|
||||
|
||||
//TOFIX 补充入箱扫码,出箱扫码异常处理接口
|
||||
|
||||
//uWcsSchedule.notifyWcs(99, 3001, data);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* AGV入箱子异常,(怎么判断入箱子异常) 缓存线编码 wcsdevice_code 满箱码 vehicle_code
|
||||
*/
|
||||
@@ -632,7 +554,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
json.put("nextpoint_code2", row.getString("nextpoint_code2"));
|
||||
result.add(json);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -644,7 +565,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
*/
|
||||
@Override
|
||||
public void agvInBoxExceptionConfirm(JSONObject param) {
|
||||
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
String instruct_uuid = param.getString("instruct_uuid");
|
||||
String cacheLine_code = param.getString("wcsdevice_code");
|
||||
@@ -716,7 +636,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
instObj.put("outboxtxm", empty_vehicle_code);
|
||||
// inst.updateInstStatus(instObj, "1");
|
||||
// inst.updateInstStatus(instObj, "2");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -747,7 +666,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
json.put("nextpoint_code2", row.getString("nextpoint_code2"));
|
||||
result.add(json);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -757,7 +675,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
*/
|
||||
@Override
|
||||
public void agvOutBoxExceptionConfirm(JSONObject param) {
|
||||
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
String instruct_uuid = param.getString("instruct_uuid");
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
@@ -798,7 +715,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
instObj.put("outboxtxm", vehicle_code);
|
||||
// inst.updateInstStatus(instObj, "1");
|
||||
// inst.updateInstStatus(instObj, "2");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -822,7 +738,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
@Override
|
||||
public JSONArray cacheLineOutBoxExceptionQuery(
|
||||
JSONObject param) {
|
||||
|
||||
String agv_no = param.getString("agv_no");
|
||||
String wcsdevice_code = param.getString("wcsdevice_code");
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
@@ -841,7 +756,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
result.add(json);
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -850,7 +764,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
@Override
|
||||
public void cacheLineOutBoxExceptionConfirm(
|
||||
JSONObject param) {
|
||||
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
String instruct_uuid = param.getString("instruct_uuid");
|
||||
JSONObject instObj = instructTab.query("instruct_uuid = '" + instruct_uuid + "'").uniqueResult(0);
|
||||
@@ -890,7 +803,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
ivtTab.update(map, "vehicle_code = '" + vehicle_code + "'");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -911,7 +823,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
//TOFIX 补充逻辑
|
||||
// 下发给wcs
|
||||
// uWcsSchedule.notifyWcs(99, 1000, objs);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -930,13 +841,8 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
Object[] objs = new Object[2];
|
||||
objs[0] = producer;
|
||||
objs[1] = putquantity;
|
||||
|
||||
|
||||
//TOFIX 补充逻辑
|
||||
// 下发给wcs
|
||||
//uWcsSchedule.notifyWcs(99, 3002, objs);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user