退料接收返回库管员

This commit is contained in:
sxu 2024-08-19 18:22:30 +08:00
parent 9443198007
commit 90d218ddb3
4 changed files with 19 additions and 2 deletions

View File

@ -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);
}

View File

@ -284,4 +284,6 @@ public interface PurchaseMacodeInfoMapper {
List<PurchaseMacodeInfo> selectPurchaseMacodeInfoListDetails(PurchaseMacodeInfo purchaseMacodeInfo);
List<String> selectKeepUser(Integer typeId);
int getCountOfMachineByTypeId(Long typeId);
}

View File

@ -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();

View File

@ -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}
</update>
<select id="getCountOfMachineByTypeId" resultType="java.lang.Integer">
SELECT
count(mm.ma_id)
FROM ma_machine mm
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
WHERE mm.ma_code is not null and mm.ma_status in (15)
AND mt.type_id = #{typeId}
</select>
</mapper>