diff --git a/sgzb-common/sgzb-common-log/src/main/java/com/bonus/sgzb/common/log/aspect/LogAspect.java b/sgzb-common/sgzb-common-log/src/main/java/com/bonus/sgzb/common/log/aspect/LogAspect.java index debc989..498fd2e 100644 --- a/sgzb-common/sgzb-common-log/src/main/java/com/bonus/sgzb/common/log/aspect/LogAspect.java +++ b/sgzb-common/sgzb-common-log/src/main/java/com/bonus/sgzb/common/log/aspect/LogAspect.java @@ -261,9 +261,9 @@ public class LogAspect BmStorageLog bmStorageLog = new BmStorageLog(); bmStorageLog.setTypeId(Objects.isNull(maInputRecord.getTypeId()) ? 0 : maInputRecord.getTypeId().intValue()); bmStorageLog.setTypeName(maInputRecord.getMaCode()); - bmStorageLog.setPreStoreNum(Objects.isNull(maInputRecord.getNum()) ? 0: maInputRecord.getNum().intValue()); + bmStorageLog.setPostStoreNum(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.setPreStoreNum(bmStorageLog.getPostStoreNum() - bmStorageLog.getInNum()); bmStorageLog.setTaskId(String.valueOf(maInputRecord.getTaskId())); bmStorageLogList.add(bmStorageLog); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java index 5d1c70c..b89796d 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java @@ -284,4 +284,6 @@ public interface PurchaseMacodeInfoMapper { List selectPurchaseMacodeInfoListDetails(PurchaseMacodeInfo purchaseMacodeInfo); List selectKeepUser(Integer typeId); + + int getCountOfMachineByTypeId(Long typeId); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java index dc271ec..6ed8f72 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java @@ -334,6 +334,11 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService .add(maType.getNum() == null ? new BigDecimal(0) : maType.getNum())); purchaseMacodeInfoMapper.updateTypeByTypeId(maType); + if ("0".equals(maType.getManageType())) { //编码设备 + int countOfMachineByTypeId = purchaseMacodeInfoMapper.getCountOfMachineByTypeId(typeId); + maInputRecord.setNum((double) countOfMachineByTypeId); + } + //判断是否是成套机具,是的话配件库存也要增加 if ("2".equals(maType.getManageType())){ PurchaseCheckInfo purchaseCheckInfo = new PurchaseCheckInfo(); diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml index 732ca84..0d794d1 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml @@ -570,4 +570,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" UPDATE ma_type SET num = ifnull( num, 0 ) + #{partNum} WHERE type_id = #{typeId} + + \ No newline at end of file