fix: 执行入库任务修复

This commit is contained in:
Kelvin 2024-12-20 10:05:40 +08:00
parent cf04961ff0
commit 1d9e31b5fa

View File

@ -173,21 +173,22 @@ public class WmsInTaskController extends BaseController {
// 入库类型为整刀回库 // 入库类型为整刀回库
if (Objects.equals(wmsInTask.getPlanTypeId(), "9")) { if (Objects.equals(wmsInTask.getPlanTypeId(), "9")) {
// 将库位信息填充至料箱
UcmCtBase ucmCtBase = ucmCtBaseService.selectUcmCtBaseByCode(wmsInTask.getBoxRfid());
ucmCtBase.setAttr1(wmsInTask.getCellTgt().toString());
ucmCtBaseService.updateUcmCtBase(ucmCtBase);
// 插入台账数据
wmsInPlanDetailEntityList.forEach(planDetailEntity -> { wmsInPlanDetailEntityList.forEach(planDetailEntity -> {
BaseKnife baseKnife = baseKnifeService.selectBaseKnifeByBaseKnifeId(planDetailEntity.getKnifeId()); BaseKnife baseKnife = baseKnifeService.selectBaseKnifeByBaseKnifeId(planDetailEntity.getKnifeId());
// 计算消耗寿命
int consumeLife = baseKnife.getKnifeLife() - (planDetailEntity.getConsumeLife() % 100);
baseKnife.setKnifeLife(consumeLife);
// 计算重置次数
int resetCount = baseKnife.getResetCount() - (planDetailEntity.getConsumeLife() / 100);
baseKnife.setResetCount(resetCount);
// 设置状态为 解锁 // 设置状态为 解锁
baseKnife.setIsLocked(0); baseKnife.setIsLocked(0);
// 设置工具状态 已入库 // 设置工具状态 已入库
baseKnife.setKnifeFineState(1); baseKnife.setKnifeFineState(1);
if (StringUtils.isNotEmpty(planDetailEntity.getRfid())) { // 状态为生效
baseKnife.setRfid(planDetailEntity.getRfid()); baseKnife.setIsValid(0);
} // 设置库位信息
baseKnife.setAreaCode(wmStorageArea.getAreaCode());
baseKnife.setAreaName(wmStorageArea.getAreaName());
// 更新台账状态 // 更新台账状态
baseKnifeService.updateBaseKnife(baseKnife); baseKnifeService.updateBaseKnife(baseKnife);
}); });