opt:空木箱入库增加层数

This commit is contained in:
2024-05-11 22:09:26 +08:00
parent a07df96854
commit 34def7f32a
6 changed files with 23 additions and 30 deletions

View File

@@ -42,10 +42,8 @@ public class VehicleTwoServiceImpl implements VehicleTwoService {
public JSONObject boxIn(JSONObject whereJson) {
// 调用接口
inBoxManageService.boxBinVehicle(whereJson);
JSONObject result = new JSONObject();
result.put("message", "入库成功!");
return result;
}

View File

@@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
@@ -16,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 二期入木箱行架任务类
@@ -38,7 +40,6 @@ public class TwoInBoxTrussTask extends AbstractAcsTask {
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i);
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1);
AcsTaskDto dto = AcsTaskDto.builder()
.ext_task_id(json.getString("task_id"))
@@ -50,6 +51,7 @@ public class TwoInBoxTrussTask extends AbstractAcsTask {
.priority(json.getString("priority"))
.class_type(json.getString("task_type"))
.dtl_type(String.valueOf(dtl_type))
.interaction_json(JSONObject.parseObject(json.getString("request_param")))
.remark(json.getString("remark"))
.build();
resultList.add(dto);
@@ -143,7 +145,12 @@ public class TwoInBoxTrussTask extends AbstractAcsTask {
json.put("create_time", DateUtil.now());
json.put("priority", "1");
json.put("acs_task_type", "7");
if(StringUtils.isNotBlank(form.getString("layer")))
{
JSONObject layer= new JSONObject();
layer.put("layer",form.getString("layer"));
json.put("request_param", layer);
}
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
return json.getString("task_id");
}

View File

@@ -151,9 +151,9 @@ public class InBoxManageServiceImpl implements InBoxManageService {
JSONObject jsonVehicle = vehicleTab.query("storagevehicle_code = '" + whereJson.getString("vehicle_code") + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(jsonVehicle)) {
throw new BadRequestException("载具不存在!");
}
if (ObjectUtil.isEmpty(jsonVehicle)) {
throw new BadRequestException("载具不存在!");
}
JSONObject jsonVeExt = new JSONObject();
jsonVeExt.put("storagevehicleext_id", IdUtil.getLongId());
@@ -171,7 +171,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
taskParam.put("next_device_code", "1001");
taskParam.put("vehicle_code", whereJson.getString("box_no"));
taskParam.put("vehicle_code2", whereJson.getString("vehicle_code"));
taskParam.put("layer", whereJson.getString("layer"));
TwoInBoxTrussTask taskBean = new TwoInBoxTrussTask();
taskBean.createTask(taskParam);
taskBean.immediateNotifyAcs(null);

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,46 +1815,35 @@ 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("空盘入库"))) {
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("载具类型不能为空!");
@@ -1861,28 +1851,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());
@@ -1893,7 +1877,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;
/**
* 温度
*/