fix:BUG修改

This commit is contained in:
zhouz
2024-06-18 10:03:24 +08:00
parent 674685ef15
commit 57defd4e0d
7 changed files with 41 additions and 37 deletions

View File

@@ -2,6 +2,7 @@ package org.nl.b_lms.sch.tasks;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -72,6 +73,8 @@ public class TwoInBoxTask extends AbstractAcsTask {
// 任务表
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
WQLObject vehicleTab = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
JSONObject jsonTask = taskTab.query("task_id = '" + taskObj.getString("task_id") + "'").uniqueResult(0);
// 更新任务的参数
@@ -96,7 +99,29 @@ public class TwoInBoxTask extends AbstractAcsTask {
jsonAttr.put("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"));
jsonAttr.put("storagevehicle_code", jsonTask.getString("vehicle_code"));
attrTab.update(jsonAttr);
}
JSONObject jsonVehicle = vehicleTab.query("storagevehicle_code = '" + jsonTask.getString("vehicle_code2") + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(jsonVehicle)) {
throw new BadRequestException("载具不存在!");
}
JSONObject ext_jo = veExtTab.query("storagevehicle_code = '"+jsonVehicle.getString("storagevehicle_code")+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(ext_jo)) {
JSONObject jsonVeExt = new JSONObject();
jsonVeExt.put("storagevehicleext_id", org.nl.common.utils.IdUtil.getLongId());
jsonVeExt.put("storagevehicle_id", jsonVehicle.getLongValue("storagevehicle_id"));
jsonVeExt.put("storagevehicle_code", jsonVehicle.getString("storagevehicle_code"));
jsonVeExt.put("storagevehicle_type", jsonVehicle.getString("storagevehicle_type"));
jsonVeExt.put("pcsn", jsonTask.getString("vehicle_code"));
jsonVeExt.put("device_uuid", org.nl.common.utils.IdUtil.getLongId());
jsonVeExt.put("update_time", DateUtil.now());
veExtTab.insert(jsonVeExt);
}else {
ext_jo.put("pcsn", jsonTask.getString("vehicle_code2"));
ext_jo.put("device_uuid", org.nl.common.utils.IdUtil.getLongId());
ext_jo.put("update_time", DateUtil.now());
veExtTab.update(ext_jo);
} }
// 取消
if (status.equals(IOSEnum.IS_NOTANDYES.code(""))) {

View File

@@ -131,7 +131,7 @@ public class TwoInEmpExcepTask extends AbstractAcsTask {
throw new BadRequestException("托盘号不能为空!");
}
if (StrUtil.isBlank(form.getString("vehicle_type"))) {
if (StrUtil.isBlank(form.getString("containerType"))) {
throw new BadRequestException("托盘类型不能为空!");
}

View File

@@ -2,6 +2,7 @@ package org.nl.b_lms.sch.tasks;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -90,6 +91,8 @@ public class TwoInEmpTask extends AbstractAcsTask {
// 完成
if (status.equals(TaskStatusEnum.FINISHED.getCode())) {
map.put("task_status", TaskStatusEnum.FINISHED.getCode());
// 更新仓位
@@ -100,6 +103,7 @@ public class TwoInEmpTask extends AbstractAcsTask {
jsonAttr.put("is_emptyvehicle",IOSEnum.IS_NOTANDYES.code(""));
attrTab.update(jsonAttr);
}
// 取消

View File

@@ -150,7 +150,7 @@ public class TwoOutEmpTask extends AbstractAcsTask {
throw new BadRequestException("托盘号不能为空!");
}
if (StrUtil.isBlank(form.getString("vehicle_type"))) {
if (StrUtil.isBlank(form.getString("containerType"))) {
throw new BadRequestException("托盘类型不能为空!");
}

View File

@@ -69,9 +69,6 @@ public class InBoxManageServiceImpl implements InBoxManageService {
@Autowired
private WmsToAcsService wmsToAcsService;
@Autowired
private AcsToWmsService acsToWmsService;
@Autowired
private ISysParamService iSysParamService;
@@ -161,10 +158,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
@Override
@Transactional
public void boxBinVehicle(JSONObject whereJson) {
// 载具表
WQLObject vehicleTab = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
// 载具扩展属性表
WQLObject veExtTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
/*
* 查询mes木箱信息插入木箱信息表
*/
@@ -205,28 +199,6 @@ public class InBoxManageServiceImpl implements InBoxManageService {
if (boxDao == null) {
throw new BadRequestException("木箱不存在!");
}
// JSONObject jsonVehicle = vehicleTab.query("storagevehicle_code = '" + whereJson.getString("vehicle_code") + "'")
// .uniqueResult(0);
// if (ObjectUtil.isEmpty(jsonVehicle)) {
// throw new BadRequestException("载具不存在!");
// }
// JSONObject ext_jo = veExtTab.query("storagevehicle_code = '"+jsonVehicle.getString("storagevehicle_code")+"'").uniqueResult(0);
// if (ObjectUtil.isEmpty(ext_jo)) {
// JSONObject jsonVeExt = new JSONObject();
// jsonVeExt.put("storagevehicleext_id", IdUtil.getLongId());
// jsonVeExt.put("storagevehicle_id", jsonVehicle.getLongValue("storagevehicle_id"));
// jsonVeExt.put("storagevehicle_code", jsonVehicle.getString("storagevehicle_code"));
// jsonVeExt.put("storagevehicle_type", jsonVehicle.getString("storagevehicle_type"));
// jsonVeExt.put("pcsn", whereJson.getString("box_no"));
// jsonVeExt.put("device_uuid", IdUtil.getLongId());
// jsonVeExt.put("update_time", DateUtil.now());
// veExtTab.insert(jsonVeExt);
// }else {
// ext_jo.put("pcsn", whereJson.getString("box_no"));
// ext_jo.put("device_uuid", IdUtil.getLongId());
// ext_jo.put("update_time", DateUtil.now());
// veExtTab.update(ext_jo);
// }
// 下发桁架任务
@@ -242,6 +214,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
device_ja.add(device_jo);
JSONObject device_data = wmsToAcsService.getPointStatus(device_ja);
JSONObject data = device_data.getJSONArray("data").getJSONObject(0);
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class);
//如果此时拆叠盘位为空
if (data.getIntValue("qty") == 0) {
//生成空托盘出库任务

View File

@@ -79,6 +79,13 @@ public class OutVehicleManageServiceImpl implements OutVehicleManageService {
throw new BadRequestException("终点点位不存在或未启用!");
}*/
//判断当前点位是否存在任务,如果存在则不生成任务
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
JSONObject jsonObject = wo_Task.query("point_code2 = '" + whereJson.getString("device_code") + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonObject)){
throw new BadRequestException("点位【"+jsonObject.getString("point_code2")+"】正在出空托盘任务!");
}
JSONObject jsonAttr = getStruct(whereJson);
if (ObjectUtil.isEmpty(jsonAttr)) {

View File

@@ -1968,11 +1968,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.info("applyTwo返回参数---------------------------------------------" + result.toString());
return result;
}
}catch (Exception ex){
log.info("applyTwo申请任务异常,任务类型为:---------------------------------------------"+type+"异常信息为"+ex.toString());
result.put("status", HttpStatus.BAD_REQUEST.value());
result.put("message","申请任务异常,任务类型为:"+type+"异常信息为"+ex.toString());
return result;
}
finally {
if (tryLock) {