会员 mainShopId
This commit is contained in:
@@ -2,11 +2,10 @@ package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.dto.shopuser.*;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.service.AShopUserService;
|
||||
import com.czg.account.service.ShopUserFlowService;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.account.vo.ShopUserFlowVO;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaStaffCheckPermission;
|
||||
import com.czg.enums.ShopUserFlowBizEnum;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
@@ -29,7 +28,7 @@ import java.math.BigDecimal;
|
||||
public class ShopUserController {
|
||||
|
||||
@Resource
|
||||
private ShopUserService shopUserService;
|
||||
private AShopUserService shopUserService;
|
||||
@Resource
|
||||
private ShopUserFlowService shopUserFlowService;
|
||||
|
||||
@@ -43,7 +42,7 @@ public class ShopUserController {
|
||||
@GetMapping("/summary")
|
||||
// @SaStaffCheckPermission("yun_xu_guan_li_hui_yuan_xin_xi")
|
||||
public CzgResult<ShopUserSummaryDTO> summary(Integer isVip) {
|
||||
return CzgResult.success(shopUserService.getSummary(StpKit.USER.getUsableShopId(), isVip));
|
||||
return CzgResult.success(shopUserService.getSummary(StpKit.USER.getHeadShopIdBySession(), isVip));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,7 +66,7 @@ public class ShopUserController {
|
||||
@GetMapping("/flow")
|
||||
// @SaStaffCheckPermission("yun_xu_guan_li_hui_yuan_xin_xi")
|
||||
public CzgResult<Page<ShopUserFlowVO>> flow(Integer userId, String bizCode, String startTime, String endTime) {
|
||||
return CzgResult.success(shopUserFlowService.pageInfo(StpKit.USER.getUsableShopId(), userId, bizCode, startTime, endTime));
|
||||
return CzgResult.success(shopUserFlowService.pageInfo(StpKit.USER.getHeadShopIdBySession(), userId, bizCode, startTime, endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,7 +82,7 @@ public class ShopUserController {
|
||||
@GetMapping("/flow/download")
|
||||
// @SaStaffCheckPermission("yun_xu_guan_li_hui_yuan_xin_xi")
|
||||
public void flowDownload(Integer userId, String bizCode, String startTime, String endTime, HttpServletResponse response) throws IOException {
|
||||
shopUserFlowService.flowDownload(StpKit.USER.getUsableShopId(), userId, bizCode, startTime, endTime, response);
|
||||
shopUserFlowService.flowDownload(StpKit.USER.getHeadShopIdBySession(), userId, bizCode, startTime, endTime, response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,7 +124,7 @@ public class ShopUserController {
|
||||
@SaAdminCheckPermission(value = "shopUser:add", name = "店铺用户添加")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> add(@RequestBody @Validated ShopUserAddDTO shopUserAddDTO) {
|
||||
return CzgResult.success(shopUserService.add(StpKit.USER.getUsableShopId(), shopUserAddDTO));
|
||||
return CzgResult.success(shopUserService.add(StpKit.USER.getHeadShopIdBySession(), shopUserAddDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,7 +136,7 @@ public class ShopUserController {
|
||||
@SaAdminCheckPermission(value = "shopUser:edit", name = "店铺用户修改")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody @Validated ShopUserEditDTO shopUserEditDTO) {
|
||||
return CzgResult.success(shopUserService.updateInfo(StpKit.USER.getUsableShopId(), shopUserEditDTO));
|
||||
return CzgResult.success(shopUserService.updateInfo(StpKit.USER.getHeadShopIdBySession(), shopUserEditDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -150,7 +149,7 @@ public class ShopUserController {
|
||||
@PutMapping("/money")
|
||||
public CzgResult<Boolean> editMoney(@RequestBody @Validated ShopUserMoneyEditDTO shopUserMoneyEditDTO) {
|
||||
shopUserMoneyEditDTO.setBizEnum(ShopUserFlowBizEnum.ADMIN_IN);
|
||||
return CzgResult.success(shopUserService.updateMoney(StpKit.USER.getUsableShopId(), shopUserMoneyEditDTO) > 0L);
|
||||
return CzgResult.success(shopUserService.updateMoney(StpKit.USER.getHeadShopIdBySession(), shopUserMoneyEditDTO) > 0L);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,9 +7,8 @@ import com.czg.account.entity.MemberPointsLog;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.entity.ShopUserFlow;
|
||||
import com.czg.account.service.MemberPointsLogService;
|
||||
import com.czg.account.service.PointsExchangeRecordService;
|
||||
import com.czg.account.service.ShopUserFlowService;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.account.service.UShopUserService;
|
||||
import com.czg.annotation.Debounce;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
@@ -29,12 +28,10 @@ import org.springframework.web.bind.annotation.*;
|
||||
@RequestMapping("/user/shopUser")
|
||||
public class UShopUserController {
|
||||
@Resource
|
||||
private ShopUserService shopUserService;
|
||||
private UShopUserService shopUserService;
|
||||
@Resource
|
||||
private ShopUserFlowService shopUserFlowService;
|
||||
@Resource
|
||||
private PointsExchangeRecordService pointsExchangeRecordService;
|
||||
@Resource
|
||||
private MemberPointsLogService memberPointsLogService;
|
||||
|
||||
/**
|
||||
@@ -45,7 +42,7 @@ public class UShopUserController {
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<ShopUserDetailDTO> get(Long shopId) {
|
||||
return CzgResult.success(shopUserService.getInfo(shopId == null ? StpKit.USER.getUsableShopId() : shopId, StpKit.USER.getLoginIdAsLong()));
|
||||
return CzgResult.success(shopUserService.getInfo(shopId == null ? StpKit.USER.getShopId() : shopId, StpKit.USER.getLoginIdAsLong()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,7 +62,7 @@ public class UShopUserController {
|
||||
*/
|
||||
@GetMapping("/code")
|
||||
public CzgResult<String> code(Long shopId) {
|
||||
return shopUserService.getCode(StpKit.USER.getLoginIdAsLong(), shopId == null ? StpKit.USER.getUsableShopId() : shopId);
|
||||
return shopUserService.getCode(StpKit.USER.getLoginIdAsLong(), shopId == null ? StpKit.USER.getShopId() : shopId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,7 +73,7 @@ public class UShopUserController {
|
||||
@PostMapping
|
||||
@Debounce("#shopUserAddDTO.phone")
|
||||
public CzgResult<Boolean> join(@RequestBody @Validated ShopUserAddDTO shopUserAddDTO) {
|
||||
return CzgResult.success(shopUserService.join(StpKit.USER.getUsableShopId(), StpKit.USER.getLoginIdAsLong(), shopUserAddDTO));
|
||||
return CzgResult.success(shopUserService.join(StpKit.USER.getShopId(), StpKit.USER.getLoginIdAsLong(), shopUserAddDTO));
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +104,7 @@ public class UShopUserController {
|
||||
*/
|
||||
@GetMapping("/pointsRecord")
|
||||
public CzgResult<Page<MemberPointsLog>> getPointsRecord() {
|
||||
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getShopId, StpKit.USER.getShopId()).eq(ShopUser::getUserId, StpKit.USER.getLoginIdAsLong()));
|
||||
ShopUser shopUser = shopUserService.getShopUserInfo(StpKit.USER.getShopId(), StpKit.USER.getLoginIdAsLong());
|
||||
return CzgResult.success(memberPointsLogService.page(PageUtil.buildPage(), new QueryWrapper().eq(MemberPointsLog::getShopId, StpKit.USER.getShopId())
|
||||
.eq(MemberPointsLog::getShopUserId, shopUser.getId()).orderBy(MemberPointsLog::getId, false)));
|
||||
}
|
||||
@@ -119,13 +116,8 @@ public class UShopUserController {
|
||||
*/
|
||||
@GetMapping("/pointsRecord/detail")
|
||||
public CzgResult<MemberPointsLog> getPointsRecordDetail(@RequestParam Long id) {
|
||||
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getShopId, StpKit.USER.getShopId()).eq(ShopUser::getUserId, StpKit.USER.getLoginIdAsLong()));
|
||||
ShopUser shopUser = shopUserService.getShopUserInfo(StpKit.USER.getShopId(), StpKit.USER.getLoginIdAsLong());
|
||||
return CzgResult.success(memberPointsLogService.getOne(new QueryWrapper().eq(MemberPointsLog::getShopId, StpKit.USER.getShopId())
|
||||
.eq(MemberPointsLog::getShopUserId, shopUser.getId()).eq(MemberPointsLog::getId, id)));
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,14 +69,4 @@ public class UserAuthorizationController {
|
||||
"shopName", shopInfo.getShopName()
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序登录
|
||||
* @return 登录信息
|
||||
*/
|
||||
@PostMapping("/test")
|
||||
public CzgResult<String> login(@RequestParam long id) {
|
||||
StpKit.USER.login(id, "2342", null, "", MyStpLogic.LoginType.USER, false, "");
|
||||
return CzgResult.success(StpKit.USER.getTokenValue());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user