|
@@ -81,7 +81,7 @@ public class PartServiceImpl extends ServiceImpl<IPartMapper, Part> implements I
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void outStock(Integer partId, Integer count,Long userId,String repairId) {
|
|
|
+ public void outStockCheck(Integer partId, Integer count,Long userId,String repairId) {
|
|
|
Part part = this.getById(partId);
|
|
|
if(part == null){
|
|
|
throw new BusinessException(ResultCode.PART_NOT_EXITS);
|
|
@@ -89,6 +89,10 @@ public class PartServiceImpl extends ServiceImpl<IPartMapper, Part> implements I
|
|
|
if(part.getPartStock() - count < 0){
|
|
|
throw new BusinessException(ResultCode.PART_STOCK_ERROR.code(),part.getPartName()+"_"+ResultCode.PART_STOCK_ERROR.message());
|
|
|
}
|
|
|
+
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void outStock(Integer partId, Integer count,Long userId,String repairId) {
|
|
|
LambdaUpdateWrapper<Part> wrapper = new LambdaUpdateWrapper<>();
|
|
|
wrapper.eq(Part::getPartId,partId);
|
|
|
wrapper.setSql("part_stock = part_stock -" + count);
|