最新代码
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
package com.starry.admin.modules.article.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.article.module.entity.PlayClerkArticleInfoEntity;
|
||||
import com.starry.admin.modules.article.module.vo.PlayClerkArticleQueryVo;
|
||||
import com.starry.admin.modules.article.module.vo.PlayClerkArticleReturnVo;
|
||||
import com.starry.admin.modules.article.service.IPlayClerkArticleInfoService;
|
||||
import com.starry.admin.modules.article.service.IPlayCustomArticleInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 店员动态信息Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/clerk/article")
|
||||
public class PlayClerkArticleInfoController {
|
||||
@Resource
|
||||
private IPlayClerkArticleInfoService playClerkArticleInfoService;
|
||||
@Resource
|
||||
private IPlayCustomArticleInfoService playCustomArticleInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询店员动态信息列表
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public R list(PlayClerkArticleQueryVo vo) {
|
||||
IPage<PlayClerkArticleReturnVo> list = playClerkArticleInfoService.selectPlayClerkArticleInfoByPage(vo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店员动态信息详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playClerkArticleInfoService.selectPlayClerkArticleInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增店员动态信息
|
||||
*/
|
||||
@Log(title = "店员动态信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody PlayClerkArticleInfoEntity playClerkArticleInfo) {
|
||||
boolean success = playClerkArticleInfoService.create(playClerkArticleInfo);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店员动态信息
|
||||
*/
|
||||
@Log(title = "店员动态信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{id}")
|
||||
public R update(@PathVariable String id, @RequestBody PlayClerkArticleInfoEntity playClerkArticleInfo) {
|
||||
playClerkArticleInfo.setId(id);
|
||||
boolean success = playClerkArticleInfoService.update(playClerkArticleInfo);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店员动态信息
|
||||
*/
|
||||
@Log(title = "店员动态信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
for (String id : ids) {
|
||||
playClerkArticleInfoService.deletePlayClerkArticleInfoById(id);
|
||||
playCustomArticleInfoService.deleteByArticleId(id);
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.starry.admin.modules.article.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.article.module.entity.PlayCustomArticleInfoEntity;
|
||||
import com.starry.admin.modules.article.service.IPlayCustomArticleInfoService;
|
||||
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-05-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/article")
|
||||
public class PlayCustomArticleInfoController {
|
||||
@Resource
|
||||
private IPlayCustomArticleInfoService playCustomArticleInfoService;
|
||||
|
||||
/**
|
||||
* 查询陪玩点赞动态信息列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(PlayCustomArticleInfoEntity playCustomArticleInfo) {
|
||||
IPage<PlayCustomArticleInfoEntity> list = playCustomArticleInfoService.selectPlayCustomArticleInfoByPage(playCustomArticleInfo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取陪玩点赞动态信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playCustomArticleInfoService.selectPlayCustomArticleInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增陪玩点赞动态信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:create')")
|
||||
@Log(title = "陪玩点赞动态信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody PlayCustomArticleInfoEntity playCustomArticleInfo) {
|
||||
boolean success = playCustomArticleInfoService.create(playCustomArticleInfo);
|
||||
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 PlayCustomArticleInfoEntity playCustomArticleInfo) {
|
||||
playCustomArticleInfo.setId(id);
|
||||
boolean success = playCustomArticleInfoService.update(playCustomArticleInfo);
|
||||
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(playCustomArticleInfoService.deletePlayCustomArticleInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.starry.admin.modules.article.mapper;
|
||||
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.starry.admin.modules.article.module.entity.PlayClerkArticleInfoEntity;
|
||||
|
||||
/**
|
||||
* 店员动态信息Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
public interface PlayClerkArticleInfoMapper extends MPJBaseMapper<PlayClerkArticleInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.starry.admin.modules.article.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.article.module.entity.PlayCustomArticleInfoEntity;
|
||||
|
||||
/**
|
||||
* 陪玩点赞动态信息Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
public interface PlayCustomArticleInfoMapper extends BaseMapper<PlayCustomArticleInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.starry.admin.modules.article.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_article_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_clerk_article_info")
|
||||
public class PlayClerkArticleInfoEntity extends BaseEntity<PlayClerkArticleInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 陪玩用户ID
|
||||
*/
|
||||
private String playUserId;
|
||||
|
||||
/**
|
||||
* 动态标题
|
||||
*/
|
||||
private String articleTitle;
|
||||
|
||||
/**
|
||||
* 动态内容类型(0:图片,1:视频)
|
||||
*/
|
||||
private String articleType;
|
||||
|
||||
/**
|
||||
* 动态内容
|
||||
*/
|
||||
private String articleCon;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
private Date releaseTime;
|
||||
|
||||
/**
|
||||
* 点赞人数
|
||||
*/
|
||||
private Long agreedQuantity;
|
||||
|
||||
/**
|
||||
* 审核状态(0:未审核:1:审核通过,2:审核不通过)
|
||||
*/
|
||||
private String reviewState;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.starry.admin.modules.article.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_custom_article_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_custom_article_info")
|
||||
public class PlayCustomArticleInfoEntity extends BaseEntity<PlayCustomArticleInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 动态ID
|
||||
*/
|
||||
private String articleId;
|
||||
|
||||
/**
|
||||
* 店员ID
|
||||
*/
|
||||
private String clerkUserId;
|
||||
|
||||
/**
|
||||
* 顾客ID
|
||||
*/
|
||||
private String customUserId;
|
||||
|
||||
/**
|
||||
* 点赞时间
|
||||
*/
|
||||
private Date endorseTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.starry.admin.modules.article.module.vo;
|
||||
|
||||
import com.starry.common.domain.BasePageEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* 动态信息查询对象
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class PlayClerkArticleQueryVo extends BasePageEntity {
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.starry.admin.modules.article.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* 动态信息查询返回对象
|
||||
*/
|
||||
@Data
|
||||
public class PlayClerkArticleReturnVo {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 陪玩用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 陪玩用户昵称
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 陪玩用户头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 动态标题
|
||||
*/
|
||||
private String articleTitle;
|
||||
|
||||
/**
|
||||
* 动态内容类型(0:图片,1:视频)
|
||||
*/
|
||||
private String articleType;
|
||||
|
||||
/**
|
||||
* 动态内容
|
||||
*/
|
||||
private String articleCon;
|
||||
|
||||
/**
|
||||
* 发布时间
|
||||
*/
|
||||
private Date releaseTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 点赞人数
|
||||
*/
|
||||
private Long agreedQuantity;
|
||||
|
||||
/**
|
||||
* 审核状态(0:未审核:1:审核通过,2:审核不通过)
|
||||
*/
|
||||
private String reviewState;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.starry.admin.modules.article.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.article.module.entity.PlayClerkArticleInfoEntity;
|
||||
import com.starry.admin.modules.article.module.vo.PlayClerkArticleQueryVo;
|
||||
import com.starry.admin.modules.article.module.vo.PlayClerkArticleReturnVo;
|
||||
|
||||
|
||||
/**
|
||||
* 店员动态信息Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
public interface IPlayClerkArticleInfoService extends IService<PlayClerkArticleInfoEntity> {
|
||||
/**
|
||||
* 查询店员动态信息
|
||||
*
|
||||
* @param id 店员动态信息主键
|
||||
* @return 店员动态信息
|
||||
*/
|
||||
PlayClerkArticleInfoEntity selectPlayClerkArticleInfoById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询店员动态信息列表
|
||||
*
|
||||
* @param vo 店员动态信息查询对象
|
||||
* @return 店员动态信息集合
|
||||
*/
|
||||
IPage<PlayClerkArticleReturnVo> selectPlayClerkArticleInfoByPage(PlayClerkArticleQueryVo vo);
|
||||
|
||||
/**
|
||||
* 新增店员动态信息
|
||||
*
|
||||
* @param playClerkArticleInfo 店员动态信息
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayClerkArticleInfoEntity playClerkArticleInfo);
|
||||
|
||||
/**
|
||||
* 修改店员动态信息
|
||||
*
|
||||
* @param playClerkArticleInfo 店员动态信息
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayClerkArticleInfoEntity playClerkArticleInfo);
|
||||
|
||||
/**
|
||||
* 批量删除店员动态信息
|
||||
*
|
||||
* @param ids 需要删除的店员动态信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayClerkArticleInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除店员动态信息信息
|
||||
*
|
||||
* @param id 店员动态信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayClerkArticleInfoById(String id);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.starry.admin.modules.article.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.article.module.entity.PlayCustomArticleInfoEntity;
|
||||
|
||||
/**
|
||||
* 陪玩点赞动态信息Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
public interface IPlayCustomArticleInfoService extends IService<PlayCustomArticleInfoEntity> {
|
||||
/**
|
||||
* 查询陪玩点赞动态信息
|
||||
*
|
||||
* @param id 陪玩点赞动态信息主键
|
||||
* @return 陪玩点赞动态信息
|
||||
*/
|
||||
PlayCustomArticleInfoEntity selectPlayCustomArticleInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询陪玩点赞动态信息列表
|
||||
*
|
||||
* @param playCustomArticleInfo 陪玩点赞动态信息
|
||||
* @return 陪玩点赞动态信息集合
|
||||
*/
|
||||
IPage<PlayCustomArticleInfoEntity> selectPlayCustomArticleInfoByPage(PlayCustomArticleInfoEntity playCustomArticleInfo);
|
||||
|
||||
/**
|
||||
* 新增陪玩点赞动态信息
|
||||
*
|
||||
* @param playCustomArticleInfo 陪玩点赞动态信息
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayCustomArticleInfoEntity playCustomArticleInfo);
|
||||
|
||||
/**
|
||||
* 修改陪玩点赞动态信息
|
||||
*
|
||||
* @param playCustomArticleInfo 陪玩点赞动态信息
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayCustomArticleInfoEntity playCustomArticleInfo);
|
||||
|
||||
/**
|
||||
* 批量删除陪玩点赞动态信息
|
||||
*
|
||||
* @param ids 需要删除的陪玩点赞动态信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayCustomArticleInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除陪玩点赞动态信息信息
|
||||
*
|
||||
* @param id 陪玩点赞动态信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayCustomArticleInfoById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 根据动态ID删除点赞信息
|
||||
*
|
||||
* @param articleId 动态ID
|
||||
*/
|
||||
void deleteByArticleId(String articleId);
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.starry.admin.modules.article.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.starry.admin.modules.article.mapper.PlayClerkArticleInfoMapper;
|
||||
import com.starry.admin.modules.article.module.entity.PlayClerkArticleInfoEntity;
|
||||
import com.starry.admin.modules.article.module.vo.PlayClerkArticleQueryVo;
|
||||
import com.starry.admin.modules.article.module.vo.PlayClerkArticleReturnVo;
|
||||
import com.starry.admin.modules.article.service.IPlayClerkArticleInfoService;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 店员动态信息Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
@Service
|
||||
public class PlayClerkArticleInfoServiceImpl extends ServiceImpl<PlayClerkArticleInfoMapper, PlayClerkArticleInfoEntity> implements IPlayClerkArticleInfoService {
|
||||
@Resource
|
||||
private PlayClerkArticleInfoMapper playClerkArticleInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询店员动态信息
|
||||
*
|
||||
* @param id 店员动态信息主键
|
||||
* @return 店员动态信息
|
||||
*/
|
||||
@Override
|
||||
public PlayClerkArticleInfoEntity selectPlayClerkArticleInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询店员动态信息列表
|
||||
*
|
||||
* @param vo 店员动态信息查询对象
|
||||
* @return 店员动态信息
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayClerkArticleReturnVo> selectPlayClerkArticleInfoByPage(PlayClerkArticleQueryVo vo) {
|
||||
MPJLambdaWrapper<PlayClerkArticleInfoEntity> lambdaQueryWrapper = new MPJLambdaWrapper<PlayClerkArticleInfoEntity>()
|
||||
//查询主表全部字段
|
||||
.selectAll(PlayClerkArticleInfoEntity.class)
|
||||
//陪玩用户表全部字段
|
||||
.selectAll(PlayClerkUserInfoEntity.class)
|
||||
//陪玩用户表
|
||||
.leftJoin(PlayClerkUserInfoEntity.class, PlayClerkUserInfoEntity::getId, PlayClerkArticleInfoEntity::getPlayUserId);
|
||||
return this.baseMapper.selectJoinPage(new Page<>(vo.getPageNum(), vo.getPageSize()), PlayClerkArticleReturnVo.class, lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增店员动态信息
|
||||
*
|
||||
* @param playClerkArticleInfo 店员动态信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayClerkArticleInfoEntity playClerkArticleInfo) {
|
||||
if (StrUtil.isBlankIfStr(playClerkArticleInfo.getId())) {
|
||||
playClerkArticleInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(playClerkArticleInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改店员动态信息
|
||||
*
|
||||
* @param playClerkArticleInfo 店员动态信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayClerkArticleInfoEntity playClerkArticleInfo) {
|
||||
return updateById(playClerkArticleInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除店员动态信息
|
||||
*
|
||||
* @param ids 需要删除的店员动态信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayClerkArticleInfoByIds(String[] ids) {
|
||||
return playClerkArticleInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店员动态信息信息
|
||||
*
|
||||
* @param id 店员动态信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayClerkArticleInfoById(String id) {
|
||||
return playClerkArticleInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.starry.admin.modules.article.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.article.mapper.PlayCustomArticleInfoMapper;
|
||||
import com.starry.admin.modules.article.module.entity.PlayCustomArticleInfoEntity;
|
||||
import com.starry.admin.modules.article.service.IPlayCustomArticleInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
/**
|
||||
* 陪玩点赞动态信息Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
@Service
|
||||
public class PlayCustomArticleInfoServiceImpl extends ServiceImpl<PlayCustomArticleInfoMapper, PlayCustomArticleInfoEntity> implements IPlayCustomArticleInfoService {
|
||||
@Resource
|
||||
private PlayCustomArticleInfoMapper playCustomArticleInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询陪玩点赞动态信息
|
||||
*
|
||||
* @param id 陪玩点赞动态信息主键
|
||||
* @return 陪玩点赞动态信息
|
||||
*/
|
||||
@Override
|
||||
public PlayCustomArticleInfoEntity selectPlayCustomArticleInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询陪玩点赞动态信息列表
|
||||
*
|
||||
* @param playCustomArticleInfo 陪玩点赞动态信息
|
||||
* @return 陪玩点赞动态信息
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayCustomArticleInfoEntity> selectPlayCustomArticleInfoByPage(PlayCustomArticleInfoEntity playCustomArticleInfo) {
|
||||
Page<PlayCustomArticleInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增陪玩点赞动态信息
|
||||
*
|
||||
* @param playCustomArticleInfo 陪玩点赞动态信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayCustomArticleInfoEntity playCustomArticleInfo) {
|
||||
if (StrUtil.isBlankIfStr(playCustomArticleInfo.getId())) {
|
||||
playCustomArticleInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(playCustomArticleInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改陪玩点赞动态信息
|
||||
*
|
||||
* @param playCustomArticleInfo 陪玩点赞动态信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayCustomArticleInfoEntity playCustomArticleInfo) {
|
||||
return updateById(playCustomArticleInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除陪玩点赞动态信息
|
||||
*
|
||||
* @param ids 需要删除的陪玩点赞动态信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayCustomArticleInfoByIds(String[] ids) {
|
||||
return playCustomArticleInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除陪玩点赞动态信息信息
|
||||
*
|
||||
* @param id 陪玩点赞动态信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayCustomArticleInfoById(String id) {
|
||||
return playCustomArticleInfoMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByArticleId(String articleId) {
|
||||
LambdaQueryWrapper<PlayCustomArticleInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayCustomArticleInfoEntity::getArticleId, articleId);
|
||||
this.baseMapper.delete(lambdaQueryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.starry.admin.modules.balance.controller;
|
||||
|
||||
import com.starry.admin.modules.balance.module.entity.PlayBalanceDetailsInfoEntity;
|
||||
import com.starry.admin.modules.balance.module.vo.PlayBalanceDetailsQueryVo;
|
||||
import com.starry.admin.modules.balance.service.IPlayBalanceDetailsInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 余额明细Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/balance/details")
|
||||
public class PlayBalanceDetailsInfoController {
|
||||
@Resource
|
||||
private IPlayBalanceDetailsInfoService playBalanceDetailsInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询余额明细列表
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public R list(@RequestBody PlayBalanceDetailsQueryVo vo) {
|
||||
return R.ok(playBalanceDetailsInfoService.selectByPage(vo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取余额明细详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playBalanceDetailsInfoService.selectPlayBalanceDetailsInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增余额明细
|
||||
*/
|
||||
@Log(title = "余额明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody PlayBalanceDetailsInfoEntity playBalanceDetailsInfo) {
|
||||
boolean success = playBalanceDetailsInfoService.create(playBalanceDetailsInfo);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改余额明细
|
||||
*/
|
||||
@Log(title = "余额明细", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{id}")
|
||||
public R update(@PathVariable String id, @RequestBody PlayBalanceDetailsInfoEntity playBalanceDetailsInfo) {
|
||||
playBalanceDetailsInfo.setId(id);
|
||||
boolean success = playBalanceDetailsInfoService.update(playBalanceDetailsInfo);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除余额明细
|
||||
*/
|
||||
@Log(title = "余额明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
return R.ok(playBalanceDetailsInfoService.deletePlayBalanceDetailsInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.starry.admin.modules.balance.mapper;
|
||||
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.starry.admin.modules.balance.module.entity.PlayBalanceDetailsInfoEntity;
|
||||
|
||||
/**
|
||||
* 余额明细Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-30
|
||||
*/
|
||||
public interface PlayBalanceDetailsInfoMapper extends MPJBaseMapper<PlayBalanceDetailsInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.starry.admin.modules.balance.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 余额明细对象 play_balance_details_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_balance_details_info")
|
||||
public class PlayBalanceDetailsInfoEntity extends BaseEntity<PlayBalanceDetailsInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 用户类型[0:陪玩;1:顾客]
|
||||
*/
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 操作前余额
|
||||
*/
|
||||
private BigDecimal balanceBeforeOperation;
|
||||
|
||||
/**
|
||||
* 操作后余额
|
||||
*/
|
||||
private BigDecimal balanceAfterOperation;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
*/
|
||||
private String operationType;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
private Date operationTime;
|
||||
|
||||
/**
|
||||
* 操作金额
|
||||
*/
|
||||
private BigDecimal balanceMoney;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.starry.admin.modules.balance.module.vo;
|
||||
|
||||
import com.starry.common.domain.BasePageEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class PlayBalanceDetailsQueryVo extends BasePageEntity {
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.starry.admin.modules.balance.module.vo;
|
||||
|
||||
import com.starry.common.domain.BasePageEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class PlayBalanceDetailsReturnVo extends BasePageEntity {
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 操作前余额
|
||||
*/
|
||||
private BigDecimal balanceBeforeOperation;
|
||||
|
||||
/**
|
||||
* 操作后余额
|
||||
*/
|
||||
private BigDecimal balanceAfterOperation;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
*/
|
||||
private String operationType;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
private Date operationTime;
|
||||
|
||||
/**
|
||||
* 操作金额
|
||||
*/
|
||||
private BigDecimal balanceMoney;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private BigDecimal orderMoney;
|
||||
|
||||
/**
|
||||
* 支付方式,0:余额支付,1:微信支付,2:支付宝支付
|
||||
*/
|
||||
private String payMethod;
|
||||
|
||||
/**
|
||||
* 赠送金额
|
||||
*/
|
||||
private BigDecimal giftAmount;
|
||||
|
||||
|
||||
/**
|
||||
* 订单最终金额
|
||||
*/
|
||||
private BigDecimal finalAmount;
|
||||
|
||||
/**
|
||||
* 订单备注
|
||||
*/
|
||||
private String orderRemark;
|
||||
|
||||
|
||||
/**
|
||||
* 顾客Id
|
||||
*/
|
||||
private String customUserId;
|
||||
|
||||
/**
|
||||
* 顾客昵称
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.starry.admin.modules.balance.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.balance.module.entity.PlayBalanceDetailsInfoEntity;
|
||||
import com.starry.admin.modules.balance.module.vo.PlayBalanceDetailsQueryVo;
|
||||
import com.starry.admin.modules.balance.module.vo.PlayBalanceDetailsReturnVo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 余额明细Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-30
|
||||
*/
|
||||
public interface IPlayBalanceDetailsInfoService extends IService<PlayBalanceDetailsInfoEntity> {
|
||||
/**
|
||||
* 查询余额明细
|
||||
*
|
||||
* @param id 余额明细主键
|
||||
* @return 余额明细
|
||||
*/
|
||||
PlayBalanceDetailsInfoEntity selectPlayBalanceDetailsInfoById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询余额明细列表
|
||||
*
|
||||
* @param vo 余额明细查询对象
|
||||
* @return 余额明细集合
|
||||
*/
|
||||
IPage<PlayBalanceDetailsReturnVo> selectByPage(PlayBalanceDetailsQueryVo vo);
|
||||
|
||||
|
||||
/**
|
||||
* 查询余额明细列表
|
||||
*
|
||||
* @param playBalanceDetailsInfo 余额明细
|
||||
* @return 余额明细集合
|
||||
*/
|
||||
IPage<PlayBalanceDetailsInfoEntity> selectPlayBalanceDetailsInfoByPage(PlayBalanceDetailsInfoEntity playBalanceDetailsInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 新增余额明细信息
|
||||
*
|
||||
* @param userType 用户类型[0:陪玩;1:顾客]
|
||||
* @param userId 用户ID
|
||||
* @param balanceBeforeOperation 操作前余额
|
||||
* @param balanceAfterOperation 操作后余额
|
||||
* @param operationType 操作类型
|
||||
* @param balanceMoney 操作金额
|
||||
*/
|
||||
void create(String userType, String userId, BigDecimal balanceBeforeOperation, BigDecimal balanceAfterOperation, String operationType, BigDecimal balanceMoney);
|
||||
|
||||
/**
|
||||
* 新增余额明细
|
||||
*
|
||||
* @param playBalanceDetailsInfo 余额明细
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayBalanceDetailsInfoEntity playBalanceDetailsInfo);
|
||||
|
||||
/**
|
||||
* 修改余额明细
|
||||
*
|
||||
* @param playBalanceDetailsInfo 余额明细
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayBalanceDetailsInfoEntity playBalanceDetailsInfo);
|
||||
|
||||
/**
|
||||
* 批量删除余额明细
|
||||
*
|
||||
* @param ids 需要删除的余额明细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayBalanceDetailsInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除余额明细信息
|
||||
*
|
||||
* @param id 余额明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayBalanceDetailsInfoById(String id);
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.starry.admin.modules.balance.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.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.starry.admin.modules.balance.mapper.PlayBalanceDetailsInfoMapper;
|
||||
import com.starry.admin.modules.balance.module.entity.PlayBalanceDetailsInfoEntity;
|
||||
import com.starry.admin.modules.balance.module.vo.PlayBalanceDetailsQueryVo;
|
||||
import com.starry.admin.modules.balance.module.vo.PlayBalanceDetailsReturnVo;
|
||||
import com.starry.admin.modules.balance.service.IPlayBalanceDetailsInfoService;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 余额明细Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-30
|
||||
*/
|
||||
@Service
|
||||
public class PlayBalanceDetailsInfoServiceImpl extends ServiceImpl<PlayBalanceDetailsInfoMapper, PlayBalanceDetailsInfoEntity> implements IPlayBalanceDetailsInfoService {
|
||||
@Resource
|
||||
private PlayBalanceDetailsInfoMapper playBalanceDetailsInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询余额明细
|
||||
*
|
||||
* @param id 余额明细主键
|
||||
* @return 余额明细
|
||||
*/
|
||||
@Override
|
||||
public PlayBalanceDetailsInfoEntity selectPlayBalanceDetailsInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<PlayBalanceDetailsReturnVo> selectByPage(PlayBalanceDetailsQueryVo vo) {
|
||||
MPJLambdaWrapper<PlayBalanceDetailsInfoEntity> lambdaQueryWrapper = new MPJLambdaWrapper<PlayBalanceDetailsInfoEntity>()
|
||||
//查询主表全部字段
|
||||
.selectAll(PlayBalanceDetailsInfoEntity.class)
|
||||
//查询顾客表
|
||||
.selectAll(PlayCustomUserInfoEntity.class)
|
||||
//查询订单表全部字段
|
||||
.selectAll(PlayOrderInfoEntity.class)
|
||||
.selectAs(PlayOrderInfoEntity::getId, "orderId")
|
||||
.selectAs(PlayOrderInfoEntity::getRemark, "orderId")
|
||||
.leftJoin(PlayOrderInfoEntity.class, PlayOrderInfoEntity::getId, PlayBalanceDetailsInfoEntity::getOrderId)
|
||||
.selectAs(PlayCustomUserInfoEntity::getId, "customUserId")
|
||||
.leftJoin(PlayCustomUserInfoEntity.class, PlayCustomUserInfoEntity::getId, PlayBalanceDetailsInfoEntity::getUserId);
|
||||
lambdaQueryWrapper.orderByDesc(PlayBalanceDetailsInfoEntity::getUserId);
|
||||
lambdaQueryWrapper.orderByDesc(PlayBalanceDetailsInfoEntity::getOperationTime);
|
||||
return this.baseMapper.selectJoinPage(new Page<>(vo.getPageNum(), vo.getPageSize()), PlayBalanceDetailsReturnVo.class, lambdaQueryWrapper);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询余额明细列表
|
||||
*
|
||||
* @param playBalanceDetailsInfo 余额明细
|
||||
* @return 余额明细
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayBalanceDetailsInfoEntity> selectPlayBalanceDetailsInfoByPage(PlayBalanceDetailsInfoEntity playBalanceDetailsInfo) {
|
||||
Page<PlayBalanceDetailsInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void create(String userType, String userId, BigDecimal balanceBeforeOperation, BigDecimal balanceAfterOperation, String operationType, BigDecimal balanceMoney) {
|
||||
PlayBalanceDetailsInfoEntity entity = new PlayBalanceDetailsInfoEntity();
|
||||
entity.setId(IdUtil.fastSimpleUUID());
|
||||
entity.setUserType(userType);
|
||||
entity.setUserId(userId);
|
||||
entity.setBalanceBeforeOperation(balanceBeforeOperation);
|
||||
entity.setBalanceAfterOperation(balanceAfterOperation);
|
||||
entity.setOperationType(operationType);
|
||||
entity.setBalanceMoney(balanceMoney);
|
||||
entity.setOperationTime(new Date());
|
||||
this.baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增余额明细
|
||||
*
|
||||
* @param playBalanceDetailsInfo 余额明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayBalanceDetailsInfoEntity playBalanceDetailsInfo) {
|
||||
if (StrUtil.isBlankIfStr(playBalanceDetailsInfo.getId())) {
|
||||
playBalanceDetailsInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(playBalanceDetailsInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改余额明细
|
||||
*
|
||||
* @param playBalanceDetailsInfo 余额明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayBalanceDetailsInfoEntity playBalanceDetailsInfo) {
|
||||
return updateById(playBalanceDetailsInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除余额明细
|
||||
*
|
||||
* @param ids 需要删除的余额明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayBalanceDetailsInfoByIds(String[] ids) {
|
||||
return playBalanceDetailsInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除余额明细信息
|
||||
*
|
||||
* @param id 余额明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayBalanceDetailsInfoById(String id) {
|
||||
return playBalanceDetailsInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,12 @@ package com.starry.admin.modules.clear.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkCommodityEntity;
|
||||
import com.starry.admin.modules.clear.module.vo.PlayClerkCommodityEditVo;
|
||||
import com.starry.admin.modules.clear.module.vo.PlayClerkCommodityQueryVo;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkCommodityService;
|
||||
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.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -68,14 +66,6 @@ public class PlayClerkCommodityController {
|
||||
}
|
||||
|
||||
|
||||
@Log(title = "启停陪玩服务项目", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/startStopClerkItem")
|
||||
public R startStopClerkItem(@Validated @RequestBody PlayClerkCommodityEditVo vo) {
|
||||
playClerkCommodityService.startStopClerkItem(vo.getCommodityType(), vo.getEnablingState());
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改陪玩服务项目
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.starry.admin.modules.clear.controller;
|
||||
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
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;
|
||||
@@ -78,6 +79,9 @@ public class PlayClerkLevelInfoController {
|
||||
@DeleteMapping("delMaxLevel")
|
||||
public R remove() {
|
||||
int level = playClerkLevelInfoService.selectMaxLevel();
|
||||
if (level <= 1) {
|
||||
throw new CustomException("最后一级,不允许删除");
|
||||
}
|
||||
playClerkLevelInfoService.delMaxLevelByLevel(level);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@@ -5,10 +5,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkLevelInfoEntity;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoEntity;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoQueryVo;
|
||||
import com.starry.admin.modules.clear.module.vo.PlayClerkLevelQueryReturnVo;
|
||||
import com.starry.admin.modules.clear.module.vo.PlayClerkUserAddToWxVo;
|
||||
import com.starry.admin.modules.clear.module.vo.PlayClerkUserAddVo;
|
||||
import com.starry.admin.modules.clear.module.vo.PlayClerkUserEditVo;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserListResultVo;
|
||||
import com.starry.admin.modules.clear.module.vo.*;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkCommodityService;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkLevelInfoService;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkUserInfoService;
|
||||
@@ -57,7 +55,7 @@ public class PlayClerkUserInfoController {
|
||||
*/
|
||||
@PostMapping("listByPage")
|
||||
public R listByPage(PlayClerkUserInfoQueryVo vo) {
|
||||
IPage<PlayClerkUserInfoEntity> list = playClerkUserInfoService.selectPlayClerkUserInfoByPage(vo);
|
||||
IPage<PlayClerkUserListResultVo> list = playClerkUserInfoService.selectPlayClerkUserInfoByPage(vo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@@ -67,7 +65,7 @@ public class PlayClerkUserInfoController {
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R list(PlayClerkUserInfoQueryVo vo) {
|
||||
IPage<PlayClerkUserInfoEntity> list = playClerkUserInfoService.selectPlayClerkUserInfoByPage(vo);
|
||||
IPage<PlayClerkUserListResultVo> list = playClerkUserInfoService.selectPlayClerkUserInfoByPage(vo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@@ -131,6 +129,21 @@ public class PlayClerkUserInfoController {
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改店员状态
|
||||
*/
|
||||
@Log(title = "店员", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/updateState")
|
||||
public R updateState(@Validated @RequestBody PlayClerkUserStateEditVo vo) {
|
||||
PlayClerkUserInfoEntity entity = ConvertUtil.entityToVo(vo, PlayClerkUserInfoEntity.class);
|
||||
boolean success = playClerkUserInfoService.update(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店员
|
||||
*/
|
||||
|
||||
@@ -65,6 +65,11 @@ public class PlayClarkUserEvaluateInfoEntity {
|
||||
*/
|
||||
private String commodityUnit;
|
||||
|
||||
/**
|
||||
* 点赞数
|
||||
*/
|
||||
public Integer likeCount;
|
||||
|
||||
|
||||
public PlayClarkUserEvaluateInfoEntity(String id, String evaluatorId, String evaluatorUsername, String evaluatorAvatar, String con, Date evaluateTime, String orderId, String clarkUsername, String commodityId, String commodityName, String commodityUnit) {
|
||||
this.id = id;
|
||||
@@ -79,4 +84,20 @@ public class PlayClarkUserEvaluateInfoEntity {
|
||||
this.commodityName = commodityName;
|
||||
this.commodityUnit = commodityUnit;
|
||||
}
|
||||
|
||||
public PlayClarkUserEvaluateInfoEntity(String id, String evaluatorId, String evaluatorUsername, String evaluatorAvatar, String con, Date evaluateTime, String orderId, String clarkUsername, String commodityId, String commodityName, String commodityUnit, int likeCount) {
|
||||
this.id = id;
|
||||
this.evaluatorId = evaluatorId;
|
||||
this.evaluatorUsername = evaluatorUsername;
|
||||
this.evaluatorAvatar = evaluatorAvatar;
|
||||
this.con = con;
|
||||
this.evaluateTime = evaluateTime;
|
||||
this.orderId = orderId;
|
||||
this.clarkUsername = clarkUsername;
|
||||
this.commodityId = commodityId;
|
||||
this.commodityName = commodityName;
|
||||
this.commodityUnit = commodityUnit;
|
||||
this.likeCount = likeCount;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 陪玩服务项目对象 play_clerk_commodity
|
||||
*
|
||||
@@ -13,7 +15,7 @@ import lombok.EqualsAndHashCode;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_clerk_commodity")
|
||||
@TableName("play_clerk_commodity_info")
|
||||
public class PlayClerkCommodityEntity extends BaseEntity<PlayClerkCommodityEntity> {
|
||||
|
||||
|
||||
@@ -50,8 +52,13 @@ public class PlayClerkCommodityEntity extends BaseEntity<PlayClerkCommodityEntit
|
||||
/**
|
||||
* 项目价格
|
||||
*/
|
||||
private String commodityPrice;
|
||||
private BigDecimal commodityPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 服务时长(文字描述信息,不参与订单计算)
|
||||
*/
|
||||
private String serviceDuration;
|
||||
/**
|
||||
* 服务启动状态
|
||||
* 0:停用
|
||||
|
||||
@@ -34,6 +34,16 @@ public class PlayClerkDataReviewInfoEntity extends BaseEntity<PlayClerkDataRevie
|
||||
*/
|
||||
private String playUserId;
|
||||
|
||||
/**
|
||||
* 店员头像
|
||||
*/
|
||||
private String clarkAvatar;
|
||||
|
||||
/**
|
||||
* 店员名称
|
||||
*/
|
||||
private String clarkNickname;
|
||||
|
||||
/**
|
||||
* 资料类型[0:店员申请,1:头像;2:相册;3:录音]
|
||||
*/
|
||||
@@ -71,6 +81,6 @@ public class PlayClerkDataReviewInfoEntity extends BaseEntity<PlayClerkDataRevie
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class PlayClerkUserDetailResultVo {
|
||||
* 礼物列表
|
||||
*/
|
||||
|
||||
private List<PlayGiftInfoEntity> gifts;
|
||||
private List<PlayGiftInfoVo> gifts;
|
||||
|
||||
/**
|
||||
* 服务项目
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,6 +39,11 @@ public class PlayClerkUserInfoEntity extends BaseEntity<PlayClerkUserInfoEntity>
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 微信号码
|
||||
*/
|
||||
private String weiChatCode;
|
||||
|
||||
/**
|
||||
* 陪玩用户ID
|
||||
*/
|
||||
@@ -58,6 +64,7 @@ public class PlayClerkUserInfoEntity extends BaseEntity<PlayClerkUserInfoEntity>
|
||||
*/
|
||||
private String levelId;
|
||||
|
||||
|
||||
/**
|
||||
* 店员类型
|
||||
*/
|
||||
@@ -120,9 +127,9 @@ public class PlayClerkUserInfoEntity extends BaseEntity<PlayClerkUserInfoEntity>
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 账户余额(单位分)
|
||||
* 账户余额
|
||||
*/
|
||||
private String accountBalance;
|
||||
private BigDecimal accountBalance;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
@@ -172,10 +179,10 @@ public class PlayClerkUserInfoEntity extends BaseEntity<PlayClerkUserInfoEntity>
|
||||
/**
|
||||
* 随机接单状态【1:允许,0:禁止】
|
||||
*/
|
||||
private String randomOrder;
|
||||
private String randomOrderState;
|
||||
|
||||
/**
|
||||
* 店员状态(0:不是陪玩,1:陪玩)
|
||||
* 店员状态(0:不是陪玩,1:陪玩,2:资料审核中)
|
||||
*/
|
||||
private String clerkState;
|
||||
/**
|
||||
|
||||
@@ -24,7 +24,6 @@ public class PlayClerkUserInfoQueryVo extends BasePageEntity {
|
||||
*/
|
||||
private String levelId;
|
||||
|
||||
|
||||
/**
|
||||
* 店员类型
|
||||
*/
|
||||
@@ -45,10 +44,15 @@ public class PlayClerkUserInfoQueryVo extends BasePageEntity {
|
||||
*/
|
||||
private String listingState;
|
||||
|
||||
/**
|
||||
* 是否推荐状态(1:已推荐,0:未推荐)
|
||||
*/
|
||||
private String recommendationState;
|
||||
|
||||
/**
|
||||
* 员工状态【1:是陪玩,0:不是陪玩】
|
||||
*/
|
||||
private String clerkState;
|
||||
private String clerkState = "1";
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
@@ -56,5 +60,4 @@ public class PlayClerkUserInfoQueryVo extends BasePageEntity {
|
||||
private String phone;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -45,6 +45,12 @@ public class PlayClerkUserListResultVo {
|
||||
*/
|
||||
private String audio;
|
||||
|
||||
|
||||
/**
|
||||
* 星座
|
||||
*/
|
||||
private String constellation;
|
||||
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
@@ -65,6 +71,16 @@ public class PlayClerkUserListResultVo {
|
||||
*/
|
||||
private Integer age;
|
||||
|
||||
/**
|
||||
* 所在省份
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 所在城市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
|
||||
/**
|
||||
* 关注(0:未关注,1:已关注)
|
||||
@@ -76,9 +92,43 @@ public class PlayClerkUserListResultVo {
|
||||
*/
|
||||
private String onlineState;
|
||||
|
||||
/**
|
||||
* 上架状态【1:上架,0:下架】
|
||||
*/
|
||||
private String listingState;
|
||||
|
||||
|
||||
/**
|
||||
* 实名状态【1:已实名,0:未实名】
|
||||
*/
|
||||
private String realState;
|
||||
|
||||
/**
|
||||
* 是否必须实名【1:必须实名,0:非必须实名,2:跟随店铺设置】
|
||||
*/
|
||||
private String mandatoryRealState;
|
||||
|
||||
/**
|
||||
* 随机接单状态【1:允许,0:禁止】
|
||||
*/
|
||||
private String randomOrderState;
|
||||
|
||||
|
||||
/**
|
||||
* 服务项目
|
||||
*/
|
||||
private List<String> commodity;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
|
||||
/**
|
||||
* 最低消费
|
||||
*/
|
||||
private String latestConsumption = "最低1船票";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import lombok.Data;
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class PlayGiftInfoEntity {
|
||||
public class PlayGiftInfoVo {
|
||||
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ public class PlayGiftInfoEntity {
|
||||
*/
|
||||
private String state;
|
||||
|
||||
public PlayGiftInfoEntity(String id, String name, String url, Integer number, String state) {
|
||||
public PlayGiftInfoVo(String id, String name, String url, Integer number, String state) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.url = url;
|
||||
@@ -97,4 +97,5 @@ public class PlayClerkUserAddVo {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.starry.admin.modules.clear.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
|
||||
@Data
|
||||
public class PlayClerkUserStateEditVo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@NotBlank(message = "id不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 是否推荐状态(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 randomOrderState;
|
||||
|
||||
|
||||
}
|
||||
@@ -23,6 +23,22 @@ public interface IPlayClerkCommodityService extends IService<PlayClerkCommodityE
|
||||
void initClerkCommodity(String playUserId);
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户ID,查询当前用户的服务项目类型
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 服务项目类型
|
||||
*/
|
||||
List<String> getClerkCommodityList(String userId);
|
||||
|
||||
/**
|
||||
* 根据用户ID,查询当前用户的服务项目类型
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return List<PlayClerkCommodityEntity>
|
||||
*/
|
||||
List<PlayClerkCommodityEntity> selectCommodityTypeByUser(String userId);
|
||||
|
||||
/**
|
||||
* 根据用户ID,查询当前用户的服务项目
|
||||
*
|
||||
@@ -42,8 +58,9 @@ public interface IPlayClerkCommodityService extends IService<PlayClerkCommodityE
|
||||
*
|
||||
* @param type 项目名称
|
||||
* @param enablingState 启停状态
|
||||
* @param clerkUserId 陪玩ID
|
||||
*/
|
||||
void startStopClerkItem(String type, String enablingState);
|
||||
void startStopClerkItem(String type, String enablingState, String clerkUserId);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,15 @@ import java.util.List;
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
public interface IPlayClerkLevelInfoService extends IService<PlayClerkLevelInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 获取新增陪玩时,默认最低等级ID
|
||||
* @return PlayClerkLevelInfoEntity
|
||||
*/
|
||||
PlayClerkLevelInfoEntity getDefaultLevel();
|
||||
/**
|
||||
*
|
||||
* 查询店员等级
|
||||
*
|
||||
* @param id 店员等级主键
|
||||
|
||||
@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoEntity;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoQueryVo;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserListResultVo;
|
||||
import com.starry.admin.modules.weichat.entity.PlayClerkUserLoginResponseVo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* 店员Service接口
|
||||
@@ -48,7 +51,7 @@ public interface IPlayClerkUserInfoService extends IService<PlayClerkUserInfoEnt
|
||||
PlayClerkUserLoginResponseVo getVo(PlayClerkUserInfoEntity vo);
|
||||
|
||||
/**
|
||||
* 跟新token
|
||||
* 更新token
|
||||
*
|
||||
* @param id 用户ID
|
||||
* @param token token
|
||||
@@ -57,13 +60,33 @@ public interface IPlayClerkUserInfoService extends IService<PlayClerkUserInfoEnt
|
||||
**/
|
||||
void updateTokenById(String id, String token);
|
||||
|
||||
/**
|
||||
* 更新账号余额
|
||||
*
|
||||
* @param id 用户ID
|
||||
* @param accountBalance 账户余额
|
||||
* @author admin
|
||||
* @since 2024/4/9 14:33
|
||||
**/
|
||||
void updateAccountBalanceById(String id, BigDecimal accountBalance);
|
||||
|
||||
|
||||
/**
|
||||
* 查询店员列表
|
||||
*
|
||||
* @param vo 店员查询对象
|
||||
* @param customUserId 顾客ID
|
||||
* @return 店员列表
|
||||
*/
|
||||
IPage<PlayClerkUserListResultVo> selectByPage(PlayClerkUserInfoQueryVo vo, String customUserId);
|
||||
|
||||
/**
|
||||
* 查询店员列表
|
||||
*
|
||||
* @param vo 店员查询对象
|
||||
* @return 店员集合
|
||||
*/
|
||||
IPage<PlayClerkUserInfoEntity> selectPlayClerkUserInfoByPage(PlayClerkUserInfoQueryVo vo);
|
||||
IPage<PlayClerkUserListResultVo> selectPlayClerkUserInfoByPage(PlayClerkUserInfoQueryVo vo);
|
||||
|
||||
/**
|
||||
* 新增店员
|
||||
|
||||
@@ -15,8 +15,8 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 陪玩服务项目Service业务层处理
|
||||
@@ -35,14 +35,20 @@ public class PlayClerkCommodityServiceImpl extends ServiceImpl<PlayClerkCommodit
|
||||
|
||||
|
||||
@Override
|
||||
public void initClerkCommodity(String playUserId) {
|
||||
public void initClerkCommodity(String userId) {
|
||||
//删除当前陪玩的所有服务项目
|
||||
LambdaQueryWrapper<PlayClerkCommodityEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayClerkCommodityEntity::getPlayUserId, userId);
|
||||
this.baseMapper.delete(lambdaQueryWrapper);
|
||||
//根据当前租户的服务项目,生成陪玩项目数据
|
||||
for (PlayCommodityInfoEntity commodityInfo : playCommodityInfoService.selectAll()) {
|
||||
PlayClerkCommodityEntity entity = new PlayClerkCommodityEntity();
|
||||
entity.setPlayUserId(playUserId);
|
||||
entity.setPlayUserId(userId);
|
||||
entity.setCommodityId(commodityInfo.getId());
|
||||
entity.setCommodityType(commodityInfo.getItemType());
|
||||
entity.setCommodityName(commodityInfo.getItemName());
|
||||
entity.setCommodityPrice(commodityInfo.getPrice());
|
||||
entity.setServiceDuration(commodityInfo.getServiceDuration());
|
||||
entity.setEnablingState("1");
|
||||
this.create(entity);
|
||||
}
|
||||
@@ -51,10 +57,23 @@ public class PlayClerkCommodityServiceImpl extends ServiceImpl<PlayClerkCommodit
|
||||
|
||||
|
||||
@Override
|
||||
public List<PlayClerkCommodityEntity> selectByUser(String playUserId) {
|
||||
public List<String> getClerkCommodityList(String userId) {
|
||||
List<PlayClerkCommodityEntity> list = this.selectCommodityTypeByUser(userId);
|
||||
return list.stream().map(PlayClerkCommodityEntity::getCommodityType).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PlayClerkCommodityEntity> selectCommodityTypeByUser(String userId) {
|
||||
LambdaQueryWrapper<PlayClerkCommodityEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.groupBy(PlayClerkCommodityEntity::getCommodityType);
|
||||
lambdaQueryWrapper.eq(PlayClerkCommodityEntity::getPlayUserId, playUserId);
|
||||
lambdaQueryWrapper.eq(PlayClerkCommodityEntity::getPlayUserId, userId);
|
||||
return this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PlayClerkCommodityEntity> selectByUser(String userId) {
|
||||
LambdaQueryWrapper<PlayClerkCommodityEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayClerkCommodityEntity::getPlayUserId, userId);
|
||||
return this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -65,11 +84,11 @@ public class PlayClerkCommodityServiceImpl extends ServiceImpl<PlayClerkCommodit
|
||||
|
||||
|
||||
@Override
|
||||
public void startStopClerkItem(String type, String enablingState) {
|
||||
public void startStopClerkItem(String type, String enablingState,String clerkUserId) {
|
||||
PlayClerkCommodityEntity entity = new PlayClerkCommodityEntity();
|
||||
entity.setEnablingState(enablingState);
|
||||
LambdaQueryWrapper<PlayClerkCommodityEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayClerkCommodityEntity::getPlayUserId, "1");
|
||||
lambdaQueryWrapper.eq(PlayClerkCommodityEntity::getPlayUserId, clerkUserId);
|
||||
lambdaQueryWrapper.eq(PlayClerkCommodityEntity::getCommodityType, type);
|
||||
this.baseMapper.update(entity, lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ 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.common.exception.CustomException;
|
||||
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;
|
||||
@@ -27,6 +28,15 @@ public class PlayClerkLevelInfoServiceImpl extends ServiceImpl<PlayClerkLevelInf
|
||||
@Resource
|
||||
private PlayClerkLevelInfoMapper playClerkLevelInfoMapper;
|
||||
|
||||
@Override
|
||||
public PlayClerkLevelInfoEntity getDefaultLevel() {
|
||||
List<PlayClerkLevelInfoEntity> list = this.selectAll();
|
||||
if (list != null && !list.isEmpty()) {
|
||||
return list.get(0);
|
||||
}
|
||||
throw new CustomException("系统错误,等级数据未初始化");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询店员等级
|
||||
*
|
||||
@@ -41,7 +51,7 @@ public class PlayClerkLevelInfoServiceImpl extends ServiceImpl<PlayClerkLevelInf
|
||||
|
||||
@Override
|
||||
public List<PlayClerkLevelInfoEntity> selectAll() {
|
||||
LambdaQueryWrapper<PlayClerkLevelInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
LambdaQueryWrapper<PlayClerkLevelInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.orderByAsc(PlayClerkLevelInfoEntity::getLevel);
|
||||
return this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -8,19 +8,18 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.starry.admin.modules.clear.mapper.PlayClerkUserInfoMapper;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkDataReviewInfoEntity;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkLevelInfoEntity;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoEntity;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoQueryVo;
|
||||
import com.starry.admin.modules.clear.module.entity.*;
|
||||
import com.starry.admin.modules.clear.module.vo.PlayClerkCommodityQueryVo;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkCommodityService;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkDataReviewInfoService;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkUserInfoService;
|
||||
import com.starry.admin.modules.follow.module.entity.PlayCustomFollowInfoEntity;
|
||||
import com.starry.admin.modules.follow.service.IPlayCustomFollowInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.PlayClerkUserLoginResponseVo;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -46,7 +45,7 @@ public class PlayClerkUserInfoServiceImpl extends ServiceImpl<PlayClerkUserInfoM
|
||||
private IPlayClerkCommodityService playClerkCommodityService;
|
||||
|
||||
@Resource
|
||||
private IPlayClerkDataReviewInfoService playClerkDataReviewInfoService;
|
||||
private IPlayCustomFollowInfoService customFollowInfoService;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -59,7 +58,7 @@ public class PlayClerkUserInfoServiceImpl extends ServiceImpl<PlayClerkUserInfoM
|
||||
@Override
|
||||
public PlayClerkUserInfoEntity selectByOpenid(String openId) {
|
||||
LambdaQueryWrapper<PlayClerkUserInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayClerkUserInfoEntity::getPlayUserId, openId);
|
||||
lambdaQueryWrapper.eq(PlayClerkUserInfoEntity::getOpenid, openId);
|
||||
return this.baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -74,12 +73,13 @@ public class PlayClerkUserInfoServiceImpl extends ServiceImpl<PlayClerkUserInfoM
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayClerkUserLoginResponseVo getVo(PlayClerkUserInfoEntity userInfo) {
|
||||
PlayClerkUserLoginResponseVo result = ConvertUtil.entityToVo(userInfo, PlayClerkUserLoginResponseVo.class);
|
||||
|
||||
// 判断头像、音频、相册是否可以编辑,如果存在未审核的数据,则不允许编辑
|
||||
PlayClerkDataReviewInfoEntity dataReviewInfo = new PlayClerkDataReviewInfoEntity();
|
||||
dataReviewInfo.setPlayUserId(userInfo.getOpenid());
|
||||
dataReviewInfo.setPlayUserId(userInfo.getId());
|
||||
dataReviewInfo.setState("0");
|
||||
List<PlayClerkDataReviewInfoEntity> list = dataReviewInfoService.queryList(dataReviewInfo);
|
||||
Map<String, PlayClerkDataReviewInfoEntity> map = list.stream().collect(Collectors.toMap(PlayClerkDataReviewInfoEntity::getDataType, account -> account));
|
||||
@@ -92,10 +92,10 @@ public class PlayClerkUserInfoServiceImpl extends ServiceImpl<PlayClerkUserInfoM
|
||||
if (map.containsKey("3")) {
|
||||
result.setAudioAllowEdit(false);
|
||||
}
|
||||
if (map.containsKey("0") || ("1").equals(result.getClerkState())) {
|
||||
if (map.containsKey("0") || "1".equals(result.getClerkState())) {
|
||||
result.setClerkAllowEdit(false);
|
||||
}
|
||||
result.setCommodity(ConvertUtil.entityToVoList(playClerkCommodityService.selectAll(), PlayClerkCommodityQueryVo.class));
|
||||
result.setCommodity(ConvertUtil.entityToVoList(playClerkCommodityService.selectCommodityTypeByUser(userInfo.getId()), PlayClerkCommodityQueryVo.class));
|
||||
result.setArea(userInfo.getProvince() + "-" + userInfo.getCity());
|
||||
return result;
|
||||
}
|
||||
@@ -109,6 +109,16 @@ public class PlayClerkUserInfoServiceImpl extends ServiceImpl<PlayClerkUserInfoM
|
||||
this.baseMapper.updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateAccountBalanceById(String id, BigDecimal accountBalance) {
|
||||
PlayClerkUserInfoEntity entity = new PlayClerkUserInfoEntity();
|
||||
entity.setAccountBalance(accountBalance);
|
||||
entity.setId(id);
|
||||
this.baseMapper.updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询店员列表
|
||||
*
|
||||
@@ -116,17 +126,17 @@ public class PlayClerkUserInfoServiceImpl extends ServiceImpl<PlayClerkUserInfoM
|
||||
* @return 店员
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayClerkUserInfoEntity> selectPlayClerkUserInfoByPage(PlayClerkUserInfoQueryVo vo) {
|
||||
Page<PlayClerkUserInfoEntity> page = new Page<>(vo.getPageNum(), vo.getPageSize());
|
||||
public IPage<PlayClerkUserListResultVo> selectPlayClerkUserInfoByPage(PlayClerkUserInfoQueryVo vo) {
|
||||
Page<PlayClerkUserListResultVo> page = new Page<>(vo.getPageNum(), vo.getPageSize());
|
||||
|
||||
MPJLambdaWrapper<PlayClerkUserInfoEntity> lambdaQueryWrapper = new MPJLambdaWrapper<PlayClerkUserInfoEntity>()
|
||||
//查询主表全部字段
|
||||
.selectAll(PlayClerkUserInfoEntity.class)
|
||||
.selectAll(PlayClerkUserInfoEntity.class).selectAs(PlayClerkUserInfoEntity::getCity, "address")
|
||||
//等级表
|
||||
.selectAs(PlayClerkLevelInfoEntity::getName, "levelName").leftJoin(PlayClerkLevelInfoEntity.class, PlayClerkLevelInfoEntity::getId, PlayClerkUserInfoEntity::getLevelId);
|
||||
|
||||
|
||||
//服务项目表
|
||||
|
||||
|
||||
if (StrUtil.isNotBlank(vo.getNickname())) {
|
||||
lambdaQueryWrapper.like(PlayClerkUserInfoEntity::getNickname, vo.getNickname());
|
||||
}
|
||||
@@ -145,9 +155,32 @@ public class PlayClerkUserInfoServiceImpl extends ServiceImpl<PlayClerkUserInfoM
|
||||
if (StrUtil.isNotBlank(vo.getClerkState())) {
|
||||
lambdaQueryWrapper.eq(PlayClerkUserInfoEntity::getClerkState, vo.getClerkState());
|
||||
}
|
||||
if (StrUtil.isNotBlank(vo.getRecommendationState())) {
|
||||
lambdaQueryWrapper.eq(PlayClerkUserInfoEntity::getRecommendationState, vo.getRecommendationState());
|
||||
}
|
||||
return this.baseMapper.selectJoinPage(page, PlayClerkUserListResultVo.class, lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
return this.baseMapper.selectJoinPage(page, PlayClerkUserInfoEntity.class, lambdaQueryWrapper);
|
||||
// return this.baseMapper.selectPage(page, lambdaQueryWrapper);
|
||||
|
||||
@Override
|
||||
public IPage<PlayClerkUserListResultVo> selectByPage(PlayClerkUserInfoQueryVo vo, String customUserId) {
|
||||
IPage<PlayClerkUserListResultVo> voIPage = this.selectPlayClerkUserInfoByPage(vo);
|
||||
// 如果当前顾客已登录,查询是否关注
|
||||
if (StrUtil.isNotBlank(customUserId)) {
|
||||
LambdaQueryWrapper<PlayCustomFollowInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getCustomUserId, customUserId);
|
||||
List<PlayCustomFollowInfoEntity> customFollowInfoEntities = customFollowInfoService.list(lambdaQueryWrapper);
|
||||
Map<String, String> customFollows = customFollowInfoEntities.stream().collect(Collectors.toMap(PlayCustomFollowInfoEntity::getClerkUserId, PlayCustomFollowInfoEntity::getFollowState));
|
||||
for (PlayClerkUserListResultVo record : voIPage.getRecords()) {
|
||||
if (customFollows.containsKey(record.getId())) {
|
||||
record.setFollowState(customFollows.get(record.getId()));
|
||||
record.setCommodity(playClerkCommodityService.getClerkCommodityList(record.getId()));
|
||||
record.setAddress(record.getCity());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return voIPage;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.starry.admin.modules.custom.controller;
|
||||
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomLevelInfoEntity;
|
||||
import com.starry.admin.modules.custom.module.vo.PlayCustomLevelAddVo;
|
||||
import com.starry.admin.modules.custom.module.vo.PlayCustomLevelEditVo;
|
||||
import com.starry.admin.modules.custom.service.IPlayCustomLevelInfoService;
|
||||
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.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 顾客等级Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/level")
|
||||
public class PlayCustomLevelInfoController {
|
||||
@Resource
|
||||
private IPlayCustomLevelInfoService playCustomLevelInfoService;
|
||||
|
||||
/**
|
||||
* 查询顾客等级列表
|
||||
*/
|
||||
@PostMapping("/listAll")
|
||||
public R listAll() {
|
||||
List<PlayCustomLevelInfoEntity> list = playCustomLevelInfoService.selectPlayCustomLevelInfoByPage();
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取顾客等级详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playCustomLevelInfoService.selectPlayCustomLevelInfoById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增顾客等级
|
||||
*/
|
||||
@Log(title = "店员等级", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody PlayCustomLevelAddVo vo) {
|
||||
PlayCustomLevelInfoEntity entity = ConvertUtil.entityToVo(vo, PlayCustomLevelInfoEntity.class);
|
||||
int level = playCustomLevelInfoService.selectMaxLevel();
|
||||
entity.setLevel(level + 1);
|
||||
boolean success = playCustomLevelInfoService.create(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改顾客等级
|
||||
*/
|
||||
@Log(title = "顾客等级", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update")
|
||||
public R update(@RequestBody PlayCustomLevelEditVo vo) {
|
||||
if (playCustomLevelInfoService.selectPlayCustomLevelInfoById(vo.getId()) == null) {
|
||||
throw new CustomException("对象不存在");
|
||||
}
|
||||
PlayCustomLevelInfoEntity entity = ConvertUtil.entityToVo(vo, PlayCustomLevelInfoEntity.class);
|
||||
boolean success = playCustomLevelInfoService.update(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店员等级
|
||||
*/
|
||||
@Log(title = "店员等级", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("delMaxLevel")
|
||||
public R remove() {
|
||||
int level = playCustomLevelInfoService.selectMaxLevel();
|
||||
if (level <= 1) {
|
||||
throw new CustomException("最后一级,不允许删除");
|
||||
}
|
||||
playCustomLevelInfoService.delMaxLevelByLevel(level);
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
@@ -1,42 +1,34 @@
|
||||
package com.starry.admin.modules.custom.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
import com.starry.admin.modules.custom.module.vo.PlayCustomUserStateEditVo;
|
||||
import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
|
||||
|
||||
import com.starry.common.annotation.Log;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 顾客Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-08
|
||||
* @since 2024-04-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/play/info")
|
||||
@RequestMapping("/custom/user")
|
||||
public class PlayCustomUserInfoController {
|
||||
@Resource
|
||||
private IPlayCustomUserInfoService playCustomUserInfoService;
|
||||
|
||||
/**
|
||||
* 查询顾客列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:list')")
|
||||
@GetMapping("/list")
|
||||
/**
|
||||
* 查询顾客列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R list(PlayCustomUserInfoEntity playCustomUserInfo) {
|
||||
IPage<PlayCustomUserInfoEntity> list = playCustomUserInfoService.selectPlayCustomUserInfoByPage(playCustomUserInfo);
|
||||
return R.ok(list);
|
||||
@@ -45,7 +37,6 @@ public class PlayCustomUserInfoController {
|
||||
/**
|
||||
* 获取顾客详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playCustomUserInfoService.selectById(id));
|
||||
@@ -54,7 +45,6 @@ public class PlayCustomUserInfoController {
|
||||
/**
|
||||
* 新增顾客
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:create')")
|
||||
@Log(title = "顾客", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody PlayCustomUserInfoEntity playCustomUserInfo) {
|
||||
@@ -65,10 +55,23 @@ public class PlayCustomUserInfoController {
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改顾客状态
|
||||
*/
|
||||
@Log(title = "顾客", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/updateState")
|
||||
public R updateState(@Validated @RequestBody PlayCustomUserStateEditVo vo) {
|
||||
PlayCustomUserInfoEntity entity = ConvertUtil.entityToVo(vo, PlayCustomUserInfoEntity.class);
|
||||
boolean success = playCustomUserInfoService.update(entity);
|
||||
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 PlayCustomUserInfoEntity playCustomUserInfo) {
|
||||
@@ -83,7 +86,6 @@ public class PlayCustomUserInfoController {
|
||||
/**
|
||||
* 删除顾客
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:remove')")
|
||||
@Log(title = "顾客", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.starry.admin.modules.custom.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomLevelInfoEntity;
|
||||
|
||||
/**
|
||||
* 顾客等级Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
public interface PlayCustomLevelInfoMapper extends BaseMapper<PlayCustomLevelInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.starry.admin.modules.custom.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 顾客等级对象 play_custom_level_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_custom_level_info")
|
||||
public class PlayCustomLevelInfoEntity extends BaseEntity<PlayCustomLevelInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 等级数字(排序字段)
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 上一级消费金额
|
||||
*/
|
||||
private String consumptionAmount;
|
||||
|
||||
/**
|
||||
* 满减比例
|
||||
*/
|
||||
private Integer discount;
|
||||
|
||||
/**
|
||||
* 头像框地址
|
||||
*/
|
||||
private String avatarFrameAddress;
|
||||
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -41,12 +42,12 @@ public class PlayCustomUserInfoEntity extends BaseEntity<PlayCustomUserInfoEntit
|
||||
private String unionid;
|
||||
|
||||
/**
|
||||
* 店员昵称
|
||||
* 顾客昵称
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 店员性别(0:位置;1:男,2:女)
|
||||
* 顾客性别(0:位置;1:男,2:女)
|
||||
*/
|
||||
private Integer sex;
|
||||
|
||||
@@ -60,6 +61,11 @@ public class PlayCustomUserInfoEntity extends BaseEntity<PlayCustomUserInfoEntit
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 微信号码
|
||||
*/
|
||||
private String weiChatCode;
|
||||
|
||||
/**
|
||||
* 等级
|
||||
*/
|
||||
@@ -81,9 +87,9 @@ public class PlayCustomUserInfoEntity extends BaseEntity<PlayCustomUserInfoEntit
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 账户余额(单位分)
|
||||
* 账户余额
|
||||
*/
|
||||
private String accountBalance;
|
||||
private BigDecimal accountBalance;
|
||||
|
||||
/**
|
||||
* 余额状态[0:不存在余额,1:存在余额]
|
||||
@@ -96,12 +102,12 @@ public class PlayCustomUserInfoEntity extends BaseEntity<PlayCustomUserInfoEntit
|
||||
private String subscribeState;
|
||||
|
||||
/**
|
||||
* 黑名单状态[0:黑名单,1:非黑名单]
|
||||
* 黑名单状态[0:非黑名单,1:黑名单]
|
||||
*/
|
||||
private String blacklistState;
|
||||
|
||||
/**
|
||||
* 违规状态[0:违规,1:未违规]
|
||||
* 违规状态[0:未违规,1:违规]
|
||||
*/
|
||||
private String violationState;
|
||||
|
||||
@@ -115,6 +121,17 @@ public class PlayCustomUserInfoEntity extends BaseEntity<PlayCustomUserInfoEntit
|
||||
*/
|
||||
private String mobilePhoneState;
|
||||
|
||||
/**
|
||||
* 实名状态【1:已实名,0:未实名】
|
||||
*/
|
||||
private String realState;
|
||||
|
||||
/**
|
||||
* 是否必须实名【1:必须实名,0:非必须实名】
|
||||
*/
|
||||
private String mandatoryRealState;
|
||||
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.starry.admin.modules.custom.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class PlayCustomLevelAddVo {
|
||||
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
@NotBlank(message = "等级名称不能为空")
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 上一级消费金额
|
||||
*/
|
||||
@NotBlank(message = "消费金额不能为空")
|
||||
private String consumptionAmount;
|
||||
|
||||
/**
|
||||
* 满减比例
|
||||
*/
|
||||
@NotBlank(message = "满减比例不能为空")
|
||||
private Integer discount;
|
||||
|
||||
/**
|
||||
* 头像框地址
|
||||
*/
|
||||
private String avatarFrameAddress;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.starry.admin.modules.custom.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class PlayCustomLevelEditVo {
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
@NotBlank(message = "ID不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 等级名称
|
||||
*/
|
||||
@NotBlank(message = "等级名称不能为空")
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 上一级消费金额
|
||||
*/
|
||||
@NotBlank(message = "消费金额不能为空")
|
||||
private String consumptionAmount;
|
||||
|
||||
/**
|
||||
* 满减比例
|
||||
*/
|
||||
@NotBlank(message = "满减比例不能为空")
|
||||
private Integer discount;
|
||||
|
||||
/**
|
||||
* 头像框地址
|
||||
*/
|
||||
private String avatarFrameAddress;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.starry.admin.modules.custom.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
|
||||
@Data
|
||||
public class PlayCustomUserStateEditVo {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@NotBlank(message = "id不能为空")
|
||||
private String id;
|
||||
|
||||
|
||||
/**
|
||||
* 余额状态[0:不存在余额,1:存在余额]
|
||||
*/
|
||||
private String accountState;
|
||||
|
||||
/**
|
||||
* 关注状态[0:未关注,1:已关注]
|
||||
*/
|
||||
private String subscribeState;
|
||||
|
||||
/**
|
||||
* 黑名单状态[0:非黑名单,1:黑名单]
|
||||
*/
|
||||
private String blacklistState;
|
||||
|
||||
/**
|
||||
* 违规状态[0:未违规,1:违规]
|
||||
*/
|
||||
private String violationState;
|
||||
|
||||
/**
|
||||
* 是否下单状态[0:未未下单,1:下单过]
|
||||
*/
|
||||
private String purchaseState;
|
||||
|
||||
/**
|
||||
* 绑定手机状态[0:未绑定,1:绑定]
|
||||
*/
|
||||
private String mobilePhoneState;
|
||||
|
||||
/**
|
||||
* 实名状态【1:已实名,0:未实名】
|
||||
*/
|
||||
private String realState;
|
||||
|
||||
/**
|
||||
* 是否必须实名【1:必须实名,0:非必须实名】
|
||||
*/
|
||||
private String mandatoryRealState;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.starry.admin.modules.custom.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomLevelInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 顾客等级Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
public interface IPlayCustomLevelInfoService extends IService<PlayCustomLevelInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 获取新增顾客时,默认最低等级ID
|
||||
*
|
||||
* @return PlayCustomLevelInfoEntity
|
||||
*/
|
||||
PlayCustomLevelInfoEntity getDefaultLevel();
|
||||
|
||||
/**
|
||||
* 查询顾客等级列表
|
||||
*
|
||||
* @return 顾客等级集合
|
||||
*/
|
||||
List<PlayCustomLevelInfoEntity> selectAll();
|
||||
|
||||
/**
|
||||
* 查询顾客等级
|
||||
*
|
||||
* @param id 顾客等级主键
|
||||
* @return 顾客等级
|
||||
*/
|
||||
PlayCustomLevelInfoEntity selectPlayCustomLevelInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询顾客等级列表
|
||||
*
|
||||
* @return 顾客等级集合
|
||||
*/
|
||||
List<PlayCustomLevelInfoEntity> selectPlayCustomLevelInfoByPage();
|
||||
|
||||
/**
|
||||
* 新增顾客等级
|
||||
*
|
||||
* @param playCustomLevelInfo 顾客等级
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayCustomLevelInfoEntity playCustomLevelInfo);
|
||||
|
||||
/**
|
||||
* 修改顾客等级
|
||||
*
|
||||
* @param playCustomLevelInfo 顾客等级
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayCustomLevelInfoEntity playCustomLevelInfo);
|
||||
|
||||
/**
|
||||
* 批量删除顾客等级
|
||||
*
|
||||
* @param ids 需要删除的顾客等级主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayCustomLevelInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除顾客等级信息
|
||||
*
|
||||
* @param id 顾客等级主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayCustomLevelInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询最大等级
|
||||
*
|
||||
* @return 最大等级
|
||||
*/
|
||||
int selectMaxLevel();
|
||||
|
||||
|
||||
/**
|
||||
* 删除最大等级
|
||||
*/
|
||||
void delMaxLevelByLevel(Integer level);
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 顾客Service接口
|
||||
*
|
||||
@@ -21,7 +23,6 @@ public interface IPlayCustomUserInfoService extends IService<PlayCustomUserInfoE
|
||||
*/
|
||||
PlayCustomUserInfoEntity selectByOpenid(String openId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询顾客
|
||||
*
|
||||
@@ -47,15 +48,25 @@ public interface IPlayCustomUserInfoService extends IService<PlayCustomUserInfoE
|
||||
boolean create(PlayCustomUserInfoEntity playCustomUserInfo);
|
||||
|
||||
/**
|
||||
* 跟新token
|
||||
* 更新token
|
||||
*
|
||||
* @param id UUID
|
||||
* @param id 账户余额
|
||||
* @param token TOKEN
|
||||
* @author admin
|
||||
* @since 2024/4/9 14:33
|
||||
**/
|
||||
void updateTokenById(String id, String token);
|
||||
|
||||
/**
|
||||
* 更新账号余额
|
||||
*
|
||||
* @param id 用户ID
|
||||
* @param accountBalance 账户余额
|
||||
* @author admin
|
||||
* @since 2024/4/9 14:33
|
||||
**/
|
||||
void updateAccountBalanceById(String id, BigDecimal accountBalance);
|
||||
|
||||
/**
|
||||
* 修改顾客
|
||||
*
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.starry.admin.modules.custom.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.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.custom.mapper.PlayCustomLevelInfoMapper;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomLevelInfoEntity;
|
||||
import com.starry.admin.modules.custom.service.IPlayCustomLevelInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 顾客等级Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-05-04
|
||||
*/
|
||||
@Service
|
||||
public class PlayCustomLevelInfoServiceImpl extends ServiceImpl<PlayCustomLevelInfoMapper, PlayCustomLevelInfoEntity> implements IPlayCustomLevelInfoService {
|
||||
@Resource
|
||||
private PlayCustomLevelInfoMapper playCustomLevelInfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public PlayCustomLevelInfoEntity getDefaultLevel() {
|
||||
List<PlayCustomLevelInfoEntity> list = this.selectAll();
|
||||
if (list != null && !list.isEmpty()) {
|
||||
return list.get(0);
|
||||
}
|
||||
throw new CustomException("系统错误,等级数据未初始化");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PlayCustomLevelInfoEntity> selectAll() {
|
||||
LambdaQueryWrapper<PlayCustomLevelInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.orderByAsc(PlayCustomLevelInfoEntity::getLevel);
|
||||
return this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询顾客等级
|
||||
*
|
||||
* @param id 顾客等级主键
|
||||
* @return 顾客等级
|
||||
*/
|
||||
@Override
|
||||
public PlayCustomLevelInfoEntity selectPlayCustomLevelInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询顾客等级列表
|
||||
*
|
||||
* @return 顾客等级
|
||||
*/
|
||||
@Override
|
||||
public List<PlayCustomLevelInfoEntity> selectPlayCustomLevelInfoByPage() {
|
||||
LambdaQueryWrapper<PlayCustomLevelInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.orderByAsc(PlayCustomLevelInfoEntity::getLevel);
|
||||
return this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增顾客等级
|
||||
*
|
||||
* @param playCustomLevelInfo 顾客等级
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayCustomLevelInfoEntity playCustomLevelInfo) {
|
||||
if (StrUtil.isBlankIfStr(playCustomLevelInfo.getId())) {
|
||||
playCustomLevelInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(playCustomLevelInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改顾客等级
|
||||
*
|
||||
* @param playCustomLevelInfo 顾客等级
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayCustomLevelInfoEntity playCustomLevelInfo) {
|
||||
return updateById(playCustomLevelInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除顾客等级
|
||||
*
|
||||
* @param ids 需要删除的顾客等级主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayCustomLevelInfoByIds(String[] ids) {
|
||||
return playCustomLevelInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除顾客等级信息
|
||||
*
|
||||
* @param id 顾客等级主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayCustomLevelInfoById(String id) {
|
||||
return playCustomLevelInfoMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int selectMaxLevel() {
|
||||
QueryWrapper<PlayCustomLevelInfoEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("max(level) as level ");
|
||||
PlayCustomLevelInfoEntity entity = this.baseMapper.selectOne(queryWrapper);
|
||||
return entity == null ? 0 : entity.getLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delMaxLevelByLevel(Integer level) {
|
||||
LambdaQueryWrapper<PlayCustomLevelInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PlayCustomLevelInfoEntity::getLevel, level);
|
||||
this.baseMapper.delete(queryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
@@ -32,7 +33,6 @@ public class PlayCustomUserInfoServiceImpl extends ServiceImpl<PlayCustomUserInf
|
||||
lambdaQueryWrapper.eq(PlayCustomUserInfoEntity::getOpenid, openId);
|
||||
return this.baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询顾客
|
||||
*
|
||||
@@ -79,6 +79,15 @@ public class PlayCustomUserInfoServiceImpl extends ServiceImpl<PlayCustomUserInf
|
||||
this.baseMapper.updateById(entity);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateAccountBalanceById(String id, BigDecimal accountBalance) {
|
||||
PlayCustomUserInfoEntity entity = new PlayCustomUserInfoEntity();
|
||||
entity.setId(id);
|
||||
entity.setAccountBalance(accountBalance);
|
||||
this.baseMapper.updateById(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改顾客
|
||||
*
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.starry.admin.modules.follow.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.follow.module.entity.PlayCustomFollowInfoEntity;
|
||||
import com.starry.admin.modules.follow.service.IPlayCustomFollowInfoService;
|
||||
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-04-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/play/follow")
|
||||
public class PlayCustomFollowInfoController {
|
||||
@Resource
|
||||
private IPlayCustomFollowInfoService playCustomFollowInfoService;
|
||||
|
||||
/**
|
||||
* 查询顾客关注陪玩信息列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(PlayCustomFollowInfoEntity playCustomFollowInfo) {
|
||||
IPage<PlayCustomFollowInfoEntity> list = playCustomFollowInfoService.selectPlayCustomFollowInfoByPage(playCustomFollowInfo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取顾客关注陪玩信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playCustomFollowInfoService.selectPlayCustomFollowInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增顾客关注陪玩信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:create')")
|
||||
@Log(title = "顾客关注陪玩信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody PlayCustomFollowInfoEntity playCustomFollowInfo) {
|
||||
boolean success = playCustomFollowInfoService.create(playCustomFollowInfo);
|
||||
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 PlayCustomFollowInfoEntity playCustomFollowInfo) {
|
||||
playCustomFollowInfo.setId(id);
|
||||
boolean success = playCustomFollowInfoService.update(playCustomFollowInfo);
|
||||
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(playCustomFollowInfoService.deletePlayCustomFollowInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.starry.admin.modules.follow.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.follow.module.entity.PlayCustomFollowInfoEntity;
|
||||
|
||||
/**
|
||||
* 顾客关注陪玩信息Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-30
|
||||
*/
|
||||
public interface PlayCustomFollowInfoMapper extends BaseMapper<PlayCustomFollowInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.starry.admin.modules.follow.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_custom_follow_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_custom_follow_info")
|
||||
public class PlayCustomFollowInfoEntity extends BaseEntity<PlayCustomFollowInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 顾客ID
|
||||
*/
|
||||
private String customUserId;
|
||||
|
||||
/**
|
||||
* 陪玩ID
|
||||
*/
|
||||
private String clerkUserId;
|
||||
|
||||
/**
|
||||
* 关注时间
|
||||
*/
|
||||
private Date followTime;
|
||||
|
||||
/**
|
||||
* 取消关注时间
|
||||
*/
|
||||
private Date unfollowTime;
|
||||
|
||||
/**
|
||||
* 关注状态[0:未关注,1:已关注]
|
||||
*/
|
||||
private String followState;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.starry.admin.modules.follow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.follow.module.entity.PlayCustomFollowInfoEntity;
|
||||
|
||||
/**
|
||||
* 顾客关注陪玩信息Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-30
|
||||
*/
|
||||
public interface IPlayCustomFollowInfoService extends IService<PlayCustomFollowInfoEntity> {
|
||||
/**
|
||||
* 查询顾客关注陪玩信息
|
||||
*
|
||||
* @param id 顾客关注陪玩信息主键
|
||||
* @return 顾客关注陪玩信息
|
||||
*/
|
||||
PlayCustomFollowInfoEntity selectPlayCustomFollowInfoById(String id);
|
||||
|
||||
/**
|
||||
* 修改关注状态
|
||||
*
|
||||
* @param customUserId 顾客ID
|
||||
* @param clarkUserId 陪玩ID
|
||||
* @return 关注状态[0:未关注,1:已关注]
|
||||
*/
|
||||
String queryFollowState(String customUserId, String clarkUserId);
|
||||
|
||||
/**
|
||||
* 修改关注状态
|
||||
*
|
||||
* @param customUserId 顾客ID
|
||||
* @param clarkUserId 陪玩ID
|
||||
* @param followState 关注状态[0:未关注,1:已关注]
|
||||
*/
|
||||
void updateFollowState(String customUserId, String clarkUserId, String followState);
|
||||
|
||||
/**
|
||||
* 查询顾客关注陪玩信息列表
|
||||
*
|
||||
* @param playCustomFollowInfo 顾客关注陪玩信息
|
||||
* @return 顾客关注陪玩信息集合
|
||||
*/
|
||||
IPage<PlayCustomFollowInfoEntity> selectPlayCustomFollowInfoByPage(PlayCustomFollowInfoEntity playCustomFollowInfo);
|
||||
|
||||
/**
|
||||
* 新增顾客关注陪玩信息
|
||||
*
|
||||
* @param playCustomFollowInfo 顾客关注陪玩信息
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayCustomFollowInfoEntity playCustomFollowInfo);
|
||||
|
||||
/**
|
||||
* 修改顾客关注陪玩信息
|
||||
*
|
||||
* @param playCustomFollowInfo 顾客关注陪玩信息
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayCustomFollowInfoEntity playCustomFollowInfo);
|
||||
|
||||
/**
|
||||
* 批量删除顾客关注陪玩信息
|
||||
*
|
||||
* @param ids 需要删除的顾客关注陪玩信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayCustomFollowInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除顾客关注陪玩信息信息
|
||||
*
|
||||
* @param id 顾客关注陪玩信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayCustomFollowInfoById(String id);
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.starry.admin.modules.follow.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.follow.mapper.PlayCustomFollowInfoMapper;
|
||||
import com.starry.admin.modules.follow.module.entity.PlayCustomFollowInfoEntity;
|
||||
import com.starry.admin.modules.follow.service.IPlayCustomFollowInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 顾客关注陪玩信息Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-30
|
||||
*/
|
||||
@Service
|
||||
public class PlayCustomFollowInfoServiceImpl extends ServiceImpl<PlayCustomFollowInfoMapper, PlayCustomFollowInfoEntity> implements IPlayCustomFollowInfoService {
|
||||
@Resource
|
||||
private PlayCustomFollowInfoMapper playCustomFollowInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询顾客关注陪玩信息
|
||||
*
|
||||
* @param id 顾客关注陪玩信息主键
|
||||
* @return 顾客关注陪玩信息
|
||||
*/
|
||||
@Override
|
||||
public PlayCustomFollowInfoEntity selectPlayCustomFollowInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String queryFollowState(String customUserId, String clarkUserId) {
|
||||
LambdaQueryWrapper<PlayCustomFollowInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getClerkUserId, clarkUserId);
|
||||
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getCustomUserId, customUserId);
|
||||
PlayCustomFollowInfoEntity entity = this.baseMapper.selectOne(lambdaQueryWrapper);
|
||||
return entity == null ? "0" : entity.getFollowState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFollowState(String customUserId, String clarkUserId, String followState) {
|
||||
LambdaQueryWrapper<PlayCustomFollowInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getClerkUserId, clarkUserId);
|
||||
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getCustomUserId, customUserId);
|
||||
PlayCustomFollowInfoEntity entity = this.baseMapper.selectOne(lambdaQueryWrapper);
|
||||
if (entity == null) {
|
||||
entity = new PlayCustomFollowInfoEntity();
|
||||
entity.setCustomUserId(customUserId);
|
||||
entity.setFollowState(followState);
|
||||
entity.setClerkUserId(clarkUserId);
|
||||
entity.setFollowTime(new Date());
|
||||
this.baseMapper.insert(entity);
|
||||
} else {
|
||||
entity.setFollowState(followState);
|
||||
this.baseMapper.updateById(entity);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询顾客关注陪玩信息列表
|
||||
*
|
||||
* @param playCustomFollowInfo 顾客关注陪玩信息
|
||||
* @return 顾客关注陪玩信息
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayCustomFollowInfoEntity> selectPlayCustomFollowInfoByPage(PlayCustomFollowInfoEntity playCustomFollowInfo) {
|
||||
Page<PlayCustomFollowInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增顾客关注陪玩信息
|
||||
*
|
||||
* @param playCustomFollowInfo 顾客关注陪玩信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayCustomFollowInfoEntity playCustomFollowInfo) {
|
||||
if (StrUtil.isBlankIfStr(playCustomFollowInfo.getId())) {
|
||||
playCustomFollowInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(playCustomFollowInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改顾客关注陪玩信息
|
||||
*
|
||||
* @param playCustomFollowInfo 顾客关注陪玩信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayCustomFollowInfoEntity playCustomFollowInfo) {
|
||||
return updateById(playCustomFollowInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除顾客关注陪玩信息
|
||||
*
|
||||
* @param ids 需要删除的顾客关注陪玩信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayCustomFollowInfoByIds(String[] ids) {
|
||||
return playCustomFollowInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除顾客关注陪玩信息信息
|
||||
*
|
||||
* @param id 顾客关注陪玩信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayCustomFollowInfoById(String id) {
|
||||
return playCustomFollowInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.starry.admin.modules.gift.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.gift.module.entity.PlayGiftInfoEntity;
|
||||
import com.starry.admin.modules.gift.service.IPlayGiftInfoService;
|
||||
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-04-25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/play/giff")
|
||||
public class PlayGiftInfoController {
|
||||
@Resource
|
||||
private IPlayGiftInfoService playGiftInfoService;
|
||||
|
||||
/**
|
||||
* 查询礼物列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:list')")
|
||||
@GetMapping("/list")
|
||||
public R list(PlayGiftInfoEntity playGiftInfo) {
|
||||
IPage<PlayGiftInfoEntity> list = playGiftInfoService.selectPlayGiftInfoByPage(playGiftInfo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取礼物详细信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playGiftInfoService.selectPlayGiftInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增礼物
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:create')")
|
||||
@Log(title = "礼物", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody PlayGiftInfoEntity playGiftInfo) {
|
||||
boolean success = playGiftInfoService.create(playGiftInfo);
|
||||
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 PlayGiftInfoEntity playGiftInfo) {
|
||||
playGiftInfo.setId(id);
|
||||
boolean success = playGiftInfoService.update(playGiftInfo);
|
||||
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(playGiftInfoService.deletePlayGiftInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.starry.admin.modules.gift.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.gift.module.entity.PlayGiftInfoEntity;
|
||||
|
||||
/**
|
||||
* 礼物Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-25
|
||||
*/
|
||||
public interface PlayGiftInfoMapper extends BaseMapper<PlayGiftInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.starry.admin.modules.gift.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 礼物对象 play_gift_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_gift_info")
|
||||
public class PlayGiftInfoEntity extends BaseEntity<PlayGiftInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 礼物名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 礼物类型(0:盲盒,1:普通礼物)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 礼物图片地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 价格单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 状态(0:正常,1:下架)
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 上架时间
|
||||
*/
|
||||
private Date listingTime;
|
||||
|
||||
/**
|
||||
* 下架时间
|
||||
*/
|
||||
private Date delintingTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.starry.admin.modules.gift.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.gift.module.entity.PlayGiftInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼物Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-25
|
||||
*/
|
||||
public interface IPlayGiftInfoService extends IService<PlayGiftInfoEntity> {
|
||||
/**
|
||||
* 查询礼物
|
||||
*
|
||||
* @param id 礼物主键
|
||||
* @return 礼物
|
||||
*/
|
||||
PlayGiftInfoEntity selectPlayGiftInfoById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有礼物
|
||||
*
|
||||
* @return List<com.starry.admin.modules.gift.module.entity.PlayGiftInfoEntity>
|
||||
* @author admin
|
||||
* @since 2024/4/25 15:56
|
||||
**/
|
||||
List<PlayGiftInfoEntity> listByAll();
|
||||
|
||||
/**
|
||||
* 查询礼物列表
|
||||
*
|
||||
* @param playGiftInfo 礼物
|
||||
* @return 礼物集合
|
||||
*/
|
||||
IPage<PlayGiftInfoEntity> selectPlayGiftInfoByPage(PlayGiftInfoEntity playGiftInfo);
|
||||
|
||||
/**
|
||||
* 新增礼物
|
||||
*
|
||||
* @param playGiftInfo 礼物
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayGiftInfoEntity playGiftInfo);
|
||||
|
||||
/**
|
||||
* 修改礼物
|
||||
*
|
||||
* @param playGiftInfo 礼物
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayGiftInfoEntity playGiftInfo);
|
||||
|
||||
/**
|
||||
* 批量删除礼物
|
||||
*
|
||||
* @param ids 需要删除的礼物主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayGiftInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除礼物信息
|
||||
*
|
||||
* @param id礼物主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayGiftInfoById(String id);
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.starry.admin.modules.gift.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.gift.mapper.PlayGiftInfoMapper;
|
||||
import com.starry.admin.modules.gift.module.entity.PlayGiftInfoEntity;
|
||||
import com.starry.admin.modules.gift.service.IPlayGiftInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼物Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-25
|
||||
*/
|
||||
@Service
|
||||
public class PlayGiftInfoServiceImpl extends ServiceImpl<PlayGiftInfoMapper, PlayGiftInfoEntity> implements IPlayGiftInfoService {
|
||||
@Resource
|
||||
private PlayGiftInfoMapper playGiftInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询礼物
|
||||
*
|
||||
* @param id 礼物主键
|
||||
* @return 礼物
|
||||
*/
|
||||
@Override
|
||||
public PlayGiftInfoEntity selectPlayGiftInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<PlayGiftInfoEntity> listByAll() {
|
||||
return this.baseMapper.selectList(new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询礼物列表
|
||||
*
|
||||
* @param playGiftInfo 礼物
|
||||
* @return 礼物
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayGiftInfoEntity> selectPlayGiftInfoByPage(PlayGiftInfoEntity playGiftInfo) {
|
||||
Page<PlayGiftInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<PlayGiftInfoEntity>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增礼物
|
||||
*
|
||||
* @param playGiftInfo 礼物
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayGiftInfoEntity playGiftInfo) {
|
||||
if (StrUtil.isBlankIfStr(playGiftInfo.getId())) {
|
||||
playGiftInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(playGiftInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改礼物
|
||||
*
|
||||
* @param playGiftInfo 礼物
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayGiftInfoEntity playGiftInfo) {
|
||||
return updateById(playGiftInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除礼物
|
||||
*
|
||||
* @param ids 需要删除的礼物主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayGiftInfoByIds(String[] ids) {
|
||||
return playGiftInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除礼物信息
|
||||
*
|
||||
* @param id 礼物主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayGiftInfoById(String id) {
|
||||
return playGiftInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,9 @@ import cn.hutool.core.util.IdUtil;
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.coupon.module.entity.CouponInfoEntity;
|
||||
import com.starry.admin.modules.coupon.service.ICouponInfoService;
|
||||
import com.starry.admin.modules.order.module.entity.OrderDetailsInfoEntity;
|
||||
import com.starry.admin.modules.order.module.entity.OrderInfoEntity;
|
||||
import com.starry.admin.modules.order.module.entity.OrderLogInfoEntity;
|
||||
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
|
||||
import com.starry.admin.modules.order.module.vo.*;
|
||||
import com.starry.admin.modules.order.service.IOrderDetailsInfoService;
|
||||
import com.starry.admin.modules.order.service.IOrderInfoService;
|
||||
import com.starry.admin.modules.order.service.IOrderLogInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderInfoService;
|
||||
import com.starry.admin.modules.play.module.entity.PlayUserInfoEntity;
|
||||
import com.starry.admin.modules.play.service.IPlayUserInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
@@ -21,7 +17,6 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
@@ -31,30 +26,24 @@ import java.util.Date;
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/order/info")
|
||||
public class OrderInfoController {
|
||||
@RequestMapping("/order/order/")
|
||||
public class PlayOrderInfoController {
|
||||
@Resource
|
||||
private IOrderInfoService orderInfoService;
|
||||
private IPlayOrderInfoService orderInfoService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IOrderDetailsInfoService orderDetailsInfoService;
|
||||
@Resource
|
||||
private ICouponInfoService couponInfoService;
|
||||
|
||||
@Resource
|
||||
private IOrderLogInfoService orderLogInfoService;
|
||||
|
||||
@Resource
|
||||
private IPlayUserInfoService playUserInfoService;
|
||||
|
||||
|
||||
@Log(title = "取消订单", businessType = BusinessType.UPDATE)
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/cancellation')")
|
||||
public R cancellationOrder(@RequestBody OrderInfoCancellationVo vo) {
|
||||
|
||||
// 判断操作人是否是陪玩本身
|
||||
OrderInfoEntity entity = orderInfoService.selectOrderInfoById(vo.getId());
|
||||
PlayOrderInfoEntity entity = orderInfoService.selectOrderInfoById(vo.getId());
|
||||
|
||||
// 校验通过
|
||||
orderInfoService.orderRefund(vo.getId(), "2", null, false);
|
||||
@@ -79,11 +68,11 @@ public class OrderInfoController {
|
||||
// 减少用户余额
|
||||
|
||||
// 新增订单记录(订单信息需完善)
|
||||
OrderInfoEntity entity = ConvertUtil.entityToVo(addVo, OrderInfoEntity.class);
|
||||
PlayOrderInfoEntity entity = ConvertUtil.entityToVo(addVo, PlayOrderInfoEntity.class);
|
||||
orderInfoService.create(entity);
|
||||
// 新增订单处理日志(打赏单,订单直接完成)
|
||||
orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "1", new Date()));
|
||||
orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "4", new Date()));
|
||||
// orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "1", new Date()));
|
||||
// orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "4", new Date()));
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
@@ -117,20 +106,20 @@ public class OrderInfoController {
|
||||
// throw new CustomException("余额不足,无法下单");
|
||||
// }
|
||||
|
||||
OrderInfoEntity entity = ConvertUtil.entityToVo(addVo, OrderInfoEntity.class);
|
||||
PlayOrderInfoEntity entity = ConvertUtil.entityToVo(addVo, PlayOrderInfoEntity.class);
|
||||
entity.setId(IdUtil.fastSimpleUUID());
|
||||
entity.setFirstOrder(true);
|
||||
entity.setOrderMoney(String.valueOf(orderTotalMoney));
|
||||
// entity.setOrderMoney(String.valueOf(orderTotalMoney));
|
||||
|
||||
orderInfoService.create(entity);
|
||||
|
||||
// 记录订单日志
|
||||
orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "0", new Date()));
|
||||
// orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "0", new Date()));
|
||||
// 记录订单详细信息
|
||||
orderDetailsInfoService.create(new OrderDetailsInfoEntity(entity.getId(), addVo.getPlayUserId(), "0"));
|
||||
for (String commodityInfoId : addVo.getCouponIds()) {
|
||||
orderDetailsInfoService.create(new OrderDetailsInfoEntity(entity.getId(), commodityInfoId, "1"));
|
||||
}
|
||||
// orderDetailsInfoService.create(new OrderDetailsInfoEntity(entity.getId(), addVo.getPlayUserId(), "0"));
|
||||
// for (String commodityInfoId : addVo.getCouponIds()) {
|
||||
// orderDetailsInfoService.create(new OrderDetailsInfoEntity(entity.getId(), commodityInfoId, "1"));
|
||||
// }
|
||||
// 发送通知给陪玩,等待陪玩接单
|
||||
|
||||
return R.ok("下单成功,等待接单");
|
||||
@@ -140,7 +129,6 @@ public class OrderInfoController {
|
||||
/**
|
||||
* 分页查询订单列表
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/list')")
|
||||
@GetMapping("/list")
|
||||
public R list(OrderInfoQueryVo vo) {
|
||||
return R.ok(orderInfoService.selectOrderInfoList(vo));
|
||||
@@ -150,7 +138,6 @@ public class OrderInfoController {
|
||||
/**
|
||||
* 根据ID查询订单
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(orderInfoService.selectOrderInfoById(id));
|
||||
@@ -160,10 +147,9 @@ public class OrderInfoController {
|
||||
/**
|
||||
* 根据ID修改订单信息
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/edit')")
|
||||
@Log(title = "修改普通订单", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update/{id}")
|
||||
public R update(@PathVariable String id, @RequestBody OrderInfoEntity orderInfoEntity) {
|
||||
public R update(@PathVariable String id, @RequestBody PlayOrderInfoEntity orderInfoEntity) {
|
||||
orderInfoEntity.setId(id);
|
||||
boolean success = orderInfoService.update(orderInfoEntity);
|
||||
if (success) {
|
||||
@@ -175,7 +161,7 @@ public class OrderInfoController {
|
||||
/**
|
||||
* 根据ID进行订单退款
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/edit')")
|
||||
|
||||
@Log(title = "用户发起订单退款申请", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/refund/{id}")
|
||||
public R refund(@RequestBody OrderInfoRefundVo vo) {
|
||||
@@ -187,7 +173,6 @@ public class OrderInfoController {
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
@PreAuthorize("@customSs.hasPermission('order/info/remove')")
|
||||
@Log(title = "删除订单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.starry.admin.modules.order.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.order.module.vo.PlayOrderRewardQueryVo;
|
||||
import com.starry.admin.modules.order.module.vo.PlayOrderRewardReturnVo;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
/**
|
||||
* 打赏订单
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/order/reward/")
|
||||
public class PlayOrderRewardInfoController {
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private IPlayOrderInfoService orderInfoService;
|
||||
|
||||
|
||||
@Log(title = "查询打赏订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/list")
|
||||
public R queryRewardOrder(@RequestBody PlayOrderRewardQueryVo vo) {
|
||||
IPage<PlayOrderRewardReturnVo> page = orderInfoService.selectRewardOrderInfoByPage(vo);
|
||||
return R.ok(page);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.starry.admin.modules.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.order.module.entity.OrderDetailsInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单详细Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
public interface OrderDetailsInfoMapper extends BaseMapper<OrderDetailsInfoEntity> {
|
||||
/**
|
||||
* 查询订单详细
|
||||
*
|
||||
* @param id 订单详细主键
|
||||
* @return 订单详细
|
||||
*/
|
||||
OrderDetailsInfoEntity selectOrderDetailsInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询订单详细列表
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 订单详细集合
|
||||
*/
|
||||
List<OrderDetailsInfoEntity> selectOrderDetailsInfoList(OrderDetailsInfoEntity orderDetailsInfo);
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.starry.admin.modules.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.order.module.entity.OrderInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
OrderInfoEntity selectOrderInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
* @param orderInfoEntity 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
List<OrderInfoEntity> selectOrderInfoList(OrderInfoEntity orderInfoEntity);
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.starry.admin.modules.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.order.module.entity.OrderLogInfoEntity;
|
||||
|
||||
/**
|
||||
* 订单日志Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
public interface OrderLogInfoMapper extends BaseMapper<OrderLogInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.starry.admin.modules.order.mapper;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
|
||||
|
||||
/**
|
||||
* 订单Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
public interface PlayOrderInfoMapper extends MPJBaseMapper<PlayOrderInfoEntity> {
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.starry.admin.modules.order.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 订单详细对象 order_details_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("order_details_info")
|
||||
public class OrderDetailsInfoEntity extends BaseEntity<OrderDetailsInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 商品ID(陪玩用户ID or 优惠券)
|
||||
*/
|
||||
private String commodityId;
|
||||
|
||||
/**
|
||||
* 商品类型【0:1】
|
||||
* 0:服务
|
||||
* 1:优惠券
|
||||
*/
|
||||
private String commodityType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remake;
|
||||
|
||||
|
||||
public OrderDetailsInfoEntity(String orderId, String commodityId, String commodityType) {
|
||||
this.orderId = orderId;
|
||||
this.commodityId = commodityId;
|
||||
this.commodityType = commodityType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.starry.admin.modules.order.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("order_log_info")
|
||||
public class OrderLogInfoEntity extends BaseEntity<OrderLogInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* uuid
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
* 0:下单
|
||||
* 1:审核
|
||||
* 2:接单
|
||||
* 3:服务
|
||||
* 4:退款
|
||||
* 4:完成
|
||||
* 6:取消
|
||||
*/
|
||||
private String operType;
|
||||
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
private Date operTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
public OrderLogInfoEntity(String orderId, String operType, Date operTime) {
|
||||
this.orderId = orderId;
|
||||
this.operType = operType;
|
||||
this.operTime = operTime;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,16 @@
|
||||
package com.starry.admin.modules.order.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.admin.common.conf.StringTypeHandler;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单对象 order_info
|
||||
@@ -16,8 +21,8 @@ import java.util.Date;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@TableName("order_info")
|
||||
public class OrderInfoEntity extends BaseEntity<OrderInfoEntity> {
|
||||
@TableName("play_order_info")
|
||||
public class PlayOrderInfoEntity extends BaseEntity<PlayOrderInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
@@ -52,7 +57,7 @@ public class OrderInfoEntity extends BaseEntity<OrderInfoEntity> {
|
||||
private String placeType;
|
||||
|
||||
/**
|
||||
* 是否是首单【0:不是。1:是】
|
||||
* 是否是首单【0:不是,1:是】
|
||||
*/
|
||||
private Boolean firstOrder;
|
||||
|
||||
@@ -61,16 +66,47 @@ public class OrderInfoEntity extends BaseEntity<OrderInfoEntity> {
|
||||
*/
|
||||
private String refundType;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String commodityId;
|
||||
|
||||
/**
|
||||
* 商品类型[0:礼物,1:服务]
|
||||
*/
|
||||
private String commodityType;
|
||||
/**
|
||||
* 商品单价
|
||||
*/
|
||||
private BigDecimal commodityPrice;
|
||||
|
||||
/**
|
||||
* 商品数量
|
||||
*/
|
||||
private String commodityNumber;
|
||||
|
||||
/**
|
||||
* 优惠券列表
|
||||
*/
|
||||
@TableField(typeHandler = StringTypeHandler.class)
|
||||
private List<String> couponIds = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 支付方式,0:余额支付,1:微信支付,2:支付宝支付
|
||||
*/
|
||||
private String payMethod;
|
||||
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private String orderMoney;
|
||||
private BigDecimal orderMoney;
|
||||
|
||||
|
||||
/**
|
||||
* 订单最终金额
|
||||
*/
|
||||
private String finalAmount;
|
||||
private BigDecimal finalAmount;
|
||||
|
||||
/**
|
||||
* 下单人
|
||||
@@ -82,6 +118,11 @@ public class OrderInfoEntity extends BaseEntity<OrderInfoEntity> {
|
||||
*/
|
||||
private Date purchaserTime;
|
||||
|
||||
/**
|
||||
* 是否需要审核,0:不需要,1:需要
|
||||
*/
|
||||
private String reviewRequired;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
@@ -97,5 +138,21 @@ public class OrderInfoEntity extends BaseEntity<OrderInfoEntity> {
|
||||
*/
|
||||
private String reviewedRemark;
|
||||
|
||||
/**
|
||||
* 接单人
|
||||
*/
|
||||
private String acceptBy;
|
||||
|
||||
/**
|
||||
* 接单时间
|
||||
*/
|
||||
private Date acceptTime;
|
||||
|
||||
|
||||
/**
|
||||
* 订单备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.starry.admin.modules.order.module.vo;
|
||||
|
||||
|
||||
import com.starry.common.domain.BasePageEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 打赏订单查询对象
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class PlayOrderRewardQueryVo extends BasePageEntity {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.starry.admin.modules.order.module.vo;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 打赏订单查询返回信息
|
||||
*/
|
||||
@Data
|
||||
public class PlayOrderRewardReturnVo {
|
||||
|
||||
/**
|
||||
* 订单ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String customUserId;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String customUserNickname;
|
||||
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String customUserAvatar;
|
||||
|
||||
|
||||
/**
|
||||
* 店员ID
|
||||
*/
|
||||
private String clerkUserId;
|
||||
|
||||
/**
|
||||
* 店员昵称
|
||||
*/
|
||||
private String clerkUserNickname;
|
||||
|
||||
/**
|
||||
* 店员头像
|
||||
*/
|
||||
private String clerkUserAvatar;
|
||||
|
||||
|
||||
/**
|
||||
* 打赏类型
|
||||
*/
|
||||
private String rewardType;
|
||||
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private String orderMoney;
|
||||
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
private String finalAmount;
|
||||
|
||||
|
||||
/**
|
||||
* 打赏留言
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 打赏时间
|
||||
*/
|
||||
private Date purchaserTime;
|
||||
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package com.starry.admin.modules.order.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.order.module.entity.OrderDetailsInfoEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单详细Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Service
|
||||
public interface IOrderDetailsInfoService extends IService<OrderDetailsInfoEntity> {
|
||||
/**
|
||||
* 查询订单详细
|
||||
*
|
||||
* @param id 订单详细主键
|
||||
* @return 订单详细
|
||||
*/
|
||||
OrderDetailsInfoEntity selectOrderDetailsInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询订单详细列表
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 订单详细集合
|
||||
*/
|
||||
List<OrderDetailsInfoEntity> selectOrderDetailsInfoList(OrderDetailsInfoEntity orderDetailsInfo);
|
||||
|
||||
/**
|
||||
* 新增订单详细
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(OrderDetailsInfoEntity orderDetailsInfo);
|
||||
|
||||
/**
|
||||
* 修改订单详细
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(OrderDetailsInfoEntity orderDetailsInfo);
|
||||
|
||||
/**
|
||||
* 批量删除订单详细
|
||||
*
|
||||
* @param ids 需要删除的订单详细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderDetailsInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除订单详细信息
|
||||
*
|
||||
* @param id 订单详细主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderDetailsInfoById(String id);
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
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.OrderInfoEntity;
|
||||
import com.starry.admin.modules.order.module.vo.OrderInfoQueryVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 订单Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Service
|
||||
public interface IOrderInfoService extends IService<OrderInfoEntity> {
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
OrderInfoEntity selectOrderInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
* @param orderInfoEntity 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
IPage<OrderInfoEntity> selectOrderInfoList(OrderInfoQueryVo orderInfoEntity);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param orderInfoEntity 订单
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(OrderInfoEntity orderInfoEntity);
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
* @param orderInfoEntity 订单
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(OrderInfoEntity orderInfoEntity);
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*
|
||||
* @param ids 需要删除的订单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除订单信息
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderInfoById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 订单退款
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @param refundType 退款类型【1:部分退款,2:全部退款】
|
||||
* @param refundMoney 退款金额,单位分(仅部分退款有效)
|
||||
* @param examine 是否需要审核
|
||||
*/
|
||||
void orderRefund(String id, String refundType, String refundMoney, boolean examine);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
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接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
public interface IOrderLogInfoService extends IService<OrderLogInfoEntity> {
|
||||
/**
|
||||
* 查询订单日志
|
||||
*
|
||||
* @param id 订单日志主键
|
||||
* @return 订单日志
|
||||
*/
|
||||
OrderLogInfoEntity selectOrderLogInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询订单日志列表
|
||||
*
|
||||
* @param orderLogInfo 订单日志
|
||||
* @return 订单日志集合
|
||||
*/
|
||||
IPage<OrderLogInfoEntity> selectOrderLogInfoByPage(OrderLogInfoEntity orderLogInfo);
|
||||
|
||||
/**
|
||||
* 新增订单日志
|
||||
*
|
||||
* @param orderLogInfo 订单日志
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(OrderLogInfoEntity orderLogInfo);
|
||||
|
||||
/**
|
||||
* 修改订单日志
|
||||
*
|
||||
* @param orderLogInfo 订单日志
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(OrderLogInfoEntity orderLogInfo);
|
||||
|
||||
/**
|
||||
* 批量删除订单日志
|
||||
*
|
||||
* @param ids 需要删除的订单日志主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderLogInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除订单日志信息
|
||||
*
|
||||
* @param id 订单日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderLogInfoById(String id);
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
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.PlayOrderInfoEntity;
|
||||
import com.starry.admin.modules.order.module.vo.OrderInfoQueryVo;
|
||||
import com.starry.admin.modules.order.module.vo.PlayOrderRewardQueryVo;
|
||||
import com.starry.admin.modules.order.module.vo.PlayOrderRewardReturnVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 订单Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Service
|
||||
public interface IPlayOrderInfoService extends IService<PlayOrderInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 新增充值单
|
||||
*
|
||||
* @param orderMoney 订单金额
|
||||
* @param finalAmount 订单最终金额(支付金额)
|
||||
* @param purchaserBy 下单人ID
|
||||
*/
|
||||
void createRechargeOrder(BigDecimal orderMoney, BigDecimal finalAmount, String purchaserBy);
|
||||
|
||||
|
||||
/**
|
||||
* 新增打赏单
|
||||
*
|
||||
* @param orderMoney 订单金额
|
||||
* @param finalAmount 订单最终金额(支付金额)
|
||||
* @param purchaserBy 下单人ID
|
||||
*/
|
||||
void createRewardOrder(BigDecimal orderMoney, BigDecimal finalAmount, String purchaserBy);
|
||||
|
||||
|
||||
/**
|
||||
* 新增赠送礼物订单
|
||||
*
|
||||
* @param commodityId 商品ID(礼物ID)
|
||||
* @param commodityPrice 商品单价(礼物单价)
|
||||
* @param commodityNumber 商品数量(礼物数量)
|
||||
* @param orderMoney 订单金额
|
||||
* @param finalAmount 订单最终金额(支付金额)
|
||||
* @param purchaserBy 下单人ID
|
||||
*/
|
||||
void createGiftOrder(String commodityId, BigDecimal commodityPrice, String commodityNumber, BigDecimal orderMoney, BigDecimal finalAmount, String purchaserBy);
|
||||
|
||||
|
||||
/**
|
||||
* 新增普通订单
|
||||
*
|
||||
* @param orderStatus 订单状态【0:1:2:3:4:5】
|
||||
* * 0:已下单
|
||||
* * 1:已审核(退款 或者 提现需要审核,其余不需要)
|
||||
* * 2:已接单
|
||||
* * 3:已开始
|
||||
* * 4:已完成
|
||||
* * 5:已取消
|
||||
* @param placeType 下单类型(0:指定单,1:随机单。2:打赏单)
|
||||
* @param commodityId 商品ID
|
||||
* @param commodityPrice 商品单价
|
||||
* @param commodityNumber 商品数量
|
||||
* @param orderMoney 订单金额
|
||||
* @param finalAmount 订单最终金额(支付金额)
|
||||
* @param purchaserBy 下单人ID
|
||||
*/
|
||||
void createOrdinaryOrder(String orderStatus, String placeType, String commodityId, BigDecimal commodityPrice, String commodityNumber, BigDecimal orderMoney, BigDecimal finalAmount, String purchaserBy);
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询打赏订单
|
||||
*
|
||||
* @param vo 打赏订单查询对象
|
||||
* @return 打赏订单
|
||||
*/
|
||||
IPage<PlayOrderRewardReturnVo> selectRewardOrderInfoByPage(PlayOrderRewardQueryVo vo);
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
PlayOrderInfoEntity selectOrderInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
* @param orderInfoEntity 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
IPage<PlayOrderInfoEntity> selectOrderInfoList(OrderInfoQueryVo orderInfoEntity);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param orderInfoEntity 订单
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayOrderInfoEntity orderInfoEntity);
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
* @param orderInfoEntity 订单
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayOrderInfoEntity orderInfoEntity);
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*
|
||||
* @param ids 需要删除的订单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除订单信息
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteOrderInfoById(String id);
|
||||
|
||||
|
||||
/**
|
||||
* 订单退款
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @param refundType 退款类型【1:部分退款,2:全部退款】
|
||||
* @param refundMoney 退款金额,单位分(仅部分退款有效)
|
||||
* @param examine 是否需要审核
|
||||
*/
|
||||
void orderRefund(String id, String refundType, String refundMoney, boolean examine);
|
||||
|
||||
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
package com.starry.admin.modules.order.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.modules.order.mapper.OrderDetailsInfoMapper;
|
||||
import com.starry.admin.modules.order.module.entity.OrderDetailsInfoEntity;
|
||||
import com.starry.admin.modules.order.service.IOrderDetailsInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单详细Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Service
|
||||
public class OrderDetailsInfoServiceImpl extends ServiceImpl<OrderDetailsInfoMapper, OrderDetailsInfoEntity> implements IOrderDetailsInfoService {
|
||||
@Resource
|
||||
private OrderDetailsInfoMapper orderDetailsInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询订单详细
|
||||
*
|
||||
* @param id 订单详细主键
|
||||
* @return 订单详细
|
||||
*/
|
||||
@Override
|
||||
public OrderDetailsInfoEntity selectOrderDetailsInfoById(String id) {
|
||||
return orderDetailsInfoMapper.selectOrderDetailsInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单详细列表
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 订单详细
|
||||
*/
|
||||
@Override
|
||||
public List<OrderDetailsInfoEntity> selectOrderDetailsInfoList(OrderDetailsInfoEntity orderDetailsInfo) {
|
||||
return orderDetailsInfoMapper.selectOrderDetailsInfoList(orderDetailsInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单详细
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(OrderDetailsInfoEntity orderDetailsInfo) {
|
||||
if (StrUtil.isBlankIfStr(orderDetailsInfo.getId())) {
|
||||
orderDetailsInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(orderDetailsInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单详细
|
||||
*
|
||||
* @param orderDetailsInfo 订单详细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(OrderDetailsInfoEntity orderDetailsInfo) {
|
||||
return updateById(orderDetailsInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单详细
|
||||
*
|
||||
* @param ids 需要删除的订单详细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderDetailsInfoByIds(String[] ids) {
|
||||
return orderDetailsInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单详细信息
|
||||
*
|
||||
* @param id 订单详细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderDetailsInfoById(String id) {
|
||||
return orderDetailsInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
package com.starry.admin.modules.order.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.order.mapper.OrderInfoMapper;
|
||||
import com.starry.admin.modules.order.module.entity.OrderInfoEntity;
|
||||
import com.starry.admin.modules.order.module.entity.OrderLogInfoEntity;
|
||||
import com.starry.admin.modules.order.module.vo.OrderInfoQueryVo;
|
||||
import com.starry.admin.modules.order.service.IOrderInfoService;
|
||||
import com.starry.admin.modules.order.service.IOrderLogInfoService;
|
||||
import com.starry.admin.modules.play.service.IPlayUserInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 订单Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Service
|
||||
public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfoEntity> implements IOrderInfoService {
|
||||
@Resource
|
||||
private OrderInfoMapper orderInfoMapper;
|
||||
|
||||
@Resource
|
||||
private IOrderLogInfoService orderLogInfoService;
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
@Override
|
||||
public OrderInfoEntity selectOrderInfoById(String id) {
|
||||
return orderInfoMapper.selectOrderInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询订单信息
|
||||
*
|
||||
* @param vo 订单分页查询对象
|
||||
* @return 订单分页查询结果
|
||||
*/
|
||||
@Override
|
||||
public IPage<OrderInfoEntity> selectOrderInfoList(OrderInfoQueryVo vo) {
|
||||
Page<OrderInfoEntity> page = new Page<>(vo.getPageNum(), vo.getPageSize());
|
||||
LambdaQueryWrapper<OrderInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
return this.baseMapper.selectPage(page, queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param orderInfo 订单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(OrderInfoEntity orderInfo) {
|
||||
if (StrUtil.isBlankIfStr(orderInfo.getId())) {
|
||||
orderInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
orderInfo.setPurchaserBy("sysadmin");
|
||||
orderInfo.setPurchaserTime(new Date());
|
||||
orderInfo.setReviewedBy("sysadmin");
|
||||
orderInfo.setReviewedTime(new Date());
|
||||
return save(orderInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
* @param orderInfo 订单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(OrderInfoEntity orderInfo) {
|
||||
return updateById(orderInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*
|
||||
* @param ids 需要删除的订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderInfoByIds(String[] ids) {
|
||||
return orderInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单信息
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderInfoById(String id) {
|
||||
return orderInfoMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void orderRefund(String id, String refundType, String refundMoney, boolean examine) {
|
||||
OrderInfoEntity entity = this.selectOrderInfoById(id);
|
||||
if (entity == null) {
|
||||
throw new CustomException("订单不存在");
|
||||
}
|
||||
if (!"0".equals(entity.getRefundType())) {
|
||||
throw new CustomException("订单已退款,无法二次退款");
|
||||
}
|
||||
// 最终退款金额
|
||||
long finalAmount = getFinalAmount(refundType, refundMoney, entity);
|
||||
|
||||
// 减少陪玩余额
|
||||
// playUserInfoService.editAccountBalance(id, String.valueOf(finalAmount), "reduce");
|
||||
// 新增用户余额
|
||||
|
||||
// 修改订单信息
|
||||
entity.setFinalAmount(String.valueOf(finalAmount));
|
||||
entity.setRefundType(refundType);
|
||||
entity.setOrderStatus("5");
|
||||
this.update(entity);
|
||||
// 增加订单处理日志
|
||||
orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "4", new Date()));
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
package com.starry.admin.modules.order.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.order.mapper.OrderLogInfoMapper;
|
||||
import com.starry.admin.modules.order.module.entity.OrderLogInfoEntity;
|
||||
import com.starry.admin.modules.order.service.IOrderLogInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
/**
|
||||
* 订单日志Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-22
|
||||
*/
|
||||
@Service
|
||||
public class OrderLogInfoServiceImpl extends ServiceImpl<OrderLogInfoMapper, OrderLogInfoEntity> implements IOrderLogInfoService {
|
||||
@Resource
|
||||
private OrderLogInfoMapper orderLogInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询订单日志
|
||||
*
|
||||
* @param id 订单日志主键
|
||||
* @return 订单日志
|
||||
*/
|
||||
@Override
|
||||
public OrderLogInfoEntity selectOrderLogInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单日志列表
|
||||
*
|
||||
* @param orderLogInfo 订单日志
|
||||
* @return 订单日志
|
||||
*/
|
||||
@Override
|
||||
public IPage<OrderLogInfoEntity> selectOrderLogInfoByPage(OrderLogInfoEntity orderLogInfo) {
|
||||
Page<OrderLogInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单日志
|
||||
*
|
||||
* @param orderLogInfo 订单日志
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(OrderLogInfoEntity orderLogInfo) {
|
||||
if (StrUtil.isBlankIfStr(orderLogInfo.getId())) {
|
||||
orderLogInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
return save(orderLogInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单日志
|
||||
*
|
||||
* @param orderLogInfo 订单日志
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(OrderLogInfoEntity orderLogInfo) {
|
||||
return updateById(orderLogInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单日志
|
||||
*
|
||||
* @param ids 需要删除的订单日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderLogInfoByIds(String[] ids) {
|
||||
return orderLogInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单日志信息
|
||||
*
|
||||
* @param id 订单日志主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderLogInfoById(String id) {
|
||||
return orderLogInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
package com.starry.admin.modules.order.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.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoEntity;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
import com.starry.admin.modules.order.mapper.PlayOrderInfoMapper;
|
||||
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
|
||||
import com.starry.admin.modules.order.module.vo.OrderInfoQueryVo;
|
||||
import com.starry.admin.modules.order.module.vo.PlayOrderRewardQueryVo;
|
||||
import com.starry.admin.modules.order.module.vo.PlayOrderRewardReturnVo;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 订单Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-20
|
||||
*/
|
||||
@Service
|
||||
public class PlayOrderInfoServiceImpl extends ServiceImpl<PlayOrderInfoMapper, PlayOrderInfoEntity> implements IPlayOrderInfoService {
|
||||
@Resource
|
||||
private PlayOrderInfoMapper orderInfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public void createRechargeOrder(BigDecimal orderMoney, BigDecimal finalAmount, String purchaserBy) {
|
||||
PlayOrderInfoEntity entity = new PlayOrderInfoEntity();
|
||||
entity.setOrderStatus("4");
|
||||
entity.setOrderType("0");
|
||||
entity.setOrderMoney(orderMoney);
|
||||
entity.setFinalAmount(finalAmount);
|
||||
entity.setPurchaserBy(purchaserBy);
|
||||
this.baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增打赏单
|
||||
* 打赏订单直接完成
|
||||
*
|
||||
* @param orderMoney 订单金额
|
||||
* @param finalAmount 订单最终金额(支付金额)
|
||||
* @param purchaserBy 下单人ID
|
||||
*/
|
||||
@Override
|
||||
public void createRewardOrder(BigDecimal orderMoney, BigDecimal finalAmount, String purchaserBy) {
|
||||
PlayOrderInfoEntity entity = new PlayOrderInfoEntity();
|
||||
entity.setOrderStatus("4");
|
||||
entity.setOrderType("2");
|
||||
entity.setPlaceType("2");
|
||||
entity.setOrderMoney(orderMoney);
|
||||
entity.setFinalAmount(finalAmount);
|
||||
entity.setPurchaserBy(purchaserBy);
|
||||
this.baseMapper.insert(entity);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createGiftOrder(String commodityId, BigDecimal commodityPrice, String commodityNumber, BigDecimal orderMoney, BigDecimal finalAmount, String purchaserBy) {
|
||||
PlayOrderInfoEntity entity = new PlayOrderInfoEntity();
|
||||
entity.setOrderStatus("4");
|
||||
entity.setOrderType("2");
|
||||
entity.setPlaceType("2");
|
||||
entity.setCommodityId(commodityId);
|
||||
entity.setCommodityPrice(commodityPrice);
|
||||
entity.setCommodityType("0");
|
||||
entity.setOrderMoney(orderMoney);
|
||||
entity.setFinalAmount(finalAmount);
|
||||
entity.setPurchaserBy(purchaserBy);
|
||||
this.baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createOrdinaryOrder(String orderStatus, String placeType, String commodityId, BigDecimal commodityPrice, String commodityNumber, BigDecimal orderMoney, BigDecimal finalAmount, String purchaserBy) {
|
||||
PlayOrderInfoEntity entity = new PlayOrderInfoEntity();
|
||||
entity.setOrderStatus(orderStatus);
|
||||
entity.setOrderType("2");
|
||||
entity.setPlaceType(placeType);
|
||||
entity.setCommodityId(commodityId);
|
||||
entity.setCommodityPrice(commodityPrice);
|
||||
entity.setCommodityNumber(commodityNumber);
|
||||
entity.setCommodityType("0");
|
||||
entity.setOrderMoney(orderMoney);
|
||||
entity.setFinalAmount(finalAmount);
|
||||
entity.setPurchaserBy(purchaserBy);
|
||||
this.baseMapper.insert(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算退款金额
|
||||
*
|
||||
* @param refundType 退款类型【1:部分退款,2:全部退款】
|
||||
* @param refundMoney 退款金额,单位分(仅部分退款有效)
|
||||
* @param entity 订单信息
|
||||
* @return 最终退款金额
|
||||
*/
|
||||
private static long getFinalAmount(String refundType, String refundMoney, PlayOrderInfoEntity 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;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<PlayOrderRewardReturnVo> selectRewardOrderInfoByPage(PlayOrderRewardQueryVo vo) {
|
||||
MPJLambdaWrapper<PlayOrderInfoEntity> lambdaQueryWrapper = new MPJLambdaWrapper<PlayOrderInfoEntity>()
|
||||
//查询主表全部字段
|
||||
.selectAll(PlayOrderInfoEntity.class)
|
||||
//查询顾客表
|
||||
.selectAs(PlayCustomUserInfoEntity::getId, "customUserId").selectAs(PlayCustomUserInfoEntity::getAvatar, "customUserAvatar").selectAs(PlayCustomUserInfoEntity::getNickname, "customUserNickname")
|
||||
//查询陪玩表
|
||||
.selectAs(PlayClerkUserInfoEntity::getId, "clerkUserId").selectAs(PlayClerkUserInfoEntity::getAvatar, "clerkUserAvatar").selectAs(PlayClerkUserInfoEntity::getNickname, "clerkUserNickname")
|
||||
//子表
|
||||
.leftJoin(PlayCustomUserInfoEntity.class, PlayCustomUserInfoEntity::getId, PlayOrderInfoEntity::getPurchaserBy)
|
||||
.leftJoin(PlayClerkUserInfoEntity.class, PlayClerkUserInfoEntity::getId, PlayOrderInfoEntity::getAcceptBy);
|
||||
lambdaQueryWrapper.eq(PlayOrderInfoEntity::getPlaceType, "2");
|
||||
lambdaQueryWrapper.orderByDesc(PlayOrderInfoEntity::getPurchaserTime);
|
||||
return this.baseMapper.selectJoinPage(new Page<>(vo.getPageNum(), vo.getPageSize()), PlayOrderRewardReturnVo.class, lambdaQueryWrapper);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
@Override
|
||||
public PlayOrderInfoEntity selectOrderInfoById(String id) {
|
||||
return orderInfoMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询订单信息
|
||||
*
|
||||
* @param vo 订单分页查询对象
|
||||
* @return 订单分页查询结果
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayOrderInfoEntity> selectOrderInfoList(OrderInfoQueryVo vo) {
|
||||
Page<PlayOrderInfoEntity> page = new Page<>(vo.getPageNum(), vo.getPageSize());
|
||||
LambdaQueryWrapper<PlayOrderInfoEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||
return this.baseMapper.selectPage(page, queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param orderInfo 订单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayOrderInfoEntity orderInfo) {
|
||||
if (StrUtil.isBlankIfStr(orderInfo.getId())) {
|
||||
orderInfo.setId(IdUtil.fastSimpleUUID());
|
||||
}
|
||||
orderInfo.setPurchaserBy("sysadmin");
|
||||
orderInfo.setPurchaserTime(new Date());
|
||||
orderInfo.setReviewedBy("sysadmin");
|
||||
orderInfo.setReviewedTime(new Date());
|
||||
return save(orderInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
* @param orderInfo 订单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayOrderInfoEntity orderInfo) {
|
||||
return updateById(orderInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*
|
||||
* @param ids 需要删除的订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderInfoByIds(String[] ids) {
|
||||
return orderInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单信息
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteOrderInfoById(String id) {
|
||||
return orderInfoMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void orderRefund(String id, String refundType, String refundMoney, boolean examine) {
|
||||
PlayOrderInfoEntity entity = this.selectOrderInfoById(id);
|
||||
if (entity == null) {
|
||||
throw new CustomException("订单不存在");
|
||||
}
|
||||
if (!"0".equals(entity.getRefundType())) {
|
||||
throw new CustomException("订单已退款,无法二次退款");
|
||||
}
|
||||
// 最终退款金额
|
||||
long finalAmount = getFinalAmount(refundType, refundMoney, entity);
|
||||
|
||||
// 减少陪玩余额
|
||||
// playUserInfoService.editAccountBalance(id, String.valueOf(finalAmount), "reduce");
|
||||
// 新增用户余额
|
||||
|
||||
// 修改订单信息
|
||||
// entity.setFinalAmount(String.valueOf(finalAmount));
|
||||
entity.setRefundType(refundType);
|
||||
entity.setOrderStatus("5");
|
||||
this.update(entity);
|
||||
// 增加订单处理日志
|
||||
// orderLogInfoService.create(new OrderLogInfoEntity(entity.getId(), "4", new Date()));
|
||||
}
|
||||
}
|
||||
@@ -10,11 +10,11 @@ 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;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ public class SysTenantController {
|
||||
@PreAuthorize("@customSs.hasPermission('platform:tenant:create')")
|
||||
@Log(title = "租户表", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@Valid @RequestBody SysTenantAddVo vo) {
|
||||
public R create(@Validated @RequestBody SysTenantAddVo vo) {
|
||||
SysTenantEntity entity = ConvertUtil.entityToVo(vo, SysTenantEntity.class);
|
||||
return sysTenantService.addTenant(entity);
|
||||
}
|
||||
|
||||
@@ -116,6 +116,11 @@ public class SysTenantEntity extends BaseEntity<SysTenantEntity> {
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* 微信商户ID
|
||||
*/
|
||||
private String mchId;
|
||||
|
||||
|
||||
/**
|
||||
* 微信公众号的app secret
|
||||
|
||||
@@ -9,10 +9,10 @@ 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;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 公告Controller
|
||||
@@ -62,7 +62,7 @@ public class PlayNoticeInfoController {
|
||||
@PreAuthorize("@customSs.hasPermission('play:info:create')")
|
||||
@Log(title = "公告", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@Valid @RequestBody PlayNoticeInfoAddVo vo) {
|
||||
public R create(@Validated @RequestBody PlayNoticeInfoAddVo vo) {
|
||||
PlayNoticeInfoEntity entity = ConvertUtil.entityToVo(vo, PlayNoticeInfoEntity.class);
|
||||
boolean success = playNoticeInfoService.create(entity);
|
||||
if (success) {
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 服务项目对象 play_commodity_info
|
||||
*
|
||||
@@ -45,7 +47,7 @@ public class PlayCommodityInfoEntity extends BaseEntity<PlayCommodityInfoEntity>
|
||||
/**
|
||||
* 服务单价
|
||||
*/
|
||||
private String price;
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ public class SysMenuController {
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("删除菜单")
|
||||
@PreAuthorize("@customSs.hasPermission('system:menu:delete')")
|
||||
@PostMapping(value = "/delete/{id}")
|
||||
|
||||
@@ -20,10 +20,10 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -51,7 +51,7 @@ public class SysRoleController {
|
||||
@ApiOperation("添加角色")
|
||||
@PreAuthorize("@customSs.hasPermission('system:role:create')")
|
||||
@PostMapping("/create")
|
||||
public R create(@Valid @RequestBody SysRoleAddVo roleAddVo) {
|
||||
public R create(@Validated @RequestBody SysRoleAddVo roleAddVo) {
|
||||
SysRoleEntity role = new SysRoleEntity();
|
||||
BeanUtils.copyProperties(roleAddVo, role);
|
||||
if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) {
|
||||
|
||||
@@ -44,7 +44,6 @@ public class SysAdministrativeAreaDictInfoServiceImpl extends ServiceImpl<SysAdm
|
||||
|
||||
@Override
|
||||
public List<AdministrativeAreaQueryReturnVo> selectTree(String level) {
|
||||
List<AdministrativeAreaQueryReturnVo> result = new ArrayList<>();
|
||||
LambdaQueryWrapper<SysAdministrativeAreaDictInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.le(SysAdministrativeAreaDictInfoEntity::getLevel, level);
|
||||
List<SysAdministrativeAreaDictInfoEntity> list = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
|
||||
@@ -20,21 +20,19 @@ import com.starry.admin.modules.clear.service.IPlayClerkUserInfoService;
|
||||
import com.starry.admin.modules.clear.service.impl.PlayClerkDataReviewInfoServiceImpl;
|
||||
import com.starry.admin.modules.clear.service.impl.PlayClerkUserInfoServiceImpl;
|
||||
import com.starry.admin.modules.weichat.entity.*;
|
||||
import com.starry.admin.modules.weichat.service.WxCustomUserService;
|
||||
import com.starry.admin.utils.SecurityUtils;
|
||||
import com.starry.common.redis.RedisCache;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import com.starry.common.utils.VerificationCodeUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
@@ -67,6 +65,9 @@ public class WxClerkController {
|
||||
@Resource
|
||||
private IPlayClerkCommodityService playClerkCommodityService;
|
||||
|
||||
@Resource
|
||||
private WxCustomUserService customUserService;
|
||||
|
||||
|
||||
@ClerkUserLogin
|
||||
@GetMapping("/user/queryById")
|
||||
@@ -94,7 +95,7 @@ public class WxClerkController {
|
||||
|
||||
@ClerkUserLogin
|
||||
@PostMapping("/user/sendCode")
|
||||
public R sendCode(@Valid @RequestBody PlayClerkUserSendCodeVo vo) {
|
||||
public R sendCode(@Validated @RequestBody PlayClerkUserSendCodeVo vo) {
|
||||
String codeKey = "login_codes:" + SecurityUtils.getTenantId() + "_" + SecureUtil.md5(vo.getAreaCode() + vo.getPhone());
|
||||
String code = VerificationCodeUtils.getVerificationCode(4);
|
||||
redisCache.setCacheObject(codeKey, code, 5L, TimeUnit.MINUTES);
|
||||
@@ -104,7 +105,7 @@ public class WxClerkController {
|
||||
|
||||
@ClerkUserLogin
|
||||
@PostMapping("/user/bindCode")
|
||||
public R bindCode(@Valid @RequestBody PlayClerkUserBindCodeVo vo) {
|
||||
public R bindCode(@Validated @RequestBody PlayClerkUserBindCodeVo vo) {
|
||||
String codeKey = "login_codes:" + SecurityUtils.getTenantId() + "_" + SecureUtil.md5(vo.getAreaCode() + vo.getPhone());
|
||||
String code = redisCache.getCacheObject(codeKey);
|
||||
if (code == null || !code.equals(vo.getCode())) {
|
||||
@@ -124,13 +125,13 @@ public class WxClerkController {
|
||||
|
||||
@ClerkUserLogin
|
||||
@PostMapping("/user/add")
|
||||
public R userAdd(@Valid @RequestBody PlayClerkUserByWxAddVo vo) {
|
||||
public R userAdd(@Validated @RequestBody PlayClerkUserByWxAddVo vo) {
|
||||
String playUserId = ThreadLocalRequestDetail.getClerkUserInfo().getId();
|
||||
PlayClerkUserInfoEntity userInfo = playClerkUserInfoService.selectById(playUserId);
|
||||
if (userInfo == null) {
|
||||
throw new CustomException("系统错误,用户不存在");
|
||||
}
|
||||
if (userInfo.getClerkState().equals("1")) {
|
||||
if ("1".equals(userInfo.getClerkState())) {
|
||||
throw new CustomException("当前用户已经是店员");
|
||||
}
|
||||
PlayClerkDataReviewInfoEntity dataReviewInfo = new PlayClerkDataReviewInfoEntity();
|
||||
@@ -141,6 +142,8 @@ public class WxClerkController {
|
||||
if (!dataReviewInfoService.queryList(dataReviewInfo).isEmpty()) {
|
||||
throw new CustomException("已有申请未审核");
|
||||
}
|
||||
dataReviewInfo.setClarkAvatar(userInfo.getAvatar());
|
||||
dataReviewInfo.setClarkNickname(userInfo.getNickname());
|
||||
dataReviewInfo.setContent(JSONObject.toJSONString(vo));
|
||||
dataReviewInfo.setAddTime(new Date());
|
||||
dataReviewInfoService.create(dataReviewInfo);
|
||||
@@ -150,7 +153,7 @@ public class WxClerkController {
|
||||
|
||||
@ClerkUserLogin
|
||||
@PostMapping("/user/updateAvatar")
|
||||
public R updateAvatar(@Valid @RequestBody PlayClerkUserAvatarVo vo) {
|
||||
public R updateAvatar(@Validated @RequestBody PlayClerkUserAvatarVo vo) {
|
||||
PlayClerkUserInfoEntity userInfo = ThreadLocalRequestDetail.getClerkUserInfo();
|
||||
|
||||
PlayClerkDataReviewInfoEntity dataReviewInfo = new PlayClerkDataReviewInfoEntity();
|
||||
@@ -161,6 +164,8 @@ public class WxClerkController {
|
||||
if (!dataReviewInfoService.queryList(dataReviewInfo).isEmpty()) {
|
||||
throw new CustomException("已有申请未审核");
|
||||
}
|
||||
dataReviewInfo.setClarkAvatar(userInfo.getAvatar());
|
||||
dataReviewInfo.setClarkNickname(userInfo.getNickname());
|
||||
dataReviewInfo.setContent(JSONObject.toJSONString(vo));
|
||||
dataReviewInfo.setAddTime(new Date());
|
||||
dataReviewInfoService.create(dataReviewInfo);
|
||||
@@ -169,7 +174,7 @@ public class WxClerkController {
|
||||
|
||||
@ClerkUserLogin
|
||||
@PostMapping("/user/updateAlbum")
|
||||
public R updateAlbum(@Valid @RequestBody PlayClerkUserAlbumVo vo) {
|
||||
public R updateAlbum(@Validated @RequestBody PlayClerkUserAlbumVo vo) {
|
||||
PlayClerkUserInfoEntity userInfo = ThreadLocalRequestDetail.getClerkUserInfo();
|
||||
PlayClerkDataReviewInfoEntity dataReviewInfo = new PlayClerkDataReviewInfoEntity();
|
||||
dataReviewInfo.setPlayUserId(userInfo.getId());
|
||||
@@ -178,14 +183,17 @@ public class WxClerkController {
|
||||
if (!dataReviewInfoService.queryList(dataReviewInfo).isEmpty()) {
|
||||
throw new CustomException("已有申请未审核");
|
||||
}
|
||||
dataReviewInfo.setClarkAvatar(userInfo.getAvatar());
|
||||
dataReviewInfo.setClarkNickname(userInfo.getNickname());
|
||||
dataReviewInfo.setContent(JSONObject.toJSONString(vo));
|
||||
dataReviewInfo.setAddTime(new Date());
|
||||
dataReviewInfoService.create(dataReviewInfo);
|
||||
return R.ok("申请成功");
|
||||
}
|
||||
|
||||
@ClerkUserLogin
|
||||
@PostMapping("/user/updateAudio")
|
||||
public R updateAudio(@Valid @RequestBody PlayClerkUserAudioVo vo) {
|
||||
public R updateAudio(@Validated @RequestBody PlayClerkUserAudioVo vo) {
|
||||
PlayClerkUserInfoEntity userInfo = ThreadLocalRequestDetail.getClerkUserInfo();
|
||||
PlayClerkDataReviewInfoEntity dataReviewInfo = new PlayClerkDataReviewInfoEntity();
|
||||
dataReviewInfo.setPlayUserId(userInfo.getId());
|
||||
@@ -194,6 +202,9 @@ public class WxClerkController {
|
||||
if (!dataReviewInfoService.queryList(dataReviewInfo).isEmpty()) {
|
||||
throw new CustomException("已有申请未审核");
|
||||
}
|
||||
dataReviewInfo.setAddTime(new Date());
|
||||
dataReviewInfo.setClarkAvatar(userInfo.getAvatar());
|
||||
dataReviewInfo.setClarkNickname(userInfo.getNickname());
|
||||
dataReviewInfo.setContent(JSONObject.toJSONString(vo));
|
||||
dataReviewInfoService.create(dataReviewInfo);
|
||||
return R.ok("申请成功");
|
||||
@@ -202,7 +213,7 @@ public class WxClerkController {
|
||||
|
||||
@ClerkUserLogin
|
||||
@PostMapping("/user/updateOnlineState")
|
||||
public R updateAudio(@Valid @RequestBody PlayClerkUserOnlineStateVo vo) {
|
||||
public R updateAudio(@Validated @RequestBody PlayClerkUserOnlineStateVo vo) {
|
||||
String userId = ThreadLocalRequestDetail.getClerkUserInfo().getId();
|
||||
PlayClerkUserInfoEntity entity = new PlayClerkUserInfoEntity();
|
||||
entity.setOnlineState(vo.getOnlineState());
|
||||
@@ -213,15 +224,15 @@ public class WxClerkController {
|
||||
|
||||
@ClerkUserLogin
|
||||
@PostMapping("/user/updateCommodity")
|
||||
public R updateAudio(@Valid @RequestBody PlayClerkCommodityEditVo vo) {
|
||||
playClerkCommodityService.startStopClerkItem(vo.getCommodityType(), vo.getEnablingState());
|
||||
public R updateAudio(@Validated @RequestBody PlayClerkCommodityEditVo vo) {
|
||||
playClerkCommodityService.startStopClerkItem(vo.getCommodityType(), vo.getEnablingState(), ThreadLocalRequestDetail.getClerkUserInfo().getId());
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
|
||||
@ClerkUserLogin
|
||||
@PostMapping("/user/updateOther")
|
||||
public R updateOther(@Valid @RequestBody PlayClerkUserOtherVo vo) {
|
||||
public R updateOther(@Validated @RequestBody PlayClerkUserOtherVo vo) {
|
||||
PlayClerkUserInfoEntity userInfo = ConvertUtil.entityToVo(vo, PlayClerkUserInfoEntity.class);
|
||||
userInfo.setId(ThreadLocalRequestDetail.getClerkUserInfo().getId());
|
||||
playClerkUserInfoService.update(userInfo);
|
||||
@@ -242,27 +253,28 @@ public class WxClerkController {
|
||||
* 分页获取店员列表
|
||||
*
|
||||
* @param vo PlayClerkUserInfoQueryVo
|
||||
* @return 店员礼列表
|
||||
* @return 店员列表
|
||||
*/
|
||||
|
||||
@PostMapping("/user/queryByPage")
|
||||
public R queryByPage(@RequestBody PlayClerkUserInfoQueryVo vo) {
|
||||
IPage<PlayClerkUserInfoEntity> page = playClerkUserInfoService.selectPlayClerkUserInfoByPage(vo);
|
||||
List<PlayClerkUserListResultVo> resultVos = new ArrayList<>();
|
||||
for (PlayClerkUserInfoEntity record : page.getRecords()) {
|
||||
PlayClerkUserListResultVo item = ConvertUtil.entityToVo(record, PlayClerkUserListResultVo.class);
|
||||
List<String> list = playClerkCommodityService.selectByUser(record.getId()).stream().map(PlayClerkCommodityEntity::getCommodityType).collect(Collectors.toList());
|
||||
item.setCommodity(list);
|
||||
resultVos.add(item);
|
||||
}
|
||||
IPage<PlayClerkUserListResultVo> page = playClerkUserInfoService.selectByPage(vo, customUserService.getLoginUserId());
|
||||
return R.ok(page);
|
||||
}
|
||||
|
||||
IPage<PlayClerkUserListResultVo> resultPage = new Page<>();
|
||||
resultPage.setRecords(resultVos);
|
||||
// 设置分页参数
|
||||
resultPage.setCurrent(page.getCurrent());
|
||||
resultPage.setSize(page.getSize());
|
||||
resultPage.setTotal(resultVos.size()); // 假设total和实际情况一致
|
||||
return R.ok(resultPage);
|
||||
|
||||
/**
|
||||
* 获取推荐用户列表
|
||||
*
|
||||
* @return 店员列表
|
||||
*/
|
||||
@PostMapping("/user/queryByRecommend")
|
||||
public R queryByRecommend() {
|
||||
PlayClerkUserInfoQueryVo vo = new PlayClerkUserInfoQueryVo();
|
||||
vo.setPageNum(10);
|
||||
vo.setPageSize(9999);
|
||||
vo.setRecommendationState("1");
|
||||
IPage<PlayClerkUserListResultVo> page = playClerkUserInfoService.selectByPage(vo, "");
|
||||
return R.ok(page);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,14 +290,17 @@ public class WxClerkController {
|
||||
if (entity == null) {
|
||||
throw new CustomException("用户不存在");
|
||||
}
|
||||
List<PlayGiftInfoEntity> list = new ArrayList<>();
|
||||
list.add(new PlayGiftInfoEntity(IdUtil.fastSimpleUUID(), "礼物1", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", 0, "0"));
|
||||
list.add(new PlayGiftInfoEntity(IdUtil.fastSimpleUUID(), "礼物2", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", 1, "0"));
|
||||
list.add(new PlayGiftInfoEntity(IdUtil.fastSimpleUUID(), "礼物3", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", 2, "1"));
|
||||
list.add(new PlayGiftInfoEntity(IdUtil.fastSimpleUUID(), "礼物4", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", 3, "1"));
|
||||
list.add(new PlayGiftInfoEntity(IdUtil.fastSimpleUUID(), "礼物5", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", 4, "1"));
|
||||
|
||||
return R.ok(list);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
List<PlayGiftInfoVo> list = new ArrayList<>();
|
||||
list.add(new PlayGiftInfoVo(IdUtil.fastSimpleUUID(), "礼物1", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", 0, "0"));
|
||||
list.add(new PlayGiftInfoVo(IdUtil.fastSimpleUUID(), "礼物2", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", 1, "0"));
|
||||
list.add(new PlayGiftInfoVo(IdUtil.fastSimpleUUID(), "礼物3", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", 2, "1"));
|
||||
list.add(new PlayGiftInfoVo(IdUtil.fastSimpleUUID(), "礼物4", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", 3, "1"));
|
||||
list.add(new PlayGiftInfoVo(IdUtil.fastSimpleUUID(), "礼物5", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", 4, "1"));
|
||||
result.put("list", list);
|
||||
result.put("obtainedGift", list.size() - 1);
|
||||
result.put("totalGift", list.size());
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -356,6 +371,7 @@ public class WxClerkController {
|
||||
entities.add(new PlayClarkUserEvaluateInfoEntity(IdUtil.fastSimpleUUID(), IdUtil.fastSimpleUUID(), "评价人3昵称", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", "评价内容", new Date(), IdUtil.fastSimpleUUID(), "店员昵称", IdUtil.fastSimpleUUID(), "文字语音条", "一小时"));
|
||||
entities.add(new PlayClarkUserEvaluateInfoEntity(IdUtil.fastSimpleUUID(), IdUtil.fastSimpleUUID(), "评价人4昵称", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", "评价内容", new Date(), IdUtil.fastSimpleUUID(), "店员昵称", IdUtil.fastSimpleUUID(), "文字语音条", "一小时"));
|
||||
entities.add(new PlayClarkUserEvaluateInfoEntity(IdUtil.fastSimpleUUID(), IdUtil.fastSimpleUUID(), "评价人5昵称", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", "评价内容", new Date(), IdUtil.fastSimpleUUID(), "店员昵称", IdUtil.fastSimpleUUID(), "文字语音条", "一小时"));
|
||||
entities.add(new PlayClarkUserEvaluateInfoEntity(IdUtil.fastSimpleUUID(), IdUtil.fastSimpleUUID(), "评价人5昵称", "https://live-cloud-cvoon.oss-cn-hangzhou.aliyuncs.com/d8e929c041e94075b93cfc6338a83d4c/2024/04/15/fc09da2f923d46e6951292ff8f34f6aa.png", "评价内容", new Date(), IdUtil.fastSimpleUUID(), "店员昵称", IdUtil.fastSimpleUUID(), "文字语音条", "一小时", 5));
|
||||
|
||||
IPage<PlayClarkUserEvaluateInfoEntity> resultPage = new Page<>();
|
||||
resultPage.setRecords(entities);
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkCommodityEntity;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkCommodityService;
|
||||
import com.starry.admin.modules.weichat.entity.PlayClarkCommodityTreeData;
|
||||
import com.starry.common.result.R;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/wx/commodity/")
|
||||
public class WxCommodityController {
|
||||
@Resource
|
||||
private IPlayClerkCommodityService clerkCommodityService;
|
||||
|
||||
@GetMapping("/getTree")
|
||||
public R getTree(@RequestParam("userId") String userId) {
|
||||
List<PlayClerkCommodityEntity> commodityEntities = clerkCommodityService.selectByUser(userId);
|
||||
Map<String, List<PlayClerkCommodityEntity>> item = commodityEntities.stream().collect(Collectors.groupingBy(PlayClerkCommodityEntity::getCommodityName));
|
||||
List<PlayClarkCommodityTreeData> result = new ArrayList<>();
|
||||
for (Map.Entry<String, List<PlayClerkCommodityEntity>> entry : item.entrySet()) {
|
||||
PlayClarkCommodityTreeData treeData = new PlayClarkCommodityTreeData(entry.getKey(), entry.getValue());
|
||||
result.add(treeData);
|
||||
}
|
||||
return R.ok(result);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.common.oss.service.IOssFileService;
|
||||
import com.starry.admin.modules.system.entity.SysAdministrativeAreaDictInfoEntity;
|
||||
import com.starry.admin.modules.system.service.ISysAdministrativeAreaDictInfoService;
|
||||
import com.starry.admin.modules.weichat.service.WxAccessTokenService;
|
||||
import com.starry.admin.modules.weichat.utils.WxFileUtils;
|
||||
|
||||
@@ -1,15 +1,36 @@
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkLevelInfoService;
|
||||
import com.starry.admin.modules.clear.service.impl.PlayClerkUserInfoServiceImpl;
|
||||
import com.starry.admin.common.aspect.CustomUserLogin;
|
||||
import com.starry.admin.common.conf.ThreadLocalRequestDetail;
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.balance.service.IPlayBalanceDetailsInfoService;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkCommodityEntity;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserInfoEntity;
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkUserListResultVo;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkCommodityService;
|
||||
import com.starry.admin.modules.clear.service.IPlayClerkUserInfoService;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
|
||||
import com.starry.admin.modules.follow.service.IPlayCustomFollowInfoService;
|
||||
import com.starry.admin.modules.gift.module.entity.PlayGiftInfoEntity;
|
||||
import com.starry.admin.modules.gift.service.IPlayGiftInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.PlayClerkFollowStateUpdate;
|
||||
import com.starry.admin.modules.weichat.entity.PlayOrderInfoCommodityAdd;
|
||||
import com.starry.admin.modules.weichat.entity.PlayOrderInfoGiftAdd;
|
||||
import com.starry.admin.modules.weichat.entity.PlayOrderInfoRewardAdd;
|
||||
import com.starry.admin.modules.weichat.service.WxCustomUserService;
|
||||
import com.starry.admin.utils.MoneyUtils;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import com.starry.common.utils.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
@@ -21,11 +42,206 @@ public class WxCustomController {
|
||||
|
||||
|
||||
@Resource
|
||||
private PlayClerkUserInfoServiceImpl playClerkUserInfoService;
|
||||
private IPlayCustomUserInfoService customUserInfoService;
|
||||
|
||||
@Resource
|
||||
private IPlayBalanceDetailsInfoService playBalanceDetailsInfoService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IPlayClerkUserInfoService clerkUserInfoService;
|
||||
|
||||
@Resource
|
||||
private IPlayGiftInfoService giftInfoService;
|
||||
|
||||
@Resource
|
||||
private IPlayClerkCommodityService clerkCommodityService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IPlayCustomFollowInfoService playCustomFollowInfoService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IPlayClerkCommodityService playClerkCommodityService;
|
||||
|
||||
@Resource
|
||||
private WxCustomUserService customUserService;
|
||||
|
||||
@Resource
|
||||
private IPlayOrderInfoService orderInfoService;
|
||||
|
||||
/**
|
||||
* 根据店员ID查询店员详细信息
|
||||
*
|
||||
* @param id 店员ID
|
||||
* @return 店员详细信息
|
||||
*/
|
||||
@GetMapping("/queryClarkDetailedById")
|
||||
public R queryClarkDetailedById(@RequestParam("id") String id) {
|
||||
PlayClerkUserInfoEntity entity = clerkUserInfoService.selectById(id);
|
||||
if (entity == null) {
|
||||
throw new CustomException("用户不存在");
|
||||
}
|
||||
PlayClerkUserListResultVo vo = ConvertUtil.entityToVo(entity, PlayClerkUserListResultVo.class);
|
||||
vo.setAddress(entity.getCity());
|
||||
// 查询是否关注,未登录情况下,默认为未关注
|
||||
String loginUserId = customUserService.getLoginUserId();
|
||||
if (StringUtils.isNotEmpty(loginUserId)) {
|
||||
vo.setFollowState(playCustomFollowInfoService.queryFollowState(loginUserId, vo.getId()));
|
||||
}
|
||||
//服务项目
|
||||
vo.setCommodity(playClerkCommodityService.getClerkCommodityList(vo.getId()));
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询店员详细信息
|
||||
*/
|
||||
@CustomUserLogin
|
||||
@GetMapping("/queryById")
|
||||
public R queryById() {
|
||||
String userId = ThreadLocalRequestDetail.getCustomUserInfo().getId();
|
||||
PlayCustomUserInfoEntity customUserInfo = customUserInfoService.selectById(userId);
|
||||
return R.ok(customUserInfo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 打赏店员
|
||||
*/
|
||||
@CustomUserLogin
|
||||
@PostMapping("/order/reward")
|
||||
public R rewardToOrder(@Validated @RequestBody PlayOrderInfoRewardAdd vo) {
|
||||
MoneyUtils.verificationTypeIsNormal(vo.getMoney());
|
||||
String userId = ThreadLocalRequestDetail.getCustomUserInfo().getId();
|
||||
PlayCustomUserInfoEntity customUserInfo = customUserInfoService.selectById(userId);
|
||||
if (customUserInfo == null) {
|
||||
throw new CustomException("用户身份异常");
|
||||
}
|
||||
PlayClerkUserInfoEntity clerkUserInfo = clerkUserInfoService.selectById(vo.getClearId());
|
||||
if (clerkUserInfo == null) {
|
||||
throw new CustomException("打赏对象不存在");
|
||||
}
|
||||
if (new BigDecimal(vo.getMoney()).compareTo(customUserInfo.getAccountBalance()) > 0) {
|
||||
throw new CustomException("余额不足");
|
||||
}
|
||||
// 记录订单信息
|
||||
orderInfoService.createRewardOrder(new BigDecimal(vo.getMoney()), new BigDecimal(vo.getMoney()), userId);
|
||||
|
||||
// 顾客减少余额
|
||||
customUserInfoService.updateAccountBalanceById(customUserInfo.getId(), customUserInfo.getAccountBalance().subtract(new BigDecimal(vo.getMoney())));
|
||||
playBalanceDetailsInfoService.create("0", customUserInfo.getId(), customUserInfo.getAccountBalance(), customUserInfo.getAccountBalance().subtract(new BigDecimal(vo.getMoney())), "打赏", new BigDecimal(vo.getMoney()).multiply(new BigDecimal("-1")));
|
||||
|
||||
// 陪玩增加余额
|
||||
clerkUserInfoService.updateAccountBalanceById(clerkUserInfo.getId(), clerkUserInfo.getAccountBalance().add(new BigDecimal(vo.getMoney())));
|
||||
playBalanceDetailsInfoService.create("1", clerkUserInfo.getId(), clerkUserInfo.getAccountBalance(), clerkUserInfo.getAccountBalance().add(new BigDecimal(vo.getMoney())), "打赏", new BigDecimal(vo.getMoney()).multiply(new BigDecimal("1")));
|
||||
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
|
||||
@CustomUserLogin
|
||||
@PostMapping("/order/gift")
|
||||
public R giftToOdder(@Validated @RequestBody PlayOrderInfoGiftAdd vo) {
|
||||
int giftQuantity;
|
||||
try {
|
||||
giftQuantity = Integer.parseInt(vo.getGiftQuantity());
|
||||
} catch (Exception e) {
|
||||
throw new CustomException("礼物数量异常");
|
||||
}
|
||||
if (giftQuantity <= 0 || giftQuantity > 10000) {
|
||||
throw new CustomException("礼物数量必须大于0并且小于1000");
|
||||
}
|
||||
String userId = ThreadLocalRequestDetail.getCustomUserInfo().getId();
|
||||
PlayGiftInfoEntity giftInfo = giftInfoService.selectPlayGiftInfoById(vo.getGiftId());
|
||||
if (giftInfo == null) {
|
||||
throw new CustomException("礼物不存在");
|
||||
}
|
||||
PlayCustomUserInfoEntity customUserInfo = customUserInfoService.selectById(userId);
|
||||
if (customUserInfo == null) {
|
||||
throw new CustomException("用户身份异常");
|
||||
}
|
||||
PlayClerkUserInfoEntity clerkUserInfo = clerkUserInfoService.selectById(vo.getClearId());
|
||||
if (clerkUserInfo == null) {
|
||||
throw new CustomException("打赏对象不存在");
|
||||
}
|
||||
BigDecimal money = giftInfo.getPrice().multiply(new BigDecimal(vo.getGiftQuantity()));
|
||||
|
||||
if (money.compareTo(customUserInfo.getAccountBalance()) > 0) {
|
||||
throw new CustomException("账号余额不足");
|
||||
}
|
||||
// 记录订单信息
|
||||
|
||||
orderInfoService.createGiftOrder(vo.getGiftId(), giftInfo.getPrice(), vo.getGiftQuantity(), money, money, userId);
|
||||
|
||||
// 顾客减少余额
|
||||
customUserInfoService.updateAccountBalanceById(customUserInfo.getId(), customUserInfo.getAccountBalance().subtract(money));
|
||||
playBalanceDetailsInfoService.create("0", customUserInfo.getId(), customUserInfo.getAccountBalance(), customUserInfo.getAccountBalance().subtract(money), "赠送礼物", money.multiply(new BigDecimal("-1")));
|
||||
|
||||
// 陪玩增加余额
|
||||
clerkUserInfoService.updateAccountBalanceById(clerkUserInfo.getId(), clerkUserInfo.getAccountBalance().add(money));
|
||||
playBalanceDetailsInfoService.create("1", clerkUserInfo.getId(), clerkUserInfo.getAccountBalance(), clerkUserInfo.getAccountBalance().add(money), "赠送礼物", money.multiply(new BigDecimal("1")));
|
||||
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
|
||||
@CustomUserLogin
|
||||
@PostMapping("/order/commodity")
|
||||
public R commodityToOdder(@Validated @RequestBody PlayOrderInfoCommodityAdd vo) {
|
||||
int commodityId;
|
||||
try {
|
||||
commodityId = Integer.parseInt(vo.getCommodityQuantity());
|
||||
} catch (Exception e) {
|
||||
throw new CustomException("礼物数量异常");
|
||||
}
|
||||
if (commodityId <= 0 || commodityId > 10000) {
|
||||
throw new CustomException("购买数量必须大于0并且小于1000");
|
||||
}
|
||||
String userId = ThreadLocalRequestDetail.getCustomUserInfo().getId();
|
||||
|
||||
PlayClerkCommodityEntity clerkCommodity = clerkCommodityService.selectPlayClerkCommodityById(vo.getCommodityId());
|
||||
if (clerkCommodity == null) {
|
||||
throw new CustomException("服务不存在");
|
||||
}
|
||||
PlayCustomUserInfoEntity customUserInfo = customUserInfoService.selectById(userId);
|
||||
if (customUserInfo == null) {
|
||||
throw new CustomException("用户身份异常");
|
||||
}
|
||||
PlayClerkUserInfoEntity clerkUserInfo = clerkUserInfoService.selectById(vo.getClearId());
|
||||
if (clerkUserInfo == null) {
|
||||
throw new CustomException("打赏对象不存在");
|
||||
}
|
||||
BigDecimal money = clerkCommodity.getCommodityPrice().multiply(new BigDecimal(vo.getCommodityQuantity()));
|
||||
|
||||
if (money.compareTo(customUserInfo.getAccountBalance()) > 0) {
|
||||
throw new CustomException("余额不足");
|
||||
}
|
||||
// 记录订单信息
|
||||
|
||||
orderInfoService.createOrdinaryOrder("2", "0", clerkCommodity.getCommodityId(), clerkCommodity.getCommodityPrice(), vo.getCommodityQuantity(), money, money, userId);
|
||||
|
||||
// 顾客减少余额
|
||||
customUserInfoService.updateAccountBalanceById(customUserInfo.getId(), customUserInfo.getAccountBalance().subtract(money));
|
||||
playBalanceDetailsInfoService.create("0", customUserInfo.getId(), customUserInfo.getAccountBalance(), customUserInfo.getAccountBalance().subtract(money), "打赏", money.multiply(new BigDecimal("-1")));
|
||||
// 陪玩增加余额
|
||||
clerkUserInfoService.updateAccountBalanceById(clerkUserInfo.getId(), clerkUserInfo.getAccountBalance().add(money));
|
||||
playBalanceDetailsInfoService.create("1", clerkUserInfo.getId(), clerkUserInfo.getAccountBalance(), clerkUserInfo.getAccountBalance().add(money), "下单", money.multiply(new BigDecimal("1")));
|
||||
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
@CustomUserLogin
|
||||
@PostMapping("/followState/update")
|
||||
public R followStateUpdate(@Validated @RequestBody PlayClerkFollowStateUpdate vo) {
|
||||
PlayClerkUserInfoEntity clerkUserInfo = clerkUserInfoService.selectById(vo.getClearId());
|
||||
if (clerkUserInfo == null) {
|
||||
throw new CustomException("关注对象不存在");
|
||||
}
|
||||
playCustomFollowInfoService.updateFollowState(ThreadLocalRequestDetail.getCustomUserInfo().getId(), vo.getClearId(), vo.getFollowState());
|
||||
return R.ok("修改成功");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
|
||||
import com.starry.admin.modules.gift.service.IPlayGiftInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.PlayGiftInfoDto;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/wx/gift/")
|
||||
public class WxGiftController {
|
||||
@Resource
|
||||
private IPlayGiftInfoService giftInfoService;
|
||||
|
||||
@GetMapping("/listByAll")
|
||||
public R rewardToOrder() {
|
||||
return R.ok(ConvertUtil.entityToVoList(giftInfoService.listByAll(),PlayGiftInfoDto.class));
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,8 @@ import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.WxUserLoginVo;
|
||||
import com.starry.admin.modules.weichat.entity.WxUserQueryAddressVo;
|
||||
import com.starry.admin.modules.weichat.service.WxCustomMpService;
|
||||
import com.starry.admin.modules.weichat.service.WxCustomUserService;
|
||||
import com.starry.admin.modules.weichat.service.WxOauthService;
|
||||
import com.starry.admin.modules.weichat.service.WxTokenService;
|
||||
import com.starry.common.redis.RedisCache;
|
||||
@@ -20,10 +22,10 @@ import com.starry.common.result.R;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.chanjar.weixin.common.bean.WxJsapiSignature;
|
||||
import me.chanjar.weixin.common.error.WxErrorException;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
|
||||
import static com.starry.common.constant.Constants.*;
|
||||
@@ -41,7 +43,7 @@ public class WxOauthController {
|
||||
|
||||
|
||||
@Resource
|
||||
private WxCustomService wxCustomService;
|
||||
private WxCustomMpService wxCustomMpService;
|
||||
|
||||
@Resource
|
||||
private IPlayCustomUserInfoService customUserInfoService;
|
||||
@@ -66,7 +68,7 @@ public class WxOauthController {
|
||||
if (!StrUtil.isBlankIfStr(vo.getUrl())) {
|
||||
defaultAddress = vo.getUrl();
|
||||
}
|
||||
WxJsapiSignature wxJsapiSignature = wxCustomService.proxyWxMpService().createJsapiSignature(defaultAddress);
|
||||
WxJsapiSignature wxJsapiSignature = wxCustomMpService.proxyWxMpService().createJsapiSignature(defaultAddress);
|
||||
return R.ok(wxJsapiSignature);
|
||||
}
|
||||
|
||||
@@ -77,7 +79,7 @@ public class WxOauthController {
|
||||
if (!StrUtil.isBlankIfStr(vo.getUrl())) {
|
||||
defaultAddress = vo.getUrl();
|
||||
}
|
||||
String url = wxCustomService.proxyWxMpService().getOAuth2Service().buildAuthorizationUrl(defaultAddress, "snsapi_userinfo", "STATE");
|
||||
String url = wxCustomMpService.proxyWxMpService().getOAuth2Service().buildAuthorizationUrl(defaultAddress, "snsapi_userinfo", "STATE");
|
||||
return R.ok(url);
|
||||
}
|
||||
|
||||
@@ -88,7 +90,7 @@ public class WxOauthController {
|
||||
|
||||
|
||||
@PostMapping("/clark/login")
|
||||
public R clerkLogin(@Valid @RequestBody WxUserLoginVo vo) {
|
||||
public R clerkLogin(@Validated @RequestBody WxUserLoginVo vo) {
|
||||
String userId = wxOauthService.clarkUserLogin(vo.getCode());
|
||||
PlayClerkUserInfoEntity entity = clerkUserInfoService.selectById(userId);
|
||||
if (entity == null) {
|
||||
@@ -107,7 +109,7 @@ public class WxOauthController {
|
||||
}
|
||||
|
||||
@PostMapping("/clark/loginById")
|
||||
public R loginById(@Valid @RequestBody WxUserLoginVo vo) {
|
||||
public R loginById(@Validated @RequestBody WxUserLoginVo vo) {
|
||||
PlayClerkUserInfoEntity entity = clerkUserInfoService.selectById(vo.getCode());
|
||||
if (entity == null) {
|
||||
throw new CustomException("用户不存在");
|
||||
@@ -139,7 +141,7 @@ public class WxOauthController {
|
||||
if (!StrUtil.isBlankIfStr(vo.getUrl())) {
|
||||
defaultAddress = vo.getUrl();
|
||||
}
|
||||
String url = wxCustomService.proxyWxMpService().getOAuth2Service().buildAuthorizationUrl(defaultAddress, "snsapi_userinfo", "STATE");
|
||||
String url = wxCustomMpService.proxyWxMpService().getOAuth2Service().buildAuthorizationUrl(defaultAddress, "snsapi_userinfo", "STATE");
|
||||
return R.ok(url);
|
||||
}
|
||||
|
||||
@@ -150,7 +152,7 @@ public class WxOauthController {
|
||||
|
||||
|
||||
@PostMapping("/custom/login")
|
||||
public R customLogin(@Valid @RequestBody WxUserLoginVo vo) {
|
||||
public R customLogin(@Validated @RequestBody WxUserLoginVo vo) {
|
||||
String userId = wxOauthService.customUserLogin(vo.getCode());
|
||||
PlayCustomUserInfoEntity entity = customUserInfoService.selectById(userId);
|
||||
if (entity == null) {
|
||||
@@ -168,6 +170,24 @@ public class WxOauthController {
|
||||
return R.ok(jsonObject);
|
||||
}
|
||||
|
||||
@PostMapping("/custom/loginById")
|
||||
public R loginById1(@Validated @RequestBody WxUserLoginVo vo) {
|
||||
PlayCustomUserInfoEntity entity = customUserInfoService.selectById(vo.getCode());
|
||||
if (entity == null) {
|
||||
throw new CustomException("用户不存在");
|
||||
}
|
||||
// 缓存租户信息
|
||||
String redisKey = "TENANT_INFO:" + entity.getId();
|
||||
redisCache.setCacheObject(redisKey, entity.getTenantId());
|
||||
JSONObject jsonObject = JSONObject.from(clerkUserInfoService.getVo(new PlayClerkUserInfoEntity()));
|
||||
String tokenValue = tokenService.createWxUserToken(entity.getId());
|
||||
jsonObject.put("tokenValue", TOKEN_PREFIX + tokenValue);
|
||||
jsonObject.put("tokenName", CLERK_USER_LOGIN_TOKEN);
|
||||
jsonObject.put("loginDate", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
|
||||
customUserInfoService.updateTokenById(entity.getId(), tokenValue);
|
||||
return R.ok(jsonObject);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/custom/logout")
|
||||
@CustomUserLogin
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.starry.admin.common.aspect.CustomUserLogin;
|
||||
import com.starry.admin.common.conf.ThreadLocalRequestDetail;
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.balance.service.IPlayBalanceDetailsInfoService;
|
||||
import com.starry.admin.modules.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
import com.starry.admin.modules.custom.service.IPlayCustomUserInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderInfoService;
|
||||
import com.starry.admin.modules.platform.entity.SysTenantEntity;
|
||||
import com.starry.admin.modules.platform.service.impl.SysTenantServiceImpl;
|
||||
import com.starry.admin.utils.SecurityUtils;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/wx/play/")
|
||||
public class WxPlayController {
|
||||
|
||||
|
||||
@Resource
|
||||
private SysTenantServiceImpl tenantService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IPlayCustomUserInfoService customUserInfoService;
|
||||
|
||||
@Resource
|
||||
private IPlayBalanceDetailsInfoService playBalanceDetailsInfoService;
|
||||
|
||||
@Resource
|
||||
private IPlayOrderInfoService orderInfoService;
|
||||
|
||||
|
||||
@CustomUserLogin
|
||||
@GetMapping("/custom/createOrder")
|
||||
public R createOrder(@RequestParam("money") String money) {
|
||||
if (StringUtils.isEmpty(money)) {
|
||||
throw new CustomException("请求参数错误,money不能为空");
|
||||
}
|
||||
|
||||
String tenantId = SecurityUtils.getTenantId();
|
||||
if (StrUtil.isBlankIfStr(tenantId)) {
|
||||
throw new CustomException("系统错误,租户ID不能为空");
|
||||
}
|
||||
SysTenantEntity entity = tenantService.selectSysTenantByTenantId(tenantId);
|
||||
if (entity == null) {
|
||||
throw new CustomException("系统错误,租户ID不能为空");
|
||||
}
|
||||
|
||||
|
||||
String openId = ThreadLocalRequestDetail.getCustomUserInfo().getOpenid();
|
||||
//订单总金额,单位为分
|
||||
int totalFee = getTotalFee(money);
|
||||
// String orderId = IdUtil.fastSimpleUUID();
|
||||
// String body = "body";
|
||||
//
|
||||
// try {
|
||||
// String id = WxPlayUtils.unifiedOrderJSAPI(openId, entity.getAppId(), entity.getMchId(), orderId, "127.0.0.1", body, SecurityUtils.getTenantId(), totalFee);
|
||||
// return R.ok(id);
|
||||
// } catch (Exception e) {
|
||||
// log.error("创建支付订单失败,error=", e);
|
||||
// throw new CustomException("创建支付订单失败," + e.getMessage());
|
||||
// }
|
||||
|
||||
String userId = ThreadLocalRequestDetail.getCustomUserInfo().getId();
|
||||
PlayCustomUserInfoEntity customUserInfo = customUserInfoService.selectById(userId);
|
||||
if (customUserInfo == null) {
|
||||
throw new CustomException("用户身份异常");
|
||||
}
|
||||
|
||||
orderInfoService.createRechargeOrder(new BigDecimal(totalFee / 100), new BigDecimal(totalFee / 100), userId);
|
||||
customUserInfoService.updateAccountBalanceById(customUserInfo.getId(), customUserInfo.getAccountBalance().add(new BigDecimal(totalFee / 100)));
|
||||
playBalanceDetailsInfoService.create("1", customUserInfo.getId(), customUserInfo.getAccountBalance(), customUserInfo.getAccountBalance().add(new BigDecimal(totalFee / 100)), "充值", new BigDecimal(totalFee / 100));
|
||||
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param money 金额,单位-元
|
||||
* @return 金额, 单位-分
|
||||
*/
|
||||
public int getTotalFee(String money) {
|
||||
int totalFee;
|
||||
try {
|
||||
totalFee = (int) Float.parseFloat(money) * 100;
|
||||
} catch (Exception e) {
|
||||
throw new CustomException("请求参数错误,money类型异常");
|
||||
}
|
||||
if (totalFee <= 0 || totalFee > 1000000) {
|
||||
throw new CustomException("请求参数错误,单笔支付金额必须大于0,且小于10000");
|
||||
}
|
||||
return totalFee;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import com.starry.admin.modules.clear.module.entity.PlayClerkCommodityEntity;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 店员商品树状数据
|
||||
*/
|
||||
@Data
|
||||
public class PlayClarkCommodityTreeData {
|
||||
|
||||
private String commodityType;
|
||||
|
||||
|
||||
private List<ClarkCommodityInfo> value;
|
||||
|
||||
|
||||
public PlayClarkCommodityTreeData(String commodityType, List<PlayClerkCommodityEntity> value) {
|
||||
this.commodityType = commodityType;
|
||||
this.value = ConvertUtil.entityToVoList(value, ClarkCommodityInfo.class);
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ClarkCommodityInfo {
|
||||
|
||||
private String id;
|
||||
|
||||
private String commodityName;
|
||||
|
||||
private BigDecimal commodityPrice;
|
||||
|
||||
private String serviceDuration;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 店员和陪玩关注状态
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class PlayClerkFollowStateUpdate {
|
||||
|
||||
|
||||
/**
|
||||
* 店员用户ID
|
||||
*/
|
||||
@NotBlank(message = "打赏对象不能为空")
|
||||
private String clearId;
|
||||
|
||||
@NotBlank(message = "关注状态不能为空")
|
||||
@Pattern(regexp = "[01]", message = "关注状态必须为0或者1")
|
||||
private String followState;
|
||||
}
|
||||
@@ -82,6 +82,12 @@ public class PlayClerkUserByWxAddVo {
|
||||
@Size(min = 1, max = 5, message = "照片必须为1-5张")
|
||||
private List<String> album;
|
||||
|
||||
|
||||
/**
|
||||
* 个性签名
|
||||
*/
|
||||
private String signature;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
||||
@@ -83,7 +83,7 @@ public class PlayClerkUserLoginResponseVo {
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private List<String> labels = new ArrayList<>();
|
||||
private List<String> label = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 分类
|
||||
|
||||
@@ -53,7 +53,7 @@ public class PlayClerkUserOtherVo {
|
||||
/**
|
||||
* 标签
|
||||
*/
|
||||
private List<String> labels = new ArrayList<>();
|
||||
private List<String> label = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 分类
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class PlayGiftInfoDto {
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 礼物名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 礼物类型(0:盲盒,1:普通礼物)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 礼物图片地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 价格单位
|
||||
*/
|
||||
private String unit;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.starry.admin.modules.weichat.entity;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新增赠礼订单实体
|
||||
*
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class PlayOrderInfoCommodityAdd {
|
||||
|
||||
|
||||
/**
|
||||
* 店员用户ID
|
||||
*/
|
||||
@NotBlank(message = "打赏对象不能为空")
|
||||
private String clearId;
|
||||
|
||||
|
||||
@NotBlank(message = "商品ID不能为空")
|
||||
private String commodityId;
|
||||
|
||||
@NotBlank(message = "礼物数量不能为空")
|
||||
private String commodityQuantity;
|
||||
|
||||
|
||||
@NotBlank(message = "微信号不能为空")
|
||||
private String weiChatCode;
|
||||
|
||||
/**
|
||||
* 优惠券ID列表
|
||||
*/
|
||||
private List<String> couponIds;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user