add:增加退料组盘按钮
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -68,4 +68,13 @@ public interface IPdmBomCallMaterialDtlService extends IService<PdmBomCallMateri
|
||||
* }
|
||||
*/
|
||||
void confirm(PdmBomCallMaterialDtlDto dto);
|
||||
|
||||
/**
|
||||
* 退料组盘确认
|
||||
*
|
||||
* @param dto {
|
||||
* 叫料明细
|
||||
* }
|
||||
*/
|
||||
void confirmGroup(PdmBomCallMaterialDtlDto dto);
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,4 +56,12 @@ export function confirm(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getDtl, getWeigh, saveWeigh, confirm }
|
||||
export function confirmGroup(data) {
|
||||
return request({
|
||||
url: 'api/bomCallMaterialDtl/confirmGroup',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getDtl, getWeigh, saveWeigh, confirm, confirmGroup }
|
||||
|
||||
@@ -100,6 +100,17 @@
|
||||
>
|
||||
退料确认
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="confirmGroup"
|
||||
>
|
||||
退料组盘确认
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -235,6 +246,21 @@ export default {
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
confirmGroup() {
|
||||
// 校验称重信息不能为0或者空
|
||||
const data = this.$refs.table.selection[0]
|
||||
if (data.weigh_qty === 0) {
|
||||
this.crud.notify('称重重量不能为0!', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
return
|
||||
}
|
||||
if (data.bom_status === '2') {
|
||||
this.crud.notify('当前明细已确认!', CRUD.NOTIFICATION_TYPE.ERROR)
|
||||
}
|
||||
crudCallMaterialDtl.confirmGroup(data).then(res => {
|
||||
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
},
|
||||
empConfirm() {
|
||||
const data = this.$refs.table.selection[0]
|
||||
if (data.bom_status === '2') {
|
||||
|
||||
Reference in New Issue
Block a user