|
|
@ -4049,9 +4049,11 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public Integer deleteApplicationInRecordById(Integer id, UserByPort userToken, String userAgent) { |
|
|
public Integer deleteApplicationInRecordById(Integer id, UserByPort userToken, String userAgent) { |
|
|
|
|
|
ApplicationInRecordP record = depositoryRecordMapper.findApplicationInRecordPById(id); |
|
|
new Thread(new Runnable() { |
|
|
new Thread(new Runnable() { |
|
|
@Override |
|
|
@Override |
|
|
public void run() { |
|
|
public void run() { |
|
|
|
|
|
updateInventoryForErrorInRecord(record.getMid(), record.getQuantity(), record.getAirUnit(), record.getPlaceId(), record.getDepositoryId()); |
|
|
} |
|
|
} |
|
|
}).start(); |
|
|
}).start(); |
|
|
return depositoryRecordMapper.deleteApplicationInRecordById(id); |
|
|
return depositoryRecordMapper.deleteApplicationInRecordById(id); |
|
|
@ -4065,7 +4067,16 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public Integer deleteApplicationInRecordByIds(List<Integer> list, UserByPort userToken, String userAgent) { |
|
|
public Integer deleteApplicationInRecordByIds(List<Integer> list, UserByPort userToken, String userAgent) { |
|
|
|
|
|
List<ApplicationInRecordP> applicationInRecordsByIds = depositoryRecordMapper.findApplicationInRecordsByIds(list); |
|
|
|
|
|
new Thread(new Runnable() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void run() { |
|
|
|
|
|
for (ApplicationInRecordP record : applicationInRecordsByIds |
|
|
|
|
|
) { |
|
|
|
|
|
updateInventoryForErrorInRecord(record.getMid(), record.getQuantity(), record.getAirUnit(), record.getPlaceId(), record.getDepositoryId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}).start(); |
|
|
return depositoryRecordMapper.deleteApplicationInRecordByIds(list); |
|
|
return depositoryRecordMapper.deleteApplicationInRecordByIds(list); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -4113,8 +4124,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
placeMapper.UpdatePlace(place); |
|
|
placeMapper.UpdatePlace(place); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
// 如果不是基础单位
|
|
|
// 如果不是基础单位
|
|
|
Map<String, Object> paramForSplitInfo = new HashMap<>(); |
|
|
Map<String, Object> paramForSplitInfo = new HashMap<>(); |
|
|
paramForSplitInfo.put("newUnit", unit); |
|
|
paramForSplitInfo.put("newUnit", unit); |
|
|
@ -4141,8 +4151,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
// 修改库存处理记录
|
|
|
// 修改库存处理记录
|
|
|
splitUnitMapper.updateSplitInventory(splitInventory); |
|
|
splitUnitMapper.updateSplitInventory(splitInventory); |
|
|
|
|
|
|
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
// 如果不能满足需求
|
|
|
// 如果不能满足需求
|
|
|
|
|
|
|
|
|
// 获取剩余不足的数量
|
|
|
// 获取剩余不足的数量
|
|
|
@ -4165,8 +4174,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
updateOutSplitInventoryInfo(parentSplitInfo, placeAndMaterialByMidAndPid, quantity, surplus, splitInfo); |
|
|
updateOutSplitInventoryInfo(parentSplitInfo, placeAndMaterialByMidAndPid, quantity, surplus, splitInfo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
// 如果当前拆单没有父级
|
|
|
// 如果当前拆单没有父级
|
|
|
|
|
|
|
|
|
boolean flag = true; |
|
|
boolean flag = true; |
|
|
@ -4282,8 +4290,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
// 如果拆单库存处理记录不存在
|
|
|
// 如果拆单库存处理记录不存在
|
|
|
|
|
|
|
|
|
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); |
|
|
int scale = splitUnitService.findSplitInfoScaleQuantity(splitInfo, -1); |
|
|
|