Browse Source

修改出库记录删除功能

lwx_dev
erdanergou 3 years ago
parent
commit
40a10f4040
  1. 11
      src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

11
src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java

@ -253,6 +253,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
String minRecord = (String) redisTemplate.opsForHash().get(key, "minRecord"); String minRecord = (String) redisTemplate.opsForHash().get(key, "minRecord");
for (ApplicationOutRecordMin recordMin : for (ApplicationOutRecordMin recordMin :
applicationOutRecordMinByParent) { applicationOutRecordMinByParent) {
Inventory inventoryById = materialMapper.findInventoryById(recordMin.getMid());
inventoryById.setNumberOfTemporary(inventoryById.getNumberOfTemporary() - recordMin.getQuantity());
materialMapper.updateInventory(inventoryById);
String redisMinRecordKey = "minRecord:" + recordMin.getId(); String redisMinRecordKey = "minRecord:" + recordMin.getId();
minRecord = minRecord.replace(redisMinRecordKey + ",", ""); minRecord = minRecord.replace(redisMinRecordKey + ",", "");
if (minRecord.length() == 2) { if (minRecord.length() == 2) {
@ -299,6 +304,12 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService {
String minRecord = (String) redisTemplate.opsForHash().get(key, "minRecord"); String minRecord = (String) redisTemplate.opsForHash().get(key, "minRecord");
for (ApplicationOutRecordMin recordMin : for (ApplicationOutRecordMin recordMin :
applicationOutRecordMinByParent) { applicationOutRecordMinByParent) {
Inventory inventoryById = materialMapper.findInventoryById(recordMin.getMid());
inventoryById.setNumberOfTemporary(inventoryById.getNumberOfTemporary() - recordMin.getQuantity());
materialMapper.updateInventory(inventoryById);
String redisMinRecordKey = "minRecord:" + recordMin.getId(); String redisMinRecordKey = "minRecord:" + recordMin.getId();
minRecord = minRecord.replace(redisMinRecordKey + ",", ""); minRecord = minRecord.replace(redisMinRecordKey + ",", "");
if (minRecord.length() == 2) { if (minRecord.length() == 2) {

Loading…
Cancel
Save