Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
2025-11-14 16:51:13 +08:00
3 changed files with 31 additions and 3 deletions

View File

@@ -1,5 +1,9 @@
package com.czg.controller;
import com.czg.account.entity.ShopUser;
import com.czg.account.service.ShopInfoService;
import com.czg.account.service.ShopUserFlowService;
import com.czg.account.service.ShopUserService;
import com.czg.account.service.TestService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -11,12 +15,25 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/test")
public class TestController {
@Resource
private ShopUserFlowService shopUserFlowService;
@Resource
private ShopInfoService shopInfoService;
@Resource
private ShopUserService shopUserService;
@Resource
private TestService testService;
@RequestMapping("/hello")
public String hello() {
return testService.insertData();
shopUserFlowService.list().forEach(item -> {
ShopUser shopUserInfo = shopUserService.getShopUserInfo(item.getShopId(), item.getUserId());
if (shopUserInfo != null) {
item.setShopUserId(shopUserInfo.getId());
shopUserFlowService.updateById(item);
}
});
// return testService.insertData();
return "";
}
}

View File

@@ -1,6 +1,10 @@
package com.czg.task;
import com.czg.account.entity.ShopUser;
import com.czg.account.service.PointsExchangeRecordService;
import com.czg.account.service.ShopInfoService;
import com.czg.account.service.ShopUserFlowService;
import com.czg.account.service.ShopUserService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
@@ -18,6 +22,12 @@ public class PointsProductExchangeTask {
@Resource
private PointsExchangeRecordService pointsExchangeRecordService;
@Resource
private ShopUserFlowService shopUserFlowService;
@Resource
private ShopInfoService shopInfoService;
@Resource
private ShopUserService shopUserService;
/**
* order 过期
@@ -26,4 +36,5 @@ public class PointsProductExchangeTask {
public void run() {
pointsExchangeRecordService.authCancel();
}
}

View File

@@ -204,7 +204,7 @@ public class MkBirthdayGiftServiceImpl extends ServiceImpl<MkBirthdayGiftMapper,
// 优惠券信息
if (config.getCouponInfoList() != null && !config.getCouponInfoList().isEmpty()) {
Map<Long, ShopCoupon> couponMap = shopCouponService.list(new QueryWrapper().eq(ShopCoupon::getId, config.getCouponInfoList()
Map<Long, ShopCoupon> couponMap = shopCouponService.list(new QueryWrapper().in(ShopCoupon::getId, config.getCouponInfoList()
.stream().map(CouponInfoDTO::getId).toList())).stream().collect(Collectors.toMap(ShopCoupon::getId, item -> item));
config.getCouponInfoList().forEach(couponInfo -> {
ShopCoupon shopCoupon = couponMap.get(couponInfo.getId());