PDA按单移位数量修改
This commit is contained in:
+22
@@ -126,6 +126,28 @@ public class ShiftManageApplicationService {
|
||||
return shiftManageDomainService.queryList(shiftManageDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按单移位管理 PDA 列表查询,填充待移位数量(物料明细待移位数量、待移位物料种数)供列表展示
|
||||
*/
|
||||
public List<ShiftManagePO> queryListForApp(ShiftManageDO shiftManageDO) {
|
||||
List<ShiftManagePO> list = queryList(shiftManageDO);
|
||||
if (CollectionUtils.isEmpty(list)) return list;
|
||||
for (ShiftManagePO po : list) {
|
||||
// 待移位总数量 = 计划数量 - 已移位数量
|
||||
BigDecimal qty = po.getQuantity() != null ? po.getQuantity() : BigDecimal.ZERO;
|
||||
BigDecimal shifted = po.getShiftQuantity() != null ? po.getShiftQuantity() : BigDecimal.ZERO;
|
||||
BigDecimal waitQty = qty.subtract(shifted).max(BigDecimal.ZERO);
|
||||
po.setWaitShiftQuantity(waitQty);
|
||||
// 列表「移位数量」展示待移位总数量,前端绑定 shiftQuantity 即可正确显示
|
||||
po.setShiftQuantity(waitQty);
|
||||
// 待移位物料种数 = 物料种数 - 移位物料种数
|
||||
int mt = po.getMaterialTypeQuantity() != null ? po.getMaterialTypeQuantity() : 0;
|
||||
int sm = po.getShiftMaterialQuantity() != null ? po.getShiftMaterialQuantity() : 0;
|
||||
po.setWaitShiftMaterialQuantity(Math.max(0, mt - sm));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* app 获取移位详情。支持两种入参:按单移位传 shiftManageId,从库存/容器移位传 materialInventoryId,返回结构一致
|
||||
*/
|
||||
|
||||
@@ -74,6 +74,14 @@ public class ShiftManagePO extends BaseVOEntity {
|
||||
@Excel(name = "移位物料种数")
|
||||
private Integer shiftMaterialQuantity;
|
||||
|
||||
@ApiModelProperty("待移位物料种数(列表展示用,= 物料种数 - 移位物料种数)")
|
||||
@TableField(exist = false)
|
||||
private Integer waitShiftMaterialQuantity;
|
||||
|
||||
@ApiModelProperty("待移位数量(列表展示用,= 计划数量 - 移位数量)")
|
||||
@TableField(exist = false)
|
||||
private BigDecimal waitShiftQuantity;
|
||||
|
||||
@ApiModelProperty("移位状态:1-已创建 2-待移位 3-移位中 4-已完成")
|
||||
@Excel(name = "移位状态:1-已创建 2-待移位 3-移位中 4-已完成")
|
||||
private Integer shiftStatus;
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class ShiftManageAppApi extends BaseController {
|
||||
ShiftManageDO shiftManageDO = shiftManageAssembler.toDO(shiftManageDTO);
|
||||
startPage();
|
||||
shiftManageDO.setOperatorsBy(SecurityUtils.getLoginUser().getUserPo().getUserId());
|
||||
List<ShiftManagePO> list = shiftManageApplicationService.queryList(shiftManageDO);
|
||||
List<ShiftManagePO> list = shiftManageApplicationService.queryListForApp(shiftManageDO);
|
||||
return getDataTableApi(list);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user