店员管理/店员等级/账户管理
This commit is contained in:
@@ -6,7 +6,6 @@ import com.starry.admin.utils.SecurityUtils;
|
||||
import com.starry.common.utils.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.jsqlparser.expression.Expression;
|
||||
import net.sf.jsqlparser.expression.NullValue;
|
||||
import net.sf.jsqlparser.expression.StringValue;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -35,9 +34,6 @@ public class MyTenantLineHandler implements TenantLineHandler {
|
||||
public Expression getTenantId() {
|
||||
// 取出当前请求的服务商ID,通过解析器注入到SQL中。
|
||||
String tenantId = SecurityUtils.getTenantId();
|
||||
if (StrUtil.isBlankIfStr(tenantId)) {
|
||||
return new NullValue();
|
||||
}
|
||||
if (StrUtil.isBlankIfStr(tenantId)) {
|
||||
tenantId = "9999";
|
||||
}
|
||||
@@ -50,9 +46,6 @@ public class MyTenantLineHandler implements TenantLineHandler {
|
||||
@Override
|
||||
public boolean ignoreTable(String tableName) {
|
||||
String prefix = StringUtils.substringBefore(tableName, "_");
|
||||
if (Arrays.asList(TABLE_FILTER).contains(tableName) || Arrays.asList(TABLE_PRE).contains(prefix)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return Arrays.asList(TABLE_FILTER).contains(tableName) || Arrays.asList(TABLE_PRE).contains(prefix);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,17 +12,14 @@ import org.springframework.context.annotation.PropertySource;
|
||||
@PropertySource(value = {"classpath:oss.properties"})
|
||||
public class OssProperties implements InitializingBean {
|
||||
|
||||
public String endpoint;
|
||||
public String accessKeyId;
|
||||
public String accessKeySecret;
|
||||
public String bucketName;
|
||||
|
||||
|
||||
public static String ENDPOINT = "";
|
||||
public static String KEY_ID = "";
|
||||
public static String KEY_SECRET = "";
|
||||
public static String BUCKET_NAME = "";
|
||||
|
||||
public String endpoint;
|
||||
public String accessKeyId;
|
||||
public String accessKeySecret;
|
||||
public String bucketName;
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
"/v2/api-docs/**"
|
||||
).permitAll()
|
||||
// 对登录注册要允许匿名访问
|
||||
.antMatchers("/login", "/captcha/get-captcha", "/wx/test/**").permitAll()
|
||||
.antMatchers("/login", "/captcha/get-captcha", "/wx/test/**","/wp/clear/**").permitAll()
|
||||
// 跨域请求会先进行一次options请求
|
||||
.antMatchers(HttpMethod.OPTIONS).permitAll()
|
||||
.anyRequest()// 除上面外的所有请求全部需要鉴权认证
|
||||
|
||||
@@ -15,6 +15,7 @@ import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@@ -34,7 +35,23 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
|
||||
private JwtToken jwtToken;
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException {
|
||||
protected boolean shouldNotFilter(HttpServletRequest request) throws ServletException {
|
||||
String url = request.getRequestURL().toString();
|
||||
log.debug("url ={}", url);
|
||||
// 指定URL不拦截
|
||||
if (url.contains("/wp/clear/")) {
|
||||
return true;
|
||||
}
|
||||
// 指定URL不拦截
|
||||
if (url.contains("/wp/custom/")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doFilterInternal(@NotNull HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException {
|
||||
LoginUser jwtUser = jwtToken.getNewLoginUser(httpServletRequest);
|
||||
if (null != jwtUser && null == SecurityContextHolder.getContext().getAuthentication()) {
|
||||
jwtToken.verifyToken(jwtUser);
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.starry.admin.modules.clear.controller;
|
||||
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkLevelInfoEntity;
|
||||
import com.starry.admin.modules.clear.module.vo.PlayClerkLevelAddVo;
|
||||
import com.starry.admin.modules.clear.module.vo.PlayClerkLevelEditVo;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkLevelInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 店员等级Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/clerk/level")
|
||||
public class PlayClerkLevelInfoController {
|
||||
@Resource
|
||||
private IPlayClerkLevelInfoService playClerkLevelInfoService;
|
||||
|
||||
/**
|
||||
* 查询店员等级列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:list')")
|
||||
@GetMapping("/list")
|
||||
public R list() {
|
||||
return R.ok(playClerkLevelInfoService.selectAll());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店员等级详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playClerkLevelInfoService.selectPlayClerkLevelInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增店员等级
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:create')")
|
||||
@Log(title = "店员等级", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody PlayClerkLevelAddVo vo) {
|
||||
PlayClerkLevelInfoEntity entity = ConvertUtil.entityToVo(vo, PlayClerkLevelInfoEntity.class);
|
||||
int level = playClerkLevelInfoService.selectMaxLevel();
|
||||
entity.setLevel(level + 1);
|
||||
boolean success = playClerkLevelInfoService.create(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店员等级
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:edit')")
|
||||
@Log(title = "店员等级", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update")
|
||||
public R update(@Validated @RequestBody PlayClerkLevelEditVo vo) {
|
||||
PlayClerkLevelInfoEntity entity = ConvertUtil.entityToVo(vo, PlayClerkLevelInfoEntity.class);
|
||||
boolean success = playClerkLevelInfoService.update(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店员等级
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:remove')")
|
||||
@Log(title = "店员等级", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("delMaxLevel")
|
||||
public R remove() {
|
||||
int level = playClerkLevelInfoService.selectMaxLevel();
|
||||
playClerkLevelInfoService.delMaxLevelByLevel(level);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.starry.admin.modules.clear.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoEntity;
|
||||
import com.starry.admin.modules.clear.module.vo.PlayClerkUserAddVo;
|
||||
import com.starry.admin.modules.clear.module.vo.PlayClerkUserEditVo;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkUserInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 店员Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/clerk/user")
|
||||
public class PlayClerkUserInfoController {
|
||||
@Resource
|
||||
private IPlayClerkUserInfoService playClerkUserInfoService;
|
||||
|
||||
/**
|
||||
* 查询店员列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(PlayClerkUserInfoEntity playClerkUserInfo) {
|
||||
IPage<PlayClerkUserInfoEntity> list = playClerkUserInfoService.selectPlayClerkUserInfoByPage(playClerkUserInfo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店员详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playClerkUserInfoService.selectPlayClerkUserInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增店员
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:create')")
|
||||
@Log(title = "店员", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@Validated @RequestBody PlayClerkUserAddVo vo) {
|
||||
PlayClerkUserInfoEntity entity = ConvertUtil.entityToVo(vo, PlayClerkUserInfoEntity.class);
|
||||
boolean success = playClerkUserInfoService.create(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店员
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:edit')")
|
||||
@Log(title = "店员", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update")
|
||||
public R update(@Validated @RequestBody PlayClerkUserEditVo vo) {
|
||||
PlayClerkUserInfoEntity entity = ConvertUtil.entityToVo(vo, PlayClerkUserInfoEntity.class);
|
||||
boolean success = playClerkUserInfoService.update(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店员
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:remove')")
|
||||
@Log(title = "店员", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
return R.ok(playClerkUserInfoService.deletePlayClerkUserInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.starry.admin.modules.clear.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkLevelInfoEntity;
|
||||
|
||||
/**
|
||||
* 店员等级Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
public interface PlayClerkLevelInfoMapper extends BaseMapper<PlayClerkLevelInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.starry.admin.modules.clear.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 店员Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
public interface PlayClerkUserInfoMapper extends BaseMapper<PlayClerkUserInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.starry.admin.modules.clear.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 店员等级对象 play_clerk_level_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_clerk_level_info")
|
||||
public class PlayClerkLevelInfoEntity extends BaseEntity<PlayClerkLevelInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 等级数字(排序字段)
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 首次固定单比例[0 - 100%]
|
||||
*/
|
||||
private Integer firstRegularRatio;
|
||||
|
||||
/**
|
||||
* 非首次固定单比例[0 - 100%]
|
||||
*/
|
||||
private Integer notFirstRegularRatio;
|
||||
|
||||
/**
|
||||
* 首次打赏比例[0 - 100%]
|
||||
*/
|
||||
private Integer firstRewardRatio;
|
||||
|
||||
/**
|
||||
* 非首次打赏比例[0 - 100%]
|
||||
*/
|
||||
private Integer notFirstRewardRatio;
|
||||
|
||||
/**
|
||||
* 首次随机单比例[0 - 100%]
|
||||
*/
|
||||
private Integer firstRandomRadio;
|
||||
|
||||
/**
|
||||
* 非首次随机单比例[0 - 100%]
|
||||
*/
|
||||
private Integer notFirstRandomRadio;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.starry.admin.modules.clear.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 play_clerk_user_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_clerk_user_info")
|
||||
public class PlayClerkUserInfoEntity extends BaseEntity<PlayClerkUserInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 陪玩用户ID
|
||||
*/
|
||||
private String playUserId;
|
||||
|
||||
/**
|
||||
* 用户的标识,对当前公众号唯一
|
||||
*/
|
||||
private String openid;
|
||||
|
||||
/**
|
||||
* 店员昵称
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 店员等级
|
||||
*/
|
||||
private String levelId;
|
||||
|
||||
/**
|
||||
* 店员性别(1:男:0:女)
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 头像框
|
||||
*/
|
||||
private String avatarFrameId;
|
||||
|
||||
/**
|
||||
* 音频
|
||||
*/
|
||||
private String audioFrequency;
|
||||
|
||||
/**
|
||||
* 星座
|
||||
*/
|
||||
private String constellation;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 个性签名
|
||||
*/
|
||||
private String signature;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private Long age;
|
||||
|
||||
/**
|
||||
* 所在国家
|
||||
*/
|
||||
private String country;
|
||||
|
||||
/**
|
||||
* 所在省份
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 所在城市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 账户余额(单位分)
|
||||
*/
|
||||
private String accountBalance;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 在职状态(1:在职,1:离职)
|
||||
*/
|
||||
private String onboardingState;
|
||||
|
||||
/**
|
||||
* 是否推荐状态(1:已推荐,0:未推荐)
|
||||
*/
|
||||
private String recommendationState;
|
||||
|
||||
/**
|
||||
* 是否置顶状态(1:已置顶,0:未置顶)
|
||||
*/
|
||||
private String pinToTopState;
|
||||
|
||||
/**
|
||||
* 在线状态【1:在线,0:离线】
|
||||
*/
|
||||
private String onlineState;
|
||||
|
||||
/**
|
||||
* 上架状态【1:上架,0:下架】
|
||||
*/
|
||||
private String listingState;
|
||||
|
||||
/**
|
||||
* 显示状态【1:显示,0:隐藏】
|
||||
*/
|
||||
private String displayState;
|
||||
|
||||
/**
|
||||
* 实名状态【1:已实名,0:未实名】
|
||||
*/
|
||||
private String realState;
|
||||
|
||||
/**
|
||||
* 是否必须实名【1:必须实名,0:非必须实名】
|
||||
*/
|
||||
private String mandatoryRealState;
|
||||
|
||||
/**
|
||||
* 随机接单状态【1:允许,0:禁止】
|
||||
*/
|
||||
private String randomOrder;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.starry.admin.modules.clear.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class PlayClerkLevelAddVo {
|
||||
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
@NotBlank(message = "等级名称不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 首次固定单比例[0 - 100%]
|
||||
*/
|
||||
private Integer firstRegularRatio;
|
||||
|
||||
/**
|
||||
* 非首次固定单比例[0 - 100%]
|
||||
*/
|
||||
private Integer notFirstRegularRatio;
|
||||
|
||||
/**
|
||||
* 首次打赏比例[0 - 100%]
|
||||
*/
|
||||
private Integer firstRewardRatio;
|
||||
|
||||
/**
|
||||
* 非首次打赏比例[0 - 100%]
|
||||
*/
|
||||
private Integer notFirstRewardRatio;
|
||||
|
||||
/**
|
||||
* 首次随机单比例[0 - 100%]
|
||||
*/
|
||||
private Integer firstRandomRadio;
|
||||
|
||||
/**
|
||||
* 非首次随机单比例[0 - 100%]
|
||||
*/
|
||||
private Integer notFirstRandomRadio;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.starry.admin.modules.clear.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class PlayClerkLevelEditVo {
|
||||
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
@NotBlank(message = "ID不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
@NotBlank(message = "等级名称不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 首次固定单比例[0 - 100%]
|
||||
*/
|
||||
private Integer firstRegularRatio;
|
||||
|
||||
/**
|
||||
* 非首次固定单比例[0 - 100%]
|
||||
*/
|
||||
private Integer notFirstRegularRatio;
|
||||
|
||||
/**
|
||||
* 首次打赏比例[0 - 100%]
|
||||
*/
|
||||
private Integer firstRewardRatio;
|
||||
|
||||
/**
|
||||
* 非首次打赏比例[0 - 100%]
|
||||
*/
|
||||
private Integer notFirstRewardRatio;
|
||||
|
||||
/**
|
||||
* 首次随机单比例[0 - 100%]
|
||||
*/
|
||||
private Integer firstRandomRadio;
|
||||
|
||||
/**
|
||||
* 非首次随机单比例[0 - 100%]
|
||||
*/
|
||||
private Integer notFirstRandomRadio;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.starry.admin.modules.clear.module.vo;
|
||||
|
||||
import com.starry.common.annotation.EnumValue;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
|
||||
@Data
|
||||
public class PlayClerkUserAddVo {
|
||||
|
||||
/**
|
||||
* 账号ID
|
||||
*/
|
||||
@NotBlank(message = "账号不能为空")
|
||||
private String playUserId;
|
||||
|
||||
/**
|
||||
* 用户的标识,对当前公众号唯一
|
||||
*/
|
||||
private String openid;
|
||||
|
||||
/**
|
||||
* 店员昵称
|
||||
*/
|
||||
@NotBlank(message = "昵称不能为空")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 店员等级
|
||||
*/
|
||||
@NotBlank(message = "等级不能为空")
|
||||
private String levelId;
|
||||
|
||||
/**
|
||||
* 店员性别(1:男:0:女)
|
||||
*/
|
||||
@NotNull(message = "性别不能为空")
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@NotBlank(message = "头像不能为空")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 音频
|
||||
*/
|
||||
@NotBlank(message = "音频不能为空")
|
||||
private String audioFrequency;
|
||||
|
||||
/**
|
||||
* 星座
|
||||
*/
|
||||
@NotBlank(message = "星座不能为空")
|
||||
private String constellation;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 个性签名
|
||||
*/
|
||||
@NotBlank(message = "签名不能为空")
|
||||
private String signature;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
@NotNull(message = "年龄不能为空")
|
||||
private Long age;
|
||||
|
||||
/**
|
||||
* 所在国家
|
||||
*/
|
||||
@NotBlank(message = "国家不能为空")
|
||||
private String country;
|
||||
|
||||
/**
|
||||
* 所在省份
|
||||
*/
|
||||
@NotBlank(message = "省份不能为空")
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 所在城市
|
||||
*/
|
||||
@NotBlank(message = "城市不能为空")
|
||||
private String city;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.starry.admin.modules.clear.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
|
||||
@Data
|
||||
public class PlayClerkUserEditVo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@NotBlank(message = "id不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 账号ID
|
||||
*/
|
||||
@NotBlank(message = "账号不能为空")
|
||||
private String playUserId;
|
||||
|
||||
/**
|
||||
* 用户的标识,对当前公众号唯一
|
||||
*/
|
||||
private String openid;
|
||||
|
||||
/**
|
||||
* 店员昵称
|
||||
*/
|
||||
@NotBlank(message = "昵称不能为空")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 店员等级
|
||||
*/
|
||||
@NotBlank(message = "等级不能为空")
|
||||
private String levelId;
|
||||
|
||||
/**
|
||||
* 店员性别(1:男:0:女)
|
||||
*/
|
||||
@NotNull(message = "性别不能为空")
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@NotBlank(message = "头像不能为空")
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 音频
|
||||
*/
|
||||
@NotBlank(message = "音频不能为空")
|
||||
private String audioFrequency;
|
||||
|
||||
/**
|
||||
* 星座
|
||||
*/
|
||||
@NotBlank(message = "星座不能为空")
|
||||
private String constellation;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 个性签名
|
||||
*/
|
||||
@NotBlank(message = "签名不能为空")
|
||||
private String signature;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
@NotNull(message = "年龄不能为空")
|
||||
private Long age;
|
||||
|
||||
/**
|
||||
* 所在国家
|
||||
*/
|
||||
@NotBlank(message = "国家不能为空")
|
||||
private String country;
|
||||
|
||||
/**
|
||||
* 所在省份
|
||||
*/
|
||||
@NotBlank(message = "省份不能为空")
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 所在城市
|
||||
*/
|
||||
@NotBlank(message = "城市不能为空")
|
||||
private String city;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.starry.admin.modules.clear.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkLevelInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店员等级Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
public interface IPlayClerkLevelInfoService extends IService<PlayClerkLevelInfoEntity> {
|
||||
/**
|
||||
* 查询店员等级
|
||||
*
|
||||
* @param id 店员等级主键
|
||||
* @return 店员等级
|
||||
*/
|
||||
PlayClerkLevelInfoEntity selectPlayClerkLevelInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询店员等级列表
|
||||
*
|
||||
* @return 店员等级集合
|
||||
*/
|
||||
List<PlayClerkLevelInfoEntity> selectAll();
|
||||
|
||||
/**
|
||||
* 分页查询店员等级列表
|
||||
*
|
||||
* @param playClerkLevelInfo 店员等级
|
||||
* @return 店员等级集合
|
||||
*/
|
||||
IPage<PlayClerkLevelInfoEntity> selectPlayClerkLevelInfoByPage(PlayClerkLevelInfoEntity playClerkLevelInfo);
|
||||
|
||||
/**
|
||||
* 新增店员等级
|
||||
*
|
||||
* @param playClerkLevelInfo 店员等级
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayClerkLevelInfoEntity playClerkLevelInfo);
|
||||
|
||||
/**
|
||||
* 修改店员等级
|
||||
*
|
||||
* @param playClerkLevelInfo 店员等级
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayClerkLevelInfoEntity playClerkLevelInfo);
|
||||
|
||||
/**
|
||||
* 批量删除店员等级
|
||||
*
|
||||
* @param ids 需要删除的店员等级主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayClerkLevelInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除店员等级信息
|
||||
*
|
||||
* @param id 店员等级主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayClerkLevelInfoById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询最大等级
|
||||
*
|
||||
* @return 最大等级
|
||||
*/
|
||||
int selectMaxLevel();
|
||||
|
||||
|
||||
/**
|
||||
* 删除最大等级
|
||||
*
|
||||
*/
|
||||
void delMaxLevelByLevel(Integer level);
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.starry.admin.modules.clear.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 店员Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
public interface IPlayClerkUserInfoService extends IService<PlayClerkUserInfoEntity> {
|
||||
/**
|
||||
* 查询店员
|
||||
* @param id 店员主键
|
||||
* @return 店员
|
||||
*/
|
||||
PlayClerkUserInfoEntity selectPlayClerkUserInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询店员列表
|
||||
* @param playClerkUserInfo 店员
|
||||
* @return 店员集合
|
||||
*/
|
||||
IPage<PlayClerkUserInfoEntity> selectPlayClerkUserInfoByPage(PlayClerkUserInfoEntity playClerkUserInfo);
|
||||
|
||||
/**
|
||||
* 新增店员
|
||||
* @param playClerkUserInfo 店员
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayClerkUserInfoEntity playClerkUserInfo);
|
||||
|
||||
/**
|
||||
* 修改店员
|
||||
* @param playClerkUserInfo 店员
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayClerkUserInfoEntity playClerkUserInfo);
|
||||
|
||||
/**
|
||||
* 批量删除店员
|
||||
*
|
||||
* @param ids 需要删除的店员主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayClerkUserInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除店员信息
|
||||
*
|
||||
* @param id 店员主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayClerkUserInfoById(String id);
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package com.starry.admin.modules.clear.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.modules.clear.mapper.PlayClerkLevelInfoMapper;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkLevelInfoEntity;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkLevelInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店员等级Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
@Service
|
||||
public class PlayClerkLevelInfoServiceImpl extends ServiceImpl<PlayClerkLevelInfoMapper, PlayClerkLevelInfoEntity> implements IPlayClerkLevelInfoService {
|
||||
@Resource
|
||||
private PlayClerkLevelInfoMapper playClerkLevelInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询店员等级
|
||||
*
|
||||
* @param id 店员等级主键
|
||||
* @return 店员等级
|
||||
*/
|
||||
@Override
|
||||
public PlayClerkLevelInfoEntity selectPlayClerkLevelInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<PlayClerkLevelInfoEntity> selectAll() {
|
||||
LambdaQueryWrapper<PlayClerkLevelInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
lambdaQueryWrapper.orderByAsc(PlayClerkLevelInfoEntity::getLevel);
|
||||
return this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询店员等级列表
|
||||
*
|
||||
* @param playClerkLevelInfo 店员等级
|
||||
* @return 店员等级
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayClerkLevelInfoEntity> selectPlayClerkLevelInfoByPage(PlayClerkLevelInfoEntity playClerkLevelInfo) {
|
||||
Page<PlayClerkLevelInfoEntity> page = new Page<>(1, 9999);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增店员等级
|
||||
*
|
||||
* @param playClerkLevelInfo 店员等级
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayClerkLevelInfoEntity playClerkLevelInfo) {
|
||||
if (StrUtil.isBlankIfStr(playClerkLevelInfo.getId())) {
|
||||
playClerkLevelInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(playClerkLevelInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店员等级
|
||||
*
|
||||
* @param playClerkLevelInfo 店员等级
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayClerkLevelInfoEntity playClerkLevelInfo) {
|
||||
return updateById(playClerkLevelInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除店员等级
|
||||
*
|
||||
* @param ids 需要删除的店员等级主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayClerkLevelInfoByIds(String[] ids) {
|
||||
return playClerkLevelInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店员等级信息
|
||||
*
|
||||
* @param id 店员等级主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayClerkLevelInfoById(String id) {
|
||||
return playClerkLevelInfoMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int selectMaxLevel() {
|
||||
QueryWrapper<PlayClerkLevelInfoEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("max(level) as level ");
|
||||
PlayClerkLevelInfoEntity entity = this.baseMapper.selectOne(queryWrapper);
|
||||
return entity == null ? 0 : entity.getLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delMaxLevelByLevel(Integer level) {
|
||||
LambdaQueryWrapper<PlayClerkLevelInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PlayClerkLevelInfoEntity::getLevel, level);
|
||||
playClerkLevelInfoMapper.delete(queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.starry.admin.modules.clear.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.modules.clear.mapper.PlayClerkUserInfoMapper;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoEntity;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkUserInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
/**
|
||||
* 店员Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
@Service
|
||||
public class PlayClerkUserInfoServiceImpl extends ServiceImpl<PlayClerkUserInfoMapper, PlayClerkUserInfoEntity> implements IPlayClerkUserInfoService {
|
||||
@Resource
|
||||
private PlayClerkUserInfoMapper playClerkUserInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询店员
|
||||
* @param id 店员主键
|
||||
* @return 店员
|
||||
*/
|
||||
@Override
|
||||
public PlayClerkUserInfoEntity selectPlayClerkUserInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询店员列表
|
||||
* @param playClerkUserInfo 店员
|
||||
* @return 店员
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayClerkUserInfoEntity> selectPlayClerkUserInfoByPage(PlayClerkUserInfoEntity playClerkUserInfo) {
|
||||
Page<PlayClerkUserInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<PlayClerkUserInfoEntity>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增店员
|
||||
* @param playClerkUserInfo 店员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayClerkUserInfoEntity playClerkUserInfo) {
|
||||
if (StrUtil.isBlankIfStr(playClerkUserInfo.getId())){
|
||||
playClerkUserInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(playClerkUserInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店员
|
||||
* @param playClerkUserInfo 店员
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayClerkUserInfoEntity playClerkUserInfo) {
|
||||
return updateById(playClerkUserInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除店员
|
||||
* @param ids 需要删除的店员主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayClerkUserInfoByIds(String[] ids) {
|
||||
return playClerkUserInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店员信息
|
||||
* @param id 店员主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayClerkUserInfoById(String id) {
|
||||
return playClerkUserInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.starry.admin.modules.commodity.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.commodity.module.entity.PlayServiceInfoEntity;
|
||||
import com.starry.admin.modules.commodity.service.IPlayServiceInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 服务项目列表Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/commodity/info")
|
||||
public class PlayServiceInfoController {
|
||||
@Resource
|
||||
private IPlayServiceInfoService playServiceInfoService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询服务项目列表列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(PlayServiceInfoEntity playServiceInfo) {
|
||||
IPage<PlayServiceInfoEntity> list = playServiceInfoService.selectPlayServiceInfoByPage(playServiceInfo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取服务项目列表详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playServiceInfoService.selectPlayServiceInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增服务项目列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:create')")
|
||||
@Log(title = "服务项目列表", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody PlayServiceInfoEntity playServiceInfo) {
|
||||
boolean success = playServiceInfoService.create(playServiceInfo);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改服务项目列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:edit')")
|
||||
@Log(title = "服务项目列表", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{id}")
|
||||
public R update(@PathVariable String id, @RequestBody PlayServiceInfoEntity playServiceInfo) {
|
||||
playServiceInfo.setId(id);
|
||||
boolean success = playServiceInfoService.update(playServiceInfo);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除服务项目列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:remove')")
|
||||
@Log(title = "服务项目列表", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
return R.ok(playServiceInfoService.deletePlayServiceInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.starry.admin.modules.commodity.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.commodity.module.entity.PlayClearServiceEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 陪玩引用服务项目Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-28
|
||||
*/
|
||||
public interface PlayClearServiceMapper extends BaseMapper<PlayClearServiceEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.starry.admin.modules.commodity.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.commodity.module.entity.PlayServiceInfoEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 服务项目列表Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-28
|
||||
*/
|
||||
public interface PlayServiceInfoMapper extends BaseMapper<PlayServiceInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.starry.admin.modules.commodity.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 陪玩引用服务项目对象 play_clear_service
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_clear_service")
|
||||
public class PlayClearServiceEntity extends BaseEntity<PlayClearServiceEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 店员用户ID
|
||||
*/
|
||||
private String playUserId;
|
||||
|
||||
/**
|
||||
* 服务项目ID
|
||||
*/
|
||||
private String serviceId;
|
||||
|
||||
|
||||
/**
|
||||
* 项目启用状态
|
||||
* 1:启用
|
||||
* 0:停用
|
||||
*
|
||||
* @since 2024/3/28 11:20
|
||||
**/
|
||||
private String enablingState;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.starry.admin.modules.commodity.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 服务项目信息对象 play_service_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_service_info")
|
||||
public class PlayServiceInfoEntity extends BaseEntity<PlayServiceInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
private String itemName;
|
||||
|
||||
/**
|
||||
* 服务时长(文字描述信息,不参与订单计算)
|
||||
*/
|
||||
private String serviceDuration;
|
||||
|
||||
/**
|
||||
* 服务单价
|
||||
*/
|
||||
private String price;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.starry.admin.modules.commodity.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.commodity.module.entity.PlayClearServiceEntity;
|
||||
|
||||
/**
|
||||
* 陪玩引用服务项目Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-28
|
||||
*/
|
||||
public interface IPlayClearServiceService extends IService<PlayClearServiceEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 初始化陪玩的服务项目
|
||||
*
|
||||
* @param playUserId 陪玩用户ID
|
||||
* @author 杭州世平信息科技有限公司-xuhq
|
||||
* @since 2024/3/28 11:13
|
||||
**/
|
||||
void initPlayService(String playUserId);
|
||||
|
||||
/**
|
||||
* 查询陪玩引用服务项目
|
||||
*
|
||||
* @param id 陪玩引用服务项目主键
|
||||
* @return 陪玩引用服务项目
|
||||
*/
|
||||
PlayClearServiceEntity selectPlayClearServiceById(String id);
|
||||
|
||||
/**
|
||||
* 查询陪玩引用服务项目列表
|
||||
*
|
||||
* @param playClearService 陪玩引用服务项目
|
||||
* @return 陪玩引用服务项目集合
|
||||
*/
|
||||
IPage<PlayClearServiceEntity> selectPlayClearServiceByPage(PlayClearServiceEntity playClearService);
|
||||
|
||||
/**
|
||||
* 新增陪玩引用服务项目
|
||||
*
|
||||
* @param playClearService 陪玩引用服务项目
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayClearServiceEntity playClearService);
|
||||
|
||||
|
||||
/**
|
||||
* 修改陪玩服务启停状态
|
||||
*
|
||||
* @param playUserId 陪玩用户ID
|
||||
* @param serviceId 服务ID
|
||||
* @param enablingState * 项目启用状态【0:停用,1:启用】
|
||||
* @author 杭州世平信息科技有限公司-xuhq
|
||||
* @since 2024/3/28 11:35
|
||||
**/
|
||||
void updateServiceEnablingState(String playUserId, String serviceId, String enablingState);
|
||||
|
||||
/**
|
||||
* 修改陪玩引用服务项目
|
||||
*
|
||||
* @param playClearService 陪玩引用服务项目
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayClearServiceEntity playClearService);
|
||||
|
||||
/**
|
||||
* 批量删除陪玩引用服务项目
|
||||
*
|
||||
* @param ids 需要删除的陪玩引用服务项目主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayClearServiceByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除陪玩引用服务项目信息
|
||||
*
|
||||
* @param id 陪玩引用服务项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayClearServiceById(String id);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.starry.admin.modules.commodity.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.commodity.module.entity.PlayServiceInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 服务项目列表Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-28
|
||||
*/
|
||||
public interface IPlayServiceInfoService extends IService<PlayServiceInfoEntity> {
|
||||
|
||||
/**
|
||||
* 查询服务项目列表
|
||||
*
|
||||
* @param id 服务项目列表主键
|
||||
* @return 服务项目列表
|
||||
*/
|
||||
PlayServiceInfoEntity selectPlayServiceInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询所有的服务项目
|
||||
*
|
||||
* @return List<PlayServiceInfoEntity>
|
||||
* @author 杭州世平信息科技有限公司-xuhq
|
||||
* @since 2024/3/28 11:18
|
||||
**/
|
||||
List<PlayServiceInfoEntity> selectPlayServiceInfoAll();
|
||||
|
||||
/**
|
||||
* 查询服务项目列表列表
|
||||
*
|
||||
* @param playServiceInfo 服务项目列表
|
||||
* @return 服务项目列表集合
|
||||
*/
|
||||
IPage<PlayServiceInfoEntity> selectPlayServiceInfoByPage(PlayServiceInfoEntity playServiceInfo);
|
||||
|
||||
/**
|
||||
* 新增服务项目列表
|
||||
*
|
||||
* @param playServiceInfo 服务项目列表
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayServiceInfoEntity playServiceInfo);
|
||||
|
||||
/**
|
||||
* 修改服务项目列表
|
||||
*
|
||||
* @param playServiceInfo 服务项目列表
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayServiceInfoEntity playServiceInfo);
|
||||
|
||||
/**
|
||||
* 批量删除服务项目列表
|
||||
*
|
||||
* @param ids 需要删除的服务项目列表主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayServiceInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除服务项目列表信息
|
||||
*
|
||||
* @param id 服务项目列表主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayServiceInfoById(String id);
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.starry.admin.modules.commodity.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.commodity.mapper.PlayClearServiceMapper;
|
||||
import com.starry.admin.modules.commodity.module.entity.PlayClearServiceEntity;
|
||||
import com.starry.admin.modules.commodity.module.entity.PlayServiceInfoEntity;
|
||||
import com.starry.admin.modules.commodity.service.IPlayClearServiceService;
|
||||
import com.starry.admin.modules.commodity.service.IPlayServiceInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 陪玩引用服务项目Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-28
|
||||
*/
|
||||
@Service
|
||||
public class PlayClearServiceServiceImpl extends ServiceImpl<PlayClearServiceMapper, PlayClearServiceEntity> implements IPlayClearServiceService {
|
||||
@Resource
|
||||
private PlayClearServiceMapper playClearServiceMapper;
|
||||
|
||||
|
||||
@Resource
|
||||
private IPlayServiceInfoService playServiceInfoService;
|
||||
|
||||
|
||||
@Override
|
||||
public void initPlayService(String playUserId) {
|
||||
for (PlayServiceInfoEntity playServiceInfoEntity : playServiceInfoService.selectPlayServiceInfoAll()) {
|
||||
PlayClearServiceEntity entity = new PlayClearServiceEntity();
|
||||
entity.setServiceId(playServiceInfoEntity.getId());
|
||||
entity.setTenantId(playServiceInfoEntity.getTenantId());
|
||||
entity.setPlayUserId(playUserId);
|
||||
entity.setEnablingState("0");
|
||||
this.create(entity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询陪玩引用服务项目
|
||||
*
|
||||
* @param id 陪玩引用服务项目主键
|
||||
* @return 陪玩引用服务项目
|
||||
*/
|
||||
@Override
|
||||
public PlayClearServiceEntity selectPlayClearServiceById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询陪玩引用服务项目列表
|
||||
*
|
||||
* @param playClearService 陪玩引用服务项目
|
||||
* @return 陪玩引用服务项目
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayClearServiceEntity> selectPlayClearServiceByPage(PlayClearServiceEntity playClearService) {
|
||||
Page<PlayClearServiceEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<PlayClearServiceEntity>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增陪玩引用服务项目
|
||||
*
|
||||
* @param playClearService 陪玩引用服务项目
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayClearServiceEntity playClearService) {
|
||||
if (StrUtil.isBlankIfStr(playClearService.getId())) {
|
||||
playClearService.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(playClearService);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateServiceEnablingState(String playUserId, String serviceId, String enablingState) {
|
||||
LambdaQueryWrapper<PlayClearServiceEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayClearServiceEntity::getServiceId, serviceId);
|
||||
lambdaQueryWrapper.eq(PlayClearServiceEntity::getPlayUserId, playUserId);
|
||||
List<PlayClearServiceEntity> list = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
if (list.size() != 1) {
|
||||
throw new CustomException("服务不存在,请查证");
|
||||
}
|
||||
// 更新服务状态
|
||||
PlayClearServiceEntity item = list.get(0);
|
||||
item.setEnablingState(enablingState);
|
||||
this.update(item);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改陪玩引用服务项目
|
||||
*
|
||||
* @param playClearService 陪玩引用服务项目
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayClearServiceEntity playClearService) {
|
||||
return updateById(playClearService);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除陪玩引用服务项目
|
||||
*
|
||||
* @param ids 需要删除的陪玩引用服务项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayClearServiceByIds(String[] ids) {
|
||||
return playClearServiceMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除陪玩引用服务项目信息
|
||||
*
|
||||
* @param id 陪玩引用服务项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayClearServiceById(String id) {
|
||||
return playClearServiceMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.starry.admin.modules.commodity.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.modules.commodity.mapper.PlayServiceInfoMapper;
|
||||
import com.starry.admin.modules.commodity.module.entity.PlayServiceInfoEntity;
|
||||
import com.starry.admin.modules.commodity.service.IPlayServiceInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 服务项目列表Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-28
|
||||
*/
|
||||
@Service
|
||||
public class PlayServiceInfoServiceImpl extends ServiceImpl<PlayServiceInfoMapper, PlayServiceInfoEntity> implements IPlayServiceInfoService {
|
||||
@Resource
|
||||
private PlayServiceInfoMapper playServiceInfoMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询服务项目列表
|
||||
*
|
||||
* @param id 服务项目列表主键
|
||||
* @return 服务项目列表
|
||||
*/
|
||||
@Override
|
||||
public PlayServiceInfoEntity selectPlayServiceInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<PlayServiceInfoEntity> selectPlayServiceInfoAll() {
|
||||
return this.baseMapper.selectList(new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询服务项目列表列表
|
||||
*
|
||||
* @param playServiceInfo 服务项目列表
|
||||
* @return 服务项目列表
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayServiceInfoEntity> selectPlayServiceInfoByPage(PlayServiceInfoEntity playServiceInfo) {
|
||||
Page<PlayServiceInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<PlayServiceInfoEntity>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增服务项目列表
|
||||
*
|
||||
* @param playServiceInfo 服务项目列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayServiceInfoEntity playServiceInfo) {
|
||||
if (StrUtil.isBlankIfStr(playServiceInfo.getId())) {
|
||||
playServiceInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(playServiceInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改服务项目列表
|
||||
*
|
||||
* @param playServiceInfo 服务项目列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayServiceInfoEntity playServiceInfo) {
|
||||
return updateById(playServiceInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除服务项目列表
|
||||
*
|
||||
* @param ids 需要删除的服务项目列表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayServiceInfoByIds(String[] ids) {
|
||||
return playServiceInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除服务项目列表信息
|
||||
*
|
||||
* @param id 服务项目列表主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayServiceInfoById(String id) {
|
||||
return playServiceInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import java.util.List;
|
||||
public interface CouponInfoMapper extends BaseMapper<CouponInfoEntity> {
|
||||
/**
|
||||
* 查询商品
|
||||
*
|
||||
* @param id 商品主键
|
||||
* @return 商品
|
||||
*/
|
||||
@@ -21,6 +22,7 @@ public interface CouponInfoMapper extends BaseMapper<CouponInfoEntity> {
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*
|
||||
* @param couponInfo 商品
|
||||
* @return 商品集合
|
||||
*/
|
||||
|
||||
@@ -25,6 +25,7 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
|
||||
|
||||
/**
|
||||
* 查询商品
|
||||
*
|
||||
* @param id 商品主键
|
||||
* @return 商品
|
||||
*/
|
||||
@@ -35,6 +36,7 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
|
||||
|
||||
/**
|
||||
* 查询商品列表
|
||||
*
|
||||
* @param couponInfo 商品
|
||||
* @return 商品
|
||||
*/
|
||||
@@ -46,6 +48,7 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
|
||||
|
||||
/**
|
||||
* 新增商品
|
||||
*
|
||||
* @param couponInfo 商品
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -56,6 +59,7 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*
|
||||
* @param couponInfo 商品
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -66,6 +70,7 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
|
||||
|
||||
/**
|
||||
* 批量删除商品
|
||||
*
|
||||
* @param ids 需要删除的商品主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -76,6 +81,7 @@ public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponI
|
||||
|
||||
/**
|
||||
* 删除商品信息
|
||||
*
|
||||
* @param id 商品主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
@@ -75,7 +75,7 @@ public class OrderInfoController {
|
||||
// }
|
||||
|
||||
// 新增陪玩余额
|
||||
playUserInfoService.editAccountBalance(addVo.getPlayUserId(), addVo.getMoney(), "add");
|
||||
// playUserInfoService.editAccountBalance(addVo.getPlayUserId(), addVo.getMoney(), "add");
|
||||
// 减少用户余额
|
||||
|
||||
// 新增订单记录(订单信息需完善)
|
||||
@@ -102,9 +102,7 @@ public class OrderInfoController {
|
||||
long orderTotalMoney = 0;
|
||||
// 校验商品(陪玩)状态
|
||||
PlayUserInfoEntity playUserInfo = playUserInfoService.selectPlayUserInfoById(addVo.getPlayUserId());
|
||||
if ("2".equals(playUserInfo.getUserState())) {
|
||||
throw new CustomException("陪玩状态异常,无法下单");
|
||||
}
|
||||
|
||||
|
||||
// 校验优惠券是否存在
|
||||
for (String commodityInfoId : addVo.getCouponIds()) {
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.List;
|
||||
public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
@@ -21,6 +22,7 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
* @param orderInfoEntity 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
|
||||
@@ -34,5 +34,4 @@ public class OrderInfoCancellationVo {
|
||||
private String operatorBy;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.starry.admin.modules.order.service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.order.module.entity.OrderLogInfoEntity;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
*
|
||||
@@ -12,6 +13,7 @@ import com.starry.admin.modules.order.module.entity.OrderLogInfoEntity;
|
||||
public interface IOrderLogInfoService extends IService<OrderLogInfoEntity> {
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*
|
||||
* @param id 【请填写功能名称】主键
|
||||
* @return 【请填写功能名称】
|
||||
*/
|
||||
@@ -19,6 +21,7 @@ public interface IOrderLogInfoService extends IService<OrderLogInfoEntity> {
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*
|
||||
* @param orderLogInfo 【请填写功能名称】
|
||||
* @return 【请填写功能名称】集合
|
||||
*/
|
||||
@@ -26,6 +29,7 @@ public interface IOrderLogInfoService extends IService<OrderLogInfoEntity> {
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*
|
||||
* @param orderLogInfo 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -33,6 +37,7 @@ public interface IOrderLogInfoService extends IService<OrderLogInfoEntity> {
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*
|
||||
* @param orderLogInfo 【请填写功能名称】
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
@@ -37,6 +37,32 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
@Resource
|
||||
private IPlayUserInfoService playUserInfoService;
|
||||
|
||||
/**
|
||||
* 计算退款金额
|
||||
*
|
||||
* @param refundType 退款类型【1:部分退款,2:全部退款】
|
||||
* @param refundMoney 退款金额,单位分(仅部分退款有效)
|
||||
* @param entity 订单信息
|
||||
* @return 最终退款金额
|
||||
*/
|
||||
private static long getFinalAmount(String refundType, String refundMoney, OrderInfoEntity entity) {
|
||||
long finalAmount = 0;
|
||||
// 部分退款,计算退款金额是否小于订单金额
|
||||
if ("1".equals(refundType)) {
|
||||
// 退款金额
|
||||
long refundMoneyLong = Long.getLong(refundMoney);
|
||||
// 订单金额
|
||||
long orderMoney = Long.getLong(entity.getOrderMoney());
|
||||
if (refundMoneyLong <= 0) {
|
||||
throw new CustomException("退款金额必须大于0");
|
||||
}
|
||||
if (orderMoney < refundMoneyLong) {
|
||||
throw new CustomException("退款金额必须小于订单总金额");
|
||||
}
|
||||
finalAmount = orderMoney - refundMoneyLong;
|
||||
}
|
||||
return finalAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
@@ -113,7 +139,6 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
return orderInfoMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void orderRefund(String id, String refundType, String refundMoney, boolean examine) {
|
||||
OrderInfoEntity entity = this.selectOrderInfoById(id);
|
||||
@@ -127,7 +152,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
long finalAmount = getFinalAmount(refundType, refundMoney, entity);
|
||||
|
||||
// 减少陪玩余额
|
||||
playUserInfoService.editAccountBalance(id, String.valueOf(finalAmount), "reduce");
|
||||
// playUserInfoService.editAccountBalance(id, String.valueOf(finalAmount), "reduce");
|
||||
// 新增用户余额
|
||||
|
||||
// 修改订单信息
|
||||
@@ -138,32 +163,4 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
// 增加订单处理日志
|
||||
orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "4", new Date()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 计算退款金额
|
||||
*
|
||||
* @param refundType 退款类型【1:部分退款,2:全部退款】
|
||||
* @param refundMoney 退款金额,单位分(仅部分退款有效)
|
||||
* @param entity 订单信息
|
||||
* @return 最终退款金额
|
||||
*/
|
||||
private static long getFinalAmount(String refundType, String refundMoney, OrderInfoEntity entity) {
|
||||
long finalAmount = 0;
|
||||
//部分退款,计算退款金额是否小于订单金额
|
||||
if ("1".equals(refundType)) {
|
||||
// 退款金额
|
||||
long refundMoneyLong = Long.getLong(refundMoney);
|
||||
// 订单金额
|
||||
long orderMoney = Long.getLong(entity.getOrderMoney());
|
||||
if (refundMoneyLong <= 0) {
|
||||
throw new CustomException("退款金额必须大于0");
|
||||
}
|
||||
if (orderMoney < refundMoneyLong) {
|
||||
throw new CustomException("退款金额必须小于订单总金额");
|
||||
}
|
||||
finalAmount = orderMoney - refundMoneyLong;
|
||||
}
|
||||
return finalAmount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +41,6 @@ public class SysTenantController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询租户表列表
|
||||
*/
|
||||
|
||||
@@ -70,5 +70,4 @@ public interface ISysTenantPackageService extends IService<SysTenantPackageEntit
|
||||
List<SimplePackage> getSimpleList();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ public interface ISysTenantService extends IService<SysTenantEntity> {
|
||||
|
||||
/**
|
||||
* 根据套餐ID查询租户
|
||||
*
|
||||
* @param packageId 套餐ID
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -2,40 +2,44 @@ package com.starry.admin.modules.play.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.play.module.entity.PlayUserInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayUserInfoAddVo;
|
||||
import com.starry.admin.modules.play.module.vo.PlayUserInfoQueryVo;
|
||||
import com.starry.admin.modules.play.module.vo.PlayUserInfoUpdateVo;
|
||||
import com.starry.admin.modules.play.service.IPlayUserInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 陪玩用户Controller
|
||||
* 账号Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-24
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/play/user/info")
|
||||
@RequestMapping("/play/user")
|
||||
public class PlayUserInfoController {
|
||||
@Resource
|
||||
private IPlayUserInfoService playUserInfoService;
|
||||
|
||||
/**
|
||||
* 查询陪玩用户列表
|
||||
* 查询账号列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(PlayUserInfoEntity playUserInfo) {
|
||||
IPage<PlayUserInfoEntity> list = playUserInfoService.selectPlayUserInfoByPage(playUserInfo);
|
||||
public R list(PlayUserInfoQueryVo vo) {
|
||||
IPage<PlayUserInfoEntity> list = playUserInfoService.selectPlayUserInfoByPage(vo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取陪玩用户详细信息
|
||||
* 获取账号详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@@ -44,13 +48,14 @@ public class PlayUserInfoController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增陪玩用户
|
||||
* 新增账号
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:create')")
|
||||
@Log(title = "陪玩用户", businessType = BusinessType.INSERT)
|
||||
@Log(title = "账号", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody PlayUserInfoEntity playUserInfo) {
|
||||
boolean success = playUserInfoService.create(playUserInfo);
|
||||
public R create(@Validated @RequestBody PlayUserInfoAddVo vo) {
|
||||
PlayUserInfoEntity entity = ConvertUtil.entityToVo(vo, PlayUserInfoEntity.class);
|
||||
boolean success = playUserInfoService.create(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
@@ -58,14 +63,14 @@ public class PlayUserInfoController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改陪玩用户
|
||||
* 修改账号
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:edit')")
|
||||
@Log(title = "陪玩用户", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{id}")
|
||||
public R update(@PathVariable String id, @RequestBody PlayUserInfoEntity playUserInfo) {
|
||||
playUserInfo.setId(id);
|
||||
boolean success = playUserInfoService.update(playUserInfo);
|
||||
@Log(title = "账号", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update")
|
||||
public R update(@Validated @RequestBody PlayUserInfoUpdateVo vo) {
|
||||
PlayUserInfoEntity entity = ConvertUtil.entityToVo(vo, PlayUserInfoEntity.class);
|
||||
boolean success = playUserInfoService.update(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
@@ -73,10 +78,10 @@ public class PlayUserInfoController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除陪玩用户
|
||||
* 删除账号
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:remove')")
|
||||
@Log(title = "陪玩用户", businessType = BusinessType.DELETE)
|
||||
@Log(title = "账号", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
return R.ok(playUserInfoService.deletePlayUserInfoByIds(ids));
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.starry.admin.modules.play.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.play.module.entity.PlayUserInfoEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 陪玩用户Mapper接口
|
||||
* 账号Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-24
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
public interface PlayUserInfoMapper extends BaseMapper<PlayUserInfoEntity> {
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 陪玩用户对象 ply_user_info
|
||||
* 账号对象 play_user_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-24
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -28,84 +28,13 @@ public class PlayUserInfoEntity extends BaseEntity<PlayUserInfoEntity> {
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
* 账户名称(手机号码)
|
||||
*/
|
||||
private String name;
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 证件号码
|
||||
* 手机号码区号
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 账户余额
|
||||
*/
|
||||
private String accountBalance;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private String profilePicture;
|
||||
|
||||
/**
|
||||
* 陪玩状态[0,1,2]
|
||||
* 0:正常,
|
||||
* 1:被标记:
|
||||
* 2:被封禁
|
||||
*/
|
||||
private String userState;
|
||||
|
||||
/**
|
||||
* 陪玩等级
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 陪玩在线状态[0:1]
|
||||
* 0:在线
|
||||
* 1:离线
|
||||
*/
|
||||
private String presenceState;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private Long age;
|
||||
|
||||
/**
|
||||
* 所在城市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 所在国家
|
||||
*/
|
||||
private String country;
|
||||
|
||||
/**
|
||||
* 所在省份
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 用户语言
|
||||
*/
|
||||
private String language;
|
||||
|
||||
private String areaCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.starry.admin.modules.play.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class PlayUserInfoAddVo {
|
||||
|
||||
/**
|
||||
* 账户名称(手机号码)
|
||||
*/
|
||||
@NotBlank(message = "手机号码不能为空")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 手机号码区号
|
||||
*/
|
||||
@NotBlank(message = "手机号码区号不能为空")
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
@NotBlank(message = "手机号码区号不能为空")
|
||||
private String verificationCode;
|
||||
|
||||
/**
|
||||
* 陪玩用户ID
|
||||
*/
|
||||
@NotBlank(message = "绑定用户不能为空")
|
||||
private String playUserId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.starry.admin.modules.play.module.vo;
|
||||
|
||||
import com.starry.common.domain.BasePageEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class PlayUserInfoQueryVo extends BasePageEntity {
|
||||
|
||||
private String id;
|
||||
|
||||
|
||||
private String username;
|
||||
|
||||
|
||||
private String areaCode;
|
||||
|
||||
|
||||
private String ruleId;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.starry.admin.modules.play.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class PlayUserInfoUpdateVo {
|
||||
|
||||
@NotBlank(message = "ID不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 陪玩用户ID
|
||||
*/
|
||||
@NotBlank(message = "绑定用户不能为空")
|
||||
private String playUserId;
|
||||
|
||||
|
||||
}
|
||||
@@ -3,97 +3,60 @@ package com.starry.admin.modules.play.service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.play.module.entity.PlayUserInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayUserInfoQueryVo;
|
||||
|
||||
/**
|
||||
* 陪玩用户Service接口
|
||||
* 账号Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-24
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
public interface IPlayUserInfoService extends IService<PlayUserInfoEntity> {
|
||||
/**
|
||||
* 查询陪玩用户
|
||||
* 查询账号
|
||||
*
|
||||
* @param id 陪玩用户主键
|
||||
* @return 陪玩用户
|
||||
* @param id 账号主键
|
||||
* @return 账号
|
||||
*/
|
||||
PlayUserInfoEntity selectPlayUserInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询陪玩用户列表
|
||||
* 查询账号列表
|
||||
*
|
||||
* @param playUserInfo 陪玩用户
|
||||
* @return 陪玩用户集合
|
||||
* @param vo 账号查询实体
|
||||
* @return 账号集合
|
||||
*/
|
||||
IPage<PlayUserInfoEntity> selectPlayUserInfoByPage(PlayUserInfoEntity playUserInfo);
|
||||
IPage<PlayUserInfoEntity> selectPlayUserInfoByPage(PlayUserInfoQueryVo vo);
|
||||
|
||||
/**
|
||||
* 新增陪玩用户
|
||||
* 新增账号
|
||||
*
|
||||
* @param playUserInfo 陪玩用户
|
||||
* @param playUserInfo 账号
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayUserInfoEntity playUserInfo);
|
||||
|
||||
/**
|
||||
* 修改陪玩用户
|
||||
* 修改账号
|
||||
*
|
||||
* @param playUserInfo 陪玩用户
|
||||
* @param playUserInfo 账号
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayUserInfoEntity playUserInfo);
|
||||
|
||||
/**
|
||||
* 批量删除陪玩用户
|
||||
* 批量删除账号
|
||||
*
|
||||
* @param ids 需要删除的陪玩用户主键集合
|
||||
* @param ids 需要删除的账号主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayUserInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除陪玩用户信息
|
||||
* 删除账号信息
|
||||
*
|
||||
* @param id 陪玩用户主键
|
||||
* @param id 账号主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayUserInfoById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 修改陪玩账户余额
|
||||
*
|
||||
* @param id 陪玩ID
|
||||
* @param accountBalance 账户余额
|
||||
* @param operate 余额操作【add or reduce】
|
||||
*/
|
||||
void editAccountBalance(String id, String accountBalance, String operate);
|
||||
|
||||
/**
|
||||
* 修改陪玩账户等级
|
||||
*
|
||||
* @param id 陪玩ID
|
||||
* @param level 陪玩等级
|
||||
*/
|
||||
void editLevel(String id, int level);
|
||||
|
||||
|
||||
/**
|
||||
* 修改陪玩账户等级
|
||||
*
|
||||
* @param id 陪玩ID
|
||||
* @param state 陪玩状态
|
||||
*/
|
||||
void editState(String id, String state);
|
||||
|
||||
|
||||
/**
|
||||
* 修改陪玩在线状态
|
||||
*
|
||||
* @param id 陪玩ID
|
||||
* @param presenceState 陪玩在线状态
|
||||
*/
|
||||
|
||||
void editPresenceState(String id, String presenceState);
|
||||
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.play.mapper.PlayUserInfoMapper;
|
||||
import com.starry.admin.modules.play.module.entity.PlayUserInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayUserInfoQueryVo;
|
||||
import com.starry.admin.modules.play.service.IPlayUserInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -16,10 +16,10 @@ import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 陪玩用户Service业务层处理
|
||||
* 账号Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-24
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
@Service
|
||||
public class PlayUserInfoServiceImpl extends ServiceImpl<PlayUserInfoMapper, PlayUserInfoEntity> implements IPlayUserInfoService {
|
||||
@@ -27,83 +27,42 @@ public class PlayUserInfoServiceImpl extends ServiceImpl<PlayUserInfoMapper, Pla
|
||||
private PlayUserInfoMapper playUserInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询陪玩用户
|
||||
* 查询账号
|
||||
*
|
||||
* @param id 陪玩用户主键
|
||||
* @return 陪玩用户
|
||||
* @param id 账号主键
|
||||
* @return 账号
|
||||
*/
|
||||
@Override
|
||||
public PlayUserInfoEntity selectPlayUserInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void editAccountBalance(String id, String accountBalance, String operate) {
|
||||
PlayUserInfoEntity entity = this.selectPlayUserInfoById(id);
|
||||
if (entity == null) {
|
||||
throw new CustomException("陪玩不存在");
|
||||
}
|
||||
long accountBalanceLong = Long.parseLong(entity.getAccountBalance());
|
||||
if ("add".equals(operate)) {
|
||||
accountBalanceLong += Long.parseLong(accountBalance);
|
||||
} else if ("reduce".equals(operate)) {
|
||||
accountBalanceLong -= Long.parseLong(accountBalance);
|
||||
if (accountBalanceLong < 0) {
|
||||
throw new CustomException("陪玩余额不足,操作失败");
|
||||
}
|
||||
}
|
||||
entity.setAccountBalance(String.valueOf(accountBalanceLong));
|
||||
this.update(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editLevel(String id, int level) {
|
||||
PlayUserInfoEntity entity = this.selectPlayUserInfoById(id);
|
||||
if (entity == null) {
|
||||
throw new CustomException("陪玩不存在");
|
||||
}
|
||||
entity.setLevel(level);
|
||||
this.update(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void editState(String id, String state) {
|
||||
PlayUserInfoEntity entity = this.selectPlayUserInfoById(id);
|
||||
if (entity == null) {
|
||||
throw new CustomException("陪玩不存在");
|
||||
}
|
||||
entity.setUserState(state);
|
||||
this.update(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editPresenceState(String id, String presenceState) {
|
||||
PlayUserInfoEntity entity = this.selectPlayUserInfoById(id);
|
||||
if (entity == null) {
|
||||
throw new CustomException("陪玩不存在");
|
||||
}
|
||||
entity.setPresenceState(presenceState);
|
||||
this.update(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询陪玩用户列表
|
||||
* 查询账号列表
|
||||
*
|
||||
* @param playUserInfo 陪玩用户
|
||||
* @return 陪玩用户
|
||||
* @param vo 账号查询实体
|
||||
* @return 账号
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayUserInfoEntity> selectPlayUserInfoByPage(PlayUserInfoEntity playUserInfo) {
|
||||
Page<PlayUserInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<>());
|
||||
public IPage<PlayUserInfoEntity> selectPlayUserInfoByPage(PlayUserInfoQueryVo vo) {
|
||||
LambdaQueryWrapper<PlayUserInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(vo.getId())) {
|
||||
lambdaQueryWrapper.eq(PlayUserInfoEntity::getId, vo.getId());
|
||||
}
|
||||
if (StrUtil.isNotBlank(vo.getUsername())) {
|
||||
lambdaQueryWrapper.eq(PlayUserInfoEntity::getUsername, vo.getUsername());
|
||||
}
|
||||
if (StrUtil.isNotBlank(vo.getAreaCode())) {
|
||||
lambdaQueryWrapper.eq(PlayUserInfoEntity::getAreaCode, vo.getAreaCode());
|
||||
}
|
||||
Page<PlayUserInfoEntity> page = new Page<>(vo.getPageNum(), vo.getPageSize());
|
||||
return this.baseMapper.selectPage(page, lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增陪玩用户
|
||||
* 新增账号
|
||||
*
|
||||
* @param playUserInfo 陪玩用户
|
||||
* @param playUserInfo 账号
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@@ -115,9 +74,9 @@ public class PlayUserInfoServiceImpl extends ServiceImpl<PlayUserInfoMapper, Pla
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改陪玩用户
|
||||
* 修改账号
|
||||
*
|
||||
* @param playUserInfo 陪玩用户
|
||||
* @param playUserInfo 账号
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@@ -126,9 +85,9 @@ public class PlayUserInfoServiceImpl extends ServiceImpl<PlayUserInfoMapper, Pla
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除陪玩用户
|
||||
* 批量删除账号
|
||||
*
|
||||
* @param ids 需要删除的陪玩用户主键
|
||||
* @param ids 需要删除的账号主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@@ -137,9 +96,9 @@ public class PlayUserInfoServiceImpl extends ServiceImpl<PlayUserInfoMapper, Pla
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除陪玩用户信息
|
||||
* 删除账号信息
|
||||
*
|
||||
* @param id 陪玩用户主键
|
||||
* @param id 账号主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.builder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.builder;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpService;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.config;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.constant;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.constant;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.constant;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.constant;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
@@ -32,6 +31,7 @@ public class WxAutoReplyController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param wxAutoReply 消息自动回复
|
||||
* @return
|
||||
@@ -45,6 +45,7 @@ public class WxAutoReplyController {
|
||||
|
||||
/**
|
||||
* 通过id查询消息自动回复
|
||||
*
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@@ -56,6 +57,7 @@ public class WxAutoReplyController {
|
||||
|
||||
/**
|
||||
* 新增消息自动回复
|
||||
*
|
||||
* @param wxAutoReply 消息自动回复
|
||||
* @return R
|
||||
*/
|
||||
@@ -68,6 +70,7 @@ public class WxAutoReplyController {
|
||||
|
||||
/**
|
||||
* 修改消息自动回复
|
||||
*
|
||||
* @param wxAutoReply 消息自动回复
|
||||
* @return R
|
||||
*/
|
||||
@@ -80,6 +83,7 @@ public class WxAutoReplyController {
|
||||
|
||||
/**
|
||||
* 通过id删除消息自动回复
|
||||
*
|
||||
* @param id id
|
||||
* @return R
|
||||
*/
|
||||
@@ -91,6 +95,7 @@ public class WxAutoReplyController {
|
||||
|
||||
/**
|
||||
* //校验参数
|
||||
*
|
||||
* @param wxAutoReply
|
||||
*/
|
||||
public void jude(WxAutoReply wxAutoReply) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
@@ -115,6 +114,7 @@ public class WxDraftController {
|
||||
|
||||
/**
|
||||
* 发布草稿箱
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
@@ -50,6 +49,7 @@ public class WxMaterialController {
|
||||
|
||||
/**
|
||||
* 上传非图文微信素材
|
||||
*
|
||||
* @param mulFile
|
||||
* @param mediaType
|
||||
* @return
|
||||
@@ -87,6 +87,7 @@ public class WxMaterialController {
|
||||
|
||||
/**
|
||||
* 上传图文消息内的图片获取URL
|
||||
*
|
||||
* @param mulFile
|
||||
* @return
|
||||
*/
|
||||
@@ -103,6 +104,7 @@ public class WxMaterialController {
|
||||
|
||||
/**
|
||||
* 通过id删除微信素材
|
||||
*
|
||||
* @param
|
||||
* @return R
|
||||
*/
|
||||
@@ -121,6 +123,7 @@ public class WxMaterialController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param type
|
||||
* @return
|
||||
@@ -146,6 +149,7 @@ public class WxMaterialController {
|
||||
|
||||
/**
|
||||
* 分页查询2
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@@ -167,6 +171,7 @@ public class WxMaterialController {
|
||||
|
||||
/**
|
||||
* 获取微信视频素材
|
||||
*
|
||||
* @param
|
||||
* @return R
|
||||
*/
|
||||
@@ -185,6 +190,7 @@ public class WxMaterialController {
|
||||
|
||||
/**
|
||||
* 获取微信素材直接文件
|
||||
*
|
||||
* @param
|
||||
* @return R
|
||||
*/
|
||||
@@ -213,6 +219,7 @@ public class WxMaterialController {
|
||||
|
||||
/**
|
||||
* 获取微信临时素材直接文件
|
||||
*
|
||||
* @param
|
||||
* @return R
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import com.starry.common.result.R;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
@@ -40,6 +39,7 @@ public class WxUserTagsController {
|
||||
|
||||
/**
|
||||
* 获取微信用户标签
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxusertags:list')")
|
||||
@@ -58,6 +58,7 @@ public class WxUserTagsController {
|
||||
|
||||
/**
|
||||
* 获取微信用户标签字典
|
||||
*
|
||||
* @param appId
|
||||
* @return
|
||||
*/
|
||||
@@ -85,6 +86,7 @@ public class WxUserTagsController {
|
||||
|
||||
/**
|
||||
* 新增微信用户标签
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxusertags:add')")
|
||||
@@ -104,6 +106,7 @@ public class WxUserTagsController {
|
||||
|
||||
/**
|
||||
* 修改微信用户标签
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('wxmp:wxusertags:edit')")
|
||||
@@ -124,6 +127,7 @@ public class WxUserTagsController {
|
||||
|
||||
/**
|
||||
* 删除微信用户标签
|
||||
*
|
||||
* @param id
|
||||
* @param appId
|
||||
* @return
|
||||
|
||||
@@ -2,28 +2,31 @@ package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class CustomWxMpProperties {
|
||||
|
||||
/**
|
||||
* 微信APPID
|
||||
*/
|
||||
public String appid;
|
||||
public String appid = "wx917f3f747c7dc5dd";
|
||||
|
||||
/**
|
||||
* 微信公众号的app secret
|
||||
*/
|
||||
public String secret;
|
||||
public String secret = "85012dec2ba8bdc9d0174dd800ef1dec";
|
||||
|
||||
/**
|
||||
* 微信公众号的token
|
||||
*/
|
||||
public String token;
|
||||
public String token = "AkzAW8yqUhOWAFN550";
|
||||
|
||||
/**
|
||||
* 微信公众号的EncodingAESKey
|
||||
*/
|
||||
public String aesKey;
|
||||
public String aesKey = "tsoM88UUQ5uEHJ29xgNiaHHaoswZapS5ijWpaN6hUZF";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.Data;
|
||||
|
||||
/**
|
||||
* 微信开发数据
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import com.starry.admin.modules.weichat.builder.TextBuilder;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.handler;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.mapper;
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.mapper;
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.utils;
|
||||
|
||||
import cn.hutool.core.lang.UUID;
|
||||
@@ -12,6 +11,7 @@ import java.nio.file.Files;
|
||||
|
||||
/**
|
||||
* file工具
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
public class FileUtils {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.utils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
package com.starry.admin.modules.weichat.utils;
|
||||
|
||||
import java.time.Instant;
|
||||
@@ -10,6 +9,7 @@ import java.time.temporal.ChronoField;
|
||||
|
||||
/**
|
||||
* LocalDateTime时间工具
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
public class LocalDateTimeUtils {
|
||||
|
||||
@@ -12,12 +12,6 @@ public class WxMpPropertiesUtils {
|
||||
|
||||
private static ISysTenantService tenantService;
|
||||
|
||||
|
||||
@Autowired
|
||||
public void setTenantService(ISysTenantService tenantService) {
|
||||
WxMpPropertiesUtils.tenantService = tenantService;
|
||||
}
|
||||
|
||||
public static CustomWxMpProperties getWeiChatProperties() {
|
||||
CustomWxMpProperties properties = new CustomWxMpProperties();
|
||||
String tenantId = CustomSecurityContextHolder.getTenantId();
|
||||
@@ -46,4 +40,9 @@ public class WxMpPropertiesUtils {
|
||||
return properties;
|
||||
}
|
||||
|
||||
@Autowired
|
||||
public void setTenantService(ISysTenantService tenantService) {
|
||||
WxMpPropertiesUtils.tenantService = tenantService;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user