修改库存开关导致数据缺失的问题
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cn.ysk.cashier.cons.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.ysk.cashier.cons.domain.*;
|
||||
import cn.ysk.cashier.cons.repository.TbConsInfoFlowRepository;
|
||||
import cn.ysk.cashier.cons.repository.TbConsInfoRepository;
|
||||
@@ -71,7 +72,6 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
||||
private final TbProductStockOperateRepository tbProductStockOperateRepository;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(TbConsInfoQueryCriteria criteria, Pageable pageable) {
|
||||
Page<TbConsInfo> page = tbConsInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable);
|
||||
@@ -140,7 +140,6 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
||||
tbConsInfoFlowRepository.save(flow);
|
||||
|
||||
|
||||
|
||||
}
|
||||
return tbConsInfoMapper.toDto(new TbConsInfo());
|
||||
}
|
||||
@@ -155,12 +154,24 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
||||
throw new Exception("耗材信息不存在");
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(resource.getConName())) {
|
||||
tbConsInfo.setConName(resource.getConName());
|
||||
}
|
||||
if (resource.getPrice() != null) {
|
||||
tbConsInfo.setPrice(resource.getPrice());
|
||||
}
|
||||
if (StrUtil.isNotBlank(resource.getConUnit())) {
|
||||
tbConsInfo.setConUnit(resource.getConUnit());
|
||||
}
|
||||
if (resource.getConWarning() != null) {
|
||||
tbConsInfo.setConWarning(resource.getConWarning());
|
||||
}
|
||||
if (StrUtil.isNotBlank(resource.getStatus())) {
|
||||
tbConsInfo.setStatus(resource.getStatus());
|
||||
}
|
||||
if (StrUtil.isNotBlank(resource.getIsCheck())) {
|
||||
tbConsInfo.setIsCheck(resource.getIsCheck());
|
||||
}
|
||||
tbConsInfo.setUpdateTime(new Timestamp(System.currentTimeMillis()));
|
||||
|
||||
tbConsInfoRepository.save(tbConsInfo);
|
||||
@@ -290,8 +301,6 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
||||
info.setStockNumber(info.getStockNumber().subtract(conInfos.getStockNumber()));
|
||||
|
||||
|
||||
|
||||
|
||||
suppFlow.setBalance(info.getStockNumber().subtract(info.getStockConsume()).subtract(conInfos.getStockNumber()));
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user