fix: 优化商品分类、售后及拼团相关

This commit is contained in:
misworga831 2023-09-27 09:16:49 +08:00
parent 02dd37c87f
commit bdd9045fc1
7 changed files with 32 additions and 8 deletions

View File

@ -1,5 +1,6 @@
package cn.lili.modules.goods.entity.dto;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -32,4 +33,18 @@ public class CategorySearchParams {
@ApiModelProperty(value = "父节点名称")
private String parentTitle;
@ApiModelProperty(value = "是否禁用")
private Boolean deleteFlag;
public <T > QueryWrapper<T> queryWrapper() {
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
queryWrapper.like(name != null, "name", name);
queryWrapper.like(parentTitle != null, "parent_title", parentTitle);
queryWrapper.eq(parentId != null, "parent_id", parentId);
queryWrapper.eq(level != null, "level", level);
queryWrapper.eq(sortOrder != null, "sort_order", sortOrder);
queryWrapper.eq(commissionRate != null, "commission_rate", commissionRate);
queryWrapper.eq(deleteFlag != null, "delete_flag", deleteFlag);
return queryWrapper;
}
}

View File

@ -2,6 +2,7 @@ package cn.lili.modules.goods.service;
import cn.lili.modules.goods.entity.dos.Category;
import cn.lili.modules.goods.entity.dto.CategorySearchParams;
import cn.lili.modules.goods.entity.vos.CategoryVO;
import com.baomidou.mybatisplus.extension.service.IService;
@ -69,9 +70,10 @@ public interface CategoryService extends IService<Category> {
* 查询所有的分类父子关系
* 数据库获取
*
* @param categorySearchParams 查询参数
* @return 所有的分类父子关系
*/
List<CategoryVO> listAllChildren();
List<CategoryVO> listAllChildren(CategorySearchParams categorySearchParams);
/**
* 获取指定分类的分类名称

View File

@ -8,6 +8,7 @@ import cn.lili.common.event.TransactionCommitSendMQEvent;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.properties.RocketmqCustomProperties;
import cn.lili.modules.goods.entity.dos.Category;
import cn.lili.modules.goods.entity.dto.CategorySearchParams;
import cn.lili.modules.goods.entity.vos.CategoryVO;
import cn.lili.modules.goods.mapper.CategoryMapper;
import cn.lili.modules.goods.service.CategoryBrandService;
@ -165,10 +166,10 @@ public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> i
}
@Override
public List<CategoryVO> listAllChildren() {
public List<CategoryVO> listAllChildren(CategorySearchParams categorySearchParams) {
//获取全部分类
List<Category> list = this.list();
List<Category> list = this.list(categorySearchParams.queryWrapper());
//构造分类树
List<CategoryVO> categoryVOList = new ArrayList<>();

View File

@ -22,6 +22,11 @@ import java.util.Date;
@Data
public class AfterSaleSearchParams extends PageVO {
private static final long serialVersionUID = 28604026820923515L;
@ApiModelProperty(value = "关键字")
private String keyword;
@ApiModelProperty(value = "售后服务单号")
private String sn;

View File

@ -213,6 +213,9 @@ public class PintuanServiceImpl extends AbstractPromotionsServiceImpl<PintuanMap
*/
private void setPintuanOrderInfo(List<Order> orders, PintuanShareVO pintuanShareVO, String skuId) {
for (Order order : orders) {
if (pintuanShareVO.getPintuanMemberVOS().stream().anyMatch(i -> i.getMemberId().equals(order.getMemberId()))) {
continue;
}
Member member = memberService.getById(order.getMemberId());
PintuanMemberVO memberVO = new PintuanMemberVO(member);
if (CharSequenceUtil.isEmpty(order.getParentOrderSn())) {

View File

@ -3,8 +3,6 @@ package cn.lili.modules.store.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
/**
* 店铺设置
*
@ -29,7 +27,6 @@ public class StoreSettingDTO {
@ApiModelProperty(value = "详细地址")
private String storeAddressDetail;
@NotEmpty
@ApiModelProperty(value = "经纬度")
private String storeCenter;

View File

@ -6,6 +6,7 @@ import cn.lili.common.enums.ResultUtil;
import cn.lili.common.exception.ServiceException;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.goods.entity.dos.Category;
import cn.lili.modules.goods.entity.dto.CategorySearchParams;
import cn.lili.modules.goods.entity.vos.CategoryVO;
import cn.lili.modules.goods.service.CategoryService;
import cn.lili.modules.goods.service.GoodsService;
@ -54,8 +55,8 @@ public class CategoryManagerController {
@ApiOperation(value = "查询全部分类列表")
@GetMapping(value = "/allChildren")
public ResultMessage<List<CategoryVO>> list() {
return ResultUtil.data(this.categoryService.listAllChildren());
public ResultMessage<List<CategoryVO>> list(CategorySearchParams categorySearchParams) {
return ResultUtil.data(this.categoryService.listAllChildren(categorySearchParams));
}
@PostMapping