master:更新优惠时,如果优惠为0,则置为无效;
parent
fba6462c0e
commit
82570399fa
|
|
@ -30,7 +30,7 @@ public class StoreSaleResVO {
|
|||
private Long storeCusId;
|
||||
@ApiModelProperty(value = "档口客户名称")
|
||||
private String storeCusName;
|
||||
@ApiModelProperty(value = "销售类型(销售 1、退货 2、销售/退货 3)")
|
||||
@ApiModelProperty(value = "销售类型(1、销售 2、退货 3、销售/退货)")
|
||||
private Integer saleType;
|
||||
@ApiModelProperty(value = "支付方式(1支付宝、2微信、3现金、4欠款)")
|
||||
private Integer payWay;
|
||||
|
|
|
|||
|
|
@ -23,10 +23,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -142,6 +139,8 @@ public class StoreCustomerProductDiscountServiceImpl implements IStoreCustomerPr
|
|||
if (CollectionUtils.isEmpty(updateList)) {
|
||||
return 0;
|
||||
}
|
||||
// 如果是discount为0,则将该优惠置为无效
|
||||
updateList.stream().filter(x -> Objects.equals(ObjectUtils.defaultIfNull(x.getDiscount(), 0), 0)).forEach(x -> x.setDelFlag(Constants.DELETED));
|
||||
return this.cusProdDiscMapper.insertOrUpdate(updateList).size();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue