| | |
| | | @ApiModelProperty(value = "用户名称") |
| | | @TableField(exist = false) |
| | | private String userName; |
| | | @ApiModelProperty(value = "变动类型 0未变化1增加2减少") |
| | | @TableField(exist = false) |
| | | private Integer variableType; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | @TableField(exist = false) |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | |
| | | @ApiModelProperty(value = "添加时间") |
| | | @TableField("create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "变动类型(1=绑定门店分佣,2=下级门店分佣,3=核销门店服务费,4=提现)") |
| | | @TableField("type") |
| | | @Excel(name = "变更类型",readConverterExp = "1=绑定门店分佣,2=下级门店分佣,3=核销门店服务费,4=提现") |
| | | @Excel(name = "变更类型",readConverterExp = "1=绑定门店分佣,2=下级门店分佣,3=核销门店服务费,4=提现") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "历史余额") |
| | |
| | | @ApiModelProperty(value = "门店id") |
| | | @TableField("shop_id") |
| | | private Integer shopId; |
| | | @ApiModelProperty(value = "门店名称") |
| | | @TableField(exist = false) |
| | | @Excel(name = "门店名称") |
| | | private String shopName; |
| | | |
| | | @ApiModelProperty(value = "店长姓名") |
| | | @TableField(exist = false) |
| | | @Excel(name = "店长姓名") |
| | | private String shopLeaderName; |
| | | @ApiModelProperty(value = "联系电话") |
| | | @TableField(exist = false) |
| | | @Excel(name = "联系电话") |
| | | private String phone; |
| | | @ApiModelProperty(value = "变动类型(1=门店业绩,2=门店返佣,3=下级门店返佣)") |
| | | @TableField("type") |
| | | @Excel(name = "变动类型", readConverterExp = "1=门店服务返佣,2=门店返佣,3=下级门店返佣") |
| | | @Excel(name = "变动类型", readConverterExp = "1=门店服务返佣,2=门店返佣,3=下级门店返佣") |
| | | private Integer type; |
| | | @ApiModelProperty(value = "变动时间") |
| | | @TableField("create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "变动时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "历史余额") |
| | | @TableField("historical_point") |
| | |
| | | @TableField("balance") |
| | | private Integer balance; |
| | | |
| | | @ApiModelProperty(value = "变动时间") |
| | | @TableField("create_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "变动时间") |
| | | private LocalDateTime createTime; |
| | | |
| | | |
| | | @ApiModelProperty(value = "变动用户id") |
| | | @TableField("create_user_id") |
| | |
| | | @TableField("order_num") |
| | | private String orderNum; |
| | | |
| | | @ApiModelProperty(value = "门店名称") |
| | | @TableField(exist = false) |
| | | @Excel(name = "门店名称") |
| | | private String shopName; |
| | | |
| | | @ApiModelProperty(value = "店长姓名") |
| | | @TableField(exist = false) |
| | | @Excel(name = "店长姓名") |
| | | private String shopLeaderName; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | @TableField(exist = false) |
| | | @Excel(name = "联系电话") |
| | | private String phone; |
| | | |
| | | |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private List<Integer> shopIds; |
| | |
| | | SysUser data = sysUserClient.getSysUser(userid).getData(); |
| | | Integer shopId = null; |
| | | Set<Long> userId = null; |
| | | Set<Long> userIdT = null; |
| | | if(data.getRoleType() == 2){ |
| | | shopId = data.getObjectId(); |
| | | userId = orderClient.getAppUserByShoppingShop(shopId).getData(); |
| | | } |
| | | UserStatistics userStatistics = appUserMapper.getUserStatistics(shopId, userId); |
| | | UserStatistics userStatistics1 = appUserMapper.getUserStatistics(shopId, userIdT); |
| | | userStatistics.setShopUser(userStatistics1.getShopUser()); |
| | | return R.ok(userStatistics); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "积分管理-用户积分明细(必传用户id)", tags = "后台") |
| | | public R<Page<UserPoint>> userlist(UserPoint userPoint) { |
| | | Page<UserPoint> page = userPointService.lambdaQuery().eq(UserPoint::getAppUserId, userPoint.getAppUserId()).orderByDesc(UserPoint::getCreateTime).page(Page.of(userPoint.getPageNum(), userPoint.getPageSize())); |
| | | for (UserPoint record : page.getRecords()) { |
| | | int i = record.getHistoricalPoint() - record.getBalance(); |
| | | if (i>0){ |
| | | record.setVariableType(2); |
| | | }else if (i<0){ |
| | | record.setVariableType(1); |
| | | }else{ |
| | | record.setVariableType(0); |
| | | } |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.account.vo.WalletStatisticsDetail; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.other.api.domain.ShopBalanceStatement; |
| | | import com.ruoyi.other.api.feignClient.ShopClient; |
| | |
| | | @Override |
| | | public CommissionStatistics commissionStatistics(Page<BalanceChangeRecord> page, BalanceChangeRecord balanceChangeRecord) { |
| | | List<BalanceChangeRecord> balanceChangeRecordList = this.baseMapper.selectBalanceChangeRecordList(balanceChangeRecord); |
| | | |
| | | BigDecimal totalCommission = balanceChangeRecordList.stream() |
| | | .filter(item -> !(item.getChangeType().equals(2) && item.getChangeType().equals(5))) |
| | | .map(BalanceChangeRecord::getChangeAmount) |
| | |
| | | .setScale(2, RoundingMode.HALF_UP); |
| | | |
| | | IPage<BalanceChangeRecord> balanceChangeRecordIPage = this.baseMapper.queryCommissionStatistics(page, balanceChangeRecord); |
| | | // 过滤商城购物 |
| | | List<BalanceChangeRecord> collect = balanceChangeRecordIPage.getRecords().stream().filter(e -> e.getChangeType() != 5).collect(Collectors.toList()); |
| | | balanceChangeRecordIPage.setRecords(collect); |
| | | return new CommissionStatistics(totalCommission, balanceChangeRecordIPage); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | List<BalanceChangeRecord> balanceChangeRecordList = this.baseMapper.selectBalanceChangeRecordList(balanceChangeRecord); |
| | | |
| | | List<WalletStatisticsDetail> walletStatisticsDetailList = new ArrayList<>(); |
| | | for (BalanceChangeRecord changeRecord : balanceChangeRecordList) { |
| | | WalletStatisticsDetail walletStatisticsDetail = new WalletStatisticsDetail(); |
| | |
| | | walletStatisticsDetailList.add(walletStatisticsDetail); |
| | | } |
| | | |
| | | walletStatisticsDetailList.addAll(r.getData().stream().map(this::createWalletStatisticsDetail).collect(Collectors.toList())); |
| | | List<WalletStatisticsDetail> collect = r.getData().stream().map(this::createWalletStatisticsDetail).collect(Collectors.toList()); |
| | | // 根据门店名称、用户姓名、联系电话进行模糊过滤 |
| | | collect = collect.stream() |
| | | .filter(e -> { |
| | | if (StringUtils.isNotEmpty(balanceChangeRecord.getShopName())) { |
| | | return e.getShopName().contains(balanceChangeRecord.getShopName()); |
| | | } else if (StringUtils.isNotEmpty(balanceChangeRecord.getUserName())) { |
| | | return e.getUserName().contains(balanceChangeRecord.getUserName()); |
| | | } else if (StringUtils.isNotEmpty(balanceChangeRecord.getUserPhone())) { |
| | | return e.getUserPhone().contains(balanceChangeRecord.getUserPhone()); |
| | | } |
| | | // 根据时间进行范围过滤 |
| | | if (balanceChangeRecord.getStartTime() != null && balanceChangeRecord.getEndTime() != null) { |
| | | return e.getCreateTime().isAfter(balanceChangeRecord.getStartTime()) && e.getCreateTime().isBefore(balanceChangeRecord.getEndTime()); |
| | | } |
| | | return false; |
| | | }).collect(Collectors.toList()); |
| | | walletStatisticsDetailList.addAll(collect); |
| | | |
| | | // 按时间排序(倒序) |
| | | walletStatisticsDetailList.sort(Comparator.comparing(WalletStatisticsDetail::getCreateTime).reversed()); |
| | |
| | | VipSetting vipSetting = vipSettingService.getVipSettingByUserId(userId); |
| | | |
| | | UserPointVO userPointVO = new UserPointVO(); |
| | | userPointVO.setTotalPoint(appUser.getTotalPoint()); |
| | | // todo bug说取剩余积分 |
| | | userPointVO.setTotalPoint(appUser.getLavePoint()); |
| | | userPointVO.setConsumePoint(appUser.getAvailablePoint()); |
| | | userPointVO.setShopPoint(appUser.getShopPoint()); |
| | | userPointVO.setSharePoint(appUser.getSharePoint()); |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | and tau.del_flag = 0 |
| | | </where> |
| | | </select> |
| | | <select id="getUserStatisticsDetail" resultType="com.ruoyi.account.vo.UserStatisticsDetail"> |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | and tau.del_flag = 0 |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | and tau.phone like concat('%',#{changeRecord.userPhone},'%') |
| | | </if> |
| | | <if test="changeRecord.startTime != null and changeRecord.endTime != null"> |
| | | and DATE(tbcr.create_time) between #{changeRecord.startTime} and #{changeRecord.endTime} |
| | | and (tbcr.create_time between #{changeRecord.startTime} and #{changeRecord.endTime}) |
| | | </if> |
| | | </where> |
| | | </sql> |
| | |
| | | select t1.*,t2.name as userName,t2.phone as userPhone |
| | | from t_withdrawal_requests t1 |
| | | left join t_app_user t2 on t1.app_user_id = t2.id |
| | | <if test="withQuery.phone != null and withQuery.phone != ''"> |
| | | AND t2.phone LIKE concat('%',#{withQuery.phone},'%') |
| | | </if> |
| | | <if test="withQuery.name != null and withQuery.name != ''"> |
| | | AND t2.phone LIKE concat('%',#{withQuery.name},'%') |
| | | </if> |
| | | order by t1.create_time desc |
| | | </select> |
| | | |
| | |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | |
| | | orderStatisticsDetail.setServiceTotal(serviceTotal); |
| | | orderStatisticsDetail.setSingleTotal(singleTotal); |
| | | orderStatisticsDetail.setTotal(total); |
| | | |
| | | orderStatisticsDetail.setServiceTotalMoney(serviceTotalMoney); |
| | | orderStatisticsDetail.setSingleTotalMoney(singleTotalMoney); |
| | | orderStatisticsDetail.setTotalMoney(totalMoney); |
| | | orderStatisticsDetails.add(orderStatisticsDetail); |
| | | }); |
| | | Integer shopId = null; |
| | |
| | | } |
| | | OrderStatistics orderStatistics = orderMapper.getOrderStatistics(startTime, endTime, shopId); |
| | | if(null != orderStatistics){ |
| | | orderStatistics.setOrderStatisticsDetailList(orderStatisticsDetails); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | List<OrderStatisticsDetail> sortedDetails = orderStatisticsDetails.stream() |
| | | .sorted(Comparator.comparing((OrderStatisticsDetail detail) -> { |
| | | try { |
| | | return dateFormat.parse(detail.getDate()); |
| | | } catch (ParseException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | }).reversed()) |
| | | .collect(Collectors.toList()); |
| | | orderStatistics.setOrderStatisticsDetailList(sortedDetails); |
| | | } |
| | | return R.ok(orderStatistics); |
| | | } |
| | |
| | | orderInfo.setUserName(appUser.getName()); |
| | | orderInfo.setPhone(appUser.getPhone()); |
| | | } |
| | | orderInfo.setOrderType(order.getOrderType() == 1 ? "服务" : (StringUtils.isNotEmpty(order.getExpressJson()) ? "单品-快递配送" : "单品-自提")); |
| | | orderInfo.setOrderType(order.getOrderType() == 1 ? "服务" : (StringUtils.isNotEmpty(order.getAddressJson()) ? "单品-快递配送" : "单品-上门自提")); |
| | | Shop shop = shopClient.getShopById(order.getShopId()).getData(); |
| | | if(null != shop){ |
| | | orderInfo.setShopName(shop.getName()); |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | @ApiOperation(value = "广告管理-banner管理-修改", tags = {"管理后台"}) |
| | | public R edit(@RequestBody Banner banner){ |
| | | bannerService.updateById(banner); |
| | | if (banner.getContentType()==2){ |
| | | LambdaUpdateWrapper<Banner> bannerLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
| | | bannerLambdaUpdateWrapper.set(Banner::getJumpType,null); |
| | | bannerLambdaUpdateWrapper.eq(Banner::getId,banner.getId()); |
| | | bannerService.update(bannerLambdaUpdateWrapper); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | @GetMapping("/detail") |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.GoodsCategory; |
| | | import com.ruoyi.other.service.GoodsCategoryService; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | public class GoodsCategoryController extends BaseController { |
| | | @Resource |
| | | private GoodsCategoryService goodsCategoryService; |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | |
| | | @PostMapping("/addGoodsCategory") |
| | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation(value = "商品管理-商品分类-删除", tags = {"管理后台"}) |
| | | public R<Void> delete(@RequestParam("id") Integer id){ |
| | | List<Goods> list = goodsService.lambdaQuery().eq(Goods::getGoodsCategoryId, id).list(); |
| | | if (!list.isEmpty())return R.fail("当前分类已关联商品,不可删除"); |
| | | goodsCategoryService.update(new LambdaUpdateWrapper<GoodsCategory>().eq(GoodsCategory::getId, id).set(GoodsCategory::getDelFlag, 1)); |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO; |
| | |
| | | @ApiOperation(value = "商品修改", tags = {"管理后台-商品管理"}) |
| | | public R<Void> manageGoodsUpdate(@RequestBody Goods goods){ |
| | | goodsService.updateManageGoods(goods); |
| | | if (goods.getType()==2){ |
| | | goods.setAppointStore(2); |
| | | goodsService.updateById(goods); |
| | | } |
| | | if (goods.getType()==1){ |
| | | LambdaUpdateWrapper<Goods> goodsLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
| | | goodsLambdaUpdateWrapper.set(Goods::getDistributionMode,null); |
| | | goodsLambdaUpdateWrapper.eq(Goods::getId, goods.getId()); |
| | | goodsService.update(goodsLambdaUpdateWrapper); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | List<Integer> integers = new ArrayList<>(); |
| | | integers.add(1); |
| | | integers.add(2); |
| | | integers.add(3); |
| | | integers.add(4); |
| | | List<Integer> integers1 = new ArrayList<>(); |
| | | integers.retainAll(integers1); |
| | | System.err.println(integers); |
| | | System.err.println(integers1); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 评论列表 |
| | | */ |
| | |
| | | public R<Page<GoodsEvaluate>> list(@ApiParam("页码") @RequestParam Integer pageNum, |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | GoodsEvaluate goodsEvaluate){ |
| | | List<Integer> goodsIds = new ArrayList<>(); |
| | | List<Long> usersNameList = new ArrayList<>(); |
| | | List<Long> usersPhoneList = new ArrayList<>(); |
| | | |
| | | if (StringUtils.isNotEmpty(goodsEvaluate.getUserName())) { |
| | | goodsIds = goodsService.lambdaQuery() |
| | | .like(Goods::getName, goodsEvaluate.getGoodsName()) |
| | | .list().stream().map(Goods::getId).collect(Collectors.toList()); |
| | | if (goodsIds.isEmpty()) { |
| | | return R.ok(new Page<>()); |
| | | } |
| | | } |
| | | if (StringUtils.isNotEmpty(goodsEvaluate.getUserName())) { |
| | | usersNameList = appUserClient.getAppUserByName(goodsEvaluate.getUserName()).getData().stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | if (usersNameList.isEmpty()) { |
| | | return R.ok(new Page<>()); |
| | | } |
| | | |
| | | } |
| | | if (StringUtils.isNotEmpty(goodsEvaluate.getPhone())) { |
| | | usersPhoneList = appUserClient.getAppUserByPhone(goodsEvaluate.getPhone()).getData().stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | if (usersPhoneList.isEmpty()) { |
| | | return R.ok(new Page<>()); |
| | | } |
| | | } |
| | | usersNameList.retainAll(usersPhoneList); |
| | | Page<GoodsEvaluate> page = goodsEvaluateService.page(Page.of(pageNum, pageSize), new LambdaQueryWrapper<GoodsEvaluate>() |
| | | .like(StringUtils.isNotEmpty(goodsEvaluate.getGoodsName()), GoodsEvaluate::getGoodsName, goodsEvaluate.getComment()) |
| | | .like(StringUtils.isNotEmpty(goodsEvaluate.getUserName()), GoodsEvaluate::getUserName, goodsEvaluate.getUserName()) |
| | | .like(StringUtils.isNotEmpty(goodsEvaluate.getPhone()), GoodsEvaluate::getPhone, goodsEvaluate.getPhone()) |
| | | .in(!goodsIds.isEmpty(), GoodsEvaluate::getGoodsId, goodsIds) |
| | | .in(!usersNameList.isEmpty(), GoodsEvaluate::getAppUserId, usersNameList) |
| | | .eq(goodsEvaluate.getStatus() != null, GoodsEvaluate::getStatus, goodsEvaluate.getStatus()) |
| | | .orderByDesc(GoodsEvaluate::getCreateTime)); |
| | | |
| | |
| | | return R.ok(one); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加活动 |
| | | */ |
| | |
| | | @ApiOperation(value = "订单优惠活动-添加活动", tags = {"管理后台-活动管理"}) |
| | | public R<Void> saveActivityConfig(@RequestBody OrderActivityInfo orderActivityInfo){ |
| | | orderActivityInfo.setIsShelf(0); |
| | | if (org.springframework.util.StringUtils.hasLength(orderActivityInfo.getVipIds())){ |
| | | List<String> vipIds = Arrays.asList(orderActivityInfo.getVipIds().split(",")); |
| | | List<OrderActivityInfo> list = orderActivityInfoService.lambdaQuery() |
| | | .le(OrderActivityInfo::getStartTime, orderActivityInfo.getStartTime()) |
| | | .or() |
| | | .ge(OrderActivityInfo::getEndTime, orderActivityInfo.getEndTime()).list(); |
| | | if (!list.isEmpty()){ |
| | | for (OrderActivityInfo activityInfo : list) { |
| | | List<String> vips = Arrays.asList(activityInfo.getVipIds().split(",")); |
| | | vipIds.retainAll(vips); |
| | | if (!vipIds.isEmpty()){ |
| | | StringBuilder message = new StringBuilder(); |
| | | List<String> collect = vips.stream().sorted().collect(Collectors.toList()); |
| | | for (String s : collect) { |
| | | switch (s){ |
| | | case "1": |
| | | message.append("普通会员,"); |
| | | break; |
| | | case "2": |
| | | message.append("黄金会员,"); |
| | | break; |
| | | case "3": |
| | | message.append("钻石会员,"); |
| | | break; |
| | | case "4": |
| | | message.append("准代理,"); |
| | | break; |
| | | case "5": |
| | | message.append("代理,"); |
| | | break; |
| | | case "6": |
| | | message.append("总代,"); |
| | | break; |
| | | case "7": |
| | | message.append("合伙人,"); |
| | | break; |
| | | } |
| | | } |
| | | StringBuilder res = message.deleteCharAt(message.length() - 1); |
| | | return R.fail(res+"在当前活动时间已有订单优惠"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | orderActivityInfoService.save(orderActivityInfo); |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "修改活动", tags = {"管理后台-活动管理"}) |
| | | public R<Void> updateActivityConfig(@RequestBody OrderActivityInfo orderActivityInfo){ |
| | | orderActivityInfo.setId(Long.valueOf(orderActivityInfo.getIdStr())); |
| | | if (org.springframework.util.StringUtils.hasLength(orderActivityInfo.getVipIds())){ |
| | | List<String> vipIds = Arrays.asList(orderActivityInfo.getVipIds().split(",")); |
| | | List<OrderActivityInfo> list = orderActivityInfoService.lambdaQuery() |
| | | .le(OrderActivityInfo::getStartTime, orderActivityInfo.getStartTime()) |
| | | .or() |
| | | .ge(OrderActivityInfo::getEndTime, orderActivityInfo.getEndTime()).list(); |
| | | if (!list.isEmpty()){ |
| | | for (OrderActivityInfo activityInfo : list) { |
| | | List<String> vips = Arrays.asList(activityInfo.getVipIds().split(",")); |
| | | vipIds.retainAll(vips); |
| | | if (!vipIds.isEmpty()){ |
| | | StringBuilder message = new StringBuilder(); |
| | | List<String> collect = vips.stream().sorted().collect(Collectors.toList()); |
| | | for (String s : collect) { |
| | | switch (s){ |
| | | case "1": |
| | | message.append("普通会员,"); |
| | | break; |
| | | case "2": |
| | | message.append("黄金会员,"); |
| | | break; |
| | | case "3": |
| | | message.append("钻石会员,"); |
| | | break; |
| | | case "4": |
| | | message.append("准代理,"); |
| | | break; |
| | | case "5": |
| | | message.append("代理,"); |
| | | break; |
| | | case "6": |
| | | message.append("总代,"); |
| | | break; |
| | | case "7": |
| | | message.append("合伙人,"); |
| | | break; |
| | | } |
| | | } |
| | | StringBuilder res = message.deleteCharAt(message.length() - 1); |
| | | return R.fail(res+"在当前活动时间已有订单优惠"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | orderActivityInfoService.updateById(orderActivityInfo); |
| | | return R.ok(); |
| | | } |
| | |
| | | OrderActivityInfo orderActivityInfo){ |
| | | |
| | | Page<OrderActivityInfo> page = orderActivityInfoService.page(Page.of(pageNum, pageSize), new LambdaQueryWrapper<OrderActivityInfo>() |
| | | .eq(orderActivityInfo.getId() != null, OrderActivityInfo::getId, orderActivityInfo.getId()) |
| | | .eq(StringUtils.isNotEmpty(orderActivityInfo.getActivityName()), OrderActivityInfo::getActivityName, orderActivityInfo.getActivityName()) |
| | | .like(orderActivityInfo.getId() != null, OrderActivityInfo::getId, orderActivityInfo.getId()) |
| | | .like(StringUtils.isNotEmpty(orderActivityInfo.getActivityName()), OrderActivityInfo::getActivityName, orderActivityInfo.getActivityName()) |
| | | .gt(orderActivityInfo.getStatus() != null && orderActivityInfo.getStatus() == 0, OrderActivityInfo::getStartTime, LocalDateTime.now()) |
| | | .ge(orderActivityInfo.getStatus() != null && orderActivityInfo.getStatus() == 1, OrderActivityInfo::getEndTime, LocalDateTime.now()) |
| | | .lt(orderActivityInfo.getStatus() != null && orderActivityInfo.getStatus() == 1, OrderActivityInfo::getStartTime, LocalDateTime.now()) |
| | | .eq(orderActivityInfo.getIsShelf() != null, OrderActivityInfo::getIsShelf, orderActivityInfo.getIsShelf()).orderByDesc(OrderActivityInfo::getCreateTime)); |
| | | .eq(orderActivityInfo.getIsShelf() != null, OrderActivityInfo::getIsShelf, orderActivityInfo.getIsShelf()).orderByDesc(OrderActivityInfo::getCreateTime) |
| | | .orderByDesc(OrderActivityInfo::getCreateTime)) |
| | | ; |
| | | page.getRecords().forEach(item -> { |
| | | LocalDateTime startTime = item.getStartTime(); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | |
| | | if(sysUser.getRoleType() == 2){ |
| | | share.setObjectId(sysUser.getObjectId().toString()); |
| | | } |
| | | share.setAuditStatus(0); |
| | | share.setDelFlag(0); |
| | | shareService.save(share); |
| | | return R.ok(); |
| | |
| | | userShop.setUserId(sysUser.getUserId()); |
| | | userShop.setShopId(shop.getId()); |
| | | userShop.setRoleType(1); |
| | | userShop.setNickName(sysUser.getNickName()); |
| | | List<UserShop> data = userShopClient.getUserShop(userShop).getData(); |
| | | if(null == data || data.size() == 0){ |
| | | userShop = new UserShop(); |
| | |
| | | userShop.setShopId(shop.getId()); |
| | | userShop.setRoleType(1); |
| | | userShop.setRoleId(2L); |
| | | userShop.setCreateTime(LocalDateTime.now()); |
| | | userShopClient.saveUserShop(userShop); |
| | | } |
| | | }else{ |
| | |
| | | Shop shop = shopService.getById(id); |
| | | shop.setDelFlag(1); |
| | | shopService.updateById(shop); |
| | | // 查询有没有门店绑定了该门店为上级门店 |
| | | List<Shop> shops = shopService.lambdaQuery() |
| | | .eq(Shop::getPid, id).list(); |
| | | if(!shops.isEmpty()){ |
| | | for (Shop shop1 : shops) { |
| | | shop1.setPid(0); |
| | | } |
| | | } |
| | | AppUser appUserById = appUserClient.getAppUserById(shop.getAppUserId()); |
| | | appUserById.setUserType(1); |
| | | appUserClient.editAppUserById(appUserById); |
| | | shopService.updateBatchById(shops); |
| | | UserShop userShop = new UserShop(); |
| | | userShop.setShopId(shop.getId()); |
| | | List<UserShop> data = userShopClient.getUserShop(userShop).getData(); |
| | |
| | | if (!shopService.cheUserByPhone(phone)) { |
| | | return R.fail("该手机号未注册"); |
| | | } |
| | | if (shop.getPid()!=null){ |
| | | Shop shopP = shopService.getById(shop.getPid()); |
| | | if (shopP.getPid()!=null&&shopP.getPid()!=0&& shopP.getPid().equals(shop.getId())){ |
| | | return R.fail("门店之间不能互相作为上级门店"); |
| | | } |
| | | } |
| | | String city = TencentMapUtil.inverseGeographicalAnalysis(shop.getLongitude(), shop.getLatitude(), false); |
| | | shop.setProvinceCode(city.substring(0, 2) + "0000"); |
| | | shop.setCityCode(city.substring(0, 4) + "00"); |
| | |
| | | BigDecimal totalCommission = shopCommissionMap.getOrDefault(1,BigDecimal.ZERO); |
| | | BigDecimal totalSubordinateCommission = shopCommissionMap.getOrDefault(2,BigDecimal.ZERO); |
| | | BigDecimal totalServiceCharge = shopCommissionMap.getOrDefault(3,BigDecimal.ZERO); |
| | | |
| | | shopCommissionStatisticsVO.setTotalCommission(totalCommission); |
| | | shopCommissionStatisticsVO.setTotalSubordinateCommission(totalSubordinateCommission); |
| | | shopCommissionStatisticsVO.setTotalServiceCharge(totalServiceCharge); |
| | | BigDecimal totalAmount = totalCommission.add(totalSubordinateCommission).add(totalServiceCharge); |
| | | shopCommissionStatisticsVO.setTotalAmount(totalAmount); |
| | | |
| | |
| | | LocalDateTime startTime = shopPoint.getStartTime(); |
| | | LocalDateTime endTime = shopPoint.getEndTime(); |
| | | if(null != startTime){ |
| | | List<ShopPoint> list = this.list(new LambdaUpdateWrapper<ShopPoint>().eq(ShopPoint::getShopId, shopPoint.getShopId()) |
| | | List<ShopPoint> list = this.list(new LambdaUpdateWrapper<ShopPoint>() |
| | | // todo bug说应展示所有门店积分数据 |
| | | // .eq(ShopPoint::getShopId, shopPoint.getShopId()) |
| | | .last(" and create_time between '" + startTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "' and '" + endTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "'")); |
| | | List<String> date = new ArrayList<>(); |
| | | List<Map<String, Integer>> data = new ArrayList<>(); |
| | |
| | | AND tci.shelf_status = #{couponInfo.shelfStatus} |
| | | </if> |
| | | </where> |
| | | order by tci.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <if test="vipId == null"> |
| | | AND tgs.vip in (0, -1) |
| | | </if> |
| | | order by tsai.create_time desc |
| | | </select> |
| | | <select id="selectDetail" resultType="com.ruoyi.other.vo.SeckillActivityDetailVO"> |
| | | SELECT |
| | |
| | | and ts.status = #{shop.status} |
| | | </if> |
| | | </where> |
| | | order by ts.create_time desc |
| | | </select> |
| | | <select id="getShopStatistics" resultType="com.ruoyi.other.vo.ShopStatistics"> |
| | | SELECT |
| | |
| | | <include refid="ShopPointList"/> |
| | | </select> |
| | | <select id="queryShpointPage" resultType="com.ruoyi.other.api.domain.ShopPoint"> |
| | | <include refid="ShopPointList"/> |
| | | SELECT |
| | | ts.`name` shopName, |
| | | ts.shop_manager shopLeaderName, |
| | | ts.phone, |
| | | tsp.type, |
| | | tsp.create_time, |
| | | tsp.variable_point, |
| | | tsp.order_num |
| | | FROM |
| | | t_shop_point tsp |
| | | LEFT JOIN t_shop ts ON tsp.shop_id = ts.id |
| | | <where> |
| | | <if test="shopPoint.shopName != null and shopPoint.shopName != ''"> |
| | | AND ts.`name` LIKE concat('%',#{shopPoint.shopName},'%') |
| | | </if> |
| | | <if test="shopPoint.shopLeaderName != null and shopPoint.shopLeaderName != ''"> |
| | | AND ts.shop_manager LIKE concat('%',#{shopPoint.shopLeaderName},'%') |
| | | </if> |
| | | <if test="shopPoint.phone != null and shopPoint.phone != ''"> |
| | | AND ts.phone LIKE concat('%',#{shopPoint.phone},'%') |
| | | </if> |
| | | <if test="shopPoint.type != null"> |
| | | AND tsp.type = #{shopPoint.type} |
| | | </if> |
| | | <if test="shopPoint.startTime !=null and shopPoint.endTime !=null"> |
| | | AND tsp.create_time BETWEEN #{shopPoint.startTime} AND #{shopPoint.endTime} |
| | | </if> |
| | | </where> |
| | | order by tsp.create_time desc |
| | | </select> |
| | | </mapper> |