This commit is contained in:
zhouz
2024-05-12 15:12:04 +08:00
6 changed files with 23 additions and 37 deletions

View File

@@ -1,4 +1,5 @@
package org.nl.wms.ext.acs.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.NumberUtil;
@@ -1323,11 +1324,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
WQLObject.getWQLObject("st_ivt_shaftivt").update(rgv_device);
//如果套管工位有货且套轴区域无轴,搬运一根轴到穿拔轴机上
if (rgv_device.getIntValue("have_qzz") == 0){
if (rgv_device.getIntValue("have_qzz") == 0) {
//判断当前穿拔轴机构上是否存在可用的气涨轴
String cbj_qzz = cbz_jo.getString("have_qzz");
//判断是否存在未完成的成品下卷任务
JSONObject container_jo = WQLObject.getWQLObject("sch_base_task").query("task_type = '010605' AND product_area = '"+product_area+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
JSONObject container_jo = WQLObject.getWQLObject("sch_base_task").query("task_type = '010605' AND product_area = '" + product_area + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
if ("0".equals(cbj_qzz) && ObjectUtil.isEmpty(container_jo)) {
PaperTrussTask paperTrussTask = SpringContextHolder.getBean(PaperTrussTask.class);
//查询套管工位的库存信息
@@ -1814,18 +1815,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
public JSONObject applyTwo(JSONObject whereJson) {
log.info("applyTwo请求参数---------------------------------------------" + whereJson.toString());
JSONObject result = new JSONObject();
String type = whereJson.getString("type");
RLock lock = redissonClient.getLock("acs_to_wms_two_a:" + type);
boolean tryLock = lock.tryLock(5, TimeUnit.SECONDS);
try {
if (tryLock) {
// 基础校验
if (ObjectUtil.isEmpty(whereJson.getString("device_code"))) {
throw new BadRequestException("设备不能为空!");
}
if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("空盘入库"))) {
String vehicleCode = whereJson.getString("vehicle_code");
if (StrUtil.isEmpty(vehicleCode)) {
@@ -1835,30 +1833,22 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
if (ObjectUtil.isEmpty(whereJson.getString("container_type"))) {
throw new BadRequestException("载具类型不能为空!");
}
if (ObjectUtil.isEmpty(whereJson.getString("vehicle_code"))) {
throw new BadRequestException("载具不能为空!");
}
}
// 1-成品入库任务
if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("成品入库任务"))) {
// 调用服务处理
if (ObjectUtil.isEmpty(whereJson.getString("material_barcode"))) {
throw new BadRequestException("子卷号不能为空!");
}
inBussManageService.inTask(whereJson);
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("空盘入库"))) {
// 2-空盘入库
whereJson.put("vehicle_type", whereJson.getString("container_type"));
inVehicleManageService.inVehicle(whereJson);
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("空盘出库"))) {
// 3-空盘出库
if (ObjectUtil.isEmpty(whereJson.getString("container_type"))) {
throw new BadRequestException("载具类型不能为空!");
@@ -1866,28 +1856,22 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
whereJson.put("vehicle_type", whereJson.getString("container_type"));
outVehicleManageService.outVehicle(whereJson);
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("异常处理位"))) {
// 4-空木箱异常处理
if (ObjectUtil.isEmpty(whereJson.getString("material_barcode"))) {
throw new BadRequestException("木箱号不能为空!");
}
JSONObject jsonTaskParam = new JSONObject();
jsonTaskParam.put("task_type", "010710");
jsonTaskParam.put("start_device_code", whereJson.getString("device_code"));
jsonTaskParam.put("next_device_code", "B1_ERRO");
jsonTaskParam.put("vehicle_code", whereJson.getString("material_barcode"));
TwoBoxExcepTask taskBean = new TwoBoxExcepTask();
taskBean.createTask(jsonTaskParam);
} else if (type.equals(IOSEnum.ACSTOLMS_TYPE.code("木箱入库"))) {
// 5-木箱入库
whereJson.put("box_no", whereJson.getString("material_barcode"));
inBoxManageService.inBox(whereJson);
}
result.put("status", HttpStatus.OK.value());
result.put("message", "下发成功!");
log.info("applyTwo返回参数---------------------------------------------" + result.toString());
@@ -1898,7 +1882,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
lock.unlock();
}
}
result.put("status", HttpStatus.BAD_REQUEST.value());
result.put("message", "申请任务超时!" + type);
log.info("applyTwo返回参数---------------------------------------------" + result.toString());

View File

@@ -59,6 +59,10 @@ public class AcsTaskDto {
* 扩展参数
*/
private String params;
/**
* 温度
*/