rev:木箱出库

This commit is contained in:
2024-07-26 12:37:59 +08:00
parent 099cf07656
commit 1c1a7eb3d0
3 changed files with 64 additions and 13 deletions

View File

@@ -11,6 +11,7 @@ import org.nl.b_lms.sch.tasks.TwoMoveBoxTask;
import org.nl.b_lms.sch.tasks.TwoOutBoxTask; import org.nl.b_lms.sch.tasks.TwoOutBoxTask;
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService; import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
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.database.service.dao.mapper.BstIvtBoxinfoMapper;
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.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBoxManageService;
import org.nl.common.utils.IdUtil; import org.nl.common.utils.IdUtil;
@@ -23,6 +24,7 @@ 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 javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
@@ -61,6 +63,9 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
@Autowired @Autowired
private IschBaseTaskService ischBaseTaskService; private IschBaseTaskService ischBaseTaskService;
@Resource
private BstIvtBoxinfoMapper bstIvtBoxinfoMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String outBox(JSONObject whereJson) { public String outBox(JSONObject whereJson) {
@@ -143,7 +148,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
attrTab.update(jsonAttr); attrTab.update(jsonAttr);
// 重新分配货位 // 重新分配货位
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne( BstIvtBoxinfo boxDao = bstIvtBoxinfoMapper.selectOne(
new QueryWrapper<BstIvtBoxinfo>().lambda() new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, taskDao.getVehicle_code()) .eq(BstIvtBoxinfo::getBox_no, taskDao.getVehicle_code())
); );
@@ -516,15 +521,29 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
} else { } else {
// 判断是否被锁定 // 判断是否被锁定
if (lowAttr.get(0).getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) { if (lowAttr.get(0).getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("未锁定"))) {
// 创建木箱移库单 // 判断浅货位木箱和深货位木箱是否相同规格
String task_group_id = createBoxMove(lowAttr.get(0)); boolean ifLike = ifLikeBox(json.getString("storagevehicle_code"), lowAttr.get(0).getString("storagevehicle_code"));
json.put("task_group_id", task_group_id); if (ifLike) {
jsonAttr = json; // 相同:出浅货位
break; jsonAttr = lowAttr.get(0);
break;
} else {
// 创建木箱移库单
String task_group_id = createBoxMove(lowAttr.get(0));
json.put("task_group_id", task_group_id);
jsonAttr = json;
break;
}
} else { } else {
jsonAttr = json; // 判断是否是空木箱出库锁
break; if (lowAttr.get(0).getString("lock_type").equals(IOSEnum.LOCK_TYPE.code("木箱出库锁"))) {
jsonAttr = json;
break;
} else {
continue;
}
} }
} }
} else if (json.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code(""))) { } else if (json.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code(""))) {
@@ -538,6 +557,32 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
return jsonAttr; return jsonAttr;
} }
/**
* 判断深货位木箱和浅货位木箱规格是否一样
* @param deep_box 深货位木箱
* @param shallow_box 浅货位木箱
* @return boolean
*/
private boolean ifLikeBox(String deep_box, String shallow_box) {
boolean flag = false;
BstIvtBoxinfo deepBoxDao = bstIvtBoxinfoMapper.selectOne(
new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, deep_box)
);
BstIvtBoxinfo shallowBoxDao = bstIvtBoxinfoMapper.selectOne(
new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, shallow_box)
);
if (deepBoxDao.getMaterial_code().equals(shallowBoxDao.getMaterial_code())) {
flag = true;
}
return flag;
}
/** /**
* 创建木箱移库任务 * 创建木箱移库任务
* *

View File

@@ -2211,8 +2211,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
// TODO 重写 // TODO 重写
if (type.equals("3")) { if (type.equals("3")) {
String task_id = outBoxManageService.taskExceptionalOut(whereJson); throw new BadRequestException("浅货位有货!");
result.put("task_id", task_id); /* String task_id = outBoxManageService.taskExceptionalOut(whereJson);
result.put("task_id", task_id);*/
} }
} else if (taskDao.getTask_type().equals(TASKEnum.VEHICLE_TYPE.code("托盘入库"))) { } else if (taskDao.getTask_type().equals(TASKEnum.VEHICLE_TYPE.code("托盘入库"))) {
// 托盘入库:满入、浅货位有货-放货时 // 托盘入库:满入、浅货位有货-放货时
@@ -2225,8 +2226,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
point_code = outVehicleManageService.taskExceptional(whereJson); point_code = outVehicleManageService.taskExceptional(whereJson);
} }
if (type.equals("3")) { if (type.equals("3")) {
String task_id = outVehicleManageService.taskExceptionalOut(whereJson); throw new BadRequestException("浅货位有货!");
result.put("task_id", task_id); /* String task_id = outVehicleManageService.taskExceptionalOut(whereJson);
result.put("task_id", task_id);*/
} }
} else if (taskDao.getTask_type().equals(TASKEnum.PROUD_TYPE.code("成品入库"))) { } else if (taskDao.getTask_type().equals(TASKEnum.PROUD_TYPE.code("成品入库"))) {
// 成品入库:满入、浅货位有货-放货时 // 成品入库:满入、浅货位有货-放货时

View File

@@ -10,6 +10,7 @@ import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvService;
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.impl.*; import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.impl.*;
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBussManageService; import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.InBussManageService;
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.LashManageService; import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.LashManageService;
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.OutBoxManageService;
import org.nl.modules.logging.annotation.Log; import org.nl.modules.logging.annotation.Log;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.st.inbill.service.CheckOutBillService; import org.nl.wms.st.inbill.service.CheckOutBillService;
@@ -48,6 +49,9 @@ public class CheckOutBillController {
private final SendOutManageServiceImpl sendOutManageService; private final SendOutManageServiceImpl sendOutManageService;
private final OutBoxManageService outBoxManageService;
@GetMapping @GetMapping
@Log("查询出库单") @Log("查询出库单")
@@ -415,7 +419,7 @@ public class CheckOutBillController {
@Log("木箱出库测试") @Log("木箱出库测试")
@SaIgnore @SaIgnore
public ResponseEntity<Object> testOutBox(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> testOutBox(@RequestBody JSONObject whereJson) {
new OutBoxManageServiceImpl().outBox(whereJson); outBoxManageService.outBox(whereJson);
return new ResponseEntity<>(HttpStatus.OK); return new ResponseEntity<>(HttpStatus.OK);
} }