|
|
@ -87,28 +87,36 @@ public class WarehouseInventoryCheckServiceImpl implements IWarehouseInventoryCh |
|
|
|
warehouseInventoryCheck.setInventoryCheckCode(newCode); |
|
|
|
warehouseInventoryCheck.setCreateTime(DateUtils.getNowDate()); |
|
|
|
warehouseInventoryCheck.setCreateBy(loginName); |
|
|
|
List<WarehouseInventoryCheckDetail> inventoryCheckDetails = warehouseInventoryCheck.getInventoryCheckDetails(); |
|
|
|
|
|
|
|
List<WarehouseInventoryCheckDetail> inventoryCheckDetails = warehouseInventoryCheck.getInventoryCheckDetails(); |
|
|
|
int numTotal = 0; |
|
|
|
if (StringUtils.isEmpty(inventoryCheckDetails)){ |
|
|
|
log.warn("仓库盘点物料相关信息为空:{}",inventoryCheckDetails); |
|
|
|
}else{ |
|
|
|
warehouseInventoryCheck.setMaterialTotal(inventoryCheckDetails.size()); |
|
|
|
for (WarehouseInventoryCheckDetail tempInventoryCheckDetail : inventoryCheckDetails) { |
|
|
|
WarehouseInventoryCheckDetail inventoryCheckDetail = new WarehouseInventoryCheckDetail(); |
|
|
|
inventoryCheckDetail.setInventoryCheckCode(newCode); |
|
|
|
inventoryCheckDetail.setInventoryCheckName(warehouseInventoryCheck.getInventoryCheckName()); |
|
|
|
inventoryCheckDetail.setMaterialNo(tempInventoryCheckDetail.getMaterialNo()); |
|
|
|
inventoryCheckDetail.setMaterialName(tempInventoryCheckDetail.getMaterialName()); |
|
|
|
inventoryCheckDetail.setMaterialDescribe(tempInventoryCheckDetail.getMaterialDescribe()); |
|
|
|
inventoryCheckDetail.setMaterialUnit(tempInventoryCheckDetail.getMaterialUnit()); |
|
|
|
inventoryCheckDetail.setInventoryCheckNum(tempInventoryCheckDetail.getInventoryCheckNum()); |
|
|
|
numTotal += tempInventoryCheckDetail.getInventoryCheckNum(); |
|
|
|
inventoryCheckDetail.setInventoryAccountNum(tempInventoryCheckDetail.getInventoryAccountNum()); |
|
|
|
inventoryCheckDetail.setRemark(tempInventoryCheckDetail.getRemark()); |
|
|
|
inventoryCheckDetail.setWarehouseCode(warehouseInventoryCheck.getWarehouseCode()); |
|
|
|
inventoryCheckDetail.setWarehouseName(warehouseInventoryCheck.getWarehouseName()); |
|
|
|
inventoryCheckDetail.setWarehouseStoreAddress(tempInventoryCheckDetail.getWarehouseStoreAddress()); |
|
|
|
inventoryCheckDetail.setBatchNumber(tempInventoryCheckDetail.getBatchNumber()); |
|
|
|
inventoryCheckDetail.setCreateBy(loginName); |
|
|
|
inventoryCheckDetail.setCreateTime(DateUtils.getNowDate()); |
|
|
|
inventoryCheckDetail.setInventoryCheckDate(warehouseInventoryCheck.getInventoryCheckDate()); |
|
|
|
inventoryCheckDetailMapper.insertWarehouseInventoryCheckDetail(inventoryCheckDetail); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
for (WarehouseInventoryCheckDetail tempInventoryCheckDetail : inventoryCheckDetails) { |
|
|
|
WarehouseInventoryCheckDetail inventoryCheckDetail = new WarehouseInventoryCheckDetail(); |
|
|
|
inventoryCheckDetail.setInventoryCheckCode(newCode); |
|
|
|
inventoryCheckDetail.setMaterialNo(tempInventoryCheckDetail.getMaterialNo()); |
|
|
|
inventoryCheckDetail.setMaterialName(tempInventoryCheckDetail.getMaterialName()); |
|
|
|
inventoryCheckDetail.setMaterialDescribe(tempInventoryCheckDetail.getMaterialDescribe()); |
|
|
|
inventoryCheckDetail.setMaterialUnit(tempInventoryCheckDetail.getMaterialUnit()); |
|
|
|
inventoryCheckDetail.setInventoryCheckNum(tempInventoryCheckDetail.getInventoryCheckNum()); |
|
|
|
inventoryCheckDetail.setInventoryAccountNum(tempInventoryCheckDetail.getInventoryAccountNum()); |
|
|
|
inventoryCheckDetail.setRemark(tempInventoryCheckDetail.getRemark()); |
|
|
|
inventoryCheckDetail.setWarehouseStoreAddress(tempInventoryCheckDetail.getWarehouseStoreAddress()); |
|
|
|
inventoryCheckDetail.setCreateBy(loginName); |
|
|
|
inventoryCheckDetail.setCreateTime(new Date()); |
|
|
|
inventoryCheckDetailMapper.insertWarehouseInventoryCheckDetail(inventoryCheckDetail); |
|
|
|
} |
|
|
|
|
|
|
|
warehouseInventoryCheck.setNumTotal(numTotal); |
|
|
|
return warehouseInventoryCheckMapper.insertWarehouseInventoryCheck(warehouseInventoryCheck); |
|
|
|
} |
|
|
|
|
|
|
@ -125,20 +133,38 @@ public class WarehouseInventoryCheckServiceImpl implements IWarehouseInventoryCh |
|
|
|
String loginName = ShiroUtils.getLoginName(); |
|
|
|
warehouseInventoryCheck.setUpdateBy(loginName); |
|
|
|
warehouseInventoryCheck.setUpdateTime(DateUtils.getNowDate()); |
|
|
|
int numTotal = 0; |
|
|
|
|
|
|
|
List<WarehouseInventoryCheckDetail> inventoryCheckDetails = warehouseInventoryCheck.getInventoryCheckDetails(); |
|
|
|
|
|
|
|
if (StringUtils.isEmpty(inventoryCheckDetails)){ |
|
|
|
log.warn("仓库盘点物料相关信息为空:{}",inventoryCheckDetails); |
|
|
|
}else{ |
|
|
|
inventoryCheckDetailMapper.deleteWarehouseInventoryCheckDetailByCode(warehouseInventoryCheck.getInventoryCheckCode()); |
|
|
|
warehouseInventoryCheck.setMaterialTotal(inventoryCheckDetails.size()); |
|
|
|
for (WarehouseInventoryCheckDetail tempInventoryCheckDetail : inventoryCheckDetails) { |
|
|
|
WarehouseInventoryCheckDetail inventoryCheckDetail = new WarehouseInventoryCheckDetail(); |
|
|
|
inventoryCheckDetail.setInventoryCheckCode(warehouseInventoryCheck.getInventoryCheckCode()); |
|
|
|
inventoryCheckDetail.setInventoryCheckName(warehouseInventoryCheck.getInventoryCheckName()); |
|
|
|
inventoryCheckDetail.setMaterialNo(tempInventoryCheckDetail.getMaterialNo()); |
|
|
|
inventoryCheckDetail.setMaterialName(tempInventoryCheckDetail.getMaterialName()); |
|
|
|
inventoryCheckDetail.setMaterialDescribe(tempInventoryCheckDetail.getMaterialDescribe()); |
|
|
|
inventoryCheckDetail.setMaterialUnit(tempInventoryCheckDetail.getMaterialUnit()); |
|
|
|
inventoryCheckDetail.setInventoryCheckNum(tempInventoryCheckDetail.getInventoryCheckNum()); |
|
|
|
numTotal += tempInventoryCheckDetail.getInventoryCheckNum(); |
|
|
|
inventoryCheckDetail.setInventoryAccountNum(tempInventoryCheckDetail.getInventoryAccountNum()); |
|
|
|
inventoryCheckDetail.setRemark(tempInventoryCheckDetail.getRemark()); |
|
|
|
inventoryCheckDetail.setWarehouseCode(warehouseInventoryCheck.getWarehouseCode()); |
|
|
|
inventoryCheckDetail.setWarehouseName(warehouseInventoryCheck.getWarehouseName()); |
|
|
|
inventoryCheckDetail.setWarehouseStoreAddress(tempInventoryCheckDetail.getWarehouseStoreAddress()); |
|
|
|
inventoryCheckDetail.setBatchNumber(tempInventoryCheckDetail.getBatchNumber()); |
|
|
|
inventoryCheckDetail.setCreateBy(loginName); |
|
|
|
inventoryCheckDetail.setCreateTime(DateUtils.getNowDate()); |
|
|
|
inventoryCheckDetail.setInventoryCheckDate(warehouseInventoryCheck.getInventoryCheckDate()); |
|
|
|
inventoryCheckDetailMapper.insertWarehouseInventoryCheckDetail(inventoryCheckDetail); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
for (WarehouseInventoryCheckDetail tempInventoryCheckDetail : inventoryCheckDetails) { |
|
|
|
|
|
|
|
tempInventoryCheckDetail.setUpdateBy(loginName); |
|
|
|
tempInventoryCheckDetail.setUpdateTime(new Date()); |
|
|
|
inventoryCheckDetailMapper.updateWarehouseInventoryCheckDetail(tempInventoryCheckDetail); |
|
|
|
} |
|
|
|
|
|
|
|
warehouseInventoryCheck.setNumTotal(numTotal); |
|
|
|
return warehouseInventoryCheckMapper.updateWarehouseInventoryCheck(warehouseInventoryCheck); |
|
|
|
} |
|
|
|
|
|
|
|