修改供应商为非必填

This commit is contained in:
牛叉闪闪
2024-08-03 18:22:36 +08:00
parent cd8ccb9a8e
commit 443df8faa3
2 changed files with 12 additions and 13 deletions

View File

@@ -66,9 +66,9 @@ public class TbConCheckServiceImpl implements TbConCheckService {
throw new Exception("耗材信息不存在");
}
BigDecimal stonum=consInfo.getStockNumber().subtract(consInfo.getStockConsume());
consInfo.setStockConsume(consInfo.getStockConsume().add(resources.getLpNum().negate()));
consInfo.setStockConsume(BigDecimal.ZERO);
consInfo.setStockNumber(resources.getStockNumber());
consInfo.setUpdateTime(new Timestamp(System.currentTimeMillis()));
tbConsInfoRepository.save(consInfo);
@@ -77,8 +77,8 @@ public class TbConCheckServiceImpl implements TbConCheckService {
conCheck.setConInfoId(consInfo.getId());
conCheck.setConName(consInfo.getConName());
conCheck.setPrice(consInfo.getPrice());
conCheck.setAcStockNumber(consInfo.getStockNumber().subtract(consInfo.getStockConsume()));
conCheck.setStockNumber(stonum);
conCheck.setAcStockNumber(resources.getStockNumber());
conCheck.setStockNumber(resources.getStockNumber());
conCheck.setLpNum(resources.getLpNum());
conCheck.setLpAmount(consInfo.getPrice().multiply(resources.getLpNum()));
conCheck.setCreateTime(new Timestamp(System.currentTimeMillis()));

View File

@@ -184,18 +184,17 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
if (Objects.isNull(tbShopInfo)) {
throw new Exception("店铺信息不存在");
}
TbShopPurveyor purveyor = tbShopPurveyorRepository.getById(resources.getSupplierId());
TbShopPurveyor purveyor=null;
TbProductStockOperate stockOperate = new TbProductStockOperate();
if (Objects.isNull(purveyor)) {
stockOperate.setPurveyorId(null);
stockOperate.setPurveyorName(null);
}else {
stockOperate.setPurveyorId(resources.getSupplierId().toString());
stockOperate.setPurveyorName(purveyor.getPurveyorName());
if(Objects.nonNull(resources.getSupplierId())){
purveyor = tbShopPurveyorRepository.getById(resources.getSupplierId());
if (Objects.nonNull(purveyor)) {
stockOperate.setPurveyorId(resources.getSupplierId().toString());
stockOperate.setPurveyorName(purveyor.getPurveyorName());
}
}
stockOperate.setShopId(tbShopInfo.getId().toString());
stockOperate.setStockSnap("");
stockOperate.setType(resources.getType().equals("in")?"cons_in":"cons_out");