Compare commits

4 Commits

Author SHA1 Message Date
76c6e12c72 统计充值金额 2025-12-26 11:19:43 +08:00
5b030ea361 名字问题 2025-12-26 11:06:07 +08:00
266e782fc0 Merge branch 'dev' into prod 2025-12-26 10:50:58 +08:00
7eeeb8a30f 分销 定时任务 2025-12-26 10:44:43 +08:00
7 changed files with 26 additions and 46 deletions

View File

@@ -1,39 +0,0 @@
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;
import org.springframework.web.bind.annotation.RestController;
/**
* @author GYJoker
*/
@RestController
@RequestMapping("/notify/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() {
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

@@ -13,6 +13,7 @@ import com.czg.market.vo.InviteUserVO;
import com.czg.market.vo.MkDistributionConfigVO; import com.czg.market.vo.MkDistributionConfigVO;
import com.czg.resp.CzgResult; import com.czg.resp.CzgResult;
import com.czg.sa.StpKit; import com.czg.sa.StpKit;
import com.czg.task.DistributionTask;
import com.czg.utils.AssertUtil; import com.czg.utils.AssertUtil;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
@@ -37,6 +38,22 @@ public class UDistributionController {
private MkDistributionWithdrawFlowService withdrawFlowService; private MkDistributionWithdrawFlowService withdrawFlowService;
@Resource @Resource
private MkDistributionFlowService distributionFlowService; private MkDistributionFlowService distributionFlowService;
@Resource
private DistributionTask distributionTask;
/**
* 分销员中心-获取配置
*/
@GetMapping("/task")
public CzgResult<String> task(@RequestParam Long shopId) {
try {
distributionTask.deliver(shopId);
} catch (Exception e) {
return CzgResult.failure(e.getMessage());
}
return CzgResult.success("任务执行成功");
}
/** /**
* 分销员中心-获取配置 * 分销员中心-获取配置

View File

@@ -50,6 +50,8 @@ public class NotifyController {
@Resource @Resource
private MkShopConsumeDiscountRecordService consumeDiscountRecordService; private MkShopConsumeDiscountRecordService consumeDiscountRecordService;
//新客立减清除数据 测试用
@RequestMapping("clear") @RequestMapping("clear")
public String clear(@RequestParam Integer shopId) { public String clear(@RequestParam Integer shopId) {
consumeDiscountRecordService.remove(new QueryWrapper().eq(MkShopConsumeDiscountRecord::getShopId, shopId)); consumeDiscountRecordService.remove(new QueryWrapper().eq(MkShopConsumeDiscountRecord::getShopId, shopId));

View File

@@ -21,7 +21,7 @@ public class StatisticTaskController {
private StatisticTask statisticTask; private StatisticTask statisticTask;
/** /**
* 基础统计 * 基础统计 预留重置统计
* *
* @param date 日期yyyy-MM-dd * @param date 日期yyyy-MM-dd
*/ */

View File

@@ -39,7 +39,7 @@ public class OTimeTask {
@Resource @Resource
private CashierCartService cartService; private CashierCartService cartService;
@Resource @Resource
private OrderPaymentService orderPaymentService; private OrderPaymentService paymentService;
@Resource @Resource
private GbOrderService gbOrderService; private GbOrderService gbOrderService;
@Resource @Resource
@@ -117,7 +117,7 @@ public class OTimeTask {
LocalDateTime tenMinutesAgo = LocalDateTime.now().minusMinutes(10); LocalDateTime tenMinutesAgo = LocalDateTime.now().minusMinutes(10);
LocalDateTime thirdDayAgo = LocalDateTime.now().minusDays(3); LocalDateTime thirdDayAgo = LocalDateTime.now().minusDays(3);
List<OrderPayment> list = orderPaymentService.list(QueryWrapper.create() List<OrderPayment> list = paymentService.list(QueryWrapper.create()
.gt(OrderPayment::getUpdateTime, thirdDayAgo) .gt(OrderPayment::getUpdateTime, thirdDayAgo)
.lt(OrderPayment::getUpdateTime, tenMinutesAgo) .lt(OrderPayment::getUpdateTime, tenMinutesAgo)
.in(OrderPayment::getSourceType, ware) .in(OrderPayment::getSourceType, ware)

View File

@@ -36,7 +36,7 @@ public class DistributionPayServiceImpl implements DistributionPayService {
private final BigDecimal MONEY_RATE = new BigDecimal("100"); private final BigDecimal MONEY_RATE = new BigDecimal("100");
@Resource @Resource
private OrderPaymentService orderPaymentService; private OrderPaymentService paymentService;
@Resource @Resource
private MkDistributionConfigService configService; private MkDistributionConfigService configService;
@Resource @Resource
@@ -74,7 +74,7 @@ public class DistributionPayServiceImpl implements DistributionPayService {
.setPayType(PayTypeConstants.PayType.PAY) .setPayType(PayTypeConstants.PayType.PAY)
.setOrderNo(payParam.getPlatformType() + IdUtil.getSnowflakeNextId()) .setOrderNo(payParam.getPlatformType() + IdUtil.getSnowflakeNextId())
.setAmount(isRecharge ? payParam.getAmount() : detail.getPayAmount()); .setAmount(isRecharge ? payParam.getAmount() : detail.getPayAmount());
orderPaymentService.save(orderPayment); paymentService.save(orderPayment);
InitInfo initInfo = new InitInfo().setConfig(detail); InitInfo initInfo = new InitInfo().setConfig(detail);
if (isRecharge) { if (isRecharge) {

View File

@@ -22,10 +22,10 @@ public class OrderPaymentServiceImpl extends ServiceImpl<OrderPaymentMapper, Ord
@Override @Override
public BigDecimal countMemberInAmount(Long shopId, Long shopUserId) { public BigDecimal countMemberInAmount(Long shopId, Long shopUserId) {
return getOneAs(QueryWrapper.create().select("IFNULL(sum(amount), 0) as total_amount") return getOneAs(QueryWrapper.create().select("IFNULL(sum(amount), 0) as total_amount")
.eq(OrderPayment::getShopId, 143) .eq(OrderPayment::getShopId, shopId)
.eq(OrderPayment::getSourceType, PayTypeConstants.SourceType.MEMBER_IN) .eq(OrderPayment::getSourceType, PayTypeConstants.SourceType.MEMBER_IN)
.eq(OrderPayment::getPayType, PayTypeConstants.PayType.PAY) .eq(OrderPayment::getPayType, PayTypeConstants.PayType.PAY)
.eq(OrderPayment::getSourceId, 127452) .eq(OrderPayment::getSourceId, shopUserId)
.eq(OrderPayment::getPayStatus, PayTypeConstants.PayStatus.SUCCESS), BigDecimal.class); .eq(OrderPayment::getPayStatus, PayTypeConstants.PayStatus.SUCCESS), BigDecimal.class);
} }
} }