add:增加退料组盘按钮

This commit is contained in:
2025-12-23 13:51:31 +08:00
parent 131b130f8f
commit 4ef8ad026a
5 changed files with 86 additions and 1 deletions

View File

@@ -65,4 +65,11 @@ public class BomCallMaterialDtlController {
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/confirmGroup")
@Log("退料组盘确认")
public ResponseEntity<Object> confirmGroup(@RequestBody PdmBomCallMaterialDtlDto dto) {
iPdmBomCallMaterialDtlService.confirmGroup(dto);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -68,4 +68,13 @@ public interface IPdmBomCallMaterialDtlService extends IService<PdmBomCallMateri
* }
*/
void confirm(PdmBomCallMaterialDtlDto dto);
/**
* 退料组盘确认
*
* @param dto {
* 叫料明细
* }
*/
void confirmGroup(PdmBomCallMaterialDtlDto dto);
}

View File

@@ -187,4 +187,39 @@ public class PdmBomCallMaterialDtlServiceImpl extends ServiceImpl<PdmBomCallMate
.eq(GroupPlate::getStoragevehicle_code, dto.getVehicle_code())
);
}
@Override
@Transactional
public void confirmGroup(PdmBomCallMaterialDtlDto dto) {
// 更新明细状态完成
PdmBomCallMaterialDtl bomdtlDao = this.getById(dto.getBomdtl_id());
bomdtlDao.setBom_status(BomEnum.CALL_BOM_DTL_STATUS.code("完成"));
bomdtlDao.setConfirm_time(DateUtil.now());
bomdtlDao.setWeigh_qty(dto.getWeigh_qty());
this.updateById(bomdtlDao);
// 查询叫料工单
PdmBomCallMaterial bomDao = iPdmBomCallMaterialService.getById(dto.getBom_id());
// 增加叫料工单实际用料重量: 叫料单实际用料 + (叫料明细出库重量 - 叫料明细称重重量)
double qty = NumberUtil.sub(dto.getOut_qty(), dto.getWeigh_qty()).doubleValue();
double real_weigh_qty = NumberUtil.add(bomDao.getReal_weigh_qty(), qty).doubleValue();
bomDao.setReal_weigh_qty(NumberUtil.round(real_weigh_qty, 2));
iPdmBomCallMaterialService.updateById(bomDao);
// 更新叫料单状态
iPdmBomCallMaterialService.updateStatus(bomDao.getBom_id());
// 更新组盘重量
groupPlateMapper.update(new GroupPlate(),
new UpdateWrapper<GroupPlate>().lambda()
.set(GroupPlate::getQty, bomdtlDao.getWeigh_qty())
.set(GroupPlate::getStatus, IOSEnum.GROUP_PLATE_STATUS.code("组盘"))
.set(GroupPlate::getBom_id, null)
.set(GroupPlate::getOut_type, null)
.set(GroupPlate::getIs_need_delete, null)
.eq(GroupPlate::getStoragevehicle_code, dto.getVehicle_code())
);
}
}