fix:木箱入库重复生成

This commit is contained in:
zhangzq
2024-12-28 19:47:56 +08:00
parent ccb821b0f2
commit 9b83326174

View File

@@ -16,6 +16,7 @@ import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -69,7 +70,14 @@ public class InVehicleManageServiceImpl implements InVehicleManageService {
if (ObjectUtil.isEmpty(jsonPoint)) {
throw new BadRequestException("起始点位不存在或未启用!");
}
int count = ischBaseTaskService.count(new QueryWrapper<SchBaseTask>()
.eq("start_device_code", whereJson.getString("device_code"))
.eq("vehicle_code", whereJson.getString("vehicle_code"))
.eq("task_type", "010705")
.lt("", TaskStatusEnum.FINISHED.getCode()));
if (count>0){
throw new BadRequestException(whereJson.getString("vehicle_code")+"当前任务正在执行中");
}
// 找一个托盘区的空仓位
JSONObject jsonParam = new JSONObject();
jsonParam.put("stor_id", IOSEnum.STOR_ID.code("二期"));
@@ -83,7 +91,6 @@ public class InVehicleManageServiceImpl implements InVehicleManageService {
notInBlockList.clear();
throw new BadRequestException("仓位不足!");
}
// 生成任务
JSONObject jsonTaskParam = new JSONObject();
jsonTaskParam.put("task_type", "010705");