Merge remote-tracking branch 'origin/test' into test
# Conflicts: # cash-service/market-service/src/main/java/com/czg/service/market/service/impl/MkShopCouponRecordServiceImpl.java
This commit is contained in:
commit
ddf3bf7697
|
|
@ -21,6 +21,7 @@ import com.czg.market.entity.ShopCoupon;
|
||||||
import com.czg.market.service.MkShopCouponRecordService;
|
import com.czg.market.service.MkShopCouponRecordService;
|
||||||
import com.czg.market.service.ShopCouponService;
|
import com.czg.market.service.ShopCouponService;
|
||||||
import com.czg.service.market.mapper.MkShopCouponRecordMapper;
|
import com.czg.service.market.mapper.MkShopCouponRecordMapper;
|
||||||
|
import com.czg.service.market.mapper.ShopCouponMapper;
|
||||||
import com.czg.utils.AssertUtil;
|
import com.czg.utils.AssertUtil;
|
||||||
import com.czg.utils.PageUtil;
|
import com.czg.utils.PageUtil;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
|
|
@ -29,7 +30,6 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
|
|
@ -56,8 +56,7 @@ public class MkShopCouponRecordServiceImpl extends ServiceImpl<MkShopCouponRecor
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private ShopUserService shopUserService;
|
private ShopUserService shopUserService;
|
||||||
@Resource
|
@Resource
|
||||||
@Lazy
|
private ShopCouponMapper couponService;
|
||||||
private ShopCouponService couponService;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -134,7 +133,7 @@ public class MkShopCouponRecordServiceImpl extends ServiceImpl<MkShopCouponRecor
|
||||||
AssertUtil.isNull(shopInfo, "店铺不存在");
|
AssertUtil.isNull(shopInfo, "店铺不存在");
|
||||||
ShopUser shopUser = shopUserService.getById(giftDTO.getShopUserId());
|
ShopUser shopUser = shopUserService.getById(giftDTO.getShopUserId());
|
||||||
AssertUtil.isNull(shopUser, "店铺用户不存在");
|
AssertUtil.isNull(shopUser, "店铺用户不存在");
|
||||||
ShopCoupon coupon = couponService.getById(giftDTO.getCouponId());
|
ShopCoupon coupon = couponService.selectOneById(giftDTO.getCouponId());
|
||||||
AssertUtil.isNull(coupon, "优惠券不存在");
|
AssertUtil.isNull(coupon, "优惠券不存在");
|
||||||
AssertUtil.isNotEqual(coupon.getIsDel(), 0, "优惠券状态异常");
|
AssertUtil.isNotEqual(coupon.getIsDel(), 0, "优惠券状态异常");
|
||||||
AssertUtil.isNull(coupon.getShopId(), "优惠券店铺不存在");
|
AssertUtil.isNull(coupon.getShopId(), "优惠券店铺不存在");
|
||||||
|
|
@ -192,7 +191,7 @@ public class MkShopCouponRecordServiceImpl extends ServiceImpl<MkShopCouponRecor
|
||||||
if (coupon.getGiveNum() != -10086) {
|
if (coupon.getGiveNum() != -10086) {
|
||||||
coupon.setLeftNum(coupon.getLeftNum() - number);
|
coupon.setLeftNum(coupon.getLeftNum() - number);
|
||||||
}
|
}
|
||||||
couponService.updateById(coupon);
|
couponService.update(coupon,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,12 +51,8 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
||||||
private MkCouponGiftService couponGiftService;
|
private MkCouponGiftService couponGiftService;
|
||||||
@Resource
|
@Resource
|
||||||
private MkShopCouponRecordService recordService;
|
private MkShopCouponRecordService recordService;
|
||||||
@Resource
|
|
||||||
private ShopUserService shopUserService;
|
|
||||||
@Resource
|
|
||||||
private ShopInfoService shopInfoService;
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private ProductService productService;
|
private ShopUserService shopUserService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<ShopCouponDTO> getCouponPage(ShopCouponDTO param) {
|
public Page<ShopCouponDTO> getCouponPage(ShopCouponDTO param) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue