店员价格
This commit is contained in:
@@ -61,15 +61,6 @@ public interface IPlayClerkUserInfoService extends IService<PlayClerkUserInfoEnt
|
|||||||
**/
|
**/
|
||||||
PlayClerkLevelInfoEntity queryLevelCommission(String clerkId);
|
PlayClerkLevelInfoEntity queryLevelCommission(String clerkId);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据账户ID查询店员
|
|
||||||
*
|
|
||||||
* @param id 店员ID
|
|
||||||
* @return 店员
|
|
||||||
*/
|
|
||||||
PlayClerkUserInfoEntity queryByUserId(String id);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询店员
|
* 查询店员
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -114,13 +114,6 @@ public class PlayClerkUserInfoServiceImpl extends ServiceImpl<PlayClerkUserInfoM
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public PlayClerkUserInfoEntity queryByUserId(String id) {
|
|
||||||
LambdaQueryWrapper<PlayClerkUserInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
lambdaQueryWrapper.eq(PlayClerkUserInfoEntity::getId, id);
|
|
||||||
return this.baseMapper.selectOne(lambdaQueryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PlayClerkUserInfoEntity selectByOpenid(String openId) {
|
public PlayClerkUserInfoEntity selectByOpenid(String openId) {
|
||||||
LambdaQueryWrapper<PlayClerkUserInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PlayClerkUserInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|||||||
@@ -148,9 +148,8 @@ public class PlayClerkUserReviewInfoServiceImpl extends ServiceImpl<PlayClerkUse
|
|||||||
@Override
|
@Override
|
||||||
public void updateDataReviewState(PlayClerkUserReviewStateEditVo vo) {
|
public void updateDataReviewState(PlayClerkUserReviewStateEditVo vo) {
|
||||||
PlayClerkUserReviewInfoEntity entity = this.selectPlayClerkUserReviewInfoById(vo.getId());
|
PlayClerkUserReviewInfoEntity entity = this.selectPlayClerkUserReviewInfoById(vo.getId());
|
||||||
PlayClerkUserInfoEntity userInfo = playClerkUserInfoService.queryByUserId(entity.getClerkId());
|
PlayClerkUserInfoEntity userInfo = playClerkUserInfoService.selectById(entity.getClerkId());
|
||||||
if ("1".equals(vo.getReviewState())) {
|
if ("1".equals(vo.getReviewState())) {
|
||||||
|
|
||||||
BeanUtils.copyProperties(entity, userInfo);
|
BeanUtils.copyProperties(entity, userInfo);
|
||||||
userInfo.setClerkState("1");
|
userInfo.setClerkState("1");
|
||||||
userInfo.setId(entity.getClerkId());
|
userInfo.setId(entity.getClerkId());
|
||||||
|
|||||||
@@ -48,11 +48,6 @@ public class PlayCommodityInfoEntity extends BaseEntity<PlayCommodityInfoEntity>
|
|||||||
*/
|
*/
|
||||||
private String serviceDuration;
|
private String serviceDuration;
|
||||||
|
|
||||||
/**
|
|
||||||
* 服务单价
|
|
||||||
*/
|
|
||||||
private BigDecimal price;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启用状态(0:停用,1:启用)
|
* 启用状态(0:停用,1:启用)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
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.common.exception.CustomException;
|
||||||
import com.starry.admin.modules.shop.mapper.PlayCommodityInfoMapper;
|
import com.starry.admin.modules.shop.mapper.PlayCommodityInfoMapper;
|
||||||
|
import com.starry.admin.modules.shop.module.entity.PlayCommodityAndLevelInfoEntity;
|
||||||
import com.starry.admin.modules.shop.module.entity.PlayCommodityInfoEntity;
|
import com.starry.admin.modules.shop.module.entity.PlayCommodityInfoEntity;
|
||||||
import com.starry.admin.modules.shop.module.vo.PlayCommodityInfoVo;
|
import com.starry.admin.modules.shop.module.vo.PlayCommodityInfoVo;
|
||||||
import com.starry.admin.modules.shop.service.IPlayCommodityInfoService;
|
import com.starry.admin.modules.shop.service.IPlayCommodityInfoService;
|
||||||
@@ -67,9 +69,13 @@ public class PlayCommodityInfoServiceImpl extends ServiceImpl<PlayCommodityInfoM
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PlayCommodityReturnVo> selectTree() {
|
public List<PlayCommodityReturnVo> selectTree() {
|
||||||
LambdaQueryWrapper<PlayCommodityInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
MPJLambdaWrapper<PlayCommodityInfoEntity> lambdaQueryWrapper = new MPJLambdaWrapper<>();
|
||||||
lambdaQueryWrapper.orderByAsc(PlayCommodityInfoEntity::getSort);
|
lambdaQueryWrapper.selectAll(PlayCommodityInfoEntity.class);
|
||||||
List<PlayCommodityInfoEntity> list = this.baseMapper.selectList(lambdaQueryWrapper);
|
// lambdaQueryWrapper.selectAs(PlayCommodityAndLevelInfoEntity::getPrice, "price");
|
||||||
|
// lambdaQueryWrapper.leftJoin(PlayCommodityAndLevelInfoEntity.class, PlayCommodityAndLevelInfoEntity::getCommodityId, PlayCommodityInfoEntity::getId);
|
||||||
|
// lambdaQueryWrapper.notIn(PlayCommodityAndLevelInfoEntity::getPrice, "null");
|
||||||
|
// lambdaQueryWrapper.orderByAsc(PlayCommodityInfoEntity::getSort);
|
||||||
|
List<PlayCommodityInfoEntity> list = this.baseMapper.selectJoinList(PlayCommodityInfoEntity.class, lambdaQueryWrapper);
|
||||||
Map<String, List<PlayCommodityInfoEntity>> collect = list.stream().filter(a -> a != null && a.getId() != null).collect(Collectors.groupingBy(PlayCommodityInfoEntity::getPId));
|
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"));
|
return this.assembleTree(collect, collect.get("00"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,23 @@
|
|||||||
package com.starry.admin.modules.weichat.controller;
|
package com.starry.admin.modules.weichat.controller;
|
||||||
|
|
||||||
import com.starry.admin.common.aspect.ClerkUserLogin;
|
import com.starry.admin.common.aspect.ClerkUserLogin;
|
||||||
|
import com.starry.admin.common.conf.ThreadLocalRequestDetail;
|
||||||
|
import com.starry.admin.common.exception.CustomException;
|
||||||
|
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
|
||||||
|
import com.starry.admin.modules.clerk.service.IPlayClerkUserInfoService;
|
||||||
|
import com.starry.admin.modules.shop.module.entity.PlayCommodityAndLevelInfoEntity;
|
||||||
|
import com.starry.admin.modules.shop.service.IPlayCommodityAndLevelInfoService;
|
||||||
import com.starry.admin.modules.shop.service.IPlayCommodityInfoService;
|
import com.starry.admin.modules.shop.service.IPlayCommodityInfoService;
|
||||||
import com.starry.admin.modules.weichat.entity.PlayCommodityReturnVo;
|
import com.starry.admin.modules.weichat.entity.PlayCommodityReturnVo;
|
||||||
import com.starry.common.result.R;
|
import com.starry.common.result.R;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,6 +34,25 @@ public class WxClerkCommodityController {
|
|||||||
@Resource
|
@Resource
|
||||||
private IPlayCommodityInfoService playCommodityInfoService;
|
private IPlayCommodityInfoService playCommodityInfoService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IPlayCommodityAndLevelInfoService iPlayCommodityAndLevelInfoService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IPlayClerkUserInfoService clerkUserInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/custom/queryClerkAllCommodityByLevel")
|
||||||
|
public R queryClerkAllCommodityByLevel(@RequestParam("id") String levelId) {
|
||||||
|
List<PlayCommodityAndLevelInfoEntity> levelInfoEntities = iPlayCommodityAndLevelInfoService.selectAll();
|
||||||
|
List<PlayCommodityReturnVo> tree = playCommodityInfoService.selectTree();
|
||||||
|
if (levelId == null || levelId.isEmpty()) {
|
||||||
|
return R.ok(tree);
|
||||||
|
}
|
||||||
|
tree = formatPlayCommodityReturnVoTree(tree, levelInfoEntities, levelId);
|
||||||
|
tree = formatPlayCommodityReturnVoTree(tree);
|
||||||
|
return R.ok(tree);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 顾客查询所有店员所有服务项目
|
* 顾客查询所有店员所有服务项目
|
||||||
@@ -33,23 +60,67 @@ public class WxClerkCommodityController {
|
|||||||
* @return 店员所有服务项目
|
* @return 店员所有服务项目
|
||||||
*/
|
*/
|
||||||
@GetMapping("/custom/queryClerkAllCommodity")
|
@GetMapping("/custom/queryClerkAllCommodity")
|
||||||
public R customQueryClerkAllCommodity() {
|
public R customQueryClerkAllCommodity(@RequestParam("id") String clerkId) {
|
||||||
|
if (clerkId == null || clerkId.isEmpty()) {
|
||||||
|
throw new CustomException("请求参数异常,id不能为空");
|
||||||
|
}
|
||||||
|
PlayClerkUserInfoEntity clerkUserInfo = clerkUserInfoService.selectById(clerkId);
|
||||||
|
List<PlayCommodityAndLevelInfoEntity> levelInfoEntities = iPlayCommodityAndLevelInfoService.selectAll();
|
||||||
List<PlayCommodityReturnVo> tree = playCommodityInfoService.selectTree();
|
List<PlayCommodityReturnVo> tree = playCommodityInfoService.selectTree();
|
||||||
|
tree = formatPlayCommodityReturnVoTree(tree, levelInfoEntities, clerkUserInfo.getLevelId());
|
||||||
|
tree = formatPlayCommodityReturnVoTree(tree);
|
||||||
return R.ok(tree);
|
return R.ok(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 顾客查询所有店员所有服务项目
|
* 店员查询自己的服务项目
|
||||||
*
|
*
|
||||||
* @return 店员所有服务项目
|
* @return 店员所有服务项目
|
||||||
*/
|
*/
|
||||||
@ClerkUserLogin
|
@ClerkUserLogin
|
||||||
@GetMapping("/clerk/queryAllCommodity")
|
@GetMapping("/clerk/queryAllCommodity")
|
||||||
public R clerkQueryAllCommodity() {
|
public R clerkQueryAllCommodity() {
|
||||||
|
String levelId = ThreadLocalRequestDetail.getClerkUserInfo().getLevelId();
|
||||||
|
List<PlayCommodityAndLevelInfoEntity> levelInfoEntities = iPlayCommodityAndLevelInfoService.selectAll();
|
||||||
List<PlayCommodityReturnVo> tree = playCommodityInfoService.selectTree();
|
List<PlayCommodityReturnVo> tree = playCommodityInfoService.selectTree();
|
||||||
|
tree = formatPlayCommodityReturnVoTree(tree, levelInfoEntities, levelId);
|
||||||
|
tree = formatPlayCommodityReturnVoTree(tree);
|
||||||
return R.ok(tree);
|
return R.ok(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<PlayCommodityReturnVo> formatPlayCommodityReturnVoTree(List<PlayCommodityReturnVo> tree, List<PlayCommodityAndLevelInfoEntity> levelInfoEntities, String levelId) {
|
||||||
|
Iterator<PlayCommodityReturnVo> it = tree.iterator();
|
||||||
|
while (it.hasNext()) {
|
||||||
|
PlayCommodityReturnVo item = it.next();
|
||||||
|
//查找当前服务项目对应的价格
|
||||||
|
for (PlayCommodityAndLevelInfoEntity levelInfoEntity : levelInfoEntities) {
|
||||||
|
if (item.getId().equals(levelInfoEntity.getCommodityId()) && levelId.equals(levelInfoEntity.getLevelId())) {
|
||||||
|
item.setPrice(levelInfoEntity.getPrice());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//如果未设置价格,删除元素
|
||||||
|
if (!"00".equals(item.getPId()) && item.getPrice() == null) {
|
||||||
|
it.remove();
|
||||||
|
}
|
||||||
|
formatPlayCommodityReturnVoTree(item.getChild(), levelInfoEntities, levelId);
|
||||||
|
}
|
||||||
|
return tree;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PlayCommodityReturnVo> formatPlayCommodityReturnVoTree(List<PlayCommodityReturnVo> tree) {
|
||||||
|
Iterator<PlayCommodityReturnVo> it = tree.iterator();
|
||||||
|
while (it.hasNext()) {
|
||||||
|
PlayCommodityReturnVo item = it.next();
|
||||||
|
if ("00".equals(item.getPId()) && item.getChild().isEmpty()) {
|
||||||
|
it.remove();
|
||||||
|
}
|
||||||
|
formatPlayCommodityReturnVoTree(item.getChild());
|
||||||
|
}
|
||||||
|
return tree;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class WxCouponController {
|
|||||||
@PostMapping("/custom/queryByOrder")
|
@PostMapping("/custom/queryByOrder")
|
||||||
public R queryByOrder(@Validated @RequestBody WxCouponOrderQueryVo vo) {
|
public R queryByOrder(@Validated @RequestBody WxCouponOrderQueryVo vo) {
|
||||||
List<PlayCouponDetailsReturnVo> list = couponDetailsService.selectByCustomId(ThreadLocalRequestDetail.getCustomUserInfo().getId());
|
List<PlayCouponDetailsReturnVo> list = couponDetailsService.selectByCustomId(ThreadLocalRequestDetail.getCustomUserInfo().getId());
|
||||||
PlayClerkUserInfoEntity clerkUserInfo = playClerkUserInfoService.queryByUserId(vo.getClerkId());
|
PlayClerkUserInfoEntity clerkUserInfo = playClerkUserInfoService.selectById(vo.getClerkId());
|
||||||
PlayCommodityInfoVo commodityInfo = playCommodityInfoService.queryCommodityInfo(vo.getCommodityId(),clerkUserInfo.getLevelId());
|
PlayCommodityInfoVo commodityInfo = playCommodityInfoService.queryCommodityInfo(vo.getCommodityId(),clerkUserInfo.getLevelId());
|
||||||
// 优惠券列表
|
// 优惠券列表
|
||||||
List<WxCouponOrderReturnVo> couponReturnVos = new ArrayList<>();
|
List<WxCouponOrderReturnVo> couponReturnVos = new ArrayList<>();
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import java.util.List;
|
|||||||
public class PlayCommodityReturnVo {
|
public class PlayCommodityReturnVo {
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
private String pId;
|
||||||
/**
|
/**
|
||||||
* 项目类型
|
* 项目类型
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user