循环依赖
This commit is contained in:
@@ -27,6 +27,7 @@ import com.czg.product.entity.Product;
|
||||
import com.czg.product.service.ProductService;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.market.enums.OrderStatusEnums;
|
||||
import com.czg.service.market.mapper.ChatCouponMapper;
|
||||
import com.czg.service.market.mapper.MkShopCouponRecordMapper;
|
||||
import com.czg.service.market.mapper.ShopCouponMapper;
|
||||
import com.czg.utils.AssertUtil;
|
||||
@@ -74,7 +75,7 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
||||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
@Resource
|
||||
private ChatCouponService chatCouponService;
|
||||
private ChatCouponMapper chatCouponMapper;
|
||||
|
||||
@Override
|
||||
public Page<ShopCouponDTO> chatCoupon(Long shopId, String search) {
|
||||
@@ -347,14 +348,14 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
||||
Collectors.counting()
|
||||
));
|
||||
chatCouponIdCountMap.forEach((chatCouponId, count) -> {
|
||||
ChatCoupon chatCoupon = chatCouponService.getById(chatCouponId);
|
||||
ChatCoupon chatCoupon = chatCouponMapper.selectOneById(chatCouponId);
|
||||
if (chatCoupon == null) {
|
||||
return;
|
||||
}
|
||||
ChatCoupon upChatCoupon = new ChatCoupon();
|
||||
upChatCoupon.setId(chatCoupon.getId());
|
||||
upChatCoupon.setUseNum(chatCoupon.getUseNum() + count.intValue());
|
||||
chatCouponService.updateById(upChatCoupon);
|
||||
chatCouponMapper.update(upChatCoupon);
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user