提交修改
This commit is contained in:
parent
c0934ba746
commit
bfb1619eba
@ -44,8 +44,6 @@ public interface VvAppCategoryDao extends BaseMapper<VvAppCategoryEntity> {
|
|||||||
List<VvAppCategoryEntity> selectVvCategoryAll();
|
List<VvAppCategoryEntity> selectVvCategoryAll();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@OrderBy(value={VvAppCategoryEntity.default_sort},type={OrderType.ASC})
|
@OrderBy(value={VvAppCategoryEntity.default_sort},type={OrderType.ASC})
|
||||||
List<VvAppCategoryEntity> selectVvCategoryByParentId(Integer parentId);
|
List<VvAppCategoryEntity> selectVvCategoryByParentId(Integer parentId);
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@ public interface VvProductDao extends BaseMapper<VvProductEntity> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@OrderBy(VvProductEntity.id_)
|
@OrderBy(value = {VvProductEntity.default_sort},type={OrderType.ASC})
|
||||||
@ExludeColumn({VvProductEntity.real_sale_count})
|
@ExludeColumn({VvProductEntity.real_sale_count})
|
||||||
List<VvProductEntity> selectIndexVvProduct(IPage page,
|
List<VvProductEntity> selectIndexVvProduct(IPage page,
|
||||||
@IF @LIKE String title,
|
@IF @LIKE String title,
|
||||||
|
|||||||
@ -0,0 +1,20 @@
|
|||||||
|
package com.heyu.api.data.dto.vv;
|
||||||
|
|
||||||
|
import com.heyu.api.data.entity.vv.VvAppCategoryEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class VvAppCategoryCategoryDTO extends VvAppCategoryEntity {
|
||||||
|
|
||||||
|
private List<VvAppCategoryEntity> childrens = new ArrayList<>();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ import java.util.Date;import java.util.Date;
|
|||||||
/**
|
/**
|
||||||
*类目表
|
*类目表
|
||||||
* @author quyixiao
|
* @author quyixiao
|
||||||
* @since 2025-08-24
|
* @since 2025-10-14
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ -21,15 +21,16 @@ private static final long serialVersionUID = 1L;
|
|||||||
public final static String CLASS_NAME ="com.heyu.api.data.entity.vv.VvAppCategoryEntity:";
|
public final static String CLASS_NAME ="com.heyu.api.data.entity.vv.VvAppCategoryEntity:";
|
||||||
|
|
||||||
public final static String all = CLASS_NAME + "*";
|
public final static String all = CLASS_NAME + "*";
|
||||||
public final static String id_ = CLASS_NAME + "id"; //
|
public final static String id_ = CLASS_NAME + "id"; //
|
||||||
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除:0 否 1 删除
|
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除:0 否 1 删除
|
||||||
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
|
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
|
||||||
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
|
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
|
||||||
public final static String parent_id = CLASS_NAME + "parent_id"; // 父亲类目id
|
public final static String parent_id = CLASS_NAME + "parent_id"; // 父亲类目id
|
||||||
public final static String image_url = CLASS_NAME + "image_url"; // 图片url
|
public final static String image_url = CLASS_NAME + "image_url"; // 图片url
|
||||||
public final static String name_ = CLASS_NAME + "name"; // 名称
|
public final static String name_ = CLASS_NAME + "name"; // 名称
|
||||||
public final static String level_ = CLASS_NAME + "level"; // 层级
|
public final static String level_ = CLASS_NAME + "level"; // 层级
|
||||||
public final static String default_sort = CLASS_NAME + "default_sort"; // 排序
|
public final static String default_sort = CLASS_NAME + "default_sort"; // 排序
|
||||||
|
public final static String category_image_url = CLASS_NAME + "category_image_url"; // 类目图片
|
||||||
//
|
//
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
@ -49,6 +50,8 @@ private static final long serialVersionUID = 1L;
|
|||||||
private Integer level;
|
private Integer level;
|
||||||
//排序
|
//排序
|
||||||
private Integer defaultSort;
|
private Integer defaultSort;
|
||||||
|
//类目图片
|
||||||
|
private String categoryImageUrl;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@ -184,6 +187,21 @@ private static final long serialVersionUID = 1L;
|
|||||||
this.defaultSort = defaultSort;
|
this.defaultSort = defaultSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类目图片
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getCategoryImageUrl() {
|
||||||
|
return categoryImageUrl;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 类目图片
|
||||||
|
* @param categoryImageUrl
|
||||||
|
*/
|
||||||
|
public void setCategoryImageUrl(String categoryImageUrl) {
|
||||||
|
this.categoryImageUrl = categoryImageUrl;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "VvAppCategoryEntity{" +
|
return "VvAppCategoryEntity{" +
|
||||||
@ -196,6 +214,7 @@ private static final long serialVersionUID = 1L;
|
|||||||
",name=" + name +
|
",name=" + name +
|
||||||
",level=" + level +
|
",level=" + level +
|
||||||
",defaultSort=" + defaultSort +
|
",defaultSort=" + defaultSort +
|
||||||
|
",categoryImageUrl=" + categoryImageUrl +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -21,31 +21,32 @@ private static final long serialVersionUID = 1L;
|
|||||||
public final static String CLASS_NAME ="com.heyu.api.data.entity.vv.VvProductEntity:";
|
public final static String CLASS_NAME ="com.heyu.api.data.entity.vv.VvProductEntity:";
|
||||||
|
|
||||||
public final static String all = CLASS_NAME + "*";
|
public final static String all = CLASS_NAME + "*";
|
||||||
public final static String id_ = CLASS_NAME + "id"; //
|
public final static String id_ = CLASS_NAME + "id"; //
|
||||||
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除:0 否 1 删除
|
public final static String is_delete = CLASS_NAME + "is_delete"; // 是否删除:0 否 1 删除
|
||||||
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
|
public final static String create_time = CLASS_NAME + "create_time"; // 创建时间
|
||||||
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
|
public final static String modify_time = CLASS_NAME + "modify_time"; // 修改时间
|
||||||
public final static String main_image_url = CLASS_NAME + "main_image_url"; // 主图
|
public final static String main_image_url = CLASS_NAME + "main_image_url"; // 主图
|
||||||
public final static String video_url = CLASS_NAME + "video_url"; // 视频url
|
public final static String video_url = CLASS_NAME + "video_url"; // 视频url
|
||||||
public final static String title_ = CLASS_NAME + "title"; // 商品标题
|
public final static String title_ = CLASS_NAME + "title"; // 商品标题
|
||||||
public final static String show_sale_price = CLASS_NAME + "show_sale_price"; // 销售价格
|
public final static String show_sale_price = CLASS_NAME + "show_sale_price"; // 销售价格
|
||||||
public final static String show_sale_count = CLASS_NAME + "show_sale_count"; // 销售数量
|
public final static String show_sale_count = CLASS_NAME + "show_sale_count"; // 销售数量
|
||||||
public final static String default_sort = CLASS_NAME + "default_sort"; // 默认排序
|
public final static String default_sort = CLASS_NAME + "default_sort"; // 默认排序
|
||||||
public final static String create_timestamp = CLASS_NAME + "create_timestamp"; // 创建时间撮
|
public final static String create_timestamp = CLASS_NAME + "create_timestamp"; // 创建时间撮
|
||||||
public final static String modify_timestamp = CLASS_NAME + "modify_timestamp"; // 修改时间撮
|
public final static String modify_timestamp = CLASS_NAME + "modify_timestamp"; // 修改时间撮
|
||||||
public final static String front_page = CLASS_NAME + "front_page"; // 是否是首页
|
public final static String front_page = CLASS_NAME + "front_page"; // 是否是首页
|
||||||
public final static String status_ = CLASS_NAME + "status"; // delete 删除,down 下架,online 在线,draft 草稿
|
public final static String status_ = CLASS_NAME + "status"; // delete 删除,down 下架,online 在线,draft 草稿
|
||||||
public final static String real_sale_count = CLASS_NAME + "real_sale_count"; // 真实销售量
|
public final static String real_sale_count = CLASS_NAME + "real_sale_count"; // 真实销售量
|
||||||
public final static String app_category_id1 = CLASS_NAME + "app_category_id1"; // app一级类目id
|
public final static String app_category_id1 = CLASS_NAME + "app_category_id1"; // app一级类目id
|
||||||
public final static String app_category_id2 = CLASS_NAME + "app_category_id2"; // app二级类目
|
public final static String app_category_id2 = CLASS_NAME + "app_category_id2"; // app二级类目
|
||||||
public final static String app_category_id3 = CLASS_NAME + "app_category_id3"; // app三级类目
|
public final static String app_category_id3 = CLASS_NAME + "app_category_id3"; // app三级类目
|
||||||
public final static String admin_category_id1 = CLASS_NAME + "admin_category_id1"; // admin1级类目
|
public final static String admin_category_id1 = CLASS_NAME + "admin_category_id1"; // admin1级类目
|
||||||
public final static String admin_category_id2 = CLASS_NAME + "admin_category_id2"; // admin2级类目
|
public final static String admin_category_id2 = CLASS_NAME + "admin_category_id2"; // admin2级类目
|
||||||
public final static String admin_category_id3 = CLASS_NAME + "admin_category_id3"; // admin3级类目
|
public final static String admin_category_id3 = CLASS_NAME + "admin_category_id3"; // admin3级类目
|
||||||
public final static String admin_category_id4 = CLASS_NAME + "admin_category_id4"; // admin4级类目
|
public final static String admin_category_id4 = CLASS_NAME + "admin_category_id4"; // admin4级类目
|
||||||
public final static String admin_category_id5 = CLASS_NAME + "admin_category_id5"; // admin5级类目
|
public final static String admin_category_id5 = CLASS_NAME + "admin_category_id5"; // admin5级类目
|
||||||
public final static String seller_id = CLASS_NAME + "seller_id"; // 商家id
|
public final static String seller_id = CLASS_NAME + "seller_id"; // 商家id
|
||||||
public final static String is_test = CLASS_NAME + "is_test"; // 是否是测试单
|
public final static String is_test = CLASS_NAME + "is_test"; // 是否是测试单
|
||||||
|
public final static String show_promotion_price = CLASS_NAME + "show_promotion_price"; // 促销价
|
||||||
//
|
//
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Long id;
|
private Long id;
|
||||||
@ -97,6 +98,8 @@ private static final long serialVersionUID = 1L;
|
|||||||
private Long sellerId;
|
private Long sellerId;
|
||||||
//是否是测试单
|
//是否是测试单
|
||||||
private Integer isTest;
|
private Integer isTest;
|
||||||
|
//促销价
|
||||||
|
private BigDecimal showPromotionPrice;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
@ -472,6 +475,21 @@ private static final long serialVersionUID = 1L;
|
|||||||
this.isTest = isTest;
|
this.isTest = isTest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 促销价
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public BigDecimal getShowPromotionPrice() {
|
||||||
|
return showPromotionPrice;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 促销价
|
||||||
|
* @param showPromotionPrice
|
||||||
|
*/
|
||||||
|
public void setShowPromotionPrice(BigDecimal showPromotionPrice) {
|
||||||
|
this.showPromotionPrice = showPromotionPrice;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "VvProductEntity{" +
|
return "VvProductEntity{" +
|
||||||
@ -500,6 +518,7 @@ private static final long serialVersionUID = 1L;
|
|||||||
",adminCategoryId5=" + adminCategoryId5 +
|
",adminCategoryId5=" + adminCategoryId5 +
|
||||||
",sellerId=" + sellerId +
|
",sellerId=" + sellerId +
|
||||||
",isTest=" + isTest +
|
",isTest=" + isTest +
|
||||||
|
",showPromotionPrice=" + showPromotionPrice +
|
||||||
"}";
|
"}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@ public class MysqlMain_update {
|
|||||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
List<TablesBean> list = new ArrayList<TablesBean>();
|
||||||
|
|
||||||
|
|
||||||
String a = "vv_buyer";
|
String a = "vv_app_category";
|
||||||
for (String s : a.split(",")) {
|
for (String s : a.split(",")) {
|
||||||
list.add(new TablesBean(s));
|
list.add(new TablesBean(s));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,6 +35,8 @@ public class AppIndexPageRequest {
|
|||||||
*/
|
*/
|
||||||
private String createTimestampSort;
|
private String createTimestampSort;
|
||||||
|
|
||||||
|
//是否是首页 , 1 首页, 0 非首页
|
||||||
|
private Integer frontPage;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 如果是内部用户,可传 1,如果不是内部用户,你就传0
|
* 如果是内部用户,可传 1,如果不是内部用户,你就传0
|
||||||
@ -47,15 +49,9 @@ public class AppIndexPageRequest {
|
|||||||
*/
|
*/
|
||||||
private Long buyerId;
|
private Long buyerId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//是否是首页
|
|
||||||
private Integer frontPage;
|
|
||||||
/***
|
/***
|
||||||
* 状态
|
* 状态
|
||||||
*/
|
*/
|
||||||
private String status ;
|
private String status ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@ import java.util.List;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/mm/app/category")
|
@RequestMapping("/mm/app/category")
|
||||||
public class AppCategoryController {
|
public class AdminAppCategoryController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private VvAppCategoryDao vvAppCategoryDao;
|
private VvAppCategoryDao vvAppCategoryDao;
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
package com.heyu.api.controller.vv;
|
||||||
|
|
||||||
|
|
||||||
|
import com.heyu.api.alibaba.request.mm.VvAppCategoryRequest;
|
||||||
|
import com.heyu.api.data.dao.vv.VvAppCategoryDao;
|
||||||
|
import com.heyu.api.data.dto.vv.VvAppCategoryCategoryDTO;
|
||||||
|
import com.heyu.api.data.entity.vv.VvAppCategoryEntity;
|
||||||
|
import com.heyu.api.data.utils.R;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/app/category")
|
||||||
|
public class AppCategoryController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VvAppCategoryDao vvAppCategoryDao;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 列表
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* http://localhost:8888/app/category/list
|
||||||
|
*/
|
||||||
|
@RequestMapping("/list")
|
||||||
|
public R list(@RequestBody VvAppCategoryRequest vvCategoryRequest) {
|
||||||
|
List<VvAppCategoryEntity> vvCategoryEntities = vvAppCategoryDao.selectVvCategoryAll();
|
||||||
|
|
||||||
|
List<VvAppCategoryEntity> list = vvAppCategoryDao.selectVvCategoryByParentId(0);
|
||||||
|
|
||||||
|
|
||||||
|
List<VvAppCategoryCategoryDTO> vvCategoryDTOS = new ArrayList<>();
|
||||||
|
for (VvAppCategoryEntity vvAppCategoryEntity : list) {
|
||||||
|
|
||||||
|
VvAppCategoryCategoryDTO vvAppCategoryCategoryDTO = new VvAppCategoryCategoryDTO();
|
||||||
|
BeanUtils.copyProperties(vvAppCategoryEntity, vvAppCategoryCategoryDTO);
|
||||||
|
|
||||||
|
for (VvAppCategoryEntity vvCategoryEntity : vvCategoryEntities) {
|
||||||
|
|
||||||
|
if(vvCategoryEntity.getParentId().equals(vvAppCategoryEntity.getId())){
|
||||||
|
|
||||||
|
vvAppCategoryCategoryDTO.getChildrens().add(vvCategoryEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vvCategoryDTOS.add(vvAppCategoryCategoryDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return R.ok().setData(vvCategoryDTOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user