生日有礼发券修复
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
package com.czg.controller;
|
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 com.czg.account.service.TestService;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -11,12 +15,25 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/test")
|
@RequestMapping("/test")
|
||||||
public class TestController {
|
public class TestController {
|
||||||
|
@Resource
|
||||||
|
private ShopUserFlowService shopUserFlowService;
|
||||||
|
@Resource
|
||||||
|
private ShopInfoService shopInfoService;
|
||||||
|
@Resource
|
||||||
|
private ShopUserService shopUserService;
|
||||||
@Resource
|
@Resource
|
||||||
private TestService testService;
|
private TestService testService;
|
||||||
|
|
||||||
@RequestMapping("/hello")
|
@RequestMapping("/hello")
|
||||||
public String 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 "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
package com.czg.task;
|
package com.czg.task;
|
||||||
|
|
||||||
|
import com.czg.account.entity.ShopUser;
|
||||||
import com.czg.account.service.PointsExchangeRecordService;
|
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 jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
@@ -18,6 +22,12 @@ public class PointsProductExchangeTask {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private PointsExchangeRecordService pointsExchangeRecordService;
|
private PointsExchangeRecordService pointsExchangeRecordService;
|
||||||
|
@Resource
|
||||||
|
private ShopUserFlowService shopUserFlowService;
|
||||||
|
@Resource
|
||||||
|
private ShopInfoService shopInfoService;
|
||||||
|
@Resource
|
||||||
|
private ShopUserService shopUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* order 过期
|
* order 过期
|
||||||
@@ -26,4 +36,5 @@ public class PointsProductExchangeTask {
|
|||||||
public void run() {
|
public void run() {
|
||||||
pointsExchangeRecordService.authCancel();
|
pointsExchangeRecordService.authCancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ public class MkBirthdayGiftServiceImpl extends ServiceImpl<MkBirthdayGiftMapper,
|
|||||||
|
|
||||||
// 优惠券信息
|
// 优惠券信息
|
||||||
if (config.getCouponInfoList() != null && !config.getCouponInfoList().isEmpty()) {
|
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));
|
.stream().map(CouponInfoDTO::getId).toList())).stream().collect(Collectors.toMap(ShopCoupon::getId, item -> item));
|
||||||
config.getCouponInfoList().forEach(couponInfo -> {
|
config.getCouponInfoList().forEach(couponInfo -> {
|
||||||
ShopCoupon shopCoupon = couponMap.get(couponInfo.getId());
|
ShopCoupon shopCoupon = couponMap.get(couponInfo.getId());
|
||||||
|
|||||||
Reference in New Issue
Block a user