接待卡,分组管理员
This commit is contained in:
@ -158,5 +158,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode BILLING_NOT_ORDER_REFUSE= new ErrorCode(1_004_024_00, "拒绝理由不能为空");
|
||||
ErrorCode BILLING_NOT_ORDER_SECURITY= new ErrorCode(1_004_023_41, "没有权限给单位统一开票");
|
||||
ErrorCode CAROUSEL_NOT_EXISTS = new ErrorCode(1_004_025_00, "小程序轮播图不存在");
|
||||
|
||||
ErrorCode TIME_NOT_SATISFY = new ErrorCode(1_004_026_00, "27号后不能充值");
|
||||
}
|
||||
|
||||
|
@ -76,9 +76,9 @@ public class ExcelImportController {
|
||||
// 设置标题(字段列表)所在行数
|
||||
.headRowNumber(2)
|
||||
.doRead();
|
||||
List<String> mobiles = successArrayList.stream().map(RechargeExcel::getMobile).collect(Collectors.toList());
|
||||
List<MemberUserDO> users = memberUserService.getByMobiles(mobiles);
|
||||
|
||||
// List<String> mobiles = successArrayList.stream().map(RechargeExcel::getMobile).collect(Collectors.toList());
|
||||
// List<MemberUserDO> users = memberUserService.getByMobiles(mobiles);
|
||||
// System.out.println(users);
|
||||
|
||||
List<RechargeExcel> notExist = new ArrayList<>();
|
||||
for (RechargeExcel excel:successArrayList){
|
||||
|
@ -3,14 +3,7 @@ package cn.iocoder.yudao.module.member.controller.admin.group;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupCreateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupPageVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupSimpleRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberUserVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.*;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserListVO;
|
||||
import cn.iocoder.yudao.module.member.convert.group.MemberGroupConvert;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.group.MemberGroupDO;
|
||||
@ -130,7 +123,7 @@ public class MemberGroupController {
|
||||
}
|
||||
|
||||
@PostMapping("/getUserList")
|
||||
@Operation(summary = "人员列表")
|
||||
@Operation(summary = "未分配人员列表")
|
||||
//@PreAuthorize("@ss.hasPermission('member:group:create')")
|
||||
public CommonResult<PageResult<MemberUserDO>> getUserList(@Valid @RequestBody MemberUserListVO vo) {
|
||||
return success(groupService.getUserList(vo));
|
||||
@ -142,4 +135,11 @@ public class MemberGroupController {
|
||||
groupService.updateAdmin(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/setAdmin")
|
||||
@Operation(summary = "设置管理员")
|
||||
public CommonResult<Boolean> setAdmin(@RequestBody GroupAdminReqVO vo) {
|
||||
groupService.setAdmin(vo);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,13 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.group.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class GroupAdminReqVO {
|
||||
|
||||
private List<Long> groupIds;
|
||||
|
||||
private Long userId;
|
||||
}
|
@ -6,6 +6,7 @@ import org.hibernate.validator.constraints.URL;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
@ -53,4 +54,13 @@ public class MemberUserAddVO {
|
||||
@Schema(description = "人脸")
|
||||
private Long faceId;
|
||||
|
||||
@Schema(description = "人员类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "接待卡(0:不是1-是)")
|
||||
private Integer reception;
|
||||
|
||||
@Schema(description = "限定金额")
|
||||
private BigDecimal limitAmount;
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ -65,6 +66,12 @@ public class MemberUserBaseVO {
|
||||
@Schema(description = "人脸")
|
||||
private Long faceId;
|
||||
|
||||
@Schema(description = "人脸")
|
||||
@Schema(description = "人员类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "接待卡(0:不是1-是)")
|
||||
private Integer reception;
|
||||
|
||||
@Schema(description = "限定金额")
|
||||
private BigDecimal limitAmount;
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@ -49,66 +50,19 @@ public class AppCardController {
|
||||
@Resource
|
||||
private RedisTemplate<String, Object> redisTemplate;
|
||||
|
||||
//@PostMapping("/create")
|
||||
//@Operation(summary = "创建余额变动明细")
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:create')")
|
||||
//public CommonResult<Long> createCard(@Valid @RequestBody CardSaveReqVO createReqVO) {
|
||||
// return success(cardService.createCard(createReqVO));
|
||||
//}
|
||||
//
|
||||
//@PutMapping("/update")
|
||||
//@Operation(summary = "更新余额变动明细")
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:update')")
|
||||
//public CommonResult<Boolean> updateCard(@Valid @RequestBody CardSaveReqVO updateReqVO) {
|
||||
// cardService.updateCard(updateReqVO);
|
||||
// return success(true);
|
||||
//}
|
||||
//
|
||||
//@DeleteMapping("/delete")
|
||||
//@Operation(summary = "删除余额变动明细")
|
||||
//@Parameter(name = "id", description = "编号", required = true)
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:delete')")
|
||||
//public CommonResult<Boolean> deleteCard(@RequestParam("id") Long id) {
|
||||
// cardService.deleteCard(id);
|
||||
// return success(true);
|
||||
//}
|
||||
//
|
||||
//@GetMapping("/get")
|
||||
//@Operation(summary = "获得余额变动明细")
|
||||
//@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:query')")
|
||||
//public CommonResult<CardRespVO> getCard(@RequestParam("id") Long id) {
|
||||
// CardDO card = cardService.getCard(id);
|
||||
// return success(BeanUtils.toBean(card, CardRespVO.class));
|
||||
//}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得余额变动明细分页")
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:query')")
|
||||
public CommonResult<PageResult<CardRespVO>> getCardPage(@Valid AppCardPageReqVO pageReqVO) {
|
||||
PageResult<CardDO> pageResult = cardService.getCardPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CardRespVO.class));
|
||||
}
|
||||
|
||||
//@GetMapping("/export-excel")
|
||||
//@Operation(summary = "导出余额变动明细 Excel")
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:export')")
|
||||
//@OperateLog(type = EXPORT)
|
||||
//public void exportCardExcel(@Valid CardPageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<CardDO> list = cardService.getCardPage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "余额变动明细.xls", "数据", CardRespVO.class,
|
||||
// BeanUtils.toBean(list, CardRespVO.class));
|
||||
//}
|
||||
|
||||
|
||||
@PutMapping("/recharge")
|
||||
@Operation(summary = "充值")
|
||||
//@PreAuthorize("@ss.hasPermission('member:card:update')")
|
||||
public CommonResult<Boolean> recharge(BigDecimal money,BigDecimal giftMoney) {
|
||||
//BigDecimal bigDecimal = money.divide(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
|
||||
//cardService.recharge(money,CardDO.ADD,giftMoney);
|
||||
return success(true);
|
||||
|
||||
}
|
||||
@ -138,32 +92,40 @@ public class AppCardController {
|
||||
@GetMapping("/weighingGetInfo")
|
||||
@Operation(summary = "获取称重相关信息")
|
||||
public CommonResult<Object> weighingGetInfo(@RequestParam String ip) {
|
||||
// 生成一个redis对象并且插入数据
|
||||
// redisTemplate.opsForValue().get(ip);
|
||||
return success(redisTemplate.opsForValue().get(ip));
|
||||
}
|
||||
|
||||
@GetMapping("/plateGetInfo")
|
||||
@Operation(summary = "获取盘子信息")
|
||||
public CommonResult<Object> plateGetInfo(@RequestParam String ip) {
|
||||
// 生成一个redis对象并且插入数据
|
||||
return success(redisTemplate.opsForValue().get(ip));
|
||||
}
|
||||
|
||||
@PostMapping("/plateAddInfo")
|
||||
@Operation(summary = "盘子信息入口")
|
||||
public void plateAddInfo(@RequestBody RobotReqVO reqVO) {
|
||||
// 生成一个redis对象并且插入数据
|
||||
redisTemplate.opsForValue().set(reqVO.getIp(), reqVO);
|
||||
}
|
||||
|
||||
@PutMapping("/rechargeByAdmin")
|
||||
@Operation(summary = "管理充值")
|
||||
public CommonResult<Boolean> rechargeByAdmin(@RequestBody RechargeVO vo) {
|
||||
BillingRespMoneyVO haveWithoutMoney = billingService.getHaveWithoutMoney(SecurityFrameworkUtils.getLoginUserId());
|
||||
if (haveWithoutMoney.getWithoutMoney().compareTo(BigDecimal.ZERO)>0){
|
||||
throw exception(BILLING_NOT_COMPLETE);
|
||||
// BillingRespMoneyVO haveWithoutMoney = billingService.getHaveWithoutMoney(SecurityFrameworkUtils.getLoginUserId());
|
||||
// if (haveWithoutMoney.getWithoutMoney().compareTo(BigDecimal.ZERO)>0){
|
||||
// throw exception(BILLING_NOT_COMPLETE);
|
||||
// }
|
||||
|
||||
//限制每月27号及以后不能充值
|
||||
LocalDate today = LocalDate.now();
|
||||
|
||||
// 获取今天是几号
|
||||
int dayOfMonth = today.getDayOfMonth();
|
||||
|
||||
// 判断是否是27号及以后
|
||||
if (dayOfMonth >= 27) {
|
||||
throw exception(TIME_NOT_SATISFY);
|
||||
}
|
||||
|
||||
cardService.rechargeByAdmin(vo);
|
||||
return success(true);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.diningplates.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@ -23,4 +24,11 @@ public class AppUserInfo {
|
||||
private BigDecimal orderMoney;
|
||||
|
||||
private BigDecimal dishesSumPrice;
|
||||
|
||||
@Schema(description = "接待卡(0:不是1-是)")
|
||||
private Integer reception;
|
||||
|
||||
@Schema(description = "限定金额")
|
||||
private BigDecimal limitAmount;
|
||||
|
||||
}
|
||||
|
@ -115,16 +115,22 @@ public class AppMemberGroupController {
|
||||
}
|
||||
|
||||
@PostMapping("/getUserList")
|
||||
@Operation(summary = "人员列表")
|
||||
@Operation(summary = "未分配人员列表")
|
||||
public CommonResult<PageResult<MemberUserDO>> getUserList(@Valid @RequestBody MemberUserListVO vo) {
|
||||
return success(groupService.getUserList(vo));
|
||||
}
|
||||
|
||||
@GetMapping("/checkGroupAdmin")
|
||||
@Operation(summary = "检测管理员")
|
||||
public CommonResult<Long> checkGroupAdmin() {
|
||||
public CommonResult<Boolean> checkGroupAdmin() {
|
||||
return success(groupService.checkGroupAdmin());
|
||||
}
|
||||
|
||||
@GetMapping("/getGroupAdmin")
|
||||
@Operation(summary = "获取管理员所管理的组")
|
||||
public CommonResult<List<MemberGroupDO>> getGroupAdmin() {
|
||||
return success(groupService.getGroupAdmin());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -180,5 +180,14 @@ public class MemberUserDO extends TenantBaseDO {
|
||||
*/
|
||||
private BigDecimal wxAmount;
|
||||
|
||||
/**
|
||||
* 接待卡(0:不是1-是)
|
||||
*/
|
||||
private Integer reception;
|
||||
|
||||
/**
|
||||
* 限定金额
|
||||
*/
|
||||
private BigDecimal limitAmount;
|
||||
|
||||
}
|
||||
|
@ -141,6 +141,8 @@ public class BusinessServiceImpl implements BusinessService {
|
||||
//客单价
|
||||
if(businessDO.getOrderSum() != 0){
|
||||
businessDO.setPriceAvg(businessDO.getTurnover().divide(new BigDecimal(businessDO.getOrderSum()), 2, RoundingMode.HALF_UP));
|
||||
}else{
|
||||
businessDO.setPriceAvg(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
//减免金额
|
||||
|
@ -481,7 +481,9 @@ public class DiningPlatesServiceImpl implements DiningPlatesService {
|
||||
appUserInfo.setNickname(StrUtil.isNotBlank(memberUserDO.getName())?memberUserDO.getName():memberUserDO.getNickname())
|
||||
.setDishesName(dish.getDishesName())
|
||||
.setDishesBasePrice(dish.getDishesBasePrice()).setDishesSumPrice(dish.getDishesSumPrice())
|
||||
.setMoney(memberUserDO.getMoney()).setOrderMoney(new BigDecimal(stringRedisTemplate.opsForValue().get(diningPlatesNum+"-"+storeId)));
|
||||
.setMoney(memberUserDO.getMoney())
|
||||
.setOrderMoney(new BigDecimal(stringRedisTemplate.opsForValue().get(diningPlatesNum+"-"+storeId)))
|
||||
.setReception(memberUserDO.getReception()).setLimitAmount(memberUserDO.getLimitAmount());
|
||||
return appUserInfo;
|
||||
}
|
||||
|
||||
|
@ -2,15 +2,11 @@ package cn.iocoder.yudao.module.member.service.group;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupCreateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupPageVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberUserVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.*;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserListVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.group.MemberGroupDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
@ -116,8 +112,10 @@ public interface MemberGroupService {
|
||||
*/
|
||||
PageResult<MemberUserDO> getUserList(MemberUserListVO listVO);
|
||||
|
||||
Long checkGroupAdmin();
|
||||
Boolean checkGroupAdmin();
|
||||
|
||||
|
||||
List<MemberGroupDO> getGroupAdmin();
|
||||
/**
|
||||
* 获取用户所在组
|
||||
*/
|
||||
@ -129,4 +127,6 @@ public interface MemberGroupService {
|
||||
Map<Long,String> getGroupNameByUserIds(List<Long> userIds);
|
||||
|
||||
void updateAdmin(MemberGroupUpdateReqVO updateReqVO);
|
||||
|
||||
void setAdmin(GroupAdminReqVO vo);
|
||||
}
|
||||
|
@ -6,13 +6,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupCreateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupPageVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupUserVo;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberGroupVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.MemberUserVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.group.vo.*;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.user.vo.MemberUserListVO;
|
||||
import cn.iocoder.yudao.module.member.convert.group.MemberGroupConvert;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.group.MemberGroupDO;
|
||||
@ -20,16 +14,14 @@ import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.group.MemberGroupMapper;
|
||||
import cn.iocoder.yudao.module.member.service.card.CardService;
|
||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
@ -159,11 +151,18 @@ public class MemberGroupServiceImpl implements MemberGroupService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long checkGroupAdmin() {
|
||||
public Boolean checkGroupAdmin() {
|
||||
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||
List<MemberGroupDO> memberGroupDOS = memberGroupMapper.selectList(Wrappers.<MemberGroupDO>lambdaQuery()
|
||||
.eq(MemberGroupDO::getUserId, loginUserId));
|
||||
return CollectionUtil.isEmpty(memberGroupDOS)?null:memberGroupDOS.get(0).getId();
|
||||
return !CollectionUtil.isEmpty(memberGroupDOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MemberGroupDO> getGroupAdmin() {
|
||||
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||
return memberGroupMapper.selectList(Wrappers.<MemberGroupDO>lambdaQuery()
|
||||
.eq(MemberGroupDO::getUserId, loginUserId));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -186,4 +185,11 @@ public class MemberGroupServiceImpl implements MemberGroupService {
|
||||
MemberGroupDO updateObj = MemberGroupConvert.INSTANCE.convert(updateReqVO);
|
||||
memberGroupMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAdmin(GroupAdminReqVO vo) {
|
||||
LambdaUpdateWrapper<MemberGroupDO> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.set(MemberGroupDO::getUserId, vo.getUserId()).in(MemberGroupDO::getId, vo.getGroupIds());
|
||||
memberGroupMapper.update(wrapper);
|
||||
}
|
||||
}
|
||||
|
@ -131,6 +131,8 @@ public class StoreBusinessServiceImpl implements StoreBusinessService {
|
||||
//客单价
|
||||
if(storeBusinessDO.getOrderSum() != 0){
|
||||
storeBusinessDO.setPriceAvg(storeBusinessDO.getTurnover().divide(new BigDecimal(storeBusinessDO.getOrderSum()), 2, RoundingMode.HALF_UP));
|
||||
}else {
|
||||
storeBusinessDO.setPriceAvg(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
//减免金额
|
||||
|
Reference in New Issue
Block a user