|
|
@@ -119,6 +119,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
@Override
|
|
|
@DataScope(businessAlias = "cb")
|
|
|
public List<GoodsVo> selectList(GoodsQueryBo bo) {
|
|
|
+ if(Validator.isNotEmpty(bo.getGoodsName())){
|
|
|
+ bo.setGoodsName(bo.getGoodsName().trim());
|
|
|
+ }
|
|
|
List<GoodsVo> list = baseMapper.selectAllList(bo);
|
|
|
if(Validator.isNotEmpty(bo.getGoodsType())&&bo.getGoodsType()==2){
|
|
|
for(GoodsVo vo : list){
|
|
|
@@ -451,7 +454,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
payStatus.add(3L);
|
|
|
//查看是否有出售过
|
|
|
OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper< OrderGoods >().eq(OrderGoods::getGoodsId,entity.getGoodsId())
|
|
|
- .in(OrderGoods::getPayStatus,payStatus).last("limit 1"));
|
|
|
+ .in(OrderGoods::getPayStatus,payStatus).ne(OrderGoods::getRefundStatus,2).last("limit 1"));
|
|
|
if(Validator.isNotEmpty(orderGoods)){
|
|
|
throw new CustomException("该商品已被购买过,无法改变状态");
|
|
|
}
|