add 入库单bug修复

This commit is contained in:
ls
2026-01-18 14:09:15 +08:00
parent 7a1277cc90
commit 30da1f5151
2 changed files with 18 additions and 22 deletions

View File

@@ -342,6 +342,8 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
ArrayList<String> paramLockList = new ArrayList<>();
// 仓位对象
StIvtStructattr stIvtStructattr = new StIvtStructattr();
List<StIvtStructattr> stIvtStructattrs = new ArrayList<>();
// 是否自动分配货位
Boolean checked = jsonObject.getBoolean("checked");
String height = "";
@@ -352,17 +354,17 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
attrParam.put("sect_id", jsonObject.getString("sect_id"));
attrParam.put("material_id", disDao.getMaterial_id());
attrParam.put("box_no", disDao.getBox_no());
BstIvtBoxinfo boxDao = getBstIvtBoxinfo(whereJson);
if (boxDao == null) {
throw new BadRequestException("未找到该木箱信息!");
}
jsonObject.put("box_no", boxDao.getBox_no());
jsonObject.put("vehicle_type", boxDao.getVehicle_type());
attrParam.put("vehicle_type", boxDao.getVehicle_type());
// BstIvtBoxinfo boxDao = getBstIvtBoxinfo(whereJson);
// if (boxDao == null) {
// throw new BadRequestException("未找到该木箱信息!");
// }
// jsonObject.put("box_no", boxDao.getBox_no());
// jsonObject.put("vehicle_type", boxDao.getVehicle_type());
// attrParam.put("vehicle_type", boxDao.getVehicle_type());
//根据木箱高度,判断入库仓位的高度
String heightLevel1 = iSysParamService.findByCode("height_level_1").getValue();
String heightLevel2 = iSysParamService.findByCode("height_level_2").getValue();
String box_high = boxDao.getBox_high();
String box_high = "3";
if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) {
height = "'1','2','3'";
} else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) {
@@ -375,8 +377,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
// 判断是否是虚拟区
if (stIvtSectattr.getSect_type_attr().equals(IOSEnum.SECT_TYPE.code("虚拟区"))) {
stIvtStructattr = stIvtStructattrMapper.selectOne(new QueryWrapper<StIvtStructattr>().eq("sect_id", jsonObject.getString("sect_id")).eq("lock_type", "1").eq("is_delete", "0").apply("IFNULL(storagevehicle_code, '') = ''"));
stIvtStructattrs = stIvtStructattrMapper.selectList(new QueryWrapper<StIvtStructattr>().eq("sect_id", jsonObject.getString("sect_id")).eq("lock_type", "1").eq("is_delete", "0").apply("IFNULL(storagevehicle_code, '') = ''"));
} else {
//TODO jsonAttr = inBussManageService.getOneStruct(attrParam);
@@ -391,12 +392,13 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
}
} else {
// 指定分配
stIvtStructattr = stIvtStructattrMapper.selectOne(new QueryWrapper<StIvtStructattr>().eq("struct_id", jsonDis.getString("struct_id")));
stIvtStructattrs = stIvtStructattrMapper.selectList(new QueryWrapper<StIvtStructattr>().eq("struct_id", jsonDis.getString("struct_id")));
}
if (ObjectUtil.isEmpty(stIvtStructattr)) {
if (stIvtStructattrs.isEmpty()) {
throw new BadRequestException("没有可用仓位!");
}
stIvtStructattr = stIvtStructattrs.get(0);
// 调用业务处理类锁定货位
paramLockList.add(stIvtStructattr.getStruct_code());
jsonLock.put("inv_type", mstDao.getBill_type());
@@ -446,7 +448,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
mst.setDis_time(DateUtil.now());
this.updateById(mst);
// 判断是否自动下发任务
if (jsonObject.getString("is_send").equals(IOSEnum.IS_NOTANDYES.code("")) && ObjectUtil.isNotEmpty(jsonObject.getString("is_send"))) {
if (ObjectUtil.isNotEmpty(jsonObject.getString("is_send"))&&jsonObject.getString("is_send").equals(IOSEnum.IS_NOTANDYES.code("")) ) {
JSONObject jsonSend = new JSONObject();
StIvtIostorinvdtl dtlDao = iStIvtIostorinvdtlService.list(
new QueryWrapper<StIvtIostorinvdtl>().lambda()

View File

@@ -90,9 +90,7 @@ public class RawAssistIStorController {
//@PreAuthorize("@el.check('structrelamaterial:edit')")
public ResponseEntity<Object> insertDtl(@RequestBody Map whereJson) {
if (whereJson.get("stor_id").toString().equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvService.insertMst(whereJson);
}
iStIvtIostorinvService.insertMst(whereJson);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@@ -104,9 +102,7 @@ public class RawAssistIStorController {
//@PreAuthorize("@el.check('sectattr:edit')")
public ResponseEntity<Object> update(@RequestBody Map whereJson) {
if (whereJson.get("stor_id").toString().equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvService.update(whereJson);
}
iStIvtIostorinvService.update(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@@ -115,9 +111,7 @@ public class RawAssistIStorController {
@Log("分配货位")
//@PreAuthorize("@el.check('materialtype:list')")
public ResponseEntity<Object> divStruct(@RequestBody Map whereJson) {
if (whereJson.get("stor_id").toString().equals(IOSEnum.STOR_ID.code("二期"))) {
iStIvtIostorinvService.divStruct(whereJson);
}
iStIvtIostorinvService.divStruct(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}