fix:空木箱出库增加校验
This commit is contained in:
@@ -9,6 +9,7 @@ import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
|||||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||||
|
import org.nl.b_lms.sch.tasks.TwoOutBoxTask;
|
||||||
import org.nl.b_lms.sch.tasks.first_floor_area.auto.AutoSendVehicleToDjq;
|
import org.nl.b_lms.sch.tasks.first_floor_area.auto.AutoSendVehicleToDjq;
|
||||||
import org.nl.b_lms.sch.tasks.first_floor_area.auto.Prun;
|
import org.nl.b_lms.sch.tasks.first_floor_area.auto.Prun;
|
||||||
import org.nl.common.TableDataInfo;
|
import org.nl.common.TableDataInfo;
|
||||||
@@ -52,7 +53,7 @@ public class PdmBiSubpackagerelationController {
|
|||||||
private IpdmBiSubpackagerelationService pdmBiSubpackagerelationService;
|
private IpdmBiSubpackagerelationService pdmBiSubpackagerelationService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IbstIvtPackageinfoivtService packageinfoivtService;
|
private TwoOutBoxTask twoOutBoxTask;
|
||||||
@Autowired
|
@Autowired
|
||||||
private AutoSendVehicleToDjq autoSendVehicleToDjq;
|
private AutoSendVehicleToDjq autoSendVehicleToDjq;
|
||||||
|
|
||||||
@@ -248,9 +249,12 @@ public class PdmBiSubpackagerelationController {
|
|||||||
autoSendVehicleToDjq.getPointCode(task,PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
|
autoSendVehicleToDjq.getPointCode(task,PackageInfoIvtEnum.TASK_TYPE.code("补空(装箱区->待检区)"));
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
@PostMapping("/ycgzd2")
|
||||||
|
@Log("异常管制点释放")
|
||||||
|
@SaIgnore
|
||||||
|
public ResponseEntity<Object> ycgzd2(@RequestBody JSONObject param) {
|
||||||
|
twoOutBoxTask.immediateNotifyAcs(null);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -410,12 +410,18 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
// 判断浅货位木箱和深货位木箱是否相同规格
|
// 判断浅货位木箱和深货位木箱是否相同规格
|
||||||
task_group_id = outBoxManageService.createBoxMove(浅Attr);
|
task_group_id = outBoxManageService.createBoxMove(浅Attr);
|
||||||
} else if (浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("验箱出库锁"))) {
|
} else if (浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("验箱出库锁"))) {
|
||||||
int 浅Task = taskService.count(new QueryWrapper<SchBaseTask>()
|
List<SchBaseTask> list = taskService.list(new QueryWrapper<SchBaseTask>()
|
||||||
.eq("is_delete", "0")
|
.eq("is_delete", "0")
|
||||||
.eq("point_code1", 浅Attr.getString("struct_code"))
|
.eq("point_code1", 浅Attr.getString("struct_code"))
|
||||||
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||||
if (浅Task == 0){
|
if (!CollectionUtils.isEmpty(list)){
|
||||||
task_group_id = outBoxManageService.createBoxMove(浅Attr);
|
Optional<SchBaseTask> any = list.stream().filter(a -> !a.getPoint_code2().equals("ZXQ_1_1")).findAny();
|
||||||
|
if (any.isPresent()){
|
||||||
|
SchBaseTask errorTask = any.get();
|
||||||
|
throw new BadRequestException("当前木箱所在货位"+boxAttr.getString("struct_code")+"对应浅货位存在任务"+errorTask.getTask_code());
|
||||||
|
}else {
|
||||||
|
task_group_id = outBoxManageService.createBoxMove(浅Attr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
throw new BadRequestException("当前木箱所在货位"+boxAttr.getString("struct_code")+"对应浅货位存在任务"+浅Attr.getString("task_code"));
|
throw new BadRequestException("当前木箱所在货位"+boxAttr.getString("struct_code")+"对应浅货位存在任务"+浅Attr.getString("task_code"));
|
||||||
@@ -436,7 +442,6 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
|
|||||||
jsonTaskParam.put("request_param", request_param.toString());
|
jsonTaskParam.put("request_param", request_param.toString());
|
||||||
TwoOutBoxTask taskBean = new TwoOutBoxTask();
|
TwoOutBoxTask taskBean = new TwoOutBoxTask();
|
||||||
taskBean.createTask(jsonTaskParam);
|
taskBean.createTask(jsonTaskParam);
|
||||||
|
|
||||||
taskBean.immediateNotifyAcs(null);
|
taskBean.immediateNotifyAcs(null);
|
||||||
|
|
||||||
String is_labeling = iSysParamService.findByCode("is_checkbox").getValue();
|
String is_labeling = iSysParamService.findByCode("is_checkbox").getValue();
|
||||||
|
|||||||
@@ -7,14 +7,19 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
import org.nl.b_lms.pdm.bi.slittingproductionplan.service.dao.PdmBiSlittingproductionplan;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||||
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
|
||||||
|
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||||
|
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||||
|
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBoxManageService;
|
||||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
@@ -29,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import static org.nl.common.enums.PackageInfoIvtEnum.IVT_STATUS;
|
import static org.nl.common.enums.PackageInfoIvtEnum.IVT_STATUS;
|
||||||
import static org.nl.wms.util.TaskUtil.getRoutePlanCode;
|
import static org.nl.wms.util.TaskUtil.getRoutePlanCode;
|
||||||
@@ -38,6 +44,7 @@ import static org.nl.wms.util.TaskUtil.getRoutePlanCode;
|
|||||||
* Created by Lxy on 2024/1/19.
|
* Created by Lxy on 2024/1/19.
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class TwoOutBoxTask extends AbstractAcsTask {
|
public class TwoOutBoxTask extends AbstractAcsTask {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,6 +55,12 @@ public class TwoOutBoxTask extends AbstractAcsTask {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IbstIvtPackageinfoivtService packageinfoivtService;
|
private IbstIvtPackageinfoivtService packageinfoivtService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OutBoxManageService outBoxManageService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IschBaseTaskService ischBaseTaskService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AcsTaskDto> addTask() {
|
public List<AcsTaskDto> addTask() {
|
||||||
/*
|
/*
|
||||||
@@ -81,7 +94,42 @@ public class TwoOutBoxTask extends AbstractAcsTask {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
JSONObject json = arr.getJSONObject(i);
|
JSONObject json = arr.getJSONObject(i);
|
||||||
|
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
|
||||||
|
JSONObject attr = attrTab.query("struct_code = '" + json.getString("point_code1") + "'").uniqueResult(0);
|
||||||
|
|
||||||
|
if (attr.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code("深"))) {
|
||||||
|
JSONObject 浅Attr = attrTab
|
||||||
|
.query("zdepth = '1' and row_num = '"+attr.getString("row_num")+"' and col_num = '" + attr.getString("col_num") + "' and layer_num = '"+attr.getString("layer_num")+"'")
|
||||||
|
.uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(浅Attr)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(浅Attr.getString("storagevehicle_code"))){
|
||||||
|
if (!浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if (浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
|
||||||
|
// 判断浅货位木箱和深货位木箱是否相同规格
|
||||||
|
outBoxManageService.createBoxMove(浅Attr);
|
||||||
|
} else if (浅Attr.getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("验箱出库锁"))) {
|
||||||
|
List<SchBaseTask> list = ischBaseTaskService.list(new QueryWrapper<SchBaseTask>()
|
||||||
|
.eq("is_delete", "0")
|
||||||
|
.eq("point_code1", 浅Attr.getString("struct_code"))
|
||||||
|
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||||
|
Optional<SchBaseTask> any = list.stream().filter(a -> !a.getPoint_code2().equals("ZXQ_1_1")).findAny();
|
||||||
|
if (any.isPresent()){
|
||||||
|
SchBaseTask errortask = any.get();
|
||||||
|
log.error("twoOutTask has error task"+errortask.getTask_code());
|
||||||
|
continue;
|
||||||
|
}else {
|
||||||
|
outBoxManageService.createBoxMove(浅Attr);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1);
|
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length() - 1);
|
||||||
AcsTaskDto dto = AcsTaskDto.builder()
|
AcsTaskDto dto = AcsTaskDto.builder()
|
||||||
.ext_task_id(json.getString("task_id"))
|
.ext_task_id(json.getString("task_id"))
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import org.nl.wms.sch.manage.TaskStatusEnum;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -261,7 +262,15 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
|||||||
if (ObjectUtil.isEmpty(jsonAttrNow)) {
|
if (ObjectUtil.isEmpty(jsonAttrNow)) {
|
||||||
throw new BadRequestException("对应浅货位不存在或未启用!" + jsonTask.getString("point_code1"));
|
throw new BadRequestException("对应浅货位不存在或未启用!" + jsonTask.getString("point_code1"));
|
||||||
}
|
}
|
||||||
|
List<SchBaseTask> list = ischBaseTaskService.list(new QueryWrapper<SchBaseTask>()
|
||||||
|
.eq("point_code1", jsonAttrNow.getString("struct_code"))
|
||||||
|
.eq("point_code2", IOSEnum.OUT_POINT.code(jsonAttrNow.getString("row_num")))
|
||||||
|
.eq("task_type", "010712")
|
||||||
|
.eq("is_delete", "0")
|
||||||
|
.lt("task_status", TaskStatusEnum.FINISHED.getCode()));
|
||||||
|
if (!CollectionUtils.isEmpty(list)){
|
||||||
|
return list.get(0).getTask_id();
|
||||||
|
}
|
||||||
// 锁住仓位
|
// 锁住仓位
|
||||||
jsonAttrNow.put("lock_type", IOSEnum.LOCK_TYPE.code("货位异常出库锁"));
|
jsonAttrNow.put("lock_type", IOSEnum.LOCK_TYPE.code("货位异常出库锁"));
|
||||||
attrTab.update(jsonAttrNow);
|
attrTab.update(jsonAttrNow);
|
||||||
|
|||||||
Reference in New Issue
Block a user