mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 09:35:29 +08:00
新增上麦顺序
This commit is contained in:
parent
6f7f8b8b60
commit
fa8d33cb9e
@ -24,9 +24,9 @@ captcha:
|
|||||||
# 是否启用验证码校验
|
# 是否启用验证码校验
|
||||||
enable: true
|
enable: true
|
||||||
# 验证码类型 math 数组计算 char 字符验证
|
# 验证码类型 math 数组计算 char 字符验证
|
||||||
type: MATH
|
type: math
|
||||||
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
|
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
|
||||||
category: CIRCLE
|
category: circle
|
||||||
# 数字验证码位数
|
# 数字验证码位数
|
||||||
numberLength: 1
|
numberLength: 1
|
||||||
# 字符验证码长度
|
# 字符验证码长度
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.dromara.system.domain.vo.BSellerVo;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
@ -67,6 +68,17 @@ public class BSellerSortController extends BaseController {
|
|||||||
@PathVariable Long id) {
|
@PathVariable Long id) {
|
||||||
return R.ok(bSellerSortService.queryById(id));
|
return R.ok(bSellerSortService.queryById(id));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 获取上麦顺序详细信息
|
||||||
|
*
|
||||||
|
* @param payDate 上麦日期
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:sellerSort:query")
|
||||||
|
@GetMapping("/queryByPayDate/{payDate}")
|
||||||
|
public R<BSellerSortVo> queryByPayDate(@NotNull(message = "日期不能为空")
|
||||||
|
@PathVariable String payDate) {
|
||||||
|
return R.ok(bSellerSortService.queryByPayDate(payDate));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增上麦顺序
|
* 新增上麦顺序
|
||||||
@ -102,4 +114,13 @@ public class BSellerSortController extends BaseController {
|
|||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(bSellerSortService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(bSellerSortService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询上麦顺序列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("system:seller:list")
|
||||||
|
@GetMapping("/sellerList")
|
||||||
|
public R<List<BSellerVo>> sellerList() {
|
||||||
|
return R.ok(bSellerSortService.querySellerList()) ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,6 +34,11 @@ public class BSellerSort extends TenantEntity {
|
|||||||
*/
|
*/
|
||||||
private Long sellerId;
|
private Long sellerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卖家名称
|
||||||
|
*/
|
||||||
|
private String sellerNickName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上麦时间
|
* 上麦时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -23,26 +23,32 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||||||
public class BSellerSortBo extends BaseEntity {
|
public class BSellerSortBo extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 卖家id
|
* 卖家id
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "卖家id不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private Long sellerId;
|
private Long sellerId;
|
||||||
|
/**
|
||||||
|
* 卖家的ids信息
|
||||||
|
*/
|
||||||
|
private String sellerIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卖家名称
|
||||||
|
*/
|
||||||
|
private String sellerNickName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上麦时间
|
* 上麦时间
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "上麦时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private Date payDate;
|
private Date payDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 顺序
|
* 顺序
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "顺序不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private Long sort;
|
private Long sort;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,18 +1,17 @@
|
|||||||
package org.dromara.system.domain.vo;
|
package org.dromara.system.domain.vo;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import cn.idev.excel.annotation.format.DateTimeFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.dromara.system.domain.BSellerSort;
|
import org.dromara.system.domain.BSellerSort;
|
||||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import cn.idev.excel.annotation.ExcelProperty;
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
|
||||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -31,7 +30,7 @@ public class BSellerSortVo implements Serializable {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "")
|
@ExcelProperty(value = "")
|
||||||
private Long id;
|
private Long id;
|
||||||
@ -41,11 +40,22 @@ public class BSellerSortVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "卖家id")
|
@ExcelProperty(value = "卖家id")
|
||||||
private Long sellerId;
|
private Long sellerId;
|
||||||
|
/**
|
||||||
|
* 卖家id
|
||||||
|
*/
|
||||||
|
private String sellerIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卖家名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "卖家名称")
|
||||||
|
private String sellerNickName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上麦时间
|
* 上麦时间
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "上麦时间")
|
@ExcelProperty(value = "上麦时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date payDate;
|
private Date payDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -156,6 +156,7 @@ public class OrderVo implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "购买日期")
|
@ExcelProperty(value = "购买日期")
|
||||||
@DateTimeFormat("yyyy-MM-dd")
|
@DateTimeFormat("yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date buyData;
|
private Date buyData;
|
||||||
/**
|
/**
|
||||||
* 购买时间
|
* 购买时间
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import org.dromara.system.domain.vo.BSellerSortVo;
|
|||||||
import org.dromara.system.domain.bo.BSellerSortBo;
|
import org.dromara.system.domain.bo.BSellerSortBo;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.system.domain.vo.BSellerVo;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -23,6 +24,13 @@ public interface IBSellerSortService {
|
|||||||
* @return 上麦顺序
|
* @return 上麦顺序
|
||||||
*/
|
*/
|
||||||
BSellerSortVo queryById(Long id);
|
BSellerSortVo queryById(Long id);
|
||||||
|
/**
|
||||||
|
* 查询上麦顺序
|
||||||
|
*
|
||||||
|
* @param payDate 售卖日期
|
||||||
|
* @return 上麦顺序
|
||||||
|
*/
|
||||||
|
BSellerSortVo queryByPayDate(String payDate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询上麦顺序列表
|
* 分页查询上麦顺序列表
|
||||||
@ -40,7 +48,12 @@ public interface IBSellerSortService {
|
|||||||
* @return 上麦顺序列表
|
* @return 上麦顺序列表
|
||||||
*/
|
*/
|
||||||
List<BSellerSortVo> queryList(BSellerSortBo bo);
|
List<BSellerSortVo> queryList(BSellerSortBo bo);
|
||||||
|
/**
|
||||||
|
* 查询所有卖家信息
|
||||||
|
*
|
||||||
|
* @return 卖家信息列表
|
||||||
|
*/
|
||||||
|
List<BSellerVo> querySellerList();
|
||||||
/**
|
/**
|
||||||
* 新增上麦顺序
|
* 新增上麦顺序
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.system.service.impl;
|
package org.dromara.system.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
@ -9,6 +10,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.system.domain.vo.BSellerVo;
|
||||||
|
import org.dromara.system.mapper.BSellerMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.system.domain.bo.BSellerSortBo;
|
import org.dromara.system.domain.bo.BSellerSortBo;
|
||||||
import org.dromara.system.domain.vo.BSellerSortVo;
|
import org.dromara.system.domain.vo.BSellerSortVo;
|
||||||
@ -16,6 +19,7 @@ import org.dromara.system.domain.BSellerSort;
|
|||||||
import org.dromara.system.mapper.BSellerSortMapper;
|
import org.dromara.system.mapper.BSellerSortMapper;
|
||||||
import org.dromara.system.service.IBSellerSortService;
|
import org.dromara.system.service.IBSellerSortService;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -32,6 +36,7 @@ import java.util.Collection;
|
|||||||
public class BSellerSortServiceImpl implements IBSellerSortService {
|
public class BSellerSortServiceImpl implements IBSellerSortService {
|
||||||
|
|
||||||
private final BSellerSortMapper baseMapper;
|
private final BSellerSortMapper baseMapper;
|
||||||
|
private final BSellerMapper sellerMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询上麦顺序
|
* 查询上麦顺序
|
||||||
@ -44,6 +49,25 @@ public class BSellerSortServiceImpl implements IBSellerSortService {
|
|||||||
return baseMapper.selectVoById(id);
|
return baseMapper.selectVoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BSellerSortVo queryByPayDate(String payDate) {
|
||||||
|
BSellerSortVo bSellerSortVo =new BSellerSortVo();
|
||||||
|
QueryWrapper<BSellerSort> objectQueryWrapper = new QueryWrapper<>();
|
||||||
|
objectQueryWrapper.eq("pay_date",payDate);
|
||||||
|
objectQueryWrapper.orderByAsc("sort");
|
||||||
|
List<BSellerSortVo> bSellerSortVos = baseMapper.selectVoList(objectQueryWrapper);
|
||||||
|
StringBuilder sellerIds= new StringBuilder();
|
||||||
|
for(int i=0;i<bSellerSortVos.size();i++){
|
||||||
|
if(i==bSellerSortVos.size()-1){
|
||||||
|
sellerIds.append(bSellerSortVos.get(i).getSellerId());
|
||||||
|
}else{
|
||||||
|
sellerIds.append(bSellerSortVos.get(i).getSellerId()).append(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bSellerSortVo.setSellerIds(sellerIds.toString());
|
||||||
|
return bSellerSortVo;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询上麦顺序列表
|
* 分页查询上麦顺序列表
|
||||||
*
|
*
|
||||||
@ -70,11 +94,21 @@ public class BSellerSortServiceImpl implements IBSellerSortService {
|
|||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(lqw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BSellerVo> querySellerList() {
|
||||||
|
List<BSellerVo> bSellerVos = sellerMapper.selectVoList();
|
||||||
|
for (BSellerVo bSellerVo : bSellerVos) {
|
||||||
|
bSellerVo.setNickName(bSellerVo.getNickName()+ (StringUtils.isNotBlank(bSellerVo.getPhone())? " "+bSellerVo.getPhone():""));
|
||||||
|
}
|
||||||
|
return bSellerVos;
|
||||||
|
}
|
||||||
|
|
||||||
private LambdaQueryWrapper<BSellerSort> buildQueryWrapper(BSellerSortBo bo) {
|
private LambdaQueryWrapper<BSellerSort> buildQueryWrapper(BSellerSortBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<BSellerSort> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<BSellerSort> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.orderByAsc(BSellerSort::getId);
|
lqw.orderByDesc(BSellerSort::getPayDate);
|
||||||
lqw.eq(bo.getSellerId() != null, BSellerSort::getSellerId, bo.getSellerId());
|
lqw.eq(bo.getSellerId() != null, BSellerSort::getSellerId, bo.getSellerId());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getSellerNickName()), BSellerSort::getSellerNickName, bo.getSellerNickName());
|
||||||
lqw.eq(bo.getPayDate() != null, BSellerSort::getPayDate, bo.getPayDate());
|
lqw.eq(bo.getPayDate() != null, BSellerSort::getPayDate, bo.getPayDate());
|
||||||
lqw.eq(bo.getSort() != null, BSellerSort::getSort, bo.getSort());
|
lqw.eq(bo.getSort() != null, BSellerSort::getSort, bo.getSort());
|
||||||
return lqw;
|
return lqw;
|
||||||
@ -88,13 +122,21 @@ public class BSellerSortServiceImpl implements IBSellerSortService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(BSellerSortBo bo) {
|
public Boolean insertByBo(BSellerSortBo bo) {
|
||||||
BSellerSort add = MapstructUtils.convert(bo, BSellerSort.class);
|
QueryWrapper<BSellerSort> objectQueryWrapper = new QueryWrapper<>();
|
||||||
validEntityBeforeSave(add);
|
objectQueryWrapper.eq("pay_date",bo.getPayDate());
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
baseMapper.delete(objectQueryWrapper);
|
||||||
if (flag) {
|
String[] split = bo.getSellerIds().split(",");
|
||||||
bo.setId(add.getId());
|
List<BSellerSort> saveList = new ArrayList<>();
|
||||||
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
BSellerSort add = new BSellerSort();
|
||||||
|
add.setPayDate(bo.getPayDate());
|
||||||
|
add.setSort((long) (j+1));
|
||||||
|
BSellerVo bSellerVo = sellerMapper.selectVoById(split[j]);
|
||||||
|
add.setSellerId(bSellerVo.getId());
|
||||||
|
add.setSellerNickName(bSellerVo.getNickName());
|
||||||
|
saveList.add(add);
|
||||||
}
|
}
|
||||||
return flag;
|
return baseMapper.insertBatch(saveList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user