|
@@ -82,10 +82,11 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
|
|
|
}
|
|
|
//没有入过库走新增操作
|
|
|
}else {
|
|
|
+ Materiel materiel = materielMapper.selectMaterielById(Long.valueOf(materialInventoryVo.getMaterialId()));
|
|
|
MaterialInventory materialInventoryObj = new MaterialInventory();
|
|
|
materialInventoryObj.setStockNumber(String.valueOf(new Date().getTime()));//库存编号
|
|
|
materialInventoryObj.setWarehouseEntryNumber(UUID.randomUUID().toString());//入库单编号
|
|
|
- materialInventoryObj.setMaterialCode(materialInventoryVo.getMaterialCode());//物料编号
|
|
|
+ materialInventoryObj.setMaterialCode(materiel.getMaterielCode());//物料编号
|
|
|
materialInventoryObj.setQuantity(materialInventoryVo.getQuantity());//数量
|
|
|
materialInventoryObj.setCreateById(SecurityUtils.getUserId());
|
|
|
materialInventoryObj.setLotNumber(materialInventoryVo.getLotNumber());//批号
|
|
@@ -99,8 +100,8 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
|
|
|
//物料名称需要根据物料编码查询下
|
|
|
Materiel materiel = materielMapper.selectMaterielById(Long.valueOf(materialInventoryVo.getMaterialId()));
|
|
|
inboundRecords3.setInboundAterialsName(materiel.getMaterielName());//物料名称
|
|
|
- inboundRecords3.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
|
|
|
- inboundRecords3.setInboundUnit(materialInventoryVo.getInboundUnit());//单位
|
|
|
+ inboundRecords3.setSpecifications(materiel.getSpecificationModel());//规格代号
|
|
|
+ inboundRecords3.setInboundUnit(materiel.getUnits());//单位
|
|
|
inboundRecords3.setInboundQuantity(materialInventoryVo.getQuantity().toString());//入库数量
|
|
|
inboundRecords3.setInboundLeader(SecurityUtils.getUsername());//仓管员
|
|
|
inboundRecords3.setCreateById(SecurityUtils.getUserId());//创建人
|
|
@@ -205,11 +206,10 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
|
|
|
outboundRecords1.setOutboundTime(new Date());//出库时间
|
|
|
//物料名称需要根据物料编码查询下
|
|
|
Materiel materiel = materielMapper.selectMaterielById(Long.valueOf(materialInventoryVo.getMaterialId()));
|
|
|
- outboundRecords1.setQtCodeNumber(materialInventoryVo.getQtCodeNumber());
|
|
|
outboundRecords1.setOutboundAterialsName(materiel.getMaterielName());//物料名称
|
|
|
outboundRecords1.setOutboundNo(UUID.randomUUID().toString());//出库编号
|
|
|
- outboundRecords1.setSpecifications(materialInventoryVo.getSpecifications());//规格代号
|
|
|
- outboundRecords1.setOutboundUnit(materialInventoryVo.getInboundUnit());//单位
|
|
|
+ outboundRecords1.setSpecifications(materiel.getSpecificationModel());//规格代号
|
|
|
+ outboundRecords1.setOutboundUnit(materiel.getUnits());//单位
|
|
|
outboundRecords1.setOutboundQuantity(materialInventoryVo.getQuantity().toString());//出库数量
|
|
|
outboundRecords1.setOutboundLeader(SecurityUtils.getUsername());//仓管员
|
|
|
outboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
|
|
@@ -265,10 +265,11 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
|
|
|
}
|
|
|
//没有入过库走新增操作
|
|
|
}else {
|
|
|
+ Materiel materiel = materielMapper.selectMaterielById(Long.valueOf(item.getMaterialId()));
|
|
|
MaterialInventory materialInventoryObj = new MaterialInventory();
|
|
|
materialInventoryObj.setStockNumber(String.valueOf(new Date().getTime()));//库存编号
|
|
|
materialInventoryObj.setWarehouseEntryNumber(UUID.randomUUID().toString());//入库单编号
|
|
|
- materialInventoryObj.setMaterialCode(item.getMaterialCode());//物料编号
|
|
|
+ materialInventoryObj.setMaterialCode(materiel.getMaterielCode());//物料编号
|
|
|
materialInventoryObj.setQuantity(item.getQuantity());//数量
|
|
|
materialInventoryObj.setCreateById(SecurityUtils.getUserId());
|
|
|
materialInventoryObj.setLotNumber(item.getLotNumber());//批号
|
|
@@ -282,8 +283,8 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
|
|
|
//物料名称需要根据物料编码查询下
|
|
|
Materiel materiel = materielMapper.selectMaterielById(Long.valueOf(item.getMaterialId()));
|
|
|
inboundRecords3.setInboundAterialsName(materiel.getMaterielName());//物料名称
|
|
|
- inboundRecords3.setSpecifications(item.getSpecifications());//规格代号
|
|
|
- inboundRecords3.setInboundUnit(item.getInboundUnit());//单位
|
|
|
+ inboundRecords3.setSpecifications(materiel.getSpecificationModel());//规格代号
|
|
|
+ inboundRecords3.setInboundUnit(materiel.getUnits());//单位
|
|
|
inboundRecords3.setInboundQuantity(item.getQuantity().toString());//入库数量
|
|
|
inboundRecords3.setInboundLeader(SecurityUtils.getUsername());//仓管员
|
|
|
inboundRecords3.setCreateById(SecurityUtils.getUserId());//创建人
|
|
@@ -351,8 +352,8 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
|
|
|
outboundRecords1.setQtCodeNumber(item.getQtCodeNumber());
|
|
|
outboundRecords1.setOutboundAterialsName(materiel.getMaterielName());//物料名称
|
|
|
outboundRecords1.setOutboundNo(UUID.randomUUID().toString());//出库编号
|
|
|
- outboundRecords1.setSpecifications(item.getSpecifications());//规格代号
|
|
|
- outboundRecords1.setOutboundUnit(item.getInboundUnit());//单位
|
|
|
+ outboundRecords1.setSpecifications(materiel.getSpecificationModel());//规格代号
|
|
|
+ outboundRecords1.setOutboundUnit(materiel.getUnits());//单位
|
|
|
outboundRecords1.setOutboundQuantity(item.getQuantity().toString());//出库数量
|
|
|
outboundRecords1.setOutboundLeader(SecurityUtils.getUsername());//仓管员
|
|
|
outboundRecords1.setCreateById(SecurityUtils.getUserId());//创建人
|
|
@@ -395,6 +396,17 @@ public class MaterialInventoryServiceImpl implements IMaterialInventoryService
|
|
|
return materialInventoryMapper.selectMaterialInventoryList(materialInventory);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询物料总数量
|
|
|
+ *
|
|
|
+ * @return 物料库存
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int selectMaterialInventoryListSum()
|
|
|
+ {
|
|
|
+ return materialInventoryMapper.selectMaterialInventoryListSum();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|