缓存线pad接口更新
This commit is contained in:
@@ -17,7 +17,6 @@ import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.exception.WDKException;
|
||||
import org.nl.wms.pda.dto.CachelineVehileMaterialDto;
|
||||
import org.nl.wms.pda.dto.MaterialDto;
|
||||
import org.nl.wms.pda.service.CacheLineHandService;
|
||||
@@ -26,6 +25,7 @@ import org.nl.wms.sch.tasks.SpeMachineryTask;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@@ -232,7 +232,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
}
|
||||
}
|
||||
}
|
||||
//TOASK 无此状态,这个状态对应什么意思? 是否为is_active 是否可用
|
||||
//TOFIX 无此状态,这个状态对应什么意思? 是否为is_active 是否可用
|
||||
json.put("is_err", "0");
|
||||
json.put("cacheLine_code", json.getString("cacheLine_code"));
|
||||
json.put("weight", NumberUtil.mul(json.getString("weight"), "1"));
|
||||
@@ -250,7 +250,9 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
* 数量 quantity 重量 weight
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void setfullBox(JSONObject param) {
|
||||
//物料ID
|
||||
String semimanufactures_uuid = param.getString("material_uuid");
|
||||
// 料箱码
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
@@ -258,76 +260,72 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
String layer_num = param.getString("layer_num");
|
||||
// 顺序号
|
||||
String seat_order_num = param.getString("seat_order_num");
|
||||
//工序
|
||||
String workprocedure_code = param.getString("workprocedure_uuid");
|
||||
// 缓存线
|
||||
String wcsdevice_code = param.getString("wcsdevice_code");
|
||||
String weight = param.getString("weight");
|
||||
String quantity = param.getString("quantity");
|
||||
if(StringUtils.isEmpty(quantity) || param.getInteger("quantity") <= 0) {
|
||||
throw new RuntimeException("数量必须大于0!");
|
||||
throw new BadRequestException("数量必须大于0!");
|
||||
}
|
||||
String workprocedure_code = param.getString("workprocedure_uuid");
|
||||
// 判断载具编码是否存在
|
||||
// 缓存线载具条码表【IF_CacheLine_Vehicle】
|
||||
/*
|
||||
* WQLObject wql=WQLObject.getWQLObject("IF_CacheLine_Vehicle"); JSONObject
|
||||
* vehiobj =
|
||||
* wql.query("is_delete='0' AND is_active='1' AND vehicle_code = '"+vehicle_code
|
||||
* +"'").uniqueResult(0); if (vehiobj==null) {
|
||||
* throw new RuntimeException("条码【" + vehicle_code + "】不存在或已被删除,操作失败!"); return null; }
|
||||
*/
|
||||
WQLObject positionTab = WQLObject.getWQLObject("IF_CacheLine_Position");
|
||||
//缓存线位置表
|
||||
WQLObject positionTab = WQLObject.getWQLObject("sch_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("位置不存在,设置有误!");
|
||||
throw new BadRequestException("位置不存在,设置有误!");
|
||||
}
|
||||
// 判断物料去的缓存线是否正确
|
||||
// PDM_BI_WorkshopMaterialCorr
|
||||
WQLObject corrTab = WQLObject.getWQLObject("PDM_BI_WorkshopMaterialCorr");
|
||||
WQLObject wpTab = WQLObject.getWQLObject("PDM_BI_WorkProcedure");
|
||||
// 设置工序信息
|
||||
//物料分类表
|
||||
WQLObject corrTab = WQLObject.getWQLObject("md_pb_classstandard");
|
||||
//工序表
|
||||
WQLObject wpTab = WQLObject.getWQLObject("pdm_bi_workprocedure");
|
||||
//物料表
|
||||
WQLObject meTab = WQLObject.getWQLObject("md_me_materialbase");
|
||||
// 查询工序信息
|
||||
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 这个是调用什么?
|
||||
JSONObject meObj = meTab.query("material_id = '" + semimanufactures_uuid + "'").uniqueResult(0);
|
||||
//查找物料分类信息
|
||||
String materialprocess_series = corrTab.query("class_id = '" + meObj.getString("material_type_id") + "'").uniqueResult(0).getString("class_name");
|
||||
//伪代码
|
||||
String cachelineCode2 = "";
|
||||
//TOFIX 这个是调用什么? 通过物料分类信息和工序编码查询缓存线编码? 这里主要提示该缓存线位置不能存放非法物料
|
||||
// AgvTwoInst inst = new AgvTwoInst();
|
||||
// String cachelineCode2 = inst.getCachelineCode(materialprocess_series, wpObj.getString("workprocedure_code"));
|
||||
String cachelineCode2 = "";
|
||||
//1.检查该缓存线位置是否存放非法物料
|
||||
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 + "】物料,操作失败!");
|
||||
throw new BadRequestException("该缓存线【" + wcsdevice_code + "】不能存放【" + materialprocess_seriesname + "】物料,操作失败!");
|
||||
}
|
||||
vehiobj.put("vehicle_code", vehicle_code);
|
||||
vehiobj.put("vehicle_uuid", vehicle_code);
|
||||
//2.缓存线位置通过扫码绑定料箱条码
|
||||
positionTab.update(vehiobj);
|
||||
WQLObject materTab = WQLObject.getWQLObject("PDM_BI_SemiMaterialCorr");
|
||||
// 缓存线载具物料表【IF_CacheLine_VehileMaterial】
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("IF_CacheLine_VehileMaterial");
|
||||
// ivtTab.delete("cacheLine_code = '" + wcsdevice_code + "' and vehicle_code =
|
||||
// '" + vehicle_code + "'");
|
||||
// 缓存线载具物料表
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||
//3.先删除料箱的所有关联信息,包括物料,工序,生产区域
|
||||
ivtTab.delete("vehicle_code = '" + vehicle_code + "'");
|
||||
// 物料信息
|
||||
JSONObject materObj = materTab.query("semimanufactures_uuid = '" + semimanufactures_uuid + "'").uniqueResult(0);
|
||||
HashMap<String,String> json = new HashMap<String,String>();
|
||||
json.put("vehmaterial_uuid", IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
json.put("vehicle_code", vehicle_code);
|
||||
json.put("vehicle_uuid", vehicle_code);
|
||||
json.put("cacheLine_code", wcsdevice_code);
|
||||
json.put("material_uuid", materObj.getString("semimanufactures_uuid"));
|
||||
json.put("material_code", materObj.getString("semimanufactures_code"));
|
||||
json.put("material_spec", materObj.getString("semimanufactures_spec"));
|
||||
json.put("material_name", materObj.getString("semimanufactures_name"));
|
||||
json.put("material_uuid", meObj.getString("material_id"));
|
||||
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("workprocedure_uuid", wpObj.getString("workprocedure_uuid"));
|
||||
json.put("workprocedure_code", wpObj.getString("workprocedure_code"));
|
||||
json.put("workprocedure_name", wpObj.getString("workprocedure_name"));
|
||||
// 有箱有料
|
||||
//有箱有料
|
||||
json.put("vehicle_status", "02");
|
||||
json.put("create_time", DateUtil.now());
|
||||
//4.重新新建该缓存线位置上的料箱为满箱及所属工序,生产区域等信息
|
||||
ivtTab.insert(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void setEmptyBox(JSONObject param) {
|
||||
// 层数
|
||||
String layer_num = param.getString("layer_num");
|
||||
@@ -337,49 +335,35 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
// 缓存线编码
|
||||
String wcsdevice_code = param.getString("wcsdevice_code");
|
||||
// 判断载具编码是否存在
|
||||
// 缓存线载具条码表【IF_CacheLine_Vehicle】
|
||||
/*
|
||||
* WQLObject wql=WQLObject.getWQLObject("IF_CacheLine_Vehicle"); JSONObject
|
||||
* vehiobj =
|
||||
* wql.query("is_delete='0' AND is_active='1' AND vehicle_code = '"+vehicle_code
|
||||
* +"'").uniqueResult(0); if (vehiobj==null) {
|
||||
* throw new RuntimeException("条码【" + vehicle_code + "】不存在或已被删除,操作失败!"); return null; }
|
||||
*/
|
||||
// 缓存线位置表【IF_CacheLine_Position】
|
||||
WQLObject positionTab = WQLObject.getWQLObject("IF_CacheLine_Position");
|
||||
// 缓存线载具物料表
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||
// 缓存线位置表
|
||||
WQLObject positionTab = WQLObject.getWQLObject("sch_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("位置不存在,设置有误!");
|
||||
throw new BadRequestException("位置不存在,设置有误!");
|
||||
}
|
||||
//1.缓存线位置通过扫码绑定料箱条码
|
||||
vehiobj.put("vehicle_code", vehicle_code);
|
||||
vehiobj.put("vehicle_uuid", vehicle_code);
|
||||
positionTab.update(vehiobj);
|
||||
// 缓存线载具物料表【IF_CacheLine_VehileMaterial】
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("IF_CacheLine_VehileMaterial");
|
||||
// 先删除空箱子位置
|
||||
// ivtTab.delete("cacheLine_code = '" + wcsdevice_code + "' and vehicle_code =
|
||||
// '" + vehicle_code + "'");
|
||||
//2.先删除料箱的所有关联信息,包括物料,工序,生产区域
|
||||
ivtTab.delete("vehicle_code = '" + vehicle_code + "'");
|
||||
JSONObject json = new JSONObject();
|
||||
// 状态设置为空箱
|
||||
json.put("vehmaterial_uuid", IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
json.put("vehicle_code", vehicle_code);
|
||||
json.put("vehicle_uuid", vehicle_code);
|
||||
json.put("cacheLine_code", wcsdevice_code);
|
||||
json.put("vehicle_status", "01");
|
||||
json.put("vehicle_code", vehicle_code);
|
||||
// json.put("vehicle_uuid", vehiobj.getString("vehicle_uuid"));
|
||||
json.put("material_uuid", "");
|
||||
json.put("material_code", "");
|
||||
json.put("material_spec", "");
|
||||
json.put("material_name", "");
|
||||
json.put("weight", "0");
|
||||
json.put("quantity", "0");
|
||||
json.put("workprocedure_uuid", "");
|
||||
json.put("workprocedure_code", "");
|
||||
json.put("workprocedure_name", "");
|
||||
json.put("create_time", DateUtil.now());
|
||||
// 3.重新新建该缓存线位置上的料箱为空箱子,是空料箱没有放物料等其他信息
|
||||
ivtTab.insert(json);
|
||||
}
|
||||
|
||||
@@ -391,14 +375,13 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
String seat_order_num = param.getString("seat_order_num");
|
||||
// 缓存线编码
|
||||
String wcsdevice_code = param.getString("wcsdevice_code");
|
||||
// 缓存线位置表【IF_CacheLine_Position】
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("IF_CacheLine_Position");
|
||||
JSONObject json = ivtTab.query("layer_num = " + layer_num + " and cacheLine_code like '%" + wcsdevice_code + "%' and order_no = " + seat_order_num + "").uniqueResult(0);
|
||||
// 缓存线位置表
|
||||
WQLObject positionTab = WQLObject.getWQLObject("sch_cacheline_position");
|
||||
JSONObject json = positionTab.query("order_no = " + seat_order_num + " and layer_num = " + layer_num + " and cacheLine_code like '%" + wcsdevice_code + "%'").uniqueResult(0);
|
||||
// 状态设置为空位
|
||||
json.put("is_blank", "1");
|
||||
json.put("vehicle_uuid", "");
|
||||
json.put("is_empty", "1");
|
||||
json.put("vehicle_code", "");
|
||||
ivtTab.update(json);
|
||||
positionTab.update(json);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -409,26 +392,25 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
String inOut_type = param.getString("inOut_type");
|
||||
String cacheLine_code = param.getString("wcsdevice_code");
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
// 缓存线位置表【IF_CacheLine_Position】
|
||||
WQLObject positionTab = WQLObject.getWQLObject("IF_CacheLine_Position");
|
||||
WQLObject vehMaterTab = WQLObject.getWQLObject("IF_CacheLine_VehileMaterial");
|
||||
// 缓存线位置表
|
||||
WQLObject positionTab = WQLObject.getWQLObject("sch_cacheline_position");
|
||||
//缓存线载具物料表
|
||||
WQLObject vehMaterTab = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||
// 入空箱
|
||||
if("1".equals(inOut_type)) {
|
||||
// 判断是否可以放入空箱子
|
||||
// 1.判断是否可以放入空箱子
|
||||
JSONObject ivtObj = positionTab.query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
// 判断箱子是否在缓存线内
|
||||
if(ivtObj != null) {
|
||||
throw new WDKException("箱子【" + vehicle_code + "】已在库内,无法入空箱!");
|
||||
throw new BadRequestException("箱子【" + vehicle_code + "】已在库内,无法入空箱!");
|
||||
}
|
||||
// 判断是否可以放入空箱子
|
||||
// 3.判断是否可以放入空箱子
|
||||
JSONObject json = positionTab.query("cacheLine_code = '" + cacheLine_code + "' and is_blank= '1'").uniqueResult(0);
|
||||
if(json == null) {
|
||||
throw new WDKException("无法找到缓存线【" + cacheLine_code + "】的空位,无法入空箱!");
|
||||
throw new BadRequestException("无法找到缓存线【" + cacheLine_code + "】的空位,无法入空箱!");
|
||||
}
|
||||
// 入了空箱子
|
||||
// 3.入空箱子
|
||||
JSONObject afterIvt = new JSONObject();
|
||||
afterIvt.put("vehmaterial_uuid", IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
afterIvt.put("vehicle_uuid", vehicle_code);
|
||||
afterIvt.put("vehicle_code", vehicle_code);
|
||||
afterIvt.put("cacheLine_code", cacheLine_code);
|
||||
afterIvt.put("vehicle_status", "01");
|
||||
@@ -438,27 +420,32 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
}
|
||||
// 出空箱
|
||||
if("2".equals(inOut_type)) {
|
||||
// 缓存线载具物料表【IF_CacheLine_VehileMaterial】
|
||||
// 缓存线载具物料表
|
||||
JSONObject json = vehMaterTab.query("cacheLine_code = '" + cacheLine_code + "' and vehicle_status= '01' and vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
if(json == null) {
|
||||
throw new WDKException("无法找到缓存线【" + cacheLine_code + "】的空箱【" + vehicle_code + "】,出空箱失败");
|
||||
throw new BadRequestException("无法找到缓存线【" + cacheLine_code + "】的空箱【" + vehicle_code + "】,出空箱失败");
|
||||
}
|
||||
// 删除掉出库的箱子
|
||||
// 删除掉出库的箱子及关联物料
|
||||
vehMaterTab.delete("cacheLine_code = '" + cacheLine_code + "' and vehicle_code = '" + vehicle_code + "'");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1 扫码异常-入箱扫码 2 扫码异
|
||||
* 出入类型 inOut_type
|
||||
* 缓存线编码 wcsdevice_c
|
||||
* 料箱码 vehicle_code
|
||||
* {"inOut_type":"1","wcsdevice_code":"HCX01","vehicle_code":"10001"}
|
||||
*/
|
||||
@Override
|
||||
public JSONArray inOutExceptionInstQuery(JSONObject param) {
|
||||
// 1 扫码异常-入箱扫码 2 扫码异常-出箱扫码
|
||||
// 出入类型 inOut_type
|
||||
// 缓存线编码 wcsdevice_code
|
||||
// 料箱码 vehicle_code
|
||||
// {"inOut_type":"1","wcsdevice_code":"HCX01","vehicle_code":"10001"}
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
String wcsdevice_code = param.getString("wcsdevice_code");
|
||||
String inOut_type = param.getString("inOut_type");
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
//TOFIX sch_base_task 指令点位表 ? 对应的sch_base_task?
|
||||
//TOFIX 是通过料箱号关联载具物料表取得缓存线ID吗? 但有两个料箱编码 vehicle_code和vehicle_code1,取vehicle_code吗? instruct_status <> '06'是执行中吗?
|
||||
//TOFIX nextwcsdevice_code ?
|
||||
WQLObject instructTab = WQLObject.getWQLObject("sch_base_task");
|
||||
JSONArray result = new JSONArray();
|
||||
// 入箱扫码异常
|
||||
if("1".equals(inOut_type)) {
|
||||
@@ -466,6 +453,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
if(StringUtils.isNotBlank(vehicle_code)) {
|
||||
where = "nextwcsdevice_code = '" + wcsdevice_code + "' and invehicle_code = '" + vehicle_code + "' and instruct_status <> '06'";
|
||||
}
|
||||
//任务里根据缓存线ID和料箱ID找关联该缓存线和料箱的那些任务
|
||||
JSONArray arr = instructTab.query(where).getResultJSONArray(0);
|
||||
for(int i = 0; i < arr.size(); i++) {
|
||||
JSONObject row = arr.getJSONObject(i);
|
||||
@@ -482,10 +470,12 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
}
|
||||
// 出箱扫码异常
|
||||
if("2".equals(inOut_type)) {
|
||||
//TOFIX nextwcsdevice_code ?
|
||||
String where = "startwcsdevice_code = '" + wcsdevice_code + "' and instruct_status <> '06'";
|
||||
if(StringUtils.isNotBlank(vehicle_code)) {
|
||||
where = "startwcsdevice_code = '" + wcsdevice_code + "' and outvehicle_code = '" + vehicle_code + "' and instruct_status <> '06'";
|
||||
}
|
||||
//任务里根据缓存线ID和料箱ID找关联该缓存线和料箱的那些任务
|
||||
JSONArray arr = instructTab.query(where).getResultJSONArray(0);
|
||||
for(int i = 0; i < arr.size(); i++) {
|
||||
JSONObject row = arr.getJSONObject(i);
|
||||
@@ -509,7 +499,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
*/
|
||||
@Override
|
||||
public void inOutExceptionInstConfirm(JSONObject param) {
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
WQLObject instructTab = WQLObject.getWQLObject("sch_base_task");
|
||||
// 1 扫码异常-入箱扫码 2 扫码异常-出箱扫码
|
||||
String inOut_type = param.getString("inOut_type");
|
||||
// 缓存线编码
|
||||
@@ -536,7 +526,8 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
public JSONArray agvInBoxExceptionQuery(JSONObject param) {
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
String wcsdevice_code = param.getString("wcsdevice_code");
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
WQLObject instructTab = WQLObject.getWQLObject("sch_base_task");
|
||||
//TOFIX nextwcsdevice_code ?
|
||||
String where = "nextwcsdevice_code = '" + wcsdevice_code + "' and invehicle_code = '" + vehicle_code + "' and instruct_status <> '06'";
|
||||
if(StringUtils.isEmpty(vehicle_code)) {
|
||||
where = "nextwcsdevice_code = '" + wcsdevice_code + "' and instruct_status <> '06'";
|
||||
@@ -565,30 +556,29 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
*/
|
||||
@Override
|
||||
public void agvInBoxExceptionConfirm(JSONObject param) {
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
WQLObject instructTab = WQLObject.getWQLObject("sch_base_task");
|
||||
String instruct_uuid = param.getString("instruct_uuid");
|
||||
String cacheLine_code = param.getString("wcsdevice_code");
|
||||
String empty_vehicle_code = param.getString("empty_vehicle_code");
|
||||
String full_vehicle_code = param.getString("full_vehicle_code");
|
||||
// 缓存线位置表【IF_CacheLine_Position】
|
||||
WQLObject positionTab = WQLObject.getWQLObject("IF_CacheLine_Position");
|
||||
|
||||
// 缓存线位置表
|
||||
WQLObject positionTab = WQLObject.getWQLObject("sch_cacheline_position");
|
||||
// 缓存线载具物料表
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||
|
||||
/*
|
||||
* JSONObject emptyObj = positionTab
|
||||
* .query("is_active = '1' and is_delete = '0' and vehicle_code = '" +
|
||||
* empty_vehicle_code + "'") .uniqueResult(0);
|
||||
*
|
||||
* // 判断箱子是否存在 if (emptyObj == null) { throw new RuntimeException("条码【" +
|
||||
* // 判断箱子是否存在 if (emptyObj == null) { throw new BadRequestException("条码【" +
|
||||
* empty_vehicle_code + "】不存在,操作失败"); return null; } JSONObject fullObj =
|
||||
* positionTab .query("is_active = '1' and is_delete = '0' and vehicle_code = '"
|
||||
* + full_vehicle_code + "'") .uniqueResult(0); // 判断箱子是否存在 if (fullObj == null)
|
||||
* { throw new RuntimeException("条码【" + full_vehicle_code + "】不存在,操作失败");
|
||||
* { throw new BadRequestException("条码【" + full_vehicle_code + "】不存在,操作失败");
|
||||
* return null; }
|
||||
*/
|
||||
JSONObject instObj = instructTab.query("instruct_uuid = '" + instruct_uuid + "'").uniqueResult(0);
|
||||
// 缓存线载具物料表【IF_CacheLine_VehileMaterial】
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("IF_CacheLine_VehileMaterial");
|
||||
// 出的空箱子
|
||||
/*
|
||||
* JSONObject emptyBoxObj =
|
||||
@@ -596,12 +586,12 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
* + "' and outvehicle_code = '" + empty_vehicle_code + "'").uniqueResult(0); if
|
||||
* (emptyBoxObj == null ||
|
||||
* StringUtils.isEmpty(emptyBoxObj.getString("vehicle_code"))) {
|
||||
* throw new RuntimeException("缓存线内的空箱:" + empty_vehicle_code + "不存在,操作失败"); return null; }
|
||||
* throw new BadRequestException("缓存线内的空箱:" + empty_vehicle_code + "不存在,操作失败"); return null; }
|
||||
*
|
||||
* // 找到空位子入满箱 JSONObject fullBoxObj =
|
||||
* ivtTab.query("is_blank = '1' AND cacheLine_code = '" + cacheLine_code + "'")
|
||||
* .uniqueResult(0); if (fullBoxObj == null) {
|
||||
* throw new RuntimeException("在缓存线:" + cacheLine_code + "未找到可用的货位进行满箱入库!"); return null; }
|
||||
* throw new BadRequestException("在缓存线:" + cacheLine_code + "未找到可用的货位进行满箱入库!"); return null; }
|
||||
*/
|
||||
// 删除出的空箱
|
||||
/*
|
||||
@@ -609,7 +599,6 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
* cacheLine_code + "' and vehicle_code = '" + empty_vehicle_code + "'")); //
|
||||
* 更新入库物料信息 JSONObject afterIvt = new JSONObject();
|
||||
* afterIvt.put("vehmaterial_uuid", IdUtil.getSnowflake(1, 1).nextIdStr()); afterIvt.put("vehicle_code",
|
||||
* full_vehicle_code); afterIvt.put("vehicle_uuid", full_vehicle_code);
|
||||
* afterIvt.put("vehicle_status", "02"); afterIvt.put("produceorder_uuid",
|
||||
* instObj.getString("produceorder_uuid")); afterIvt.put("produceorder_code",
|
||||
* instObj.getString("produceorder_code")); afterIvt.put("workprocedure_uuid",
|
||||
@@ -630,7 +619,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
*
|
||||
* ivtTab.insert(afterIvt);
|
||||
*/
|
||||
//TOASK 此逻辑疑问
|
||||
//TOFIX 此逻辑疑问
|
||||
// AgvTwoInst inst = new AgvTwoInst();
|
||||
instObj.put("inboxtxm", full_vehicle_code);
|
||||
instObj.put("outboxtxm", empty_vehicle_code);
|
||||
@@ -646,7 +635,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
String wcsdevice_code = param.getString("wcsdevice_code");
|
||||
JSONArray arr = new JSONArray();
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
WQLObject instructTab = WQLObject.getWQLObject("sch_base_task");
|
||||
if(StringUtils.isEmpty(vehicle_code)) {
|
||||
arr = instructTab.query("startwcsdevice_code = '" + wcsdevice_code + "' and instruct_status <> '06'").getResultJSONArray(0);
|
||||
}
|
||||
@@ -675,27 +664,26 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
*/
|
||||
@Override
|
||||
public void agvOutBoxExceptionConfirm(JSONObject param) {
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
WQLObject instructTab = WQLObject.getWQLObject("sch_base_task");
|
||||
String instruct_uuid = param.getString("instruct_uuid");
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
String cacheLine_code = param.getString("wcsdevice_code");
|
||||
JSONObject instObj = instructTab.query("instruct_uuid = '" + instruct_uuid + "'").uniqueResult(0);
|
||||
|
||||
/*
|
||||
* // 缓存线载具物料表【IF_CacheLine_VehileMaterial】 WQLObject ivtTab =
|
||||
* WQLObject.getWQLObject("IF_CacheLine_VehileMaterial"); //
|
||||
* 缓存线位置表【IF_CacheLine_Position】 WQLObject positionTab =
|
||||
* WQLObject.getWQLObject("IF_CacheLine_Position"); // 查看是否有空位入 JSONObject
|
||||
* // 缓存线载具物料表【sch_cacheline_vehilematerial】 WQLObject ivtTab =
|
||||
* WQLObject.getWQLObject("sch_cacheline_vehilematerial"); //
|
||||
* 缓存线位置表【sch_cacheline_position】 WQLObject positionTab =
|
||||
* WQLObject.getWQLObject("sch_cacheline_position"); // 查看是否有空位入 JSONObject
|
||||
* positionObj = positionTab.query("is_blank = '1' AND cacheLine_code = '" +
|
||||
* cacheLine_code + "'") .uniqueResult(0);
|
||||
*
|
||||
* if (positionObj == null) {
|
||||
* throw new RuntimeException("缓存线无剩余位置,操作失败"); return null;
|
||||
* throw new BadRequestException("缓存线无剩余位置,操作失败"); return null;
|
||||
*
|
||||
* }
|
||||
*
|
||||
* // 入的空箱子 JSONObject afterIvt = new JSONObject();
|
||||
* afterIvt.put("vehmaterial_uuid", IdUtil.getSnowflake(1, 1).nextIdStr()); afterIvt.put("vehicle_uuid",
|
||||
* vehicle_code); afterIvt.put("vehicle_code", vehicle_code);
|
||||
* afterIvt.put("cacheLine_code", cacheLine_code);
|
||||
*
|
||||
@@ -708,8 +696,9 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
* afterIvt.put("quantity", "0"); afterIvt.put("weight", "0");
|
||||
* afterIvt.put("update_time", DateUtil.now()); ivtTab.insert(afterIvt);
|
||||
*/
|
||||
//TOASK 此逻辑疑问
|
||||
// AgvTwoInst inst = new AgvTwoInst();
|
||||
//TOFIX 此逻辑疑问
|
||||
// AgvTwoInst inst = new AgvTwoInst();
|
||||
// inst.updateInstStatus(instObj, "1");
|
||||
// 出箱的时候入箱码和出箱码相同
|
||||
instObj.put("inboxtxm", vehicle_code);
|
||||
instObj.put("outboxtxm", vehicle_code);
|
||||
@@ -740,7 +729,7 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
JSONObject param) {
|
||||
String agv_no = param.getString("agv_no");
|
||||
String wcsdevice_code = param.getString("wcsdevice_code");
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
WQLObject instructTab = WQLObject.getWQLObject("sch_base_task");
|
||||
JSONArray arr = instructTab.query("(startwcsdevice_code = '" + wcsdevice_code + "' or nextwcsdevice_code = '" + wcsdevice_code + "') and instruct_status <> '06' and agv_no like '%" + agv_no + "%'").getResultJSONArray(0);
|
||||
JSONArray result = new JSONArray();
|
||||
for(int i = 0; i < arr.size(); i++) {
|
||||
@@ -764,11 +753,12 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
@Override
|
||||
public void cacheLineOutBoxExceptionConfirm(
|
||||
JSONObject param) {
|
||||
WQLObject instructTab = WQLObject.getWQLObject("IF_WCS_InstructPoint");
|
||||
WQLObject instructTab = WQLObject.getWQLObject("sch_base_task");
|
||||
String instruct_uuid = param.getString("instruct_uuid");
|
||||
JSONObject instObj = instructTab.query("instruct_uuid = '" + instruct_uuid + "'").uniqueResult(0);
|
||||
if(instObj != null) {
|
||||
instObj.put("instruct_status", "06");
|
||||
//TOFIX instructfinish_mode 是任务完成类型吗? finish_type
|
||||
instObj.put("instructfinish_mode", "02");
|
||||
instObj.put("update_time", DateUtil.now());
|
||||
instObj.put("remark", "缓存线出箱异常确认完成!");
|
||||
@@ -794,8 +784,8 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
// 得到异常的载具号
|
||||
String vehicle_codeStr = instObj.getString("vehicle_code");
|
||||
String[] arr = vehicle_codeStr.split(",");
|
||||
// 缓存线载具物料表【IF_CacheLine_VehileMaterial】
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("IF_CacheLine_VehileMaterial");
|
||||
// 缓存线载具物料表
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("sch_cacheline_vehilematerial");
|
||||
for(String vehicle_code : arr) {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
// 异常
|
||||
@@ -825,17 +815,13 @@ public class CacheLineHandServiceImpl implements CacheLineHandService{
|
||||
// uWcsSchedule.notifyWcs(99, 1000, objs);
|
||||
}
|
||||
|
||||
/**
|
||||
* public static HttpContext getHttpContext(Pageable pageable) { HttpContext ctx
|
||||
* = new HttpContext(getUUID()); ctx.setPage(pageable.getPageNumber() + 1 + "");
|
||||
* ctx.setRows(pageable.getPageSize() + ""); return ctx; }
|
||||
*/
|
||||
@Override
|
||||
public void pourMaterial(JSONObject param) {
|
||||
// 指令标识
|
||||
String instruct_uuid = param.getString("instruct_uuid");
|
||||
// 指令点位表【IF_WCS_InstructPoint】
|
||||
JSONObject instObj = WQLObject.getWQLObject("IF_WCS_InstructPoint").query("instruct_uuid = '" + instruct_uuid + "'").uniqueResult(0);
|
||||
// 指令点位表【sch_base_task】
|
||||
JSONObject instObj = WQLObject.getWQLObject("sch_base_task").query("instruct_uuid = '" + instruct_uuid + "'").uniqueResult(0);
|
||||
//TOFIX quantity 是物料数量吗? material_qty
|
||||
int putquantity = instObj.getInteger("quantity");
|
||||
String producer = instObj.getString("nextwcsdevice_code");
|
||||
Object[] objs = new Object[2];
|
||||
|
||||
Reference in New Issue
Block a user