fix:原料库入库优化

This commit is contained in:
zhengxuming
2025-08-14 17:19:07 +08:00
parent 014861ce99
commit 7d76106f54
4 changed files with 28 additions and 10 deletions

View File

@@ -72,4 +72,6 @@ public class StrategyStructParam {
* 占位状态
*/
private Integer occupancy_state;
private Boolean is_empty_vehicle;
}

View File

@@ -3,6 +3,7 @@ package org.nl.wms.decision_manage.service.strategyConfig.decisioner.impl.diy;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.nl.wms.basedata_manage.service.IStructattrService;
import org.nl.wms.basedata_manage.service.dao.Structattr;
import org.nl.wms.decision_manage.service.strategyConfig.decisioner.Decisioner;
@@ -30,15 +31,28 @@ public class RawInRuleHandle extends Decisioner<Structattr, JSONObject> {
@Override
public List<Structattr> handler(List<Structattr> list, JSONObject param) {
QueryWrapper<Structattr> query = new QueryWrapper<Structattr>()
.eq("is_used", true)
.eq("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))
.eq("sect_code", param.getString("sect_code"))
.isNull("storagevehicle_code")
.isNull("Task_code")
.eq("occupancy_state",1)
.orderByAsc("update_time");
List<Structattr> querylList = iStructattrService.list(query);
return querylList;
//为空,则为普通入库,需要一个空托盘位置,适用于普通入库
if (!param.containsKey("is_empty_vehicle")) {
QueryWrapper<Structattr> query = new QueryWrapper<Structattr>()
.eq("is_used", true)
.eq("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))
.eq("sect_code", param.getString("sect_code"))
.isNotNull("storagevehicle_code")
.isNull("Task_code")
.eq("occupancy_state", 2)
.orderByAsc("update_time");
return iStructattrService.list(query);
} else {
//空位,适用于空托盘入库
QueryWrapper<Structattr> query = new QueryWrapper<Structattr>()
.eq("is_used", true)
.eq("lock_type", IOSEnum.LOCK_TYPE.code("未锁定"))
.eq("sect_code", param.getString("sect_code"))
.isNull("storagevehicle_code")
.isNull("Task_code")
.eq("occupancy_state", 1)
.orderByAsc("update_time");
return iStructattrService.list(query);
}
}
}

View File

@@ -667,6 +667,7 @@ public class PdaIosInServiceImpl implements PdaIosInService {
params.put("qty", whereJson.getString("qty"));
params.put("pcsn", whereJson.getString("pcsn"));
params.put("stragegy_type", whereJson.getString("stragegy_type"));
params.put("is_empty_vehicle", true);
Structattr attrDao = iRawAssistIStorService.getStructattr(params);
//确定起点
SchBasePoint schBasePoint = iSchBasePointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, whereJson.getString("site_code")));

View File

@@ -589,6 +589,7 @@ public class InBillServiceImpl extends ServiceImpl<IOStorInvMapper, IOStorInv> i
.qty(new BigDecimal(param.getString("qty")))
.pcsn(param.getString("pcsn"))
.stragegyType(param.getString("stragegy_type"))
.is_empty_vehicle(param.getBoolean("is_empty_vehicle"))
.build());
if (CollectionUtils.isEmpty(structattrs)) {
throw new BadRequestException("无可用货位");