库存日志
This commit is contained in:
parent
87a451b893
commit
fdd7037ee5
|
|
@ -177,6 +177,6 @@ public class LeaseOutDetails implements Serializable {
|
|||
private Integer num;
|
||||
|
||||
/** 操作后库存 */
|
||||
private String postStoreNum;
|
||||
private int postStoreNum;
|
||||
|
||||
}
|
||||
|
|
@ -268,8 +268,8 @@ public class LogAspect
|
|||
BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
bmStorageLog.setTypeId(Integer.parseInt(machineDto.getTypeId()));
|
||||
bmStorageLog.setTypeName(machineDto.getMaCode());
|
||||
bmStorageLog.setPreStoreNum(machineDto.getNum().intValue());
|
||||
bmStorageLog.setInNum(machineDto.getPutInStoreNum().intValue());
|
||||
bmStorageLog.setPreStoreNum(Objects.isNull(machineDto.getNum()) ? 0 : machineDto.getNum().intValue());
|
||||
bmStorageLog.setInNum(Objects.isNull(machineDto.getPutInStoreNum()) ? 0 : machineDto.getPutInStoreNum().intValue());
|
||||
bmStorageLog.setPostStoreNum(bmStorageLog.getPreStoreNum() + bmStorageLog.getInNum());
|
||||
bmStorageLogList.add(bmStorageLog);
|
||||
}
|
||||
|
|
@ -279,17 +279,44 @@ public class LogAspect
|
|||
MaInputVO maInputVO = (MaInputVO) joinPoint.getArgs()[0];
|
||||
for (MaInputRecord maInputRecord : maInputVO.getInputRecordList()) {
|
||||
BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
bmStorageLog.setTypeId(maInputRecord.getTypeId().intValue());
|
||||
bmStorageLog.setTypeId(Objects.isNull(maInputRecord.getTypeId()) ? 0 : maInputRecord.getTypeId().intValue());
|
||||
bmStorageLog.setTypeName(maInputRecord.getMaCode());
|
||||
bmStorageLog.setPreStoreNum(maInputRecord.getNum().intValue());
|
||||
bmStorageLog.setInNum(maInputRecord.getInputNum().intValue());
|
||||
bmStorageLog.setPreStoreNum(Objects.isNull(maInputRecord.getNum()) ? 0: maInputRecord.getNum().intValue());
|
||||
bmStorageLog.setInNum(Objects.isNull(maInputRecord.getInputNum()) ? 0: maInputRecord.getInputNum().intValue());
|
||||
bmStorageLog.setPostStoreNum(bmStorageLog.getPreStoreNum() + bmStorageLog.getInNum());
|
||||
bmStorageLog.setTaskId(String.valueOf(maInputRecord.getTaskId()));
|
||||
bmStorageLogList.add(bmStorageLog);
|
||||
}
|
||||
}
|
||||
// 领料出库
|
||||
if (joinPoint.getArgs()[0] instanceof List &&
|
||||
((List) joinPoint.getArgs()[0]).stream().noneMatch((o -> !(o instanceof LeaseOutDetails)))) {
|
||||
List<LeaseOutDetails> leaseOutDetails = (List<LeaseOutDetails>)joinPoint.getArgs()[0];
|
||||
for (LeaseOutDetails lod : leaseOutDetails) {
|
||||
BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
bmStorageLog.setPreStoreNum(lod.getNum());
|
||||
bmStorageLog.setOutNum(Objects.isNull(lod.getOutNum()) ? 0 : lod.getOutNum().intValue());
|
||||
bmStorageLog.setPostStoreNum(lod.getPostStoreNum());
|
||||
bmStorageLogList.add(bmStorageLog);
|
||||
}
|
||||
}
|
||||
if (joinPoint.getArgs()[0] instanceof LeaseOutDetails) {
|
||||
LeaseOutDetails lod = (LeaseOutDetails)joinPoint.getArgs()[0];
|
||||
BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
bmStorageLog.setPreStoreNum(lod.getNum());
|
||||
bmStorageLog.setOutNum(Objects.isNull(lod.getOutNum()) ? 0 : lod.getOutNum().intValue());
|
||||
bmStorageLog.setPostStoreNum(lod.getPostStoreNum());
|
||||
bmStorageLogList.add(bmStorageLog);
|
||||
}
|
||||
// 退料接收-完成退料
|
||||
if (joinPoint.getArgs()[0] instanceof LeaseOutDetails) {
|
||||
LeaseOutDetails lod = (LeaseOutDetails)joinPoint.getArgs()[0];
|
||||
BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
bmStorageLog.setPreStoreNum(lod.getNum());
|
||||
bmStorageLog.setOutNum(Objects.isNull(lod.getOutNum()) ? 0 : lod.getOutNum().intValue());
|
||||
bmStorageLog.setPostStoreNum(lod.getPostStoreNum());
|
||||
bmStorageLogList.add(bmStorageLog);
|
||||
}
|
||||
// 二级库出入库
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
if (res == 0) {
|
||||
throw new RuntimeException("出库失败,插入结算记录失败");
|
||||
}
|
||||
record.setPostStoreNum(String.valueOf(getStorageNum(record)));
|
||||
record.setPostStoreNum(getStorageNum(record));
|
||||
} else {
|
||||
return AjaxResult.error("领料出库失败,机具库存不足");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,10 @@ public class PurchaseMacodeInfo extends BaseEntity
|
|||
@ApiModelProperty(value = "机具ID")
|
||||
private long maId;
|
||||
|
||||
/** 实时库存 */
|
||||
@ApiModelProperty(value = "实时库存")
|
||||
private BigDecimal num;
|
||||
|
||||
/** 采购数量 */
|
||||
@ApiModelProperty(value = "采购数量")
|
||||
private Long purchaseNum;
|
||||
|
|
@ -286,6 +290,14 @@ public class PurchaseMacodeInfo extends BaseEntity
|
|||
this.maId = maId;
|
||||
}
|
||||
|
||||
public BigDecimal getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(BigDecimal num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public Long getPurchaseNum() {
|
||||
return purchaseNum;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -362,6 +362,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
pcd.type_id typeId,
|
||||
pcd.task_id taskId,
|
||||
mt.CODE specsCode,
|
||||
mt.num num,
|
||||
mt1.CODE typeCode,
|
||||
CASE
|
||||
WHEN pmi.ma_code IS NULL THEN
|
||||
|
|
|
|||
Loading…
Reference in New Issue