修改供应商为非必填
This commit is contained in:
@@ -66,9 +66,9 @@ public class TbConCheckServiceImpl implements TbConCheckService {
|
|||||||
throw new Exception("耗材信息不存在");
|
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()));
|
consInfo.setUpdateTime(new Timestamp(System.currentTimeMillis()));
|
||||||
tbConsInfoRepository.save(consInfo);
|
tbConsInfoRepository.save(consInfo);
|
||||||
|
|
||||||
@@ -77,8 +77,8 @@ public class TbConCheckServiceImpl implements TbConCheckService {
|
|||||||
conCheck.setConInfoId(consInfo.getId());
|
conCheck.setConInfoId(consInfo.getId());
|
||||||
conCheck.setConName(consInfo.getConName());
|
conCheck.setConName(consInfo.getConName());
|
||||||
conCheck.setPrice(consInfo.getPrice());
|
conCheck.setPrice(consInfo.getPrice());
|
||||||
conCheck.setAcStockNumber(consInfo.getStockNumber().subtract(consInfo.getStockConsume()));
|
conCheck.setAcStockNumber(resources.getStockNumber());
|
||||||
conCheck.setStockNumber(stonum);
|
conCheck.setStockNumber(resources.getStockNumber());
|
||||||
conCheck.setLpNum(resources.getLpNum());
|
conCheck.setLpNum(resources.getLpNum());
|
||||||
conCheck.setLpAmount(consInfo.getPrice().multiply(resources.getLpNum()));
|
conCheck.setLpAmount(consInfo.getPrice().multiply(resources.getLpNum()));
|
||||||
conCheck.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
conCheck.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
||||||
|
|||||||
@@ -184,18 +184,17 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||||||
if (Objects.isNull(tbShopInfo)) {
|
if (Objects.isNull(tbShopInfo)) {
|
||||||
throw new Exception("店铺信息不存在");
|
throw new Exception("店铺信息不存在");
|
||||||
}
|
}
|
||||||
TbShopPurveyor purveyor = tbShopPurveyorRepository.getById(resources.getSupplierId());
|
|
||||||
|
TbShopPurveyor purveyor=null;
|
||||||
TbProductStockOperate stockOperate = new TbProductStockOperate();
|
TbProductStockOperate stockOperate = new TbProductStockOperate();
|
||||||
if (Objects.isNull(purveyor)) {
|
if(Objects.nonNull(resources.getSupplierId())){
|
||||||
stockOperate.setPurveyorId(null);
|
purveyor = tbShopPurveyorRepository.getById(resources.getSupplierId());
|
||||||
stockOperate.setPurveyorName(null);
|
if (Objects.nonNull(purveyor)) {
|
||||||
}else {
|
stockOperate.setPurveyorId(resources.getSupplierId().toString());
|
||||||
stockOperate.setPurveyorId(resources.getSupplierId().toString());
|
stockOperate.setPurveyorName(purveyor.getPurveyorName());
|
||||||
stockOperate.setPurveyorName(purveyor.getPurveyorName());
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
stockOperate.setShopId(tbShopInfo.getId().toString());
|
stockOperate.setShopId(tbShopInfo.getId().toString());
|
||||||
stockOperate.setStockSnap("");
|
stockOperate.setStockSnap("");
|
||||||
stockOperate.setType(resources.getType().equals("in")?"cons_in":"cons_out");
|
stockOperate.setType(resources.getType().equals("in")?"cons_in":"cons_out");
|
||||||
|
|||||||
Reference in New Issue
Block a user