fix:入库新增高度要求

This commit is contained in:
zhouz
2024-05-15 20:26:02 +08:00
parent 8eb06a6dcc
commit 10f431ca71
4 changed files with 73 additions and 33 deletions

View File

@@ -39,6 +39,7 @@ import org.nl.modules.common.exception.BadRequestException;
import org.nl.common.utils.CodeUtil; import org.nl.common.utils.CodeUtil;
import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.system.service.param.ISysParamService;
import org.nl.wms.basedata.st.service.StorattrService; import org.nl.wms.basedata.st.service.StorattrService;
import org.nl.wms.basedata.st.service.dto.StorattrDto; import org.nl.wms.basedata.st.service.dto.StorattrDto;
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl; import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
@@ -77,7 +78,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
* 木箱信息服务 * 木箱信息服务
*/ */
@Autowired @Autowired
private IBstIvtBoxinfoService iBstIvtBoxinfoService; private IBstIvtBoxinfoService iBstIvtBoxinfoService;
/** /**
* 仓库服务 * 仓库服务
*/ */
@@ -113,10 +114,14 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
*/ */
@Autowired @Autowired
private PointService pointService; private PointService pointService;
@Autowired
private ISysParamService iSysParamService;
@Resource @Resource
private IpdmBiSubpackagerelationService ipdmBiSubpackagerelationService; private IpdmBiSubpackagerelationService ipdmBiSubpackagerelationService;
@Override @Override
public Object pageQuery(Map query, Pageable pageQuery) { public Object pageQuery(Map query, Pageable pageQuery) {
Page<Object> page = PageHelper.startPage(pageQuery.getPageNumber() + 1, pageQuery.getPageSize()); Page<Object> page = PageHelper.startPage(pageQuery.getPageNumber() + 1, pageQuery.getPageSize());
@@ -296,6 +301,25 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
attrParam.put("sect_id", jsonObject.getString("sect_id")); attrParam.put("sect_id", jsonObject.getString("sect_id"));
attrParam.put("material_id", disDao.getMaterial_id()); attrParam.put("material_id", disDao.getMaterial_id());
attrParam.put("box_no", disDao.getBox_no()); attrParam.put("box_no", disDao.getBox_no());
// 查询木箱信息
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, disDao.getBox_no())
);
attrParam.put("vehicle_type", boxDao.getVehicle_type());
//根据木箱高度,判断入库仓位的高度
String height = "";
String heightLevel1 = iSysParamService.findByCode("height_level_1").getValue();
String heightLevel2 = iSysParamService.findByCode("height_level_2").getValue();
String box_high = boxDao.getBox_high();
if (Integer.parseInt(box_high) <= Integer.parseInt(heightLevel1)) {
height = "1";
} else if (Integer.parseInt(box_high) > Integer.parseInt(heightLevel1) && Integer.parseInt(box_high) <= Integer.parseInt(heightLevel2)) {
height = "2";
} else {
height = "3";
}
attrParam.put("height", height);
JSONObject jsonSect = sectTab.query("sect_id = '" + jsonObject.getString("sect_id") + "'").uniqueResult(0); JSONObject jsonSect = sectTab.query("sect_id = '" + jsonObject.getString("sect_id") + "'").uniqueResult(0);
@@ -340,12 +364,12 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
// 更新分配明细 // 更新分配明细
iStIvtIostorinvdisService.update( iStIvtIostorinvdisService.update(
new UpdateWrapper<StIvtIostorinvdis>().lambda() new UpdateWrapper<StIvtIostorinvdis>().lambda()
.set(StIvtIostorinvdis::getStruct_id,jsonAttr.getString("struct_id")) .set(StIvtIostorinvdis::getStruct_id, jsonAttr.getString("struct_id"))
.set(StIvtIostorinvdis::getStruct_code,jsonAttr.getString("struct_code")) .set(StIvtIostorinvdis::getStruct_code, jsonAttr.getString("struct_code"))
.set(StIvtIostorinvdis::getStruct_name,jsonAttr.getString("struct_name")) .set(StIvtIostorinvdis::getStruct_name, jsonAttr.getString("struct_name"))
.set(StIvtIostorinvdis::getSect_id,jsonAttr.getString("sect_id")) .set(StIvtIostorinvdis::getSect_id, jsonAttr.getString("sect_id"))
.set(StIvtIostorinvdis::getSect_code,jsonAttr.getString("sect_code")) .set(StIvtIostorinvdis::getSect_code, jsonAttr.getString("sect_code"))
.set(StIvtIostorinvdis::getSect_name,jsonAttr.getString("sect_name")) .set(StIvtIostorinvdis::getSect_name, jsonAttr.getString("sect_name"))
.set(StIvtIostorinvdis::getWork_status, work_status) .set(StIvtIostorinvdis::getWork_status, work_status)
.set(StIvtIostorinvdis::getTask_id, task_id) .set(StIvtIostorinvdis::getTask_id, task_id)
.eq(StIvtIostorinvdis::getIostorinv_id, disDao.getIostorinv_id()) .eq(StIvtIostorinvdis::getIostorinv_id, disDao.getIostorinv_id())
@@ -358,7 +382,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
.eq(StIvtIostorinvdis::getIostorinv_id, disDao.getIostorinv_id()) .eq(StIvtIostorinvdis::getIostorinv_id, disDao.getIostorinv_id())
.eq(StIvtIostorinvdis::getBox_no, disDao.getBox_no()) .eq(StIvtIostorinvdis::getBox_no, disDao.getBox_no())
); );
upateIvt(disDaoList, mstDao,IOSEnum.IVT_CHANGE.code("加待入")); upateIvt(disDaoList, mstDao, IOSEnum.IVT_CHANGE.code("加待入"));
// 更新明细状态 // 更新明细状态
iStIvtIostorinvdtlService.updateStatus(disDao.getIostorinvdtl_id()); iStIvtIostorinvdtlService.updateStatus(disDao.getIostorinvdtl_id());
@@ -380,25 +404,25 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
).get(0); ).get(0);
List<LinkedHashMap> disList = iStIvtIostorinvdisService.list( List<LinkedHashMap> disList = iStIvtIostorinvdisService.list(
new QueryWrapper<StIvtIostorinvdis>().lambda() new QueryWrapper<StIvtIostorinvdis>().lambda()
.eq(StIvtIostorinvdis::getIostorinv_id, mst.getIostorinv_id()) .eq(StIvtIostorinvdis::getIostorinv_id, mst.getIostorinv_id())
).stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row), LinkedHashMap.class)) ).stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row), LinkedHashMap.class))
.collect(Collectors.toList()); .collect(Collectors.toList());
//查询木箱码 //查询木箱码
PdmBiSubpackagerelation pdmBiSubpackagerelation = ipdmBiSubpackagerelationService.getOne(new LambdaQueryWrapper<PdmBiSubpackagerelation>() PdmBiSubpackagerelation pdmBiSubpackagerelation = ipdmBiSubpackagerelationService.getOne(new LambdaQueryWrapper<PdmBiSubpackagerelation>()
.eq(PdmBiSubpackagerelation::getContainer_name,whereJson.get("material_barcode"))); .eq(PdmBiSubpackagerelation::getContainer_name, whereJson.get("material_barcode")));
// 查询木箱信息 // 查询木箱信息
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne( BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
new QueryWrapper<BstIvtBoxinfo>().lambda() new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, pdmBiSubpackagerelation.getPackage_box_sn()) .eq(BstIvtBoxinfo::getBox_no, pdmBiSubpackagerelation.getPackage_box_sn())
); );
jsonSend.put("dtl_row",JSONObject.parseObject(JSON.toJSONString(dtlDao))); jsonSend.put("dtl_row", JSONObject.parseObject(JSON.toJSONString(dtlDao)));
jsonSend.put("tableMater", disList); jsonSend.put("tableMater", disList);
jsonSend.put("point_code", jsonObject.getString("point_code")); jsonSend.put("point_code", jsonObject.getString("point_code"));
jsonSend.put("stor_id", mst.getStor_id()); jsonSend.put("stor_id", mst.getStor_id());
//成品入库托盘类型 //成品入库托盘类型
jsonSend.put("vehicle_code",jsonObject.getString("box_no")); jsonSend.put("vehicle_code", jsonObject.getString("box_no"));
jsonSend.put("vehicle_code2",jsonObject.getString("vehicle_code")); jsonSend.put("vehicle_code2", jsonObject.getString("vehicle_code"));
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("containerType", boxDao.getVehicle_type()); param.put("containerType", boxDao.getVehicle_type());
jsonSend.put("request_param", param.toString()); jsonSend.put("request_param", param.toString());
@@ -406,7 +430,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
// 下发任务 // 下发任务
JSONObject sendJson = new JSONObject(); JSONObject sendJson = new JSONObject();
sendJson.put("task_id",task_id1); sendJson.put("task_id", task_id1);
this.reIssueTask(sendJson); this.reIssueTask(sendJson);
} }
} }
@@ -450,15 +474,15 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
.eq(StIvtIostorinvdis::getBox_no, jsonDis.getString("box_no")) .eq(StIvtIostorinvdis::getBox_no, jsonDis.getString("box_no"))
); );
upateIvt(disDaoList,mstDao,IOSEnum.IVT_CHANGE.code("减待入")); upateIvt(disDaoList, mstDao, IOSEnum.IVT_CHANGE.code("减待入"));
// 更新分配明细状态 // 更新分配明细状态
iStIvtIostorinvdisService.update( iStIvtIostorinvdisService.update(
new UpdateWrapper<StIvtIostorinvdis>().lambda() new UpdateWrapper<StIvtIostorinvdis>().lambda()
.eq(StIvtIostorinvdis::getStruct_code, jsonDis.getString("struct_code")) .eq(StIvtIostorinvdis::getStruct_code, jsonDis.getString("struct_code"))
.eq(StIvtIostorinvdis::getIostorinv_id, jsonDis.getString("iostorinv_id")) .eq(StIvtIostorinvdis::getIostorinv_id, jsonDis.getString("iostorinv_id"))
.eq(StIvtIostorinvdis::getBox_no, jsonDis.getString("box_no")) .eq(StIvtIostorinvdis::getBox_no, jsonDis.getString("box_no"))
.set(StIvtIostorinvdis::getPoint_id, null) .set(StIvtIostorinvdis::getPoint_id, null)
.set(StIvtIostorinvdis::getSect_id, null) .set(StIvtIostorinvdis::getSect_id, null)
.set(StIvtIostorinvdis::getSect_code, "") .set(StIvtIostorinvdis::getSect_code, "")
.set(StIvtIostorinvdis::getSect_name, "") .set(StIvtIostorinvdis::getSect_name, "")
@@ -571,7 +595,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
JSONObject jsonTask = WQLObject.getWQLObject("sch_base_task").query("task_id = '" + task_id + "'").uniqueResult(0); JSONObject jsonTask = WQLObject.getWQLObject("sch_base_task").query("task_id = '" + task_id + "'").uniqueResult(0);
AbstractAcsTask taskClass = new TwoInTask(); AbstractAcsTask taskClass = new TwoInTask();
taskClass.updateTaskStatus(jsonTask,IOSEnum.IS_NOTANDYES.code("")); taskClass.updateTaskStatus(jsonTask, IOSEnum.IS_NOTANDYES.code(""));
} }
@Override @Override
@@ -582,7 +606,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
JSONObject jsonTask = WQLObject.getWQLObject("sch_base_task").query("task_id = '" + task_id + "'").uniqueResult(0); JSONObject jsonTask = WQLObject.getWQLObject("sch_base_task").query("task_id = '" + task_id + "'").uniqueResult(0);
AbstractAcsTask taskClass = new TwoInTask(); AbstractAcsTask taskClass = new TwoInTask();
taskClass.updateTaskStatus(jsonTask,TaskStatusEnum.FINISHED.getCode()); taskClass.updateTaskStatus(jsonTask, TaskStatusEnum.FINISHED.getCode());
} }
@Override @Override
@@ -695,6 +719,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
/** /**
* 更新主表状态 * 更新主表状态
*
* @param iostorinv_id 主表标识 * @param iostorinv_id 主表标识
*/ */
public StIvtIostorinv updateMstStatus(Long iostorinv_id) { public StIvtIostorinv updateMstStatus(Long iostorinv_id) {
@@ -759,6 +784,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
/** /**
* 完成单据:更新主表、明细表、分配明细表、更新库存、更新仓位、更新任务 * 完成单据:更新主表、明细表、分配明细表、更新库存、更新仓位、更新任务
*
* @param mstDao :主表实体类 * @param mstDao :主表实体类
*/ */
private void confirmMst(StIvtIostorinv mstDao) { private void confirmMst(StIvtIostorinv mstDao) {
@@ -781,7 +807,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
.eq(StIvtIostorinvdis::getIostorinv_id, mstDao.getIostorinv_id()) .eq(StIvtIostorinvdis::getIostorinv_id, mstDao.getIostorinv_id())
); );
upateIvt(disDaoList,mstDao,IOSEnum.IVT_CHANGE.code("加库存")); upateIvt(disDaoList, mstDao, IOSEnum.IVT_CHANGE.code("加库存"));
// 更新仓位:解锁仓位、加载具、清除锁定信息 // 更新仓位:解锁仓位、加载具、清除锁定信息
String struct_code_in = disDaoList.stream() String struct_code_in = disDaoList.stream()
@@ -810,7 +836,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
.collect(Collectors.toList()); .collect(Collectors.toList());
if (ObjectUtil.isEmpty(jsonAttrList)) { if (ObjectUtil.isEmpty(jsonAttrList)) {
throw new BadRequestException("仓位信息错误,请检查!"+jsonObject.getString("struct_code")); throw new BadRequestException("仓位信息错误,请检查!" + jsonObject.getString("struct_code"));
} }
JSONObject jsonAttr = jsonAttrList.get(0); JSONObject jsonAttr = jsonAttrList.get(0);
@@ -859,7 +885,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
} }
} }
taskService.update(jsonTaskParam,"task_id IN ('"+String.join("','", needUpdateTaskList)+"') AND task_status <> '"+TaskStatusEnum.FINISHED.getCode()+"'"); taskService.update(jsonTaskParam, "task_id IN ('" + String.join("','", needUpdateTaskList) + "') AND task_status <> '" + TaskStatusEnum.FINISHED.getCode() + "'");
// 更新子卷包装关系 // 更新子卷包装关系
String pcsn_in = disDaoList.stream() String pcsn_in = disDaoList.stream()
@@ -869,7 +895,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
JSONObject jsonSubParam = new JSONObject(); JSONObject jsonSubParam = new JSONObject();
jsonSubParam.put("status", SUBEnum.STATUS.code("入库")); jsonSubParam.put("status", SUBEnum.STATUS.code("入库"));
subTab.update(jsonSubParam,"container_name IN ('"+pcsn_in+"')"); subTab.update(jsonSubParam, "container_name IN ('" + pcsn_in + "')");
/* /*
* 插入子卷包装关系出入记录 * 插入子卷包装关系出入记录

View File

@@ -111,6 +111,8 @@ public class InBussManageServiceImpl implements InBussManageService {
JSONArray attrArry = attrTab.query("IFNULL(storagevehicle_code,'') = '' " + JSONArray attrArry = attrTab.query("IFNULL(storagevehicle_code,'') = '' " +
"AND is_used = '" + IOSEnum.IS_NOTANDYES.code("") + "' AND is_delete = '" + IOSEnum.IS_NOTANDYES.code("") + "' " + "AND is_used = '" + IOSEnum.IS_NOTANDYES.code("") + "' AND is_delete = '" + IOSEnum.IS_NOTANDYES.code("") + "' " +
"AND lock_type = '" + IOSEnum.LOCK_TYPE.code("未锁定") + "' AND stor_id = '"+jsonObject.getString("stor_id")+"' " + "AND lock_type = '" + IOSEnum.LOCK_TYPE.code("未锁定") + "' AND stor_id = '"+jsonObject.getString("stor_id")+"' " +
"AND storagevehicle_type = '" + jsonObject.getString("vehicle_type") + "'" +
"AND height = '" + jsonObject.getString("height") + "'" +
"AND sect_id = '"+jsonObject.getString("sect_id")+"'").getResultJSONArray(0); "AND sect_id = '"+jsonObject.getString("sect_id")+"'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(attrArry)) { if (ObjectUtil.isEmpty(attrArry)) {
@@ -127,6 +129,8 @@ public class InBussManageServiceImpl implements InBussManageService {
jsonSub.put("stor_id", jsonObject.getString("stor_id")); jsonSub.put("stor_id", jsonObject.getString("stor_id"));
jsonSub.put("sect_id", jsonObject.getString("sect_id")); jsonSub.put("sect_id", jsonObject.getString("sect_id"));
jsonSub.put("material_id", jsonObject.getString("material_id")); jsonSub.put("material_id", jsonObject.getString("material_id"));
jsonSub.put("vehicle_type", jsonObject.getString("vehicle_type"));
jsonSub.put("height", jsonObject.getString("height"));
String block_num = getMinBlock(jsonSub); String block_num = getMinBlock(jsonSub);
/* /*

View File

@@ -22,6 +22,8 @@
输入.box_length TYPEAS s_string 输入.box_length TYPEAS s_string
输入.box_width TYPEAS s_string 输入.box_width TYPEAS s_string
输入.box_high TYPEAS s_string 输入.box_high TYPEAS s_string
输入.vehicle_type TYPEAS s_string
输入.height TYPEAS s_string
输入.block_in TYPEAS f_string 输入.block_in TYPEAS f_string
输入.row_in TYPEAS f_string 输入.row_in TYPEAS f_string
输入.block_num TYPEAS s_string 输入.block_num TYPEAS s_string
@@ -64,6 +66,8 @@
AND IFNULL(attr.storagevehicle_code,'') = '' AND IFNULL(attr.storagevehicle_code,'') = ''
AND attr.stor_id = 输入.stor_id AND attr.stor_id = 输入.stor_id
AND attr.sect_id = 输入.sect_id AND attr.sect_id = 输入.sect_id
AND attr.height = 输入.height
AND attr.storagevehicle_type = 输入.vehicle_type
OPTION 输入.not_block <> "" OPTION 输入.not_block <> ""
attr.block_num NOT IN 输入.not_block attr.block_num NOT IN 输入.not_block
@@ -203,6 +207,8 @@
AND IFNULL(attr.storagevehicle_code,'') = '' AND IFNULL(attr.storagevehicle_code,'') = ''
AND attr.stor_id = 输入.stor_id AND attr.stor_id = 输入.stor_id
AND attr.sect_id = 输入.sect_id AND attr.sect_id = 输入.sect_id
AND attr.height = 输入.height
AND attr.storagevehicle_type = 输入.vehicle_type
OPTION 输入.block_num <> "" OPTION 输入.block_num <> ""
attr.block_num = 输入.block_num attr.block_num = 输入.block_num
@@ -229,6 +235,8 @@
AND attr.is_delete = '0' AND attr.is_delete = '0'
AND attr.stor_id = 输入.stor_id AND attr.stor_id = 输入.stor_id
AND attr.sect_id = 输入.sect_id AND attr.sect_id = 输入.sect_id
AND attr.height = 输入.height
AND attr.storagevehicle_type = 输入.vehicle_type
OPTION 输入.block_num <> "" OPTION 输入.block_num <> ""
attr.block_num = 输入.block_num attr.block_num = 输入.block_num

View File

@@ -330,7 +330,9 @@ public class RawFoilServiceImpl implements RawFoilService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public JSONObject needEmptyVehicle(JSONObject whereJson) { public JSONObject needEmptyVehicle(JSONObject whereJson) {
String point_code = whereJson.getString("point_code"); throw new BadRequestException("请点击呼叫按钮进行搬运!");
/*String point_code = whereJson.getString("point_code");
if (ObjectUtil.isEmpty(point_code)) { if (ObjectUtil.isEmpty(point_code)) {
throw new BadRequestException("输入的点位不能为空!"); throw new BadRequestException("输入的点位不能为空!");
} }
@@ -352,10 +354,10 @@ public class RawFoilServiceImpl implements RawFoilService {
// 3.如果没找到则继续找下一节点 // 3.如果没找到则继续找下一节点
String start_pint_code = ""; String start_pint_code = "";
if (ObjectUtil.isEmpty(jsonIvt)) { if (ObjectUtil.isEmpty(jsonIvt)) {
/*String point_location = jsonSb.getString("point_location"); *//*String point_location = jsonSb.getString("point_location");
if (StrUtil.equals(point_location, "0")) map.put("point_location", "1"); if (StrUtil.equals(point_location, "0")) map.put("point_location", "1");
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0"); if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);*/ JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);*//*
throw new BadRequestException("未查询到有空轴且母卷位置为空的点位!"); throw new BadRequestException("未查询到有空轴且母卷位置为空的点位!");
} else { } else {
start_pint_code = jsonIvt.getString("empty_point_code"); start_pint_code = jsonIvt.getString("empty_point_code");
@@ -373,7 +375,7 @@ public class RawFoilServiceImpl implements RawFoilService {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("message", "操作成功!"); jo.put("message", "操作成功!");
return jo; return jo;*/
} }
@Override @Override