diff --git a/cash-api/account-server/src/main/java/com/czg/controller/user/UserAuthorizationController.java b/cash-api/account-server/src/main/java/com/czg/controller/user/UserAuthorizationController.java index 248a9596..0868e02c 100644 --- a/cash-api/account-server/src/main/java/com/czg/controller/user/UserAuthorizationController.java +++ b/cash-api/account-server/src/main/java/com/czg/controller/user/UserAuthorizationController.java @@ -2,6 +2,8 @@ package com.czg.controller.user; import com.czg.account.dto.auth.LoginTokenDTO; import com.czg.account.dto.auth.UserAuthorizationLoginDTO; +import com.czg.account.entity.ShopInfo; +import com.czg.account.service.ShopInfoService; import com.czg.account.service.UserAuthorizationService; import com.czg.resp.CzgResult; import com.czg.sa.MyStpLogic; @@ -21,6 +23,8 @@ import java.util.Map; public class UserAuthorizationController { @Resource private UserAuthorizationService userAuthorizationService; + @Resource + private ShopInfoService shopInfoService; /** * 小程序登录 @@ -39,8 +43,17 @@ public class UserAuthorizationController { * @return 返回openId */ @GetMapping("/openId") - public CzgResult getOpenId(@RequestParam String code, @RequestParam String source) { - return CzgResult.success(userAuthorizationService.getOpenId(code, source)); + public CzgResult> getOpenId(@RequestParam String code, @RequestParam String source, @RequestParam Long shopId) { + String openId = userAuthorizationService.getOpenId(code, source); + ShopInfo shopInfo = shopInfoService.getById(shopId); + if (shopInfo == null){ + return CzgResult.failure("店铺信息不存在"); + } + return CzgResult.success(Map.of( + "openId", openId, + "shopImage", shopInfo.getLogo(), + "shopName", shopInfo.getShopName() + )); } /** diff --git a/cash-api/order-server/src/main/java/com/czg/task/StatisticTask.java b/cash-api/order-server/src/main/java/com/czg/task/StatisticTask.java index 3ad50046..c2f594ae 100644 --- a/cash-api/order-server/src/main/java/com/czg/task/StatisticTask.java +++ b/cash-api/order-server/src/main/java/com/czg/task/StatisticTask.java @@ -4,6 +4,7 @@ import com.czg.order.service.ShopOrderStatisticService; import com.czg.order.service.ShopProdStatisticService; import com.czg.order.service.ShopTableOrderStatisticService; import jakarta.annotation.Resource; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; /** @@ -18,7 +19,10 @@ public class StatisticTask { @Resource private ShopOrderStatisticService shopOrderStatisticService; +// @Scheduled(cron = "0 0 18 * * ?") public void run() { shopOrderStatisticService.statistic(); + shopProdStatisticService.statistic(); + shopTableOrderStatisticService.statistic(); } }