fix
This commit is contained in:
@@ -9,8 +9,8 @@ import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.clerk.mapper.PlayClerkCommodityMapper;
|
||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkCommodityEntity;
|
||||
import com.starry.admin.modules.clerk.service.IPlayClerkCommodityService;
|
||||
import com.starry.admin.modules.play.module.entity.PlayCommodityInfoEntity;
|
||||
import com.starry.admin.modules.play.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayCommodityInfoEntity;
|
||||
import com.starry.admin.modules.shop.service.IPlayCommodityInfoService;
|
||||
import com.starry.common.utils.IdUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -37,7 +37,7 @@ public class PlayClerkCommodityServiceImpl extends ServiceImpl<PlayClerkCommodit
|
||||
|
||||
@Override
|
||||
public void initClerkCommodity(String userId) {
|
||||
// 删除当前陪聊的所有服务项目
|
||||
// 查询当前陪聊的所有服务项目
|
||||
LambdaQueryWrapper<PlayClerkCommodityEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayClerkCommodityEntity::getClerkId, userId);
|
||||
this.baseMapper.delete(lambdaQueryWrapper);
|
||||
|
||||
@@ -8,8 +8,8 @@ import com.starry.admin.modules.order.module.entity.PlayOrderRandomInfoEntity;
|
||||
import com.starry.admin.modules.order.module.vo.*;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderRandomInfoService;
|
||||
import com.starry.admin.modules.play.module.vo.PlayCommodityInfoVo;
|
||||
import com.starry.admin.modules.play.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayCommodityInfoVo;
|
||||
import com.starry.admin.modules.shop.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.weichat.service.WxCustomMpService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.context.CustomSecurityContextHolder;
|
||||
@@ -64,13 +64,13 @@ public class PlayOrderInfoController {
|
||||
if (orderInfo.getFinalAmount().compareTo(vo.getRefundAmount()) < 0) {
|
||||
throw new CustomException("退款金额不能大于支付金额");
|
||||
}
|
||||
if (orderInfo.getOrderStatus().equals("3")) {
|
||||
if ("3".equals(orderInfo.getOrderStatus())) {
|
||||
throw new CustomException("【已完成】的订单无法操作退款");
|
||||
}
|
||||
if (orderInfo.getOrderStatus().equals("4")) {
|
||||
if ("4".equals(orderInfo.getOrderStatus())) {
|
||||
throw new CustomException("【已取消】的订单无法操作退款");
|
||||
}
|
||||
if (orderInfo.getRefundType().equals("1")) {
|
||||
if ("1".equals(orderInfo.getRefundType())) {
|
||||
throw new CustomException("每个订单只能退款一次~");
|
||||
}
|
||||
PlayOrderInfoEntity updateOrderInfo = new PlayOrderInfoEntity();
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.starry.admin.modules.platform.mapper.SysTenantMapper;
|
||||
import com.starry.admin.modules.platform.mapper.SysTenantPackageMapper;
|
||||
import com.starry.admin.modules.platform.service.ISysTenantService;
|
||||
import com.starry.admin.modules.platform.vo.SysTenantQueryVo;
|
||||
import com.starry.admin.modules.play.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.shop.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.system.entity.SysRoleEntity;
|
||||
import com.starry.admin.modules.system.entity.SysRoleMenuEntity;
|
||||
import com.starry.admin.modules.system.entity.SysUserEntity;
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.starry.admin.modules.play.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.play.module.entity.PlayNoticeInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayNoticeInfoAddVo;
|
||||
import com.starry.admin.modules.play.service.IPlayNoticeInfoService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 公告Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/play/notice")
|
||||
public class PlayNoticeInfoController {
|
||||
@Resource
|
||||
private IPlayNoticeInfoService playNoticeInfoService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*/
|
||||
@GetMapping("/listAll")
|
||||
public R listAll(PlayNoticeInfoEntity playNoticeInfo) {
|
||||
IPage<PlayNoticeInfoEntity> list = playNoticeInfoService.selectPlayNoticeInfoByPage(playNoticeInfo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R list(PlayNoticeInfoEntity playNoticeInfo) {
|
||||
IPage<PlayNoticeInfoEntity> list = playNoticeInfoService.selectPlayNoticeInfoByPage(playNoticeInfo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公告详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playNoticeInfoService.selectPlayNoticeInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公告
|
||||
*/
|
||||
@Log(title = "公告", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@Validated @RequestBody PlayNoticeInfoAddVo vo) {
|
||||
PlayNoticeInfoEntity entity = ConvertUtil.entityToVo(vo, PlayNoticeInfoEntity.class);
|
||||
boolean success = playNoticeInfoService.create(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除公告
|
||||
*/
|
||||
@Log(title = "公告", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
return R.ok(playNoticeInfoService.deletePlayNoticeInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
package com.starry.admin.modules.play.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.common.oss.service.IOssFileService;
|
||||
import com.starry.admin.modules.play.module.entity.PlayResourcesInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayResourcesInfoAddVo;
|
||||
import com.starry.admin.modules.play.module.vo.PlayResourcesInfoReviewVo;
|
||||
import com.starry.admin.modules.play.service.IPlayResourcesInfoService;
|
||||
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 org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 陪聊资源Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/play/resource/info")
|
||||
public class PlayResourcesInfoController {
|
||||
@Resource
|
||||
private IPlayResourcesInfoService playResourcesInfoService;
|
||||
|
||||
@Resource
|
||||
private IOssFileService ossFileService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询陪聊资源列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R list(PlayResourcesInfoEntity playResourcesInfo) {
|
||||
IPage<PlayResourcesInfoEntity> list = playResourcesInfoService.selectPlayResourcesInfoByPage(playResourcesInfo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取陪聊资源详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playResourcesInfoService.selectPlayResourcesInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 陪聊上传资源(图片/签名/视频/录音小样等)
|
||||
*/
|
||||
@Log(title = "陪聊资源", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@RequestBody PlayResourcesInfoAddVo vo, @RequestParam("file") MultipartFile file) throws IOException {
|
||||
// 校验文件类型是否正常
|
||||
|
||||
// 上传文件到OSS
|
||||
String fileAddress = ossFileService.upload(file.getInputStream(), "", file.getOriginalFilename());
|
||||
|
||||
// 保持陪聊资源
|
||||
PlayResourcesInfoEntity entity = ConvertUtil.entityToVo(vo, PlayResourcesInfoEntity.class);
|
||||
entity.setAddress(fileAddress);
|
||||
boolean success = playResourcesInfoService.create(entity);
|
||||
// 发送审核通知给对应的管理员
|
||||
|
||||
// 返回信息
|
||||
if (success) {
|
||||
return R.ok("成功");
|
||||
}
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 陪聊资料审核
|
||||
*/
|
||||
@Log(title = "陪聊资源审核", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/examine")
|
||||
public R examinePlayResourcesInfo(@RequestBody PlayResourcesInfoReviewVo vo) {
|
||||
// 验证权限,判断当前接口调用人是否有权限操作该接口
|
||||
|
||||
// 资料审核
|
||||
playResourcesInfoService.examinePlayResourcesInfo(vo.getId(), vo.isSuccess(), vo.getRemark());
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除陪聊资源
|
||||
*/
|
||||
@Log(title = "陪聊资源", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
return R.ok(playResourcesInfoService.deletePlayResourcesInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
package com.starry.admin.modules.play.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.play.module.entity.PlayUserInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayUserInfoAddVo;
|
||||
import com.starry.admin.modules.play.module.vo.PlayUserInfoQueryVo;
|
||||
import com.starry.admin.modules.play.module.vo.PlayUserInfoUpEditVo;
|
||||
import com.starry.admin.modules.play.service.IPlayUserInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 账号Controller
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/play/user")
|
||||
public class PlayUserInfoController {
|
||||
@Resource
|
||||
private IPlayUserInfoService playUserInfoService;
|
||||
|
||||
/**
|
||||
* 查询账号列表
|
||||
*/
|
||||
//@PreAuthorize("@customSs.hasPermission('play:user:list')")
|
||||
@PostMapping("/listByPage")
|
||||
public R listAll(@Validated @RequestBody PlayUserInfoQueryVo vo) {
|
||||
IPage<PlayUserInfoEntity> list = playUserInfoService.selectPlayUserInfoByPage(vo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账号详细信息
|
||||
*/
|
||||
//@PreAuthorize("@customSs.hasPermission('play:user:list')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") String id) {
|
||||
return R.ok(playUserInfoService.selectPlayUserInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增账号
|
||||
*/
|
||||
//@PreAuthorize("@customSs.hasPermission('play:user:add')")
|
||||
@Log(title = "账号", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/create")
|
||||
public R create(@Validated @RequestBody PlayUserInfoAddVo vo) {
|
||||
PlayUserInfoEntity entity = ConvertUtil.entityToVo(vo, PlayUserInfoEntity.class);
|
||||
boolean success = playUserInfoService.create(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("添加失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账号
|
||||
*/
|
||||
//@PreAuthorize("@customSs.hasPermission('play:user:update')")
|
||||
@Log(title = "账号", businessType = BusinessType.UPDATE)
|
||||
@PostMapping(value = "/update")
|
||||
public R update(@Validated @RequestBody PlayUserInfoUpEditVo vo) {
|
||||
PlayUserInfoEntity entity = ConvertUtil.entityToVo(vo, PlayUserInfoEntity.class);
|
||||
boolean success = playUserInfoService.update(entity);
|
||||
if (success) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error("修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除账号
|
||||
*/
|
||||
//@PreAuthorize("@customSs.hasPermission('play:user:delete')")
|
||||
@Log(title = "账号", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R remove(@PathVariable String[] ids) {
|
||||
return R.ok(playUserInfoService.deletePlayUserInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.starry.admin.modules.play.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.play.module.entity.PlayNoticeInfoEntity;
|
||||
|
||||
/**
|
||||
* 公告Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-06
|
||||
*/
|
||||
public interface PlayNoticeInfoMapper extends BaseMapper<PlayNoticeInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.starry.admin.modules.play.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.play.module.entity.PlayResourcesInfoEntity;
|
||||
|
||||
/**
|
||||
* 陪聊资源Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-23
|
||||
*/
|
||||
public interface PlayResourcesInfoMapper extends BaseMapper<PlayResourcesInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.starry.admin.modules.play.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.starry.admin.modules.play.module.entity.PlayUserInfoEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 账号Mapper接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
public interface PlayUserInfoMapper extends BaseMapper<PlayUserInfoEntity> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.starry.admin.modules.play.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 公告对象 play_notice_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_notice_info")
|
||||
public class PlayNoticeInfoEntity extends BaseEntity<PlayNoticeInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 公告类型【0:公告,1:消息】
|
||||
*/
|
||||
private String noticeType;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package com.starry.admin.modules.play.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_resources_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_resources_info")
|
||||
public class PlayResourcesInfoEntity extends BaseEntity<PlayResourcesInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 陪聊用户ID
|
||||
*/
|
||||
private String playUserId;
|
||||
|
||||
/**
|
||||
* 陪聊展示资源类型[0;1;2;3;4]
|
||||
* 0:签名
|
||||
* 1:录音小样
|
||||
* 2:视频小样
|
||||
* 3:轮播图
|
||||
*/
|
||||
private String resourcesType;
|
||||
|
||||
/**
|
||||
* 资源存放地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
private Date uploadTime;
|
||||
|
||||
/**
|
||||
* 资源状态[0;1;2;3]
|
||||
* 0:未审核
|
||||
* 1:审核通过
|
||||
* 2:审核未通过
|
||||
*/
|
||||
private String resourcesState;
|
||||
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
private String reviewedBy;
|
||||
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
private Date reviewedTime;
|
||||
|
||||
/**
|
||||
* 审核内容
|
||||
*/
|
||||
private String reviewedRemark;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.starry.admin.modules.play.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 账号对象 play_user_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("play_user_info")
|
||||
public class PlayUserInfoEntity extends BaseEntity<PlayUserInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 账户名称(手机号码)
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 手机号码区号
|
||||
*/
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 账户状态(1:审批通过,0:注册未审批)
|
||||
*/
|
||||
private String accountState;
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
package com.starry.admin.modules.play.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 公告对象 play_notice_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-06
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class PlayNoticeInfoAddVo {
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
@NotBlank(message = "标题不能为空")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
@NotBlank(message = "内容不能为空")
|
||||
private String content;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
package com.starry.admin.modules.play.module.vo;
|
||||
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 新增陪聊资料对象
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class PlayResourcesInfoAddVo extends BaseEntity<PlayResourcesInfoAddVo> {
|
||||
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@NotNull(message = "租户ID不能为空")
|
||||
private String tenantId;
|
||||
|
||||
|
||||
/**
|
||||
* 陪聊展示资源类型[0;1;2;3;4]
|
||||
* 0:签名
|
||||
* 1:录音小样
|
||||
* 2:视频小样
|
||||
* 3:轮播图
|
||||
*/
|
||||
@NotNull(message = "资源类型不能为空")
|
||||
private String resourcesType;
|
||||
|
||||
|
||||
/**
|
||||
* 资源状态[0;1;2;3]
|
||||
* 0:未审核
|
||||
* 1:审核通过
|
||||
* 2:审核未通过
|
||||
*/
|
||||
private String resourcesState = "0";
|
||||
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.starry.admin.modules.play.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 陪聊资料审核
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class PlayResourcesInfoReviewVo {
|
||||
|
||||
|
||||
@NotNull(message = "ID不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
@NotNull(message = "租户ID不能为空")
|
||||
private String tenantId;
|
||||
|
||||
|
||||
/**
|
||||
* 是否通过
|
||||
*/
|
||||
private boolean success;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package com.starry.admin.modules.play.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class PlayUserInfoAddVo {
|
||||
|
||||
/**
|
||||
* 账户名称(手机号码)
|
||||
*/
|
||||
@NotBlank(message = "手机号码不能为空")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 手机号码区号
|
||||
*/
|
||||
@NotBlank(message = "手机号码区号不能为空")
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
@NotBlank(message = "手机号码区号不能为空")
|
||||
private String verificationCode;
|
||||
|
||||
/**
|
||||
* 陪聊用户ID
|
||||
*/
|
||||
@NotBlank(message = "绑定用户不能为空")
|
||||
private String playUserId;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.starry.admin.modules.play.module.vo;
|
||||
|
||||
import com.starry.common.domain.BasePageEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class PlayUserInfoQueryVo extends BasePageEntity {
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
|
||||
private String userCode;
|
||||
|
||||
|
||||
/**
|
||||
* 角色ID
|
||||
*/
|
||||
private String ruleId;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private List<String> addTime;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.starry.admin.modules.play.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class PlayUserInfoUpEditVo {
|
||||
|
||||
@NotBlank(message = "ID不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 陪聊用户ID
|
||||
*/
|
||||
@NotBlank(message = "绑定用户不能为空")
|
||||
private String playUserId;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.starry.admin.modules.play.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
*/
|
||||
@Data
|
||||
public class PlayUserInfoUpdateVo {
|
||||
|
||||
@NotBlank(message = "ID不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 陪聊用户ID
|
||||
*/
|
||||
@NotBlank(message = "绑定用户不能为空")
|
||||
private String playUserId;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package com.starry.admin.modules.play.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.play.module.entity.PlayNoticeInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公告Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-06
|
||||
*/
|
||||
public interface IPlayNoticeInfoService extends IService<PlayNoticeInfoEntity> {
|
||||
/**
|
||||
* 查询公告
|
||||
*
|
||||
* @param id 公告主键
|
||||
* @return 公告
|
||||
*/
|
||||
PlayNoticeInfoEntity selectPlayNoticeInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*
|
||||
* @return 公告集合
|
||||
*/
|
||||
List<PlayNoticeInfoEntity> selectPlayNoticeInfo();
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*
|
||||
* @param playNoticeInfo 公告
|
||||
* @return 公告集合
|
||||
*/
|
||||
IPage<PlayNoticeInfoEntity> selectPlayNoticeInfoByPage(PlayNoticeInfoEntity playNoticeInfo);
|
||||
|
||||
/**
|
||||
* 新增公告
|
||||
*
|
||||
* @param playNoticeInfo 公告
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayNoticeInfoEntity playNoticeInfo);
|
||||
|
||||
/**
|
||||
* 修改公告
|
||||
*
|
||||
* @param playNoticeInfo 公告
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayNoticeInfoEntity playNoticeInfo);
|
||||
|
||||
/**
|
||||
* 批量删除公告
|
||||
*
|
||||
* @param ids 需要删除的公告主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayNoticeInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除公告信息
|
||||
*
|
||||
* @param id 公告主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayNoticeInfoById(String id);
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.starry.admin.modules.play.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.play.module.entity.PlayResourcesInfoEntity;
|
||||
|
||||
/**
|
||||
* 陪聊资源Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-24
|
||||
*/
|
||||
public interface IPlayResourcesInfoService extends IService<PlayResourcesInfoEntity> {
|
||||
/**
|
||||
* 查询陪聊资源
|
||||
*
|
||||
* @param id 陪聊资源主键
|
||||
* @return 陪聊资源
|
||||
*/
|
||||
PlayResourcesInfoEntity selectPlayResourcesInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询陪聊资源列表
|
||||
*
|
||||
* @param playResourcesInfo 陪聊资源
|
||||
* @return 陪聊资源集合
|
||||
*/
|
||||
IPage<PlayResourcesInfoEntity> selectPlayResourcesInfoByPage(PlayResourcesInfoEntity playResourcesInfo);
|
||||
|
||||
/**
|
||||
* 新增陪聊资源
|
||||
*
|
||||
* @param playResourcesInfo 陪聊资源
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayResourcesInfoEntity playResourcesInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 审核陪聊资源信息
|
||||
*
|
||||
* @param id 资源ID
|
||||
* @param success 是否通过
|
||||
* @param remark 备注
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean examinePlayResourcesInfo(String id, boolean success, String remark);
|
||||
|
||||
/**
|
||||
* 修改陪聊资源
|
||||
*
|
||||
* @param playResourcesInfo 陪聊资源
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayResourcesInfoEntity playResourcesInfo);
|
||||
|
||||
/**
|
||||
* 批量删除陪聊资源
|
||||
*
|
||||
* @param ids 需要删除的陪聊资源主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayResourcesInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除陪聊资源信息
|
||||
*
|
||||
* @param id 陪聊资源主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayResourcesInfoById(String id);
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package com.starry.admin.modules.play.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.play.module.entity.PlayUserInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayUserInfoQueryVo;
|
||||
|
||||
/**
|
||||
* 账号Service接口
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
public interface IPlayUserInfoService extends IService<PlayUserInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询账号
|
||||
*
|
||||
* @param id 账号主键
|
||||
* @return 账号
|
||||
*/
|
||||
PlayUserInfoEntity selectPlayUserInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询账号列表
|
||||
*
|
||||
* @param vo 账号查询实体
|
||||
* @return 账号集合
|
||||
*/
|
||||
IPage<PlayUserInfoEntity> selectPlayUserInfoByPage(PlayUserInfoQueryVo vo);
|
||||
|
||||
/**
|
||||
* 新增账号
|
||||
*
|
||||
* @param playUserInfo 账号
|
||||
* @return 结果
|
||||
*/
|
||||
boolean create(PlayUserInfoEntity playUserInfo);
|
||||
|
||||
/**
|
||||
* 修改账号
|
||||
*
|
||||
* @param playUserInfo 账号
|
||||
* @return 结果
|
||||
*/
|
||||
boolean update(PlayUserInfoEntity playUserInfo);
|
||||
|
||||
/**
|
||||
* 批量删除账号
|
||||
*
|
||||
* @param ids 需要删除的账号主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayUserInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除账号信息
|
||||
*
|
||||
* @param id 账号主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deletePlayUserInfoById(String id);
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
package com.starry.admin.modules.play.service.impl;
|
||||
|
||||
import com.starry.common.utils.IdUtils;
|
||||
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.play.mapper.PlayNoticeInfoMapper;
|
||||
import com.starry.admin.modules.play.module.entity.PlayNoticeInfoEntity;
|
||||
import com.starry.admin.modules.play.service.IPlayNoticeInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公告Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-04-06
|
||||
*/
|
||||
@Service
|
||||
public class PlayNoticeInfoServiceImpl extends ServiceImpl<PlayNoticeInfoMapper, PlayNoticeInfoEntity> implements IPlayNoticeInfoService {
|
||||
@Resource
|
||||
private PlayNoticeInfoMapper playNoticeInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询公告
|
||||
*
|
||||
* @param id 公告主键
|
||||
* @return 公告
|
||||
*/
|
||||
@Override
|
||||
public PlayNoticeInfoEntity selectPlayNoticeInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<PlayNoticeInfoEntity> selectPlayNoticeInfo() {
|
||||
return this.baseMapper.selectList(new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*
|
||||
* @param playNoticeInfo 公告
|
||||
* @return 公告
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayNoticeInfoEntity> selectPlayNoticeInfoByPage(PlayNoticeInfoEntity playNoticeInfo) {
|
||||
Page<PlayNoticeInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公告
|
||||
*
|
||||
* @param playNoticeInfo 公告
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayNoticeInfoEntity playNoticeInfo) {
|
||||
if (StrUtil.isBlankIfStr(playNoticeInfo.getId())) {
|
||||
playNoticeInfo.setId(IdUtils.getUuid());
|
||||
}
|
||||
return save(playNoticeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公告
|
||||
*
|
||||
* @param playNoticeInfo 公告
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayNoticeInfoEntity playNoticeInfo) {
|
||||
return updateById(playNoticeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除公告
|
||||
*
|
||||
* @param ids 需要删除的公告主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayNoticeInfoByIds(String[] ids) {
|
||||
return playNoticeInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公告信息
|
||||
*
|
||||
* @param id 公告主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayNoticeInfoById(String id) {
|
||||
return playNoticeInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
package com.starry.admin.modules.play.service.impl;
|
||||
|
||||
import com.starry.common.utils.IdUtils;
|
||||
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.play.mapper.PlayResourcesInfoMapper;
|
||||
import com.starry.admin.modules.play.module.entity.PlayResourcesInfoEntity;
|
||||
import com.starry.admin.modules.play.service.IPlayResourcesInfoService;
|
||||
import com.starry.admin.utils.SecurityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 陪聊资源Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-24
|
||||
*/
|
||||
@Service
|
||||
public class PlayResourcesInfoServiceImpl extends ServiceImpl<PlayResourcesInfoMapper, PlayResourcesInfoEntity> implements IPlayResourcesInfoService {
|
||||
@Resource
|
||||
private PlayResourcesInfoMapper playResourcesInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询陪聊资源
|
||||
*
|
||||
* @param id 陪聊资源主键
|
||||
* @return 陪聊资源
|
||||
*/
|
||||
@Override
|
||||
public PlayResourcesInfoEntity selectPlayResourcesInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询陪聊资源列表
|
||||
*
|
||||
* @param playResourcesInfo 陪聊资源
|
||||
* @return 陪聊资源
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayResourcesInfoEntity> selectPlayResourcesInfoByPage(PlayResourcesInfoEntity playResourcesInfo) {
|
||||
Page<PlayResourcesInfoEntity> page = new Page<>(1, 10);
|
||||
return this.baseMapper.selectPage(page, new LambdaQueryWrapper<PlayResourcesInfoEntity>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增陪聊资源
|
||||
*
|
||||
* @param playResourcesInfo 陪聊资源
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayResourcesInfoEntity playResourcesInfo) {
|
||||
if (StrUtil.isBlankIfStr(playResourcesInfo.getId())) {
|
||||
playResourcesInfo.setId(IdUtils.getUuid());
|
||||
}
|
||||
playResourcesInfo.setPlayUserId(SecurityUtils.getLoginUser().getUserId());
|
||||
return save(playResourcesInfo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean examinePlayResourcesInfo(String id, boolean success, String remark) {
|
||||
PlayResourcesInfoEntity entity = this.selectPlayResourcesInfoById(id);
|
||||
if (entity == null) {
|
||||
throw new CustomException("资源不存在,请检查");
|
||||
}
|
||||
entity.setResourcesState(success ? "1" : "2");
|
||||
entity.setReviewedBy(SecurityUtils.getLoginUser().getUserId());
|
||||
entity.setReviewedTime(new Date());
|
||||
entity.setReviewedRemark(remark);
|
||||
// 审核通过后,先删除旧的资源,然后将新的资源标识审核通过状态
|
||||
if (success) {
|
||||
// 查询当前用户,所有同类型的资源,然后删除之前的资源
|
||||
LambdaQueryWrapper<PlayResourcesInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayResourcesInfoEntity::getPlayUserId, entity.getPlayUserId());
|
||||
lambdaQueryWrapper.eq(PlayResourcesInfoEntity::getTenantId, entity.getTenantId());
|
||||
lambdaQueryWrapper.eq(PlayResourcesInfoEntity::getResourcesType, entity.getResourcesType());
|
||||
for (PlayResourcesInfoEntity item : this.baseMapper.selectList(lambdaQueryWrapper)) {
|
||||
if (!id.equals(item.getId())) {
|
||||
this.deletePlayResourcesInfoById(item.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
this.update(entity);
|
||||
// 查询旧资源
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改陪聊资源
|
||||
*
|
||||
* @param playResourcesInfo 陪聊资源
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayResourcesInfoEntity playResourcesInfo) {
|
||||
return updateById(playResourcesInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除陪聊资源
|
||||
*
|
||||
* @param ids 需要删除的陪聊资源主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayResourcesInfoByIds(String[] ids) {
|
||||
return playResourcesInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除陪聊资源信息
|
||||
*
|
||||
* @param id 陪聊资源主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayResourcesInfoById(String id) {
|
||||
return playResourcesInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
package com.starry.admin.modules.play.service.impl;
|
||||
|
||||
import com.starry.common.utils.IdUtils;
|
||||
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.play.mapper.PlayUserInfoMapper;
|
||||
import com.starry.admin.modules.play.module.entity.PlayUserInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayUserInfoQueryVo;
|
||||
import com.starry.admin.modules.play.service.IPlayUserInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 账号Service业务层处理
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-30
|
||||
*/
|
||||
@Service
|
||||
public class PlayUserInfoServiceImpl extends ServiceImpl<PlayUserInfoMapper, PlayUserInfoEntity> implements IPlayUserInfoService {
|
||||
@Resource
|
||||
private PlayUserInfoMapper playUserInfoMapper;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询账号
|
||||
*
|
||||
* @param id 账号主键
|
||||
* @return 账号
|
||||
*/
|
||||
@Override
|
||||
public PlayUserInfoEntity selectPlayUserInfoById(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询账号列表
|
||||
*
|
||||
* @param vo 账号查询实体
|
||||
* @return 账号
|
||||
*/
|
||||
@Override
|
||||
public IPage<PlayUserInfoEntity> selectPlayUserInfoByPage(PlayUserInfoQueryVo vo) {
|
||||
LambdaQueryWrapper<PlayUserInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StrUtil.isNotBlank(vo.getId())) {
|
||||
lambdaQueryWrapper.eq(PlayUserInfoEntity::getId, vo.getId());
|
||||
}
|
||||
if (StrUtil.isNotBlank(vo.getUserCode())) {
|
||||
lambdaQueryWrapper.eq(PlayUserInfoEntity::getAreaCode, vo.getUserCode());
|
||||
}
|
||||
Page<PlayUserInfoEntity> page = new Page<>(vo.getPageNum(), vo.getPageSize());
|
||||
return this.baseMapper.selectPage(page, lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增账号
|
||||
*
|
||||
* @param playUserInfo 账号
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean create(PlayUserInfoEntity playUserInfo) {
|
||||
if (StrUtil.isBlankIfStr(playUserInfo.getId())) {
|
||||
playUserInfo.setId(IdUtils.getUuid());
|
||||
}
|
||||
return save(playUserInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改账号
|
||||
*
|
||||
* @param playUserInfo 账号
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PlayUserInfoEntity playUserInfo) {
|
||||
return updateById(playUserInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除账号
|
||||
*
|
||||
* @param ids 需要删除的账号主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayUserInfoByIds(String[] ids) {
|
||||
return playUserInfoMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除账号信息
|
||||
*
|
||||
* @param id 账号主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePlayUserInfoById(String id) {
|
||||
return playUserInfoMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,21 @@
|
||||
package com.starry.admin.modules.play.controller;
|
||||
package com.starry.admin.modules.shop.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.play.module.entity.PlayCommodityInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayCommodityInfoAddVo;
|
||||
import com.starry.admin.modules.play.service.IPlayCommodityInfoService;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayCommodityInfoEntity;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayCommodityInfoAddVo;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayCommodityInfoUpdateVo;
|
||||
import com.starry.admin.modules.shop.service.IPlayCommodityInfoService;
|
||||
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;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 服务项目Controller
|
||||
@@ -19,19 +24,37 @@ import javax.annotation.Resource;
|
||||
* @since 2024-03-31
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/play/commodity")
|
||||
@RequestMapping("/shop/commodity")
|
||||
public class PlayCommodityInfoController {
|
||||
@Resource
|
||||
private IPlayCommodityInfoService playCommodityInfoService;
|
||||
|
||||
/**
|
||||
* 查询服务项目列表
|
||||
* 查询服务项目类型
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public R list(PlayCommodityInfoEntity playCommodityInfo) {
|
||||
IPage<PlayCommodityInfoEntity> list = playCommodityInfoService.selectPlayCommodityInfoByPage(playCommodityInfo);
|
||||
return R.ok(list);
|
||||
@GetMapping("/listAll")
|
||||
public R queryCommodityType() {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
List<PlayCommodityInfoEntity> list = playCommodityInfoService.selectByType();
|
||||
for (PlayCommodityInfoEntity entity : list) {
|
||||
Map<String, Object> map = BeanUtil.beanToMap(entity);
|
||||
map.put("children", playCommodityInfoService.selectByPId(entity.getId()));
|
||||
result.add(map);
|
||||
}
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改服务项目类型
|
||||
*/
|
||||
@PostMapping("/updateInfo")
|
||||
public R updateInfo(@Validated @RequestBody PlayCommodityInfoUpdateVo vo) {
|
||||
PlayCommodityInfoEntity entity = playCommodityInfoService.selectPlayCommodityInfoById(vo.getId());
|
||||
BeanUtil.copyProperties(vo, entity);
|
||||
playCommodityInfoService.update(entity);
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取服务项目详细信息
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.starry.admin.modules.play.mapper;
|
||||
package com.starry.admin.modules.shop.mapper;
|
||||
|
||||
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.starry.admin.modules.play.module.entity.PlayCommodityInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayCommodityInfoVo;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayCommodityInfoEntity;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayCommodityInfoVo;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.starry.admin.modules.play.module.entity;
|
||||
package com.starry.admin.modules.shop.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
@@ -53,20 +53,13 @@ public class PlayCommodityInfoEntity extends BaseEntity<PlayCommodityInfoEntity>
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 启用状态(0:停用,1:启用)
|
||||
*/
|
||||
private String enableStace;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
**/
|
||||
private Integer sort;
|
||||
|
||||
public PlayCommodityInfoEntity() {
|
||||
}
|
||||
|
||||
public PlayCommodityInfoEntity(String id, String pId, String itemType, String itemName, String serviceDuration, BigDecimal price) {
|
||||
this.id = id;
|
||||
this.pId = pId;
|
||||
this.itemType = itemType;
|
||||
this.itemName = itemName;
|
||||
this.serviceDuration = serviceDuration;
|
||||
this.price = price;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.starry.admin.modules.play.module.vo;
|
||||
package com.starry.admin.modules.shop.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.starry.admin.modules.shop.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 服务项目对象 play_commodity_info
|
||||
*
|
||||
* @author admin
|
||||
* @since 2024-03-31
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class PlayCommodityInfoUpdateVo {
|
||||
|
||||
@NotNull(message = "ID不能为空")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 服务时长(文字描述信息,不参与订单计算)
|
||||
*/
|
||||
@NotNull(message = "服务时长不能为空")
|
||||
private String serviceDuration;
|
||||
|
||||
/**
|
||||
* 服务单价
|
||||
*/
|
||||
@NotNull(message = "单价不能为空")
|
||||
private String price;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.starry.admin.modules.play.module.vo;
|
||||
package com.starry.admin.modules.shop.module.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.starry.admin.modules.play.service;
|
||||
package com.starry.admin.modules.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.play.module.entity.PlayCommodityInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayCommodityInfoVo;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayCommodityInfoEntity;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayCommodityInfoVo;
|
||||
import com.starry.admin.modules.weichat.entity.PlayCommodityReturnVo;
|
||||
|
||||
import java.util.List;
|
||||
@@ -63,6 +63,14 @@ public interface IPlayCommodityInfoService extends IService<PlayCommodityInfoEnt
|
||||
*/
|
||||
List<PlayCommodityInfoEntity> selectAll();
|
||||
|
||||
|
||||
/**
|
||||
* 查询当前租户所有服务项目列表
|
||||
*
|
||||
* @return 当前租户所有服务项目列表
|
||||
*/
|
||||
List<PlayCommodityInfoEntity> selectByPId(String pId);
|
||||
|
||||
/**
|
||||
* 查询服务项目列表
|
||||
*
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.starry.admin.modules.play.service.impl;
|
||||
package com.starry.admin.modules.shop.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -6,10 +6,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.starry.admin.common.exception.CustomException;
|
||||
import com.starry.admin.modules.play.mapper.PlayCommodityInfoMapper;
|
||||
import com.starry.admin.modules.play.module.entity.PlayCommodityInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayCommodityInfoVo;
|
||||
import com.starry.admin.modules.play.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.shop.mapper.PlayCommodityInfoMapper;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayCommodityInfoEntity;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayCommodityInfoVo;
|
||||
import com.starry.admin.modules.shop.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.PlayCommodityReturnVo;
|
||||
import com.starry.admin.utils.SecurityUtils;
|
||||
import com.starry.common.utils.ConvertUtil;
|
||||
@@ -68,6 +68,7 @@ public class PlayCommodityInfoServiceImpl extends ServiceImpl<PlayCommodityInfoM
|
||||
@Override
|
||||
public List<PlayCommodityReturnVo> selectTree() {
|
||||
LambdaQueryWrapper<PlayCommodityInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.orderByAsc(PlayCommodityInfoEntity::getSort);
|
||||
List<PlayCommodityInfoEntity> list = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
Map<String, List<PlayCommodityInfoEntity>> collect = list.stream().filter(a -> a != null && a.getId() != null).collect(Collectors.groupingBy(PlayCommodityInfoEntity::getPId));
|
||||
return this.assembleTree(collect, collect.get("00"));
|
||||
@@ -97,6 +98,7 @@ public class PlayCommodityInfoServiceImpl extends ServiceImpl<PlayCommodityInfoM
|
||||
public List<PlayCommodityInfoEntity> selectByType() {
|
||||
LambdaQueryWrapper<PlayCommodityInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayCommodityInfoEntity::getItemType, "服务类型");
|
||||
lambdaQueryWrapper.orderByAsc(PlayCommodityInfoEntity::getSort);
|
||||
return this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -129,6 +131,14 @@ public class PlayCommodityInfoServiceImpl extends ServiceImpl<PlayCommodityInfoM
|
||||
return entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PlayCommodityInfoEntity> selectByPId(String pId) {
|
||||
|
||||
LambdaQueryWrapper<PlayCommodityInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PlayCommodityInfoEntity::getPId, pId);
|
||||
return this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询服务项目列表
|
||||
*
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.starry.admin.modules.weichat.controller;
|
||||
|
||||
import com.starry.admin.common.aspect.ClerkUserLogin;
|
||||
import com.starry.admin.modules.play.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.shop.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.PlayCommodityReturnVo;
|
||||
import com.starry.common.result.R;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -5,8 +5,8 @@ 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.custom.module.entity.PlayCustomUserInfoEntity;
|
||||
import com.starry.admin.modules.play.module.vo.PlayCommodityInfoVo;
|
||||
import com.starry.admin.modules.play.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayCommodityInfoVo;
|
||||
import com.starry.admin.modules.shop.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayCouponInfoEntity;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayCouponDetailsReturnVo;
|
||||
import com.starry.admin.modules.shop.service.IPlayCouponDetailsService;
|
||||
|
||||
@@ -30,9 +30,9 @@ import com.starry.admin.modules.order.service.IPlayOrderComplaintInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderEvaluateInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderInfoService;
|
||||
import com.starry.admin.modules.order.service.IPlayOrderRandomInfoService;
|
||||
import com.starry.admin.modules.play.module.vo.PlayCommodityInfoVo;
|
||||
import com.starry.admin.modules.play.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.shop.module.entity.PlayCouponInfoEntity;
|
||||
import com.starry.admin.modules.shop.module.vo.PlayCommodityInfoVo;
|
||||
import com.starry.admin.modules.shop.service.IPlayCommodityInfoService;
|
||||
import com.starry.admin.modules.shop.service.IPlayCouponInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.*;
|
||||
import com.starry.admin.modules.weichat.entity.clerk.PlayClerkUserInfoResultVo;
|
||||
|
||||
Reference in New Issue
Block a user