切换店铺统计 √

下单选择会员 √
注册会员 √
完善手机号 √
会员流水信息同步 √
This commit is contained in:
谭凯凯
2025-04-10 15:37:17 +08:00
committed by Tankaikai
parent e17a2ee5d1
commit 63e608a208
26 changed files with 263 additions and 64 deletions

View File

@@ -28,6 +28,11 @@
<groupId>cn.dev33</groupId>
<artifactId>sa-token-spring-boot3-starter</artifactId>
</dependency>
<dependency>
<groupId>com.mybatis-flex</groupId>
<artifactId>mybatis-flex-spring-boot3-starter</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>

View File

@@ -16,6 +16,7 @@ import cn.dev33.satoken.stp.StpLogic;
import cn.hutool.core.util.StrUtil;
import com.czg.exception.ApiNotPrintException;
import com.czg.exception.CzgException;
import com.mybatisflex.core.row.DbChain;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
@@ -57,12 +58,13 @@ public class MyStpLogic {
/**
* 身份切换
* @param id 用户id
* @param account 账户名
* @param shopId 店铺id
* @param shopName 店铺名称
*
* @param id 用户id
* @param account 账户名
* @param shopId 店铺id
* @param shopName 店铺名称
* @param loginType 登录类型
* @param isAdmin 是否管理员
* @param isAdmin 是否管理员
*/
public void switchTo(boolean isMain, Long id, String account, Long shopId, String shopName, LoginType loginType, boolean isAdmin) {
StpLogic logic = getLogic();
@@ -113,7 +115,6 @@ public class MyStpLogic {
}
/**
* 获取当前登录账号名称 管理端为用户账号 客户端为openId
*
@@ -137,6 +138,7 @@ public class MyStpLogic {
/**
* 获取主店铺id
*
* @return id
*/
public Long getHeadId() {
@@ -200,6 +202,19 @@ public class MyStpLogic {
return shopId == null ? defaultVal : shopId;
}
/**
* 获取主店id
* @return 主店id
*/
public Long getHeadShopId() {
Long shopId = getShopId(0L);
Long mainId = DbChain.table("tb_shop_config").select("main_id").where("id = ? and is_enable_vip_sync = ?", shopId, 1).objAs(Long.class);
if (mainId != null) {
return mainId;
}
return shopId;
}
/**
* 校验是否为管理端登录
*/
@@ -941,9 +956,6 @@ public class MyStpLogic {
}
public void endSwitch() {
getLogic().endSwitch();
}

View File

@@ -12,6 +12,7 @@ import lombok.EqualsAndHashCode;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* 商品规格
@@ -81,5 +82,9 @@ public class ShopProdSpecDTO extends TreeNode<ShopProdSpecDTO> implements Serial
*/
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
/**
* 受影响的规格id列表
*/
@JSONField(serialize = false)
private List<Long> affectedIdList;
}

View File

@@ -25,6 +25,7 @@ public interface ShopProdUnitService extends IService<ShopProdUnit> {
/**
* 获取商品单位列表
*
* @param param 查询参数
* @return 商品单位列表数据
*/
@@ -32,6 +33,7 @@ public interface ShopProdUnitService extends IService<ShopProdUnit> {
/**
* 获取商品单位详情
*
* @param id 商品单位ID
* @return 商品单位详情数据
*/
@@ -41,8 +43,9 @@ public interface ShopProdUnitService extends IService<ShopProdUnit> {
* 新增商品单位
*
* @param dto 商品单位数据
* @return 新增商品单位ID
*/
void addShopProdUnit(ShopProdUnitDTO dto);
Long addShopProdUnit(ShopProdUnitDTO dto);
/**
* 更新商品单位