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