Commit e6d81eed authored by jiaorz's avatar jiaorz

Merge branch 'master-order' into dev

parents eacf42c7 1dbfeb93
......@@ -63,7 +63,7 @@ public class ActivityProductBiz extends BaseBiz<ActivityProductMapper, ActivityP
ActivityProduct oldValue = selectById(activityProduct.getId());
if (oldValue != null) { //增加销量,减少库存
oldValue.setSales(oldValue.getSales() + activityProduct.getSales());
if (oldValue.getStock() > 0) {
if (oldValue.getStock() > 0 || activityProduct.getSales() < 0) {
oldValue.setStock(oldValue.getStock() - activityProduct.getSales());
updateSelectiveByIdRe(oldValue);
return ObjectRestResponse.succ(oldValue);
......
......@@ -57,7 +57,7 @@ public class ActivityProductSpecsBiz extends BaseBiz<ActivityProductSpecsMapper,
}
ActivityProductSpecs oldValue = selectById(activityProductSpecs.getId());
if (oldValue != null) { //增加销量,减少库存
if (oldValue.getStock() > 0) {
if (oldValue.getStock() > 0 || activityProductSpecs.getSales() < 0) {
oldValue.setSales(oldValue.getSales() + activityProductSpecs.getSales());
oldValue.setStock(oldValue.getStock() - activityProductSpecs.getSales());
updateSelectiveByIdRe(oldValue);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment